aboutsummaryrefslogtreecommitdiff
path: root/gdb/p-exp.y
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/p-exp.y
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/p-exp.y')
-rw-r--r--gdb/p-exp.y19
1 files changed, 10 insertions, 9 deletions
diff --git a/gdb/p-exp.y b/gdb/p-exp.y
index 2b5eb6f..ea7eb8c 100644
--- a/gdb/p-exp.y
+++ b/gdb/p-exp.y
@@ -629,9 +629,10 @@ block : block COLONCOLON name
std::string copy = copy_name ($3);
struct symbol *tem
= lookup_symbol (copy.c_str (), $1,
- VAR_DOMAIN, NULL).symbol;
+ SEARCH_FUNCTION_DOMAIN,
+ nullptr).symbol;
- if (!tem || tem->aclass () != LOC_BLOCK)
+ if (tem == nullptr)
error (_("No function \"%s\" in specified context."),
copy.c_str ());
$$ = tem->value_block (); }
@@ -642,7 +643,7 @@ variable: block COLONCOLON name
std::string copy = copy_name ($3);
sym = lookup_symbol (copy.c_str (), $1,
- VAR_DOMAIN, NULL);
+ SEARCH_VFT, NULL);
if (sym.symbol == 0)
error (_("No symbol \"%s\" in specified context."),
copy.c_str ());
@@ -672,7 +673,7 @@ variable: qualified_name
struct block_symbol sym
= lookup_symbol (name.c_str (), nullptr,
- VAR_DOMAIN, nullptr);
+ SEARCH_VFT, nullptr);
pstate->push_symbol (name.c_str (), sym);
}
;
@@ -1400,7 +1401,7 @@ yylex (void)
static const char this_name[] = "this";
if (lookup_symbol (this_name, pstate->expression_context_block,
- VAR_DOMAIN, NULL).symbol)
+ SEARCH_VFT, NULL).symbol)
{
free (uptokstart);
return THIS;
@@ -1440,7 +1441,7 @@ yylex (void)
sym = NULL;
else
sym = lookup_symbol (tmp.c_str (), pstate->expression_context_block,
- VAR_DOMAIN, &is_a_field_of_this).symbol;
+ SEARCH_VFT, &is_a_field_of_this).symbol;
/* second chance uppercased (as Free Pascal does). */
if (!sym && is_a_field_of_this.type == NULL && !is_a_field)
{
@@ -1456,7 +1457,7 @@ yylex (void)
sym = NULL;
else
sym = lookup_symbol (tmp.c_str (), pstate->expression_context_block,
- VAR_DOMAIN, &is_a_field_of_this).symbol;
+ SEARCH_VFT, &is_a_field_of_this).symbol;
}
/* Third chance Capitalized (as GPC does). */
if (!sym && is_a_field_of_this.type == NULL && !is_a_field)
@@ -1479,7 +1480,7 @@ yylex (void)
sym = NULL;
else
sym = lookup_symbol (tmp.c_str (), pstate->expression_context_block,
- VAR_DOMAIN, &is_a_field_of_this).symbol;
+ SEARCH_VFT, &is_a_field_of_this).symbol;
}
if (is_a_field || (is_a_field_of_this.type != NULL))
@@ -1576,7 +1577,7 @@ yylex (void)
cur_sym
= lookup_symbol (ncopy,
pstate->expression_context_block,
- VAR_DOMAIN, NULL).symbol;
+ SEARCH_VFT, NULL).symbol;
if (cur_sym)
{
if (cur_sym->aclass () == LOC_TYPEDEF)