This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[commit] optimization to dummy_frame_sniffer


2005-04-01  Michael Snyder  <msnyder@redhat.com>

	* dummy-frame.c (dummy_frame_sniffer): Optimization: don't bother
	computing this_id if there are no dummy frames on the stack.
	
Index: dummy-frame.c
===================================================================
RCS file: /cvs/src/src/gdb/dummy-frame.c,v
retrieving revision 1.42
diff -p -r1.42 dummy-frame.c
*** dummy-frame.c	14 Feb 2005 18:10:07 -0000	1.42
--- dummy-frame.c	2 Apr 2005 00:44:15 -0000
*************** dummy_frame_sniffer (const struct frame_
*** 137,161 ****
       entry point, or some random address on the stack.  Trying to use
       that PC to apply standard frame ID unwind techniques is just
       asking for trouble.  */
!   /* Use an architecture specific method to extract the prev's dummy
!      ID from the next frame.  Note that this method uses
!      frame_register_unwind to obtain the register values needed to
!      determine the dummy frame's ID.  */
!   this_id = gdbarch_unwind_dummy_id (get_frame_arch (next_frame), next_frame);
! 
!   /* Use that ID to find the corresponding cache entry.  */
!   for (dummyframe = dummy_frame_stack;
!        dummyframe != NULL;
!        dummyframe = dummyframe->next)
      {
!       if (frame_id_eq (dummyframe->id, this_id))
  	{
! 	  struct dummy_frame_cache *cache;
! 	  cache = FRAME_OBSTACK_ZALLOC (struct dummy_frame_cache);
! 	  cache->prev_regcache = dummyframe->regcache;
! 	  cache->this_id = this_id;
! 	  (*this_prologue_cache) = cache;
! 	  return 1;
  	}
      }
    return 0;
--- 137,167 ----
       entry point, or some random address on the stack.  Trying to use
       that PC to apply standard frame ID unwind techniques is just
       asking for trouble.  */
!   
!   /* Don't bother unles there is at least one dummy frame.  */
!   if (dummy_frame_stack != NULL)
      {
!       /* Use an architecture specific method to extract the prev's
! 	 dummy ID from the next frame.  Note that this method uses
! 	 frame_register_unwind to obtain the register values needed to
! 	 determine the dummy frame's ID.  */
!       this_id = gdbarch_unwind_dummy_id (get_frame_arch (next_frame), 
! 					 next_frame);
! 
!       /* Use that ID to find the corresponding cache entry.  */
!       for (dummyframe = dummy_frame_stack;
! 	   dummyframe != NULL;
! 	   dummyframe = dummyframe->next)
  	{
! 	  if (frame_id_eq (dummyframe->id, this_id))
! 	    {
! 	      struct dummy_frame_cache *cache;
! 	      cache = FRAME_OBSTACK_ZALLOC (struct dummy_frame_cache);
! 	      cache->prev_regcache = dummyframe->regcache;
! 	      cache->this_id = this_id;
! 	      (*this_prologue_cache) = cache;
! 	      return 1;
! 	    }
  	}
      }
    return 0;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]