aboutsummaryrefslogtreecommitdiff
path: root/gdb/c-exp.y
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/c-exp.y')
-rw-r--r--gdb/c-exp.y26
1 files changed, 4 insertions, 22 deletions
diff --git a/gdb/c-exp.y b/gdb/c-exp.y
index 71610e9..13b06f3 100644
--- a/gdb/c-exp.y
+++ b/gdb/c-exp.y
@@ -1104,30 +1104,12 @@ variable: qualified_name
| COLONCOLON name_not_typename
{
std::string name = copy_name ($2.stoken);
- struct symbol *sym;
- struct bound_minimal_symbol msymbol;
-
- sym
+ struct block_symbol sym
= lookup_symbol (name.c_str (),
(const struct block *) NULL,
- VAR_DOMAIN, NULL).symbol;
- if (sym)
- {
- write_exp_elt_opcode (pstate, OP_VAR_VALUE);
- write_exp_elt_block (pstate, NULL);
- write_exp_elt_sym (pstate, sym);
- write_exp_elt_opcode (pstate, OP_VAR_VALUE);
- break;
- }
-
- msymbol = lookup_bound_minimal_symbol (name.c_str ());
- if (msymbol.minsym != NULL)
- write_exp_msymbol (pstate, msymbol);
- else if (!have_full_symbols () && !have_partial_symbols ())
- error (_("No symbol table is loaded. Use the \"file\" command."));
- else
- error (_("No symbol \"%s\" in current context."),
- name.c_str ());
+ VAR_DOMAIN, NULL);
+ write_exp_symbol_reference (pstate, name.c_str (),
+ sym);
}
;