]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Fix gdb.lookup_type for function-local types
authorHannes Domani <ssbssa@yahoo.de>
Mon, 24 Jun 2024 16:45:37 +0000 (18:45 +0200)
committerHannes Domani <ssbssa@yahoo.de>
Mon, 24 Jun 2024 16:45:37 +0000 (18:45 +0200)
commit5ae5974d60378fa3faecff64725e00c8695bcc7d
tree8b78e488803dfc72e650ec3bab61e030fcf069bb
parenta6e529673a95670a9c3046c3681fe6864b2cd05c
Fix gdb.lookup_type for function-local types

Looking for a type defined locally in a function doesn't work
any more since the introduction of TYPE_DOMAIN:
```
(gdb) python print (gdb.lookup_type ('main()::Local'))
Python Exception <class 'gdb.error'>: No type named main()::Local.
Error occurred in Python: No type named main()::Local.
```

cp_search_static_and_baseclasses was simply missing a check for
SEARCH_TYPE_DOMAIN, now it works again:
```
(gdb) python print (gdb.lookup_type ('main()::Local'))
Local
```

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31922
Approved-By: Tom Tromey <tom@tromey.com>
gdb/cp-namespace.c
gdb/testsuite/gdb.python/py-type.c
gdb/testsuite/gdb.python/py-type.exp