* expression.h (enum exp_opcode): Document a register name for

OP_REGISTER.
	* parse.c (write_dollar_variable): Write the register name for
	OP_REGISTER.
	(operator_length_standard): Expect the register name following
	OP_REGISTER.
	* ada-lang.c (resolve_subexp): Likewise.
	* ax-gdb.c (gen_expr): Likewise.
	* eval.c (evaluate_subexp_standard): Likewise.
	* expprint.c (print_subexp_standard, dump_subexp_body_standard):
	Likewise.
	* tracepoint.c (encode_actions): Likewise.
This commit is contained in:
Daniel Jacobowitz
2007-06-13 17:11:09 +00:00
parent 0caa462c16
commit 67f3407ffb
8 changed files with 60 additions and 24 deletions

View File

@@ -500,16 +500,21 @@ evaluate_subexp_standard (struct type *expect_type,
case OP_REGISTER:
{
int regno = longest_to_int (exp->elts[pc + 1].longconst);
const char *name = &exp->elts[pc + 2].string;
int regno;
struct value *val;
(*pos) += 2;
(*pos) += 3 + BYTES_TO_EXP_ELEM (exp->elts[pc + 1].longconst + 1);
regno = frame_map_name_to_regnum (deprecated_safe_get_selected_frame (),
name, strlen (name));
if (regno == -1)
error (_("Register $%s not available."), name);
if (noside == EVAL_AVOID_SIDE_EFFECTS)
val = value_zero (register_type (current_gdbarch, regno), not_lval);
else
val = value_of_register (regno, get_selected_frame (NULL));
if (val == NULL)
error (_("Value of register %s not available."),
frame_map_regnum_to_name (get_selected_frame (NULL), regno));
error (_("Value of register %s not available."), name);
else
return val;
}