]> Git Repo - binutils.git/blobdiff - gdb/dummy-frame.c
gdb/
[binutils.git] / gdb / dummy-frame.c
index 1f29859f09e6f976dd857b9ce201f597a9331cde..fab10c08e021f04f004350a0e0004fafd6043cea 100644 (file)
@@ -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
@@ -106,7 +107,7 @@ struct dummy_frame *
 cached_find_dummy_frame (struct frame_info *frame, void **cache)
 {
   if ((*cache) == NULL)
-    (*cache) = find_dummy_frame (frame->pc, frame->frame);
+    (*cache) = find_dummy_frame (get_frame_pc (frame), get_frame_base (frame));
   return (*cache);
 }
 
@@ -207,7 +208,7 @@ void
 generic_push_dummy_frame (void)
 {
   struct dummy_frame *dummy_frame;
-  CORE_ADDR fp = (get_current_frame ())->frame;
+  CORE_ADDR fp = get_frame_base (get_current_frame ());
 
   /* check to see if there are stale dummy frames, 
      perhaps left over from when a longjump took us out of a 
@@ -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;
+}
+
This page took 0.027654 seconds and 4 git commands to generate.