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.
This commit is contained in:
Pedro Alves
2011-02-16 18:07:58 +00:00
parent 5ff2bd081f
commit a0c78a733a
5 changed files with 36 additions and 9 deletions

View File

@@ -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;
}