From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17842 invoked by alias); 9 Nov 2014 07:45:58 -0000 Mailing-List: contact gdb-prs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-prs-owner@sourceware.org Received: (qmail 17816 invoked by uid 48); 9 Nov 2014 07:45:56 -0000 From: "b.r.longbons at gmail dot com" To: gdb-prs@sourceware.org Subject: [Bug python/17568] New: gdb.lookup_type fails if a C++11 enum class has a value with the same name Date: Sun, 09 Nov 2014 07:45:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: python X-Bugzilla-Version: 7.7 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: b.r.longbons at gmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-q4/txt/msg00221.txt.bz2 https://sourceware.org/bugzilla/show_bug.cgi?id=17568 Bug ID: 17568 Summary: gdb.lookup_type fails if a C++11 enum class has a value with the same name Product: gdb Version: 7.7 Status: NEW Severity: normal Priority: P2 Component: python Assignee: unassigned at sourceware dot org Reporter: b.r.longbons at gmail dot com // source, compile with -std=c++0x, requires gcc 4.4 or later enum class SP { SP }; This bug is most likely related to the fact that gdb does not yet distinguish between 'enum' and 'enum class', but somehow `ptype` manages to get the right symbol. # bad (gdb) python print gdb.lookup_type('SP') Traceback (most recent call last): File "", line 1, in gdb.error: No type named SP. Error while executing Python code. # bad, SP is a type, SP::SP is the value (gdb) python print gdb.parse_and_eval('SP') SP # bad, but useful to get the thing I'm actually wanting (gdb) python print gdb.parse_and_eval('SP').type SP # mostly good (should be 'enum class') (gdb) ptype SP type = enum SP {SP} # bad, there is no value named 'SP', only 'SP::SP' (gdb) p SP $1 = SP # bad (gdb) p SP::SP A syntax error in expression, near `'. -- You are receiving this mail because: You are on the CC list for the bug.