Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* glib/backtrace question
@ 2005-02-09  1:47 Brian Hanley
  2005-02-09  2:33 ` muppet
  0 siblings, 1 reply; 2+ messages in thread
From: Brian Hanley @ 2005-02-09  1:47 UTC (permalink / raw)
  To: GTK Dev List, GDB Mailing List, GCC Mailing List

Hi All,

Whatever happened to the backtrace() and backtrace_symbols() calls in
glib?
I came across a magazine article from a few years back where the author
was
using the "backtrace()" and "backtrace_symbols()" calls in order to
print
a backtrace during program execution.

I can't find those calls in glib anymore.

It seems that the preferred way of doing this now is to take a gcore,
and
start up a new gdb process to examine the stack, or to use a perl script
to translate the symbol names.

I would prefer to print a dynamic backtrace from within the process
being traced.

Are there currently glib function calls which allow me to walk the
stack?
Is there an interface in the gdb code that I can link to for a dynamic
backtrace?
Is there another library or other code which allows for dynamic
backtraces?

Brian

_________________________________________
 Brian Hanley, Software Developer
 FlexTrade Systems - Great Neck, NY 11021
 brian.hanley@flextrade.com
 +1 (516) 627-8993 Ext. 238
_________________________________________


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

* Re: glib/backtrace question
  2005-02-09  1:47 glib/backtrace question Brian Hanley
@ 2005-02-09  2:33 ` muppet
  0 siblings, 0 replies; 2+ messages in thread
From: muppet @ 2005-02-09  2:33 UTC (permalink / raw)
  To: Brian Hanley; +Cc: GTK Dev List, GCC Mailing List, GDB Mailing List


On Feb 8, 2005, at 8:27 PM, Brian Hanley wrote:

> Whatever happened to the backtrace() and backtrace_symbols() calls in 
> glib?

You're thinking of glibc, not GLib.

   #include <execinfo.h>
     backtrace
     backtrace_symbols
     backtrace_symbols_fd

These give you module & offset; you still need to use the addr2line 
utility to get filename & line number information from debugging 
symbols.

--
She's obviously your child.  She looks like you, she talks a lot, and 
most of it is gibberish.
   -- Elysse, to me, of Zella.


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

end of thread, other threads:[~2005-02-09  1:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-02-09  1:47 glib/backtrace question Brian Hanley
2005-02-09  2:33 ` muppet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox