This is the mail archive of the egcs@egcs.cygnus.com mailing list for the EGCS project. See the EGCS home page for more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Maybe off topic?


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