Skip to content

Instantly share code, notes, and snippets.

@Kyle-Ye
Created October 3, 2025 12:15
Show Gist options
  • Save Kyle-Ye/78830f89d55d44ce0fc9e8dd447fdb86 to your computer and use it in GitHub Desktop.
Save Kyle-Ye/78830f89d55d44ce0fc9e8dd447fdb86 to your computer and use it in GitHub Desktop.
Make kdebug_is_enabled always return true
// 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 },
};
@Kyle-Ye
Copy link
Author

Kyle-Ye commented Oct 3, 2025

image

SwiftUI's DynamicProperty will use Signpost to trace its lifecycle when kdebug is enabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment