This is with today's cvs head gcc and cvs head gdb.
I'm running on x86 FC2.

The test program:

#include <stdio.h>

enum java_tree_index
{
  JTI_PROMOTED_BYTE_TYPE_NODE,
  JTI_PROMOTED_SHORT_TYPE_NODE,
  JTI_PROMOTED_CHAR_TYPE_NODE,
  JTI_PROMOTED_BOOLEAN_TYPE_NODE,

  JTI_MAX
};

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


what happens:
opsy. gcc -g -o zz zz.c
opsy. ~/gnu/baseline-gdb/install/bin/gdb zz
GNU gdb 6.3.50.20050811-cvs
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) b main
Breakpoint 1 at 0x8048380: file zz.c, line 15.
(gdb) r
Starting program: /tmp/zz
                                                                                
Breakpoint 1, main () at zz.c:15
15        printf ("%d\n", (int) JTI_MAX);
(gdb) p JTI_MAX
No symbol "JTI_MAX" in current context.


I think it should know the value of JTI_MAX here.
I know this used to work; for instance it works fine with the
system compiler on FC2 - gcc (GCC) 3.3.3 20040412 (Red Hat Linux 3.3.3-7)
(FWIW this bug is a big impediment to debugging gcj.)

-- 
           Summary: enum constants not visible to gdb
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: debug
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: tromey at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org
  GCC host triplet: i686-pc-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23336

Reply via email to