This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
enhancement suggestion: gdb backtrace library
- To: "'gdb at sourceware dot cygnus dot com'" <gdb at sourceware dot cygnus dot com>
- Subject: enhancement suggestion: gdb backtrace library
- From: Bergur Ragnarsson <Bergur dot Ragnarsson at tern dot is>
- Date: Tue, 14 Aug 2001 10:36:31 -0000
The c-library assert(...) can quickly stop buggy logic and sometimes reveal
the cause by the single line error description. Often however a full stack
trace is needed to find the error.
It would be quite a productivity improvement if programmers could call a
function like
gdb_backtrace(options)
which would print up to 30 or so stack frames; this would allow the
programmer to go directly to fixing the code. This would also be great in
multithreaded code, where we often have been unable to produce stack traces.
The glibc-library has an backtrace(..) and backtrace_symbols(..), but these
functions didn't produce correct stack traces on our system.
Bergur Ragnarsson