Skip to content
Snippets Groups Projects
Commit c1b7d930 authored by Dan Hirsch's avatar Dan Hirsch
Browse files

On second thought, let's not use dladdr. It's a silly extension.

parent de38f7bc
No related branches found
No related tags found
No related merge requests found
......@@ -8,14 +8,17 @@
// This is some spectacularly non-portable code... but whee!
#include <dlfcn.h>
char* getsym(void* addr) {
Dl_info dli;
char* retstr;
#if 0
// This will be fixed later.
Dl_info dli;
if (dladdr(addr, &dli) != 0 && dli.dli_sname != NULL) {
if (dli.dli_saddr == addr)
return strdup(dli.dli_sname);
else
asprintf(&retstr, "%s+0x%lx", dli.dli_sname, addr - dli.dli_saddr);
} else
#endif
asprintf(&retstr, "%p", addr);
return retstr;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment