dummy_frame = xmalloc (sizeof (struct dummy_frame));
dummy_frame->registers = xmalloc (REGISTER_BYTES);
- dummy_frame->pc = read_register (PC_REGNUM);
- dummy_frame->sp = read_register (SP_REGNUM);
+ dummy_frame->pc = read_pc ();
+ dummy_frame->sp = read_sp ();
dummy_frame->top = dummy_frame->sp;
dummy_frame->fp = fp;
read_register_bytes (0, dummy_frame->registers, REGISTER_BYTES);
dummy_frame_stack->top = sp;
}
-/* Function: pop_frame
- Restore the machine state from either the saved dummy stack or a
+/* Restore the machine state from either the saved dummy stack or a
real stack frame. */
void
-generic_pop_current_frame (pop)
- void (*pop) (struct frame_info * frame);
+generic_pop_current_frame (void (*popper) (struct frame_info * frame))
{
struct frame_info *frame = get_current_frame ();
+
if (PC_IN_CALL_DUMMY (frame->pc, frame->frame, frame->frame))
generic_pop_dummy_frame ();
else
- pop (frame);
+ (*popper) (frame);
}
/* Function: pop_dummy_frame