Bug 10513 - enums of a given name seem to mask decls of the same name.
Summary: enums of a given name seem to mask decls of the same name.
Status: RESOLVED FIXED
Alias: None
Product: gdb
Classification: Unclassified
Component: gdb (show other bugs)
Version: archer
: P2 normal
Target Milestone: 7.2
Assignee: Chris Moller
URL:
Keywords:
Depends on:
Blocks: 11211
  Show dependency treegraph
 
Reported: 2009-08-12 15:55 UTC by Chris Moller
Modified: 2010-03-13 00:47 UTC (History)
1 user (show)

See Also:
Host: i686-pc-linux-gnu
Target: i686-pc-linux-gnu
Build: i686-pc-linux-gnu
Last reconfirmed:


Attachments
Testcase showing the failure. (147 bytes, text/plain)
2009-08-12 15:59 UTC, Chris Moller
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Moller 2009-08-12 15:55:30 UTC
Given a program that includes both something like an "int vv;" and an "enum vv
{...}:" trying to print the value of vv results in:

(gdb) p vv
Attempt to use a type name as an expression
(gdb) ptype vv
type = enum vv {v0, v1}
(gdb) 

The enum vv seems to be masking the int vv.
Comment 1 Chris Moller 2009-08-12 15:59:33 UTC
Created attachment 4129 [details]
Testcase showing the failure.

Testcase showing the failure.  Compile with -g, gdb it, br at the line
containing "vv = 9;"  Run, then try to print the value of vv.  It fails because
vv is being resolved to the enum, not the int of the same name.
Comment 2 Tom Tromey 2010-03-13 00:47:10 UTC
Fixed on trunk.