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]

exp/1445: C enum prints 129 as -127 with dwarf-2


>Number:         1445
>Category:       exp
>Synopsis:       C enum prints 129 as -127 with dwarf-2
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Mon Nov 10 23:58:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     nomura@netapp.com
>Release:        6.0, 5.3, 5.2.1
>Organization:
>Environment:
RH linux 8 or 9
>Description:
C enum with value 129 prints as -127.  Seems to be
sensitive to debug format because compiling with
stabs (gcc -gstabs a.c) prints the right value.
>How-To-Repeat:
[bughouse]$ cat a.c
enum {
        x = 129
};

main ()
{
        printf ("%d\n", x);
}
[bughouse]$ gcc -g a.c
[bughouse]$ gdb a.out
GNU gdb Red Hat Linux (5.3post-0.20021129.18rh)
Copyright 2003 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"...
(gdb) p/d x
$1 = -127
(gdb) 


[bughouse]$ uname -a
Linux bughouse 2.4.20-8 #1 Thu Mar 13 17:54:28 EST 2003 i686 i686 i386 GNU/Linux
[bughouse]$ gcc -v
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.2.2/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/u
sr/share/info --enable-shared --enable-threads=posix --disable-checking --with-s
ystem-zlib --enable-__cxa_atexit --host=i386-redhat-linux
Thread model: posix
gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5)
[bughouse]$ cat /etc/issue
Red Hat Linux release 9 (Shrike)
Kernel \r on an \m

[bughouse]$ 
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


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