aboutsummaryrefslogtreecommitdiff
path: root/gdb/ax-gdb.c
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2011-02-16 18:07:58 +0000
committerPedro Alves <palves@redhat.com>2011-02-16 18:07:58 +0000
commita0c78a733a3def605ce73c42e1610f676c7ac910 (patch)
treeadc6f0f089338ff6650098112cb91082b1a17f69 /gdb/ax-gdb.c
parent5ff2bd081f67d55a8a93f3945a8112336bae6d3c (diff)
downloadfsf-binutils-gdb-a0c78a733a3def605ce73c42e1610f676c7ac910.zip
fsf-binutils-gdb-a0c78a733a3def605ce73c42e1610f676c7ac910.tar.gz
fsf-binutils-gdb-a0c78a733a3def605ce73c42e1610f676c7ac910.tar.bz2
2011-02-16 Tom Tromey <tromey@redhat.com>
gdb/ * ax-gdb.c.c (gen_expr) <UNOP_MEMVAL>: Handle value kinds other than axs_rvalue. 2011-02-16 Pedro Alves <pedro@codesourcery.com> gdb/testsuite/ * collection.c (globalarr3): New global. (main): Initialize it before collecting, and and clear it afterwards. * collection.exp (gdb_collect_globals_test): Test collecting with '{type} addr', where the addr expression is not an rvalue.
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 2908431..d1736e1 100644
--- a/gdb/ax-gdb.c
+++ b/gdb/ax-gdb.c
@@ -2044,14 +2044,13 @@ gen_expr (struct expression *exp, union exp_element **pc,
(*pc) += 3;
gen_expr (exp, pc, ax, value);
- /* I'm not sure I understand UNOP_MEMVAL entirely. I think
- it's just a hack for dealing with minsyms; you take some
- integer constant, pretend it's the address of an lvalue of
- the given type, and dereference it. */
- if (value->kind != axs_rvalue)
- /* This would be weird. */
- internal_error (__FILE__, __LINE__,
- _("gen_expr: OP_MEMVAL operand isn't an rvalue???"));
+
+ /* If we have an axs_rvalue or an axs_lvalue_memory, then we
+ already have the right value on the stack. For
+ axs_lvalue_register, we must convert. */
+ if (value->kind == axs_lvalue_register)
+ require_rvalue (ax, value);
+
value->type = type;
value->kind = axs_lvalue_memory;
}