2003-01-19 Andrew Cagney <ac131313@redhat.com>

* frame-unwind.h (frame_unwind_pop_ftype): Declare.
	(struct frame_unwind): Add field pop.
	* frame.h (frame_pop): Declare.
	* frame.c (frame_saved_regs_pop): New function.
	(trad_frame_unwinder): Add frame_saved_regs_pop.
	(frame_pop): New function.
	* dummy-frame.c (dummy_frame_pop): New function.
	(discard_innermost_dummy): New function.
	(generic_pop_dummy_frame): Use discard_innermost_dummy.
	(dummy_frame_unwind): Add dummy_frame_pop.
	* infrun.c (normal_stop): Call frame_pop instead of POP_FRAME.
	* valops.c (hand_function_call): Ditto.
	* stack.c (return_command): Ditto.
This commit is contained in:
Andrew Cagney 2003-01-19 17:39:16 +00:00
parent b4fc4eff63
commit dbe9fe588f
8 changed files with 118 additions and 14 deletions

View file

@ -1625,6 +1625,10 @@ return_command (char *retval_exp, int from_tty)
error ("Not confirmed.");
}
/* FIXME: cagney/2003-01-18: Rather than pop each frame in turn,
this code should just go straight to the relevant frame and pop
that. */
/* Do the real work. Pop until the specified frame is current. We
use this method because the deprecated_selected_frame is not valid after
a POP_FRAME. The pc comparison makes this work even if the
@ -1632,11 +1636,11 @@ return_command (char *retval_exp, int from_tty)
while (selected_frame_addr != get_frame_base (frame = get_current_frame ())
|| selected_frame_pc != get_frame_pc (frame))
POP_FRAME;
frame_pop (get_current_frame ());
/* Then pop that frame. */
POP_FRAME;
frame_pop (get_current_frame ());
/* Compute the return value (if any) and store in the place
for return values. */
@ -1646,9 +1650,14 @@ return_command (char *retval_exp, int from_tty)
/* If we are at the end of a call dummy now, pop the dummy frame too. */
/* FIXME: cagney/2003-01-18: This is silly. Instead of popping all
the frames except the dummy, and then, as an afterthought,
popping the dummy frame, this code should just pop through to the
dummy frame. */
if (CALL_DUMMY_HAS_COMPLETED (read_pc(), read_sp (),
get_frame_base (get_current_frame ())))
POP_FRAME;
frame_pop (get_current_frame ());
/* If interactive, print the frame that is now current. */