implementation of backtrace on OSX?

Rene Limberger
2007-10-16T04:39:55Z

hi,

can anyone give me some pointers to where in the source code the gdb
backtrace is generated? ion linux, there is backtrace() via
execinfo.h, unfortunately this is not available on OSX and i would
like to take a peak at how gdb implements what we get when we type
"bt". so for example:

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x00000000
[Switching to process 31347 thread 0x3303]
0x001e9f1d in somefnc ()
(gdb) bt
#0 0x001e9f1d in somefnc ()
#1 0x003291ac in call_something (n=0x611ca0, something=0xb02267b4) at
somefile.c:47
...
#11 0x93b853a1 in _pthread_start ()
#12 0x93b8525e in thread_start ()

i am specifically interested in how gdb resolves the file and line
number from the debug info.

thanks,
-r