void
dummy_frame_push (struct regcache *caller_regcache,
		  const struct frame_id *dummy_id)
{
  struct gdbarch *gdbarch = get_regcache_arch (caller_regcache);
  struct dummy_frame *dummy_frame;

  /* Check to see if there are stale dummy frames, perhaps left over
     from when a longjump took us out of a function that was called by
     the debugger.  */
  dummy_frame = dummy_frame_stack;
  while (dummy_frame)
    /* FIXME: cagney/2004-08-02: Should just test IDs.  */
    if (frame_id_inner (gdbarch, dummy_frame->id, (*dummy_id)))
      /* Stale -- destroy!  */
      {
	dummy_frame_stack = dummy_frame->next;
	regcache_xfree (dummy_frame->regcache);
	xfree (dummy_frame);
	dummy_frame = dummy_frame_stack;
      }
    else
      dummy_frame = dummy_frame->next;

  dummy_frame = XZALLOC (struct dummy_frame);
  dummy_frame->regcache = caller_regcache;
  dummy_frame->id = (*dummy_id);
  dummy_frame->next = dummy_frame_stack;
  dummy_frame_stack = dummy_frame;
}
Exemple #2
0
void
dummy_frame_push (struct regcache *caller_regcache,
		  const struct frame_id *dummy_id)
{
  struct dummy_frame *dummy_frame;

  /* Check to see if there are stale dummy frames, perhaps left over
     from when a longjump took us out of a function that was called by
     the debugger.  */
  dummy_frame = dummy_frame_stack;
  while (dummy_frame)
    /* FIXME: cagney/2004-08-02: Should just test IDs.  */
    /* APPLE LOCAL: Check the ptid as well as the frame.  */
    if (ptid_equal (dummy_frame->ptid, inferior_ptid) 
	&& frame_id_inner (dummy_frame->id, (*dummy_id)))
      /* Stale -- destroy!  */
      {
	dummy_frame_stack = dummy_frame->next;
	regcache_xfree (dummy_frame->regcache);
	xfree (dummy_frame);
	dummy_frame = dummy_frame_stack;
      }
    else
      dummy_frame = dummy_frame->next;
  
  /* APPLE LOCAL begin subroutine inlining  */
  inlined_subroutine_save_before_dummy_call ();
  /* APPLE LOCAL end subroutine inlining  */

  dummy_frame = XZALLOC (struct dummy_frame);
  dummy_frame->regcache = caller_regcache;
  dummy_frame->id = (*dummy_id);
  /* APPLE LOCAL: Initialize this frames ptid.  */
  dummy_frame->ptid = inferior_ptid;
  dummy_frame->next = dummy_frame_stack;
  dummy_frame_stack = dummy_frame;
}