Add backtrace to gdb ...

Andrew Cagney ac131313@cygnus.com
Wed Sep 26 23:24:00 GMT 2001


... of GDB debugging gdb.

Hello,

The attatched is a quick hack to tweek internal_error() giving the behavour:

(gdb) maint internal-error
/home/scratch/PENDING/stack-dump/src/gdb/maint.c:119: 
gdb-internal-error: internal maintenance
An internal GDB error was detected.  This may make further
debugging unreliable.  Continue this debugging session? (y or n) n

Create a core file containing the current state of GDB? (y or n) n

Produce a back-trace? (y or n) y

GNU gdb 2001-09-27-cvs (MI_OUT)
Copyright 2001 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain 
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
( echo set prompt ; echo attach 20618 ; echo bt ) | gdb -nw -nx --quiet 
./gdb/gdb
(gdb) Attaching to program 
`/home/scratch/PENDING/stack-dump/native/./gdb/gdb', process 20618
Reading symbols from /usr/libexec/ld.elf_so...done.
Reading symbols from /usr/lib/libtermcap.so.0...done.
Reading symbols from /usr/lib/libm.so.0...done.
Reading symbols from /usr/lib/libc.so.12...done.
0x41b2437c in ?? () from /usr/lib/libc.so.12
#0  0x41b2437c in ?? () from /usr/lib/libc.so.12
Detaching from program: 
/home/scratch/PENDING/stack-dump/native/./gdb/gdb process 20618

Just a shame that this GDB couldn't back-trace from libc.

Anyway, any comments on the idea of adding something like this to GDB? 
(Just not this exact patch).

As for the origins of the idea, came across it in a UNIX faq.

Andrew


More information about the Gdb mailing list