diff options
-rw-r--r-- | bfd/version.h | 2 | ||||
-rw-r--r-- | gdb/ada-exp.y | 1 | ||||
-rw-r--r-- | gdb/cp-namespace.c | 4 | ||||
-rw-r--r-- | gdb/testsuite/gdb.python/py-type.c | 5 | ||||
-rw-r--r-- | gdb/testsuite/gdb.python/py-type.exp | 6 |
5 files changed, 15 insertions, 3 deletions
diff --git a/bfd/version.h b/bfd/version.h index 9e7e9dd..9bec574 100644 --- a/bfd/version.h +++ b/bfd/version.h @@ -16,7 +16,7 @@ In releases, the date is not included in either version strings or sonames. */ -#define BFD_VERSION_DATE 20240622 +#define BFD_VERSION_DATE 20240628 #define BFD_VERSION @bfd_version@ #define BFD_VERSION_STRING @bfd_version_package@ @bfd_version_string@ #define REPORT_BUGS_TO @report_bugs_to@ diff --git a/gdb/ada-exp.y b/gdb/ada-exp.y index f3cef6d..8cf4b8f 100644 --- a/gdb/ada-exp.y +++ b/gdb/ada-exp.y @@ -36,6 +36,7 @@ %{ #include <ctype.h> +#include <unordered_map> #include "expression.h" #include "value.h" #include "parser-defs.h" diff --git a/gdb/cp-namespace.c b/gdb/cp-namespace.c index 4434ddf..255b22e 100644 --- a/gdb/cp-namespace.c +++ b/gdb/cp-namespace.c @@ -287,10 +287,10 @@ cp_search_static_and_baseclasses (const char *name, struct type *scope_type = scope_sym.symbol->type (); /* If the scope is a function/method, then look up NESTED as a local - static variable. E.g., "print 'function()::static_var'". */ + static variable or type. E.g., "print 'function()::static_var'". */ if ((scope_type->code () == TYPE_CODE_FUNC || scope_type->code () == TYPE_CODE_METHOD) - && (domain & SEARCH_VAR_DOMAIN) != 0) + && (domain & (SEARCH_VAR_DOMAIN | SEARCH_TYPE_DOMAIN)) != 0) return lookup_symbol (nested, scope_sym.symbol->value_block (), domain, NULL); diff --git a/gdb/testsuite/gdb.python/py-type.c b/gdb/testsuite/gdb.python/py-type.c index bedabc6..7a0df8a 100644 --- a/gdb/testsuite/gdb.python/py-type.c +++ b/gdb/testsuite/gdb.python/py-type.c @@ -118,6 +118,11 @@ main () c.a_method (0, 1); c.a_const_method (0, 1); C::a_static_method (0, 1); + + struct Local { int g; } l; + l.g = 5; + typedef int IntType; + IntType it = 6; #endif enum E e; diff --git a/gdb/testsuite/gdb.python/py-type.exp b/gdb/testsuite/gdb.python/py-type.exp index 74e1234..e524959 100644 --- a/gdb/testsuite/gdb.python/py-type.exp +++ b/gdb/testsuite/gdb.python/py-type.exp @@ -85,6 +85,12 @@ proc test_fields {lang} { gdb_test "python print (gdb.parse_and_eval ('C::a_static_method').type.fields ()\[0\].type)" "int" gdb_test "python print (gdb.parse_and_eval ('C::a_static_method').type.fields ()\[1\].type)" "char" gdb_test "python print (gdb.parse_and_eval ('c')\['a_static_method'\].type.fields ()\[0\].type)" "int" + + # Test function-local types. + gdb_test "python print (gdb.lookup_type ('main()::Local'))" "Local" + gdb_test "python print (gdb.lookup_type ('main()::Local').fields ()\[0\].type)" "int" + gdb_test "python print (gdb.lookup_type ('main()::IntType'))" "IntType" + gdb_test "python print (gdb.lookup_type ('main()::IntType').target ())" "int" } # Test normal fields usage in structs. |