diff options
author | Andrew Cagney <cagney@redhat.com> | 2003-01-19 17:39:16 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 2003-01-19 17:39:16 +0000 |
commit | dbe9fe588fc696a5d74b3a5c3208f2568b9fb7aa (patch) | |
tree | 2d995d5a3e6b2d1b7fc8ccda1b5cf3b523c8c83e /gdb/frame.c | |
parent | b4fc4eff63f50b61e744a5ad0bdac77e40441739 (diff) | |
download | gdb-dbe9fe588fc696a5d74b3a5c3208f2568b9fb7aa.zip gdb-dbe9fe588fc696a5d74b3a5c3208f2568b9fb7aa.tar.gz 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/frame.c')
-rw-r--r-- | gdb/frame.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/gdb/frame.c b/gdb/frame.c index f85b54a..9fb5e9b 100644 --- a/gdb/frame.c +++ b/gdb/frame.c @@ -145,6 +145,18 @@ frame_id_unwind (struct frame_info *frame) return frame->id_unwind_cache; } +void +frame_pop (struct frame_info *frame) +{ + /* FIXME: cagney/2003-01-18: There is probably a chicken-egg problem + with passing in current_regcache. The pop function needs to be + written carefully so as to not overwrite registers whose [old] + values are needed to restore other registers. Instead, this code + should pass in a scratch cache and, as a second step, restore the + registers using that. */ + frame->unwind->pop (frame, &frame->unwind_cache, current_regcache); + flush_cached_frames (); +} void frame_register_unwind (struct frame_info *frame, int regnum, @@ -715,7 +727,15 @@ frame_saved_regs_id_unwind (struct frame_info *next_frame, void **cache, id->base = base; } +static void +frame_saved_regs_pop (struct frame_info *fi, void **cache, + struct regcache *regcache) +{ + POP_FRAME; +} + const struct frame_unwind trad_frame_unwinder = { + frame_saved_regs_pop, frame_saved_regs_pc_unwind, frame_saved_regs_id_unwind, frame_saved_regs_register_unwind |