aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbtypes.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2023-03-30 23:00:26 -0600
committerTom Tromey <tom@tromey.com>2024-01-28 10:58:16 -0700
commitccf41c248737eb6650211481366c4e1156ce01ae (patch)
tree55933f48a150085e0df7728b4f82047977559a88 /gdb/gdbtypes.c
parent6c0152149476085e6c4c5c812bfc3a06fff7c938 (diff)
downloadgdb-ccf41c248737eb6650211481366c4e1156ce01ae.zip
gdb-ccf41c248737eb6650211481366c4e1156ce01ae.tar.gz
gdb-ccf41c248737eb6650211481366c4e1156ce01ae.tar.bz2
Use domain_search_flags in lookup_symbol et al
This changes lookup_symbol and associated APIs to accept domain_search_flags rather than a domain_enum. Note that this introduces some new constants to Python and Guile. I chose to break out the documentation patch for this, because the internals here do not change until a later patch, and it seemed simpler to patch the docs just once, rather than twice.
Diffstat (limited to 'gdb/gdbtypes.c')
-rw-r--r--gdb/gdbtypes.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
index 1dc68a99..f4eff65 100644
--- a/gdb/gdbtypes.c
+++ b/gdb/gdbtypes.c
@@ -1655,7 +1655,7 @@ lookup_typename (const struct language_defn *language,
{
struct symbol *sym;
- sym = lookup_symbol_in_language (name, block, VAR_DOMAIN,
+ sym = lookup_symbol_in_language (name, block, SEARCH_VFT,
language->la_language, NULL).symbol;
if (sym != NULL && sym->aclass () == LOC_TYPEDEF)
{
@@ -1699,7 +1699,7 @@ lookup_struct (const char *name, const struct block *block)
{
struct symbol *sym;
- sym = lookup_symbol (name, block, STRUCT_DOMAIN, 0).symbol;
+ sym = lookup_symbol (name, block, SEARCH_STRUCT_DOMAIN, 0).symbol;
if (sym == NULL)
{
@@ -1722,7 +1722,7 @@ lookup_union (const char *name, const struct block *block)
struct symbol *sym;
struct type *t;
- sym = lookup_symbol (name, block, STRUCT_DOMAIN, 0).symbol;
+ sym = lookup_symbol (name, block, SEARCH_STRUCT_DOMAIN, 0).symbol;
if (sym == NULL)
error (_("No union type named %s."), name);
@@ -1745,7 +1745,7 @@ lookup_enum (const char *name, const struct block *block)
{
struct symbol *sym;
- sym = lookup_symbol (name, block, STRUCT_DOMAIN, 0).symbol;
+ sym = lookup_symbol (name, block, SEARCH_STRUCT_DOMAIN, 0).symbol;
if (sym == NULL)
{
error (_("No enum type named %s."), name);
@@ -1772,7 +1772,8 @@ lookup_template_type (const char *name, struct type *type,
nam += type->name ();
nam += " >"; /* FIXME, extra space still introduced in gcc? */
- symbol *sym = lookup_symbol (nam.c_str (), block, VAR_DOMAIN, 0).symbol;
+ symbol *sym = lookup_symbol (nam.c_str (), block,
+ SEARCH_STRUCT_DOMAIN, 0).symbol;
if (sym == NULL)
{
@@ -2994,7 +2995,8 @@ check_typedef (struct type *type)
stub_noname_complaint ();
return make_qualified_type (type, instance_flags, NULL);
}
- sym = lookup_symbol (name, 0, STRUCT_DOMAIN, 0).symbol;
+ sym = lookup_symbol (name, nullptr, SEARCH_STRUCT_DOMAIN,
+ nullptr).symbol;
if (sym)
type->set_target_type (sym->type ());
else /* TYPE_CODE_UNDEF */
@@ -3084,7 +3086,8 @@ check_typedef (struct type *type)
stub_noname_complaint ();
return make_qualified_type (type, instance_flags, NULL);
}
- sym = lookup_symbol (name, 0, STRUCT_DOMAIN, 0).symbol;
+ sym = lookup_symbol (name, nullptr, SEARCH_STRUCT_DOMAIN,
+ nullptr).symbol;
if (sym)
{
/* Same as above for opaque types, we can replace the stub