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.c27
1 files changed, 12 insertions, 15 deletions
diff --git a/gdb/m32c-tdep.c b/gdb/m32c-tdep.c
index 3a4dbda..39f9ec0 100644
--- a/gdb/m32c-tdep.c
+++ b/gdb/m32c-tdep.c
@@ -1079,11 +1079,11 @@ struct m32c_pv_state
static int
m32c_pv_push (struct m32c_pv_state *state, pv_t value, int size)
{
- if (pv_area_store_would_trash (state->stack, state->sp))
+ if (state->stack->store_would_trash (state->sp))
return 1;
state->sp = pv_add_constant (state->sp, -size);
- pv_area_store (state->stack, state->sp, size, value);
+ state->stack->store (state->sp, size, value);
return 0;
}
@@ -1114,7 +1114,7 @@ static pv_t
m32c_srcdest_fetch (struct m32c_pv_state *state, struct srcdest loc, int size)
{
if (loc.kind == srcdest_mem)
- return pv_area_fetch (state->stack, loc.addr, size);
+ return state->stack->fetch (loc.addr, size);
else if (loc.kind == srcdest_partial_reg)
return pv_unknown ();
else
@@ -1131,9 +1131,9 @@ m32c_srcdest_store (struct m32c_pv_state *state, struct srcdest loc,
{
if (loc.kind == srcdest_mem)
{
- if (pv_area_store_would_trash (state->stack, loc.addr))
+ if (state->stack->store_would_trash (loc.addr))
return 1;
- pv_area_store (state->stack, loc.addr, size, value);
+ state->stack->store (loc.addr, size, value);
}
else if (loc.kind == srcdest_partial_reg)
*loc.reg = pv_unknown ();
@@ -1350,7 +1350,7 @@ m32c_pv_enter (struct m32c_pv_state *state, int size)
/* If simulating this store would require us to forget
everything we know about the stack frame in the name of
accuracy, it would be better to just quit now. */
- if (pv_area_store_would_trash (state->stack, state->sp))
+ if (state->stack->store_would_trash (state->sp))
return 1;
if (m32c_pv_push (state, state->fb, tdep->push_addr_bytes))
@@ -1441,7 +1441,7 @@ m32c_is_arg_spill (struct m32c_pv_state *st,
return (m32c_is_arg_reg (st, value)
&& loc.kind == srcdest_mem
&& pv_is_register (loc.addr, tdep->sp->num)
- && ! pv_area_find_reg (st->stack, st->arch, value.reg, 0));
+ && ! st->stack->find_reg (st->arch, value.reg, 0));
}
/* Return non-zero if a store of VALUE to LOC is probably
@@ -1462,7 +1462,7 @@ m32c_is_struct_return (struct m32c_pv_state *st,
struct gdbarch_tdep *tdep = gdbarch_tdep (st->arch);
return (m32c_is_1st_arg_reg (st, value)
- && !pv_area_find_reg (st->stack, st->arch, value.reg, 0)
+ && !st->stack->find_reg (st->arch, value.reg, 0)
&& loc.kind == srcdest_reg
&& (pv_is_register (*loc.reg, tdep->a0->num)
|| pv_is_register (*loc.reg, tdep->a1->num)));
@@ -1493,7 +1493,7 @@ m32c_pushm_is_reg_save (struct m32c_pv_state *st, int src)
/* Function for finding saved registers in a 'struct pv_area'; we pass
- this to pv_area_scan.
+ this to pv_area::scan.
If VALUE is a saved register, ADDR says it was saved at a constant
offset from the frame base, and SIZE indicates that the whole
@@ -1546,7 +1546,6 @@ m32c_analyze_prologue (struct gdbarch *arch,
struct gdbarch_tdep *tdep = gdbarch_tdep (arch);
unsigned long mach = gdbarch_bfd_arch_info (arch)->mach;
CORE_ADDR after_last_frame_related_insn;
- struct cleanup *back_to;
struct m32c_pv_state st;
st.arch = arch;
@@ -1560,8 +1559,8 @@ m32c_analyze_prologue (struct gdbarch *arch,
st.fb = pv_register (tdep->fb->num, 0);
st.sp = pv_register (tdep->sp->num, 0);
st.pc = pv_register (tdep->pc->num, 0);
- st.stack = make_pv_area (tdep->sp->num, gdbarch_addr_bit (arch));
- back_to = make_cleanup_free_pv_area (st.stack);
+ pv_area stack (tdep->sp->num, gdbarch_addr_bit (arch));
+ st.stack = &stack;
/* Record that the call instruction has saved the return address on
the stack. */
@@ -1812,11 +1811,9 @@ m32c_analyze_prologue (struct gdbarch *arch,
prologue->kind = prologue_first_frame;
/* Record where all the registers were saved. */
- pv_area_scan (st.stack, check_for_saved, (void *) prologue);
+ st.stack->scan (check_for_saved, (void *) prologue);
prologue->prologue_end = after_last_frame_related_insn;
-
- do_cleanups (back_to);
}