🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gdb.bug
Article #1253

can't print enums on AMD

#1253
From: 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).
Technical Details
Message-ID: <mailman.1835.1109463985.32256.bug-gdb@gnu.org>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!newsfeed.stanford.edu!shelby.stanford.edu!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: f5053,ccac432d2b682634,start
X-Google-Attributes: gidf5053,public
X-Google-Language: ENGLISH,ASCII-7-bit
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!newsfeed.stanford.edu!shelby.stanford.edu!not-for-mail
From: Kevin Nomura <nomura@netapp.com>
Newsgroups: gnu.gdb.bug
Subject: can't print enums on AMD
Date: Thu, 24 Feb 2005 11:41:16 -0800
Lines: 77
Approved: bug-gdb@gnu.org
Message-ID: <mailman.1835.1109463985.32256.bug-gdb@gnu.org>
NNTP-Posting-Host: lists.gnu.org
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: news.Stanford.EDU 1109463123 25401 199.232.76.165 (27 Feb 2005 00:12:03 GMT)
X-Complaints-To: news@news.stanford.edu
To: bug-gdb@gnu.org
Envelope-to: bug-gdb@gnu.org
Content-Disposition: inline
User-Agent: Mutt/1.5.6+20040907i
X-Mailman-Approved-At: Sat, 26 Feb 2005 19:26:21 -0500
X-BeenThere: bug-gdb@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "Bug reports for GDB, the GNU debugger" <bug-gdb.gnu.org>
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/bug-gdb>,
 <mailto:bug-gdb-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/bug-gdb>
List-Post: <mailto:bug-gdb@gnu.org>
List-Help: <mailto:bug-gdb-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/bug-gdb>,
 <mailto:bug-gdb-request@gnu.org?subject=subscribe>