wrong-code regressions review

Bradley Lucier lucier@math.purdue.edu
Wed Dec 15 21:23:00 GMT 2004


On Dec 15, 2004, at 10:14 AM, Giovanni Bajo wrote:

> Bradley Lucier <lucier@math.purdue.edu> wrote:
>
>> Can you recommend a debugger that will give me accurate information on
>> sparc-solaris2.9 or x86-linux?
>
> Most developers and I use GDB 6.1 or CVS HEAD. What's wrong with that? 
> What
> are you missing exactly?

Should I be able to use "info locals"?  Or "p var_name"?  When I 
compile code with

gcc -g -I../include -Wall -W -Wno-unused -O1 -fno-math-errno 
-fschedule-insns2 -fno-trapping-math -fno-strict-aliasing 
-fomit-frame-pointer -fPIC -fno-common -mieee-fp -DHAVE_CONFIG_H -c 
_front.c

this doesn't seem to work:

[lucier@cohomology gambit]$ env GAMBCDIR=../../../lib gdb  
../../../gsc/gsc
GNU gdb 6.3
Copyright 2004 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.
This GDB was configured as "i686-pc-linux-gnu"...Using host 
libthread_db library "/lib/tls/libthread_db.so.1".

(gdb) run  -:=../../.. fib.scm
Starting program: /home/lucier/programs/gambc40b11/gsc/gsc -:=../../.. 
fib.scm

Program received signal SIGSEGV, Segmentation fault.
0x081562c8 in ___H__20___front (___ps=0x8486700) at _front.c:7075
7075       ___SET_R2(___FIXMAX(___R3,___R2))
(gdb) ,e
Undefined command: "".  Try "help".
(gdb) info locals
___pc = dwarf2_read_address: Corrupted DWARF expression.
(gdb) p ___r4
Variable "___r4" is not available.
(gdb) p ___r1
Variable "___r1" is not available.
(gdb) p ___r2
Variable "___r2" is not available.

and if I compile it without the -fomit-frame-pointer, I get

[lucier@cohomology gambit]$ env GAMBCDIR=../../../lib gdb  
../../../gsc/gsc
GNU gdb 6.3
Copyright 2004 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.
This GDB was configured as "i686-pc-linux-gnu"...Using host 
libthread_db library "/lib/tls/libthread_db.so.1".

(gdb) run  -:=../../.. fib.scm
Starting program: /home/lucier/programs/gambc40b11/gsc/gsc -:=../../.. 
fib.scm

Program received signal SIGSEGV, Segmentation fault.
0x081541ae in ___H__20___front (___ps=0x8481ea0) at _front.c:7075
7075       ___SET_R2(___FIXMAX(___R3,___R2))
(gdb) info locals
___pc = 137816529
___start = 137799889
___temp = Variable "___temp" is not available.
(gdb) p ___r3
Variable "___r3" is not available.

and if I use the built-in gdb 6.1:

[lucier@cohomology gambit]$ env GAMBCDIR=../../../lib /usr/bin/gdb 
../../../gsc/gsc
GNU gdb Red Hat Linux (6.1post-1.20040607.17rh)
Copyright 2004 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.
This GDB was configured as "i386-redhat-linux-gnu"...Using host 
libthread_db library "/lib/tls/libthread_db.so.1".

(gdb) run  -:=../../.. fib.scm
Starting program: /home/lucier/programs/gambc40b11/gsc/gsc -:=../../.. 
fib.scm

Program received signal SIGSEGV, Segmentation fault.
0x081541ae in ___H__20___front (___ps=0x8481ea0) at _front.c:7075
7075       ___SET_R2(___FIXMAX(___R3,___R2))
(gdb) info locals
___pc = 137816529
___start = 137799889
___temp = Variable "___temp" is not available.
(gdb)



More information about the Gcc mailing list