Created
October 3, 2025 12:15
-
-
Save Kyle-Ye/78830f89d55d44ce0fc9e8dd447fdb86 to your computer and use it in GitHub Desktop.
Make kdebug_is_enabled always return true
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// kdebug_interpose.c | |
#include <stdbool.h> | |
#include <stdint.h> | |
#include <dlfcn.h> | |
// Forward declare the original | |
extern bool kdebug_is_enabled(uint32_t debugid); | |
// Our replacement | |
static bool my_kdebug_is_enabled(uint32_t debugid) { | |
return true; | |
} | |
// Interpose using Mach-O section | |
typedef struct interpose_s { | |
const void *replacement; | |
const void *original; | |
} interpose_t; | |
__attribute__((used)) static const interpose_t interposers[] | |
__attribute__((section("__DATA, __interpose"))) = { | |
{ (const void *)my_kdebug_is_enabled, (const void *)kdebug_is_enabled }, | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
SwiftUI's DynamicProperty will use Signpost to trace its lifecycle when kdebug is enabled.