Maybe off topic?

Andreas Schwab schwab@LS5.informatik.uni-dortmund.de
Fri Mar 26 02:05:00 GMT 1999


Jeffrey A Law <law@upchuck.cygnus.com> writes:

|>   In message < E10QOsn-0004a6-00@roboto.devolution.com >you write:
|>   > Is there any way to generate a stack trace from within a running program?
|>   > i.e. save a backtrace in memory and periodically flush it to disk?
|>   > (On ix86 Linux)
|> It's certainly possible, but there's no simple function lying around to
|> do it.
|> 
|> One approach would be to use the dwarf2 unwind tables to walk up the stack.
|> The other would be to duplicate the frame chain building found in gdb.

Glibc 2.1 has backtrace, declared in <execinfo.h>.

-- 
Andreas Schwab                                      "And now for something
schwab@issan.cs.uni-dortmund.de                      completely different"
schwab@gnu.org


More information about the Gcc mailing list