Re: implementation of backtrace on OSX?

Daniel Jacobowitz
2007-10-16T11:43:17Z

On Mon, Oct 15, 2007 at 09:39:48PM -0700, Rene Limberger wrote:
> 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:

We can't help you with GDB on OS X; Apple's got their own version.
FSF GDB doesn't support OS X.

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

It maintains a complete symbol table, so there's no small piece of
code I can point you to. The easiest way to do this is to use
binutils's addr2line utility.

--
Daniel Jacobowitz
CodeSourcery