public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* implementation of backtrace on OSX?
@ 2007-10-16  4:39 Rene Limberger
  2007-10-16 11:43 ` Daniel Jacobowitz
  0 siblings, 1 reply; 2+ messages in thread
From: Rene Limberger @ 2007-10-16  4:39 UTC (permalink / raw)
  To: gdb

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: implementation of backtrace on OSX?
  2007-10-16  4:39 implementation of backtrace on OSX? Rene Limberger
@ 2007-10-16 11:43 ` Daniel Jacobowitz
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel Jacobowitz @ 2007-10-16 11:43 UTC (permalink / raw)
  To: Rene Limberger; +Cc: gdb

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-10-16 11:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-10-16  4:39 implementation of backtrace on OSX? Rene Limberger
2007-10-16 11:43 ` Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).