[v2,26/30] Only search types in cp_lookup_rtti_type

Message ID 20240118-submit-domain-hacks-2-v2-26-aecab29fa104@tromey.com
State New
Headers
Series Restructure symbol domains |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 fail Patch failed to apply
linaro-tcwg-bot/tcwg_gdb_build--master-arm fail Patch failed to apply

Commit Message

Tom Tromey Jan. 18, 2024, 8:32 p.m. UTC
  This changes cp_lookup_rtti_type to only search for types -- not
functions or variables.  Due to the symbol-matching hack, this could
just use SEARCH_TYPE_DOMAIN, but I think it's better to be clear; also
I hold on to some hope that perhaps the hack can someday be removed.
---
 gdb/cp-support.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
  

Patch

diff --git a/gdb/cp-support.c b/gdb/cp-support.c
index 9a59d7632a1..6b7c2f5a062 100644
--- a/gdb/cp-support.c
+++ b/gdb/cp-support.c
@@ -1498,9 +1498,9 @@  cp_lookup_rtti_type (const char *name, const struct block *block)
   struct symbol * rtti_sym;
   struct type * rtti_type;
 
-  /* Use VAR_DOMAIN here as NAME may be a typedef.  PR 18141, 18417.
-     Classes "live" in both STRUCT_DOMAIN and VAR_DOMAIN.  */
-  rtti_sym = lookup_symbol (name, block, SEARCH_VFT, NULL).symbol;
+  rtti_sym = lookup_symbol (name, block,
+			    SEARCH_TYPE_DOMAIN | SEARCH_STRUCT_DOMAIN,
+			    nullptr).symbol;
 
   if (rtti_sym == NULL)
     {