aboutsummaryrefslogtreecommitdiff
path: root/gdb/ax-gdb.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2011-06-17 20:46:47 +0000
committerTom Tromey <tromey@redhat.com>2011-06-17 20:46:47 +0000
commit66a17cb6292ee31b9f46520761098d56550a341b (patch)
tree84bc405dd78d87cbab72d55ce5460034f25f57d3 /gdb/ax-gdb.c
parent7518bff55ab27e073e9d03b5d700d469d362c85d (diff)
downloadgdb-66a17cb6292ee31b9f46520761098d56550a341b.zip
gdb-66a17cb6292ee31b9f46520761098d56550a341b.tar.gz
gdb-66a17cb6292ee31b9f46520761098d56550a341b.tar.bz2
* 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 19c00ad..5258167 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);