From dbe9fe588fc696a5d74b3a5c3208f2568b9fb7aa Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Sun, 19 Jan 2003 17:39:16 +0000 Subject: 2003-01-19 Andrew Cagney * 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. --- gdb/stack.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'gdb/stack.c') diff --git a/gdb/stack.c b/gdb/stack.c index b48dec7..405a5e4 100644 --- a/gdb/stack.c +++ b/gdb/stack.c @@ -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. */ -- cgit v1.1