aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2009-12-28 16:49:14 +0000
committerPedro Alves <palves@redhat.com>2009-12-28 16:49:14 +0000
commit6a0fc12fb1e6ef883c57a5524ebd6c6171572f9a (patch)
tree4176ab8ed1127fc911db2b3d4dbabaaa7bb539e4 /gdb
parentca5c370d27dbe4f384787370fbb2195a0237897c (diff)
downloadgdb-6a0fc12fb1e6ef883c57a5524ebd6c6171572f9a.zip
gdb-6a0fc12fb1e6ef883c57a5524ebd6c6171572f9a.tar.gz
gdb-6a0fc12fb1e6ef883c57a5524ebd6c6171572f9a.tar.bz2
* ax-gdb.c (gen_expr) <OP_THIS>: Lookup `this' in the context of
the tracepoint, not of the selected frame and language.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/ax-gdb.c21
2 files changed, 10 insertions, 16 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index e1115bc..101f7e0 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2009-12-28 Pedro Alves <pedro@codesourcery.com>
+
+ * ax-gdb.c (gen_expr) <OP_THIS>: Lookup `this' in the context of
+ the tracepoint, not of the selected frame and language.
+
2009-12-23 Stan Shebs <stan@codesourcery.com>
* ax-gdb.c (gen_expr): Handle OP_THIS.
diff --git a/gdb/ax-gdb.c b/gdb/ax-gdb.c
index a1c3d6e..a64658d 100644
--- a/gdb/ax-gdb.c
+++ b/gdb/ax-gdb.c
@@ -1762,30 +1762,19 @@ gen_expr (struct expression *exp, union exp_element **pc,
case OP_THIS:
{
- char *name;
- struct frame_info *frame;
+ char *this_name;
struct symbol *func, *sym;
struct block *b;
- name = current_language->la_name_of_this;
- if (!name)
- error (_("no `this' in current language"));
-
- frame = get_selected_frame (_("no frame selected"));
-
- func = get_frame_function (frame);
- if (!func)
- error (_("no `%s' in nameless context"), name);
-
+ 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);
- if (dict_empty (BLOCK_DICT (b)))
- error (_("no args, no `%s' in block"), name);
/* 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, name, NULL, VAR_DOMAIN);
+ sym = lookup_block_symbol (b, this_name, NULL, VAR_DOMAIN);
if (!sym)
- error (_("no `%s' found"), name);
+ error (_("no `%s' found"), this_name);
gen_var_ref (exp->gdbarch, ax, value, sym);
(*pc) += 2;