This is the mail archive of the gdb-prs@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

gdb/779: mishandled enums in sparc-sun-solaris2.8 gcc 3.2 + gdb 20021001


>Number:         779
>Category:       gdb
>Synopsis:       mishandled enums in sparc-sun-solaris2.8 gcc 3.2 + gdb 20021001
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Oct 02 11:28:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     rrh@cray.com
>Release:        gdb 20021001
>Organization:
>Environment:
sparc-sun-solaris2.8
>Description:
An enumeration constructed with members that are unsigned
integers >= 0x80000000 confuses gdb 20021001.  The type information
is evidently dropped on the floor in gdb.
If you compile the enclosed program -g, and then debug,
and then put a breakpoint on the return statement in main,
and then print out the values of the local variables, you'll get
(gdb) print c
$4 = Red
(gdb) print good
$5 = gCC_MEMORY_NB
(gdb) print bad
$6 = <error type>
(gdb)
note that the bad enumeration uses large numbers;
the good enumeration uses values that aren't so large (bit 31 not set)

The stabs information for the enums is:
.stabs "color:t(0,24)=eRed:0,Blue:1,;",128,0,2,0
.stabs "addr_bad:t(0,25)=ebCC_0_LOW_BADDR:2147483648,bCC_1_LOW_BADDR:2281701376,bCC_MEMORY_NB:100745216,;",128,0,6,0
.stabs "addr_gooBreakpoint 3, error_type (pp=0xffbeda4c, objfile=0x377c30) at stabsread.c:2327

gdb calls error_type with

Breakpoint 3, error_type (pp=0xffbeda4c, objfile=0x377c30) at stabsread.c:2327
2327      complain (&error_type_complaint);
(top-gdb) print *pp
$1 = 0x36e8a5 "bCC_MEMORY_NB:100745216,;"

>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="d0.cc"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="d0.cc"

ZW51bSBjb2xvciB7CiAgUmVkPSAwLAogIEJsdWUgPSAxCn07CmVudW0gYWRkcl9iYWQgewogIGJD
Q18wX0xPV19CQUREUiA9IDB4ODAwMDAwMDAsIAogIGJDQ18xX0xPV19CQUREUiA9IDB4ODgwMDAw
MDAsIAogIGJDQ19NRU1PUllfTkIgICA9IDB4MDYwMTQwMDAgICAKfTsKZW51bSBhZGRyX2dvb2Qg
ewogIGdDQ18wX0xPV19CQUREUiA9IDB4MDgwMDAwMDAsIAogIGdDQ18xX0xPV19CQUREUiA9IDB4
MDg4MDAwMDAsIAogIGdDQ19NRU1PUllfTkIgICA9IDB4MDYwMTQwMDAgICAKfTsKCmludCBtYWlu
KHZvaWQpCnsKICBjb2xvciBjID0gUmVkOwogIGFkZHJfZ29vZCBnb29kID0gZ0NDX01FTU9SWV9O
QjsKICBhZGRyX2JhZCBiYWQgPSBiQ0NfTUVNT1JZX05COwogIHJldHVybiAwOwp9Cg==


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]