summaryrefslogtreecommitdiff
path: root/gdb/ax-gdb.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2011-06-17 20:46:46 +0000
committerTom Tromey <tromey@redhat.com>2011-06-17 20:46:46 +0000
commit73020efaf1860119c3775d1efd3e896ef0da2753 (patch)
tree468dd1be4661391b5ab2ba1f3407467b507e1103 /gdb/ax-gdb.c
parenta03c034dadca211c0c179497907a776a84b024f7 (diff)
downloadgdb-73020efaf1860119c3775d1efd3e896ef0da2753.tar.gz
* valops.c (value_of_this): Use lookup_language_this.
* symtab.h (lookup_language_this): Declare. * symtab.c (lookup_language_this): New function. (lookup_symbol_aux): Use lookup_language_this. * ax-gdb.c (gen_expr) <OP_THIS>: Use lookup_language_this.
Diffstat (limited to 'gdb/ax-gdb.c')
-rw-r--r--gdb/ax-gdb.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/gdb/ax-gdb.c b/gdb/ax-gdb.c
index 19c00ade5a3..5258167df38 100644
--- a/gdb/ax-gdb.c
+++ b/gdb/ax-gdb.c
@@ -2138,18 +2138,17 @@ gen_expr (struct expression *exp, union exp_element **pc,
case OP_THIS:
{
char *this_name;
- struct symbol *func, *sym;
+ struct symbol *sym, *func;
struct block *b;
+ const struct language_defn *lang;
- func = block_linkage_function (block_for_pc (ax->scope));
- this_name = language_def (SYMBOL_LANGUAGE (func))->la_name_of_this;
- b = SYMBOL_BLOCK_VALUE (func);
+ b = block_for_pc (ax->scope);
+ func = block_linkage_function (b);
+ lang = language_def (SYMBOL_LANGUAGE (func));
- /* Calling lookup_block_symbol is necessary to get the LOC_REGISTER
- symbol instead of the LOC_ARG one (if both exist). */
- sym = lookup_block_symbol (b, this_name, VAR_DOMAIN);
+ sym = lookup_language_this (lang, b);
if (!sym)
- error (_("no `%s' found"), this_name);
+ error (_("no `%s' found"), lang->la_name_of_this);
gen_var_ref (exp->gdbarch, ax, value, sym);