From 67f3407ffbf8f43d93f0c9b2d7e26e767ca5fb53 Mon Sep 17 00:00:00 2001 From: Daniel Jacobowitz Date: Wed, 13 Jun 2007 17:11:09 +0000 Subject: * 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. --- gdb/eval.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'gdb/eval.c') diff --git a/gdb/eval.c b/gdb/eval.c index 75cea6b..4222495 100644 --- a/gdb/eval.c +++ b/gdb/eval.c @@ -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; } -- cgit v1.1