aboutsummaryrefslogtreecommitdiff
path: root/gdb/dummy-frame.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2002-12-13 16:40:25 +0000
committerAndrew Cagney <cagney@redhat.com>2002-12-13 16:40:25 +0000
commitc689142becccac9fa3b1f9833243048a50396ffe (patch)
treededb68db325ddaa0f88cde3003ff3a6413962c22 /gdb/dummy-frame.c
parent18ea5ba4f05d572ec1513a37c22544c6037b21fa (diff)
downloadgdb-c689142becccac9fa3b1f9833243048a50396ffe.zip
gdb-c689142becccac9fa3b1f9833243048a50396ffe.tar.gz
gdb-c689142becccac9fa3b1f9833243048a50396ffe.tar.bz2
2002-12-13 Andrew Cagney <ac131313@redhat.com>
* frame.h (frame_id_unwind): Declare. (struct frame_info): Add fields id_unwind, id_unwind_cache_p and id_unwind_cache. (frame_id_unwind_ftype): Declare. * frame.c (frame_id_unwind): New function. (set_unwind_by_pc): Add unwind_id parameter. Initialized. (create_new_frame, get_prev_frame): Pass id_unwind to set_unwind_by_pc. (frame_saved_regs_id_unwind): New function. (frame_saved_regs_id_unwind): New function. * dummy-frame.c (dummy_frame_id_unwind): New function. (struct dummy_frame): Add field id. (generic_push_dummy_frame): Initialize `id'. * dummy-frame.h (dummy_frame_id_unwind): Declare.
Diffstat (limited to 'gdb/dummy-frame.c')
-rw-r--r--gdb/dummy-frame.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/gdb/dummy-frame.c b/gdb/dummy-frame.c
index deed9c3..fab10c0 100644
--- a/gdb/dummy-frame.c
+++ b/gdb/dummy-frame.c
@@ -43,6 +43,7 @@ struct dummy_frame
CORE_ADDR fp;
CORE_ADDR sp;
CORE_ADDR top;
+ struct frame_id id;
struct regcache *regcache;
/* Address range of the call dummy code. Look for PC in the range
@@ -232,6 +233,7 @@ generic_push_dummy_frame (void)
dummy_frame->sp = read_sp ();
dummy_frame->top = 0;
dummy_frame->fp = fp;
+ dummy_frame->id = get_frame_id (get_current_frame ());
regcache_cpy (dummy_frame->regcache, current_regcache);
dummy_frame->next = dummy_frame_stack;
dummy_frame_stack = dummy_frame;
@@ -342,3 +344,17 @@ dummy_frame_pc_unwind (struct frame_info *frame,
return dummy->pc;
}
+
+struct frame_id
+dummy_frame_id_unwind (struct frame_info *frame,
+ void **cache)
+{
+ struct dummy_frame *dummy = cached_find_dummy_frame (frame, cache);
+ /* Oops! In a dummy-frame but can't find the stack dummy. Pretend
+ that the frame doesn't unwind. Should this function instead
+ return a has-no-caller indication? */
+ if (dummy == NULL)
+ return null_frame_id;
+ return dummy->id;
+}
+