c/debug: func addr and info

This commit is contained in:
visualfc
2024-11-28 12:01:11 +08:00
parent 6a3fce97cf
commit 67f9580c5d
3 changed files with 66 additions and 0 deletions

14
c/debug/_wrap/debug.c Normal file
View File

@@ -0,0 +1,14 @@
#if defined(__linux__)
#define _GNU_SOURCE
#include <features.h>
#endif
#include <dlfcn.h>
void *llgo_address() {
return __builtin_return_address(0);
}
int llgo_addrinfo(void *addr, Dl_info *info) {
return dladdr(addr, info);
}