On 2009-04-01 19:16:20 +0200, grauzone <[email protected]> said:
- linux: backtrace, get just the addresses, those can be resolved
through addr2line to have function and file/line number
You can get the mangled function name in a very simple way: just open
/proc/self/exe and read the .symtab and .strtab sections. That's not
perfect, but better than nothing, and it's probably much simpler than
to parse the debugging infos.
patch are welcome ;)
at the moment I use dladdr which on mac gives info for both static and
dynamically loaded objects, but on linux gives just the offset to the
beginning of the static exe image.
Fawzi