🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Kevin Nomura Thu, 24 Feb 2005 19:41
can't print enums on AMD
#1253
Author: Kevin Nomura
Date: Thu, 24 Feb 2005 19:41
75 lines
3229 bytes
Are enums known to be broken with dwarf2 on the amd64 target?
google didn't help me, so thought I'd ask here.



Testcase:

[scm8]$ cat en.c
enum enumtype { ENUM_VALUE_ONE = 0x00000001 };

main ()
{
        printf ("%d\n", ENUM_VALUE_ONE );
}


Problem:

[scm8]$ gcc -gdwarf-2 en.c    # same result as gcc -g
[scm8]$ gdb -q a.out
Using host libthread_db library "/lib64/tls/libthread_db.so.1".
(gdb) p ENUM_VALUE_ONE
No symbol "ENUM_VALUE_ONE" in current context.

And with my own gdb 6.3:

[scm8]$ ~/dl/gdb-6.3_amd64/gdb/gdb a.out
GNU gdb 6.3
This GDB was configured as "x86_64-unknown-linux-gnu"...Using host
libthread_db library "/lib64/tls/libthread_db.so.1".

(gdb) p ENUM_VALUE_ONE
No symbol "ENUM_VALUE_ONE" in current context.
(gdb) q


however

[scm8]$ gcc -gstabs en.c
[scm8]$ gdb -q a.out
Using host libthread_db library "/lib64/tls/libthread_db.so.1".
(gdb) p ENUM_VALUE_ONE
$1 = ENUM_VALUE_ONE
(gdb) p (int)ENUM_VALUE_ONE
$2 = 1




Configuration:

[scm8]$ cat /etc/issue
Red Hat Enterprise Linux AS release 3 (Taroon Update 3)

[scm8]$ gcc -v
Reading specs from /usr/lib/gcc-lib/x86_64-redhat-linux/3.2.3/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --enable-shared --enable-threads=posix
--disable-checking --with-system-zlib --enable-__cxa_atexit
--host=x86_64-redhat-linux
Thread model: posix
gcc version 3.2.3 20030502 (Red Hat Linux 3.2.3-42)

[scm8]$ gdb --version
GNU gdb Red Hat Linux (6.1post-1.20040607.17rh)
This GDB was configured as "x86_64-redhat-linux-gnu".

[scm8]$ rpm -qa | grep (gcc|gdb)
gdb-6.1post-1.20040607.17
gcc-3.2.3-42


This problem was originally seen with gcc = gcc 3.4.2 cross
compiling to amd64 from Linux (so it's not obviously due to
a back-level compiler).
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads