This is the mail archive of the
gdb-prs@sources.redhat.com
mailing list for the GDB project.
gdb/171: FAIL: gdb.base/corefile.exp: print func2::coremaker_local
- To: gdb-gnats at sources dot redhat dot com
- Subject: gdb/171: FAIL: gdb.base/corefile.exp: print func2::coremaker_local
- From: geoffk at redhat dot com
- Date: 9 Jul 2001 02:40:26 -0000
- Reply-To: geoffk at redhat dot com
>Number: 171
>Category: gdb
>Synopsis: FAIL: gdb.base/corefile.exp: print func2::coremaker_local
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sun Jul 08 19:48:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator: geoffk@redhat.com
>Release: CVS as at 20010516T083945Z
>Organization:
>Environment:
i686-unknown-linux-gnu native
GCC versions from CVS from
>Description:
When running corefile.exp from the GDB testsuite with these
newer versions of GCC, the logfile shows:
print coremaker_ro
$3 = 201
(gdb) PASS: gdb.base/corefile.exp: print coremaker_ro
print func2::coremaker_local
No frame is currently executing in block func2.
(gdb) FAIL: gdb.base/corefile.exp: print func2::coremaker_local
bt
#0 0x4006bdd1 in __kill () from /lib/libc.so.6
#1 0x4006bbaa in raise (sig=6) at ../sysdeps/posix/raise.c:27
#2 0x4006d352 in abort () at ../sysdeps/generic/abort.c:88
#3 0x08048777 in func2 () at /maat/heart/tbox/objs/share/gdb-testsuite/gdb.base/coremaker.c:107
#4 0x08048783 in func1 () at /maat/heart/tbox/objs/share/gdb-testsuite/gdb.base/coremaker.c:113
#5 0x08048798 in main () at /maat/heart/tbox/objs/share/gdb-testsuite/gdb.base/coremaker.c:119
#6 0x4005af31 in __libc_start_main (main=0x8048788 <main>, argc=1, ubp_av=0xbffffcd4, init=0x80483ec <_init>, fini=0x80487dc <_fini>, rtld_fini=0x4000e274 <_dl_fini>, stack_end=0xbffffccc) at ../sysdeps/generic/libc-start.c:129
(gdb) PASS: gdb.base/corefile.exp: backtrace in corefile.exp
Note that the backtrace succeeds, and correctly shows
the line number of the abort(), but local variables are not
accessible.
>How-To-Repeat:
The problem can be reproduced by, of course, compiling
coremaker.c with new GCC, running it, running GDB on the
resulting corefile, and entering
"print func2::coremaker_local".
It also works to take the old .s file and apply the following diff:
--- coremaker.old.s Sun Jul 8 19:08:36 2001
+++ coremaker.tst.s Sun Jul 8 19:36:52 2001
@@ -583,16 +583,7 @@ func2:
movl $0, -44(%ebp)
.L18:
cmpl $4, -44(%ebp)
- jle .L21
- .stabn 68,0,106,.LM29-func2
-.LM29:
- movl coremaker_ro, %eax
- incl %eax
- movl %eax, coremaker_data
- .stabn 68,0,107,.LM30-func2
-.LM30:
- call abort
-.L21:
+ jg .L19
.stabn 68,0,105,.LM31-func2
.LM31:
movl -44(%ebp), %eax
@@ -605,6 +596,15 @@ func2:
leal -44(%ebp), %eax
incl (%eax)
jmp .L18
+.L19:
+ .stabn 68,0,106,.LM100-func2
+.LM100:
+ movl coremaker_ro, %eax
+ incl %eax
+ movl %eax, coremaker_data
+ .stabn 68,0,107,.LM101-func2
+.LM101:
+ call abort
.LBE3:
.stabn 68,0,108,.LM33-func2
.LM33:
I suspect an off-by-one error related to 'call' instructions
at the end of a function.
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: