Bug 9282

Summary: Enum support in dwarf reader is inconsistent
Product: gdb Reporter: drow <drow>
Component: c++Assignee: Not yet assigned to anyone <unassigned>
Status: RESOLVED FIXED    
Severity: enhancement CC: gdb-prs, tromey
Priority: P3    
Version: 6.5   
Target Milestone: 7.1   
Host: Target:
Build: Last reconfirmed:

Description drow@false.org 2006-09-28 19:28:01 UTC
[Converted from Gnats 2177]

Compile this:

struct A {
  enum X { Y };
};

enum A::X z = A::Y;

GDB will print out the type of z as "enum X".

Compile this:
namespace NS
{
  struct B { int q; };
  B qq;
  int f() { return 0; }
};

struct A {
  enum X { Y };
};

enum A::X z = A::Y;

Now GDB will print out the type of z as 'enum A::X'.  If your headers happen to trigger this, it causes a failure in classes.exp.

This has to do with handling of processing_has_namespace_info.  I think we need to approach whether to trust scope information differently.  I don't have time to debug it further right now.

Release:
GDB 6.5
Comment 1 Tom Tromey 2010-01-19 02:29:49 UTC
I tried today with cvs head gdb and a recent-ish (Fedora 11 system) gcc.
In both cases I get:

(gdb) ptype z
type = enum A::X {A::Y}

So, I think this has been fixed at some point.