aboutsummaryrefslogtreecommitdiff
path: root/gdb/stack.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2003-01-19 17:39:16 +0000
committerAndrew Cagney <cagney@redhat.com>2003-01-19 17:39:16 +0000
commitdbe9fe588fc696a5d74b3a5c3208f2568b9fb7aa (patch)
tree2d995d5a3e6b2d1b7fc8ccda1b5cf3b523c8c83e /gdb/stack.c
parentb4fc4eff63f50b61e744a5ad0bdac77e40441739 (diff)
downloadfsf-binutils-gdb-dbe9fe588fc696a5d74b3a5c3208f2568b9fb7aa.zip
fsf-binutils-gdb-dbe9fe588fc696a5d74b3a5c3208f2568b9fb7aa.tar.gz
fsf-binutils-gdb-dbe9fe588fc696a5d74b3a5c3208f2568b9fb7aa.tar.bz2
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.
Diffstat (limited to 'gdb/stack.c')
-rw-r--r--gdb/stack.c15
1 files changed, 12 insertions, 3 deletions
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. */