]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Use type-specific lookups in cp-support.c
authorTom Tromey <tom@tromey.com>
Sun, 17 Aug 2025 17:38:15 +0000 (11:38 -0600)
committerTom Tromey <tom@tromey.com>
Mon, 8 Sep 2025 20:06:10 +0000 (14:06 -0600)
cp-support.c has code to substitute types for typedef names when
canonicalizing a C++ name.  I believe this code can use type-specific
search domains; and doing this greatly speeds up some cases.

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

gdb/cp-support.c

index be66be95d6164b3835add8db41071b46d39c328f..7ed15eef17396c4f9f4d9cf91db6aa5e36516f8e 100644 (file)
@@ -150,7 +150,8 @@ inspect_type (struct demangle_parse_info *info,
 
   try
     {
-      sym = lookup_symbol (name, 0, SEARCH_VFT, 0).symbol;
+      sym = lookup_symbol (name, 0, (SEARCH_TYPE_DOMAIN
+                                    | SEARCH_STRUCT_DOMAIN), 0).symbol;
     }
   catch (const gdb_exception &except)
     {
@@ -504,7 +505,8 @@ replace_typedefs (struct demangle_parse_info *info,
              try
                {
                  sym = lookup_symbol (local_name.get (), 0,
-                                      SEARCH_VFT, 0).symbol;
+                                      (SEARCH_TYPE_DOMAIN
+                                       | SEARCH_STRUCT_DOMAIN), 0).symbol;
                }
              catch (const gdb_exception &except)
                {