aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2loc.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/dwarf2loc.c')
-rw-r--r--gdb/dwarf2loc.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c
index addae13..fa17ea6 100644
--- a/gdb/dwarf2loc.c
+++ b/gdb/dwarf2loc.c
@@ -317,13 +317,9 @@ dwarf_expr_read_addr_from_reg (void *baton, int dwarf_regnum)
{
struct dwarf_expr_baton *debaton = (struct dwarf_expr_baton *) baton;
struct gdbarch *gdbarch = get_frame_arch (debaton->frame);
- CORE_ADDR result;
- int regnum;
+ int regnum = gdbarch_dwarf2_reg_to_regnum (gdbarch, dwarf_regnum);
- regnum = gdbarch_dwarf2_reg_to_regnum (gdbarch, dwarf_regnum);
- result = address_from_register (builtin_type (gdbarch)->builtin_data_ptr,
- regnum, debaton->frame);
- return result;
+ return address_from_register (regnum, debaton->frame);
}
/* Implement struct dwarf_expr_context_funcs' "get_reg_value" callback. */