This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC] Backtrace oddity with verbose on
- From: Fred Fish <fnf at specifix dot com>
- To: gdb-patches at sources dot redhat dot com
- Cc: fnf at specifix dot com
- Date: Thu, 8 Feb 2007 13:40:18 -0700
- Subject: Re: [RFC] Backtrace oddity with verbose on
- References: <200701301416.10975.fnf@specifix.com>
- Reply-to: fnf at specifix dot com
On Tuesday 30 January 2007 14:16, Fred Fish wrote:
> If a stack backtrace triggers one of the "corrupt stack" errors like
> the following:
>
> Previous frame identical to this frame (corrupt stack?)
>
> the backtrace command will print nothing except this message the first
> time a backtrace is done, if verbose is on.
BTW, here is an easy way to reproduce this.
$ cat x.c
int sub2 ()
{
}
int sub ()
{
sub2 ();
}
int main ()
{
sub ();
}
$ cat .gdbinit
set verbose on
br sub2
run
set ***(int *)$sp=0
set **(int *)$sp=0
set *(int *)$sp=0
echo Doing first backtrace\n
bt
echo Doing second backtrace\n
bt
Now compile 'x' and run gdb. Here is the relevant output for Fedora Core 6's gdb:
$ /usr/bin/gdb x
GNU gdb Red Hat Linux (6.5-15.fc6rh)
...
Doing first backtrace
Previous frame inner to this frame (corrupt stack?)
Doing second backtrace
#0 sub2 () at x.c:3
#1 0x08048331 in sub () at x.c:7
(gdb)
Here is the relevant output for gdb 6.6:
$ /tmp/gdb x
GNU gdb 6.6 broadcom_2007a_411
...
Doing first backtrace
#0 sub2 () at x.c:3
#1 0x08048331 in sub () at x.c:7
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
Doing second backtrace
#0 sub2 () at x.c:3
#1 0x08048331 in sub () at x.c:7
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
So the problem is now fixed apparently.
-Fred