[Bug python/17568] gdb.lookup_type fails if a C++11 enum class has a value with the same name

ssbssa at sourceware dot org sourceware-bugzilla@sourceware.org
Fri Dec 15 20:18:03 GMT 2023


https://sourceware.org/bugzilla/show_bug.cgi?id=17568

Hannes Domani <ssbssa at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |7.8
             Status|NEW                         |RESOLVED
                 CC|                            |ssbssa at sourceware dot org
         Resolution|---                         |FIXED

--- Comment #1 from Hannes Domani <ssbssa at sourceware dot org> ---
Looks to me like this was fixed quite some time ago.

With gdb-7.8 I already get these results:
```
(gdb) pt SP
type = enum class SP : int {SP::SP}
(gdb) p SP
Attempt to use a type name as an expression
(gdb) p SP::SP
$1 = SP::SP
(gdb) py print(gdb.lookup_type('SP'))
SP
(gdb) py print(gdb.parse_and_eval('SP'))
Traceback (most recent call last):
  File "<string>", line 1, in <module>
gdb.error: Attempt to use a type name as an expression
Error while executing Python code.
(gdb) py print(gdb.parse_and_eval('SP::SP'))
SP::SP
```

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Gdb-prs mailing list