aboutsummaryrefslogtreecommitdiff
path: root/gdb/m32c-tdep.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/m32c-tdep.c')
-rw-r--r--gdb/m32c-tdep.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/gdb/m32c-tdep.c b/gdb/m32c-tdep.c
index d66e0d9..2ff2685 100644
--- a/gdb/m32c-tdep.c
+++ b/gdb/m32c-tdep.c
@@ -2535,6 +2535,7 @@ m32c_virtual_frame_pointer (CORE_ADDR pc,
CORE_ADDR func_addr, func_end, sal_end;
struct m32c_prologue p;
+ struct regcache *regcache = get_current_regcache ();
struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
if (!find_pc_partial_function (pc, &name, &func_addr, &func_end))
@@ -2544,15 +2545,15 @@ m32c_virtual_frame_pointer (CORE_ADDR pc,
switch (p.kind)
{
case prologue_with_frame_ptr:
- *frame_regnum = m32c_banked_register (tdep->fb, current_regcache)->num;
+ *frame_regnum = m32c_banked_register (tdep->fb, regcache)->num;
*frame_offset = p.frame_ptr_offset;
break;
case prologue_sans_frame_ptr:
- *frame_regnum = m32c_banked_register (tdep->sp, current_regcache)->num;
+ *frame_regnum = m32c_banked_register (tdep->sp, regcache)->num;
*frame_offset = p.frame_size;
break;
default:
- *frame_regnum = m32c_banked_register (tdep->sp, current_regcache)->num;
+ *frame_regnum = m32c_banked_register (tdep->sp, regcache)->num;
*frame_offset = 0;
break;
}