[PATCH]: Change i386-stub.c to use 'T' response packet.

J.T. Conklin jtc@redback.com
Thu Mar 1 14:43:00 GMT 2001


I'll be committing the following patch.  It changes i386-stub.c to use
the 'T' instead of the 'S' response packet to notify GDB the target is
stopped.  This greatly improves step performance, since in most cases
GDB no longer has to fetch all registers.

2001-03-01  J.T. Conklin  <jtc@redback.com>

	* i386-stub.c (handle_exception): Use 'T' response packet.

Index: i386-stub.c
===================================================================
RCS file: /cvs/src/src/gdb/i386-stub.c,v
retrieving revision 1.3
diff -c -r1.3 i386-stub.c
*** i386-stub.c	2001/01/23 19:45:08	1.3
--- i386-stub.c	2001/03/01 22:35:47
***************
*** 758,767 ****
  
    /* reply to host that an exception has occurred */
    sigval = computeSignal (exceptionVector);
!   remcomOutBuffer[0] = 'S';
!   remcomOutBuffer[1] = hexchars[sigval >> 4];
!   remcomOutBuffer[2] = hexchars[sigval % 16];
!   remcomOutBuffer[3] = 0;
  
    putpacket (remcomOutBuffer);
  
--- 758,786 ----
  
    /* reply to host that an exception has occurred */
    sigval = computeSignal (exceptionVector);
! 
!   ptr = remcomOutBuffer;
! 
!   *ptr++ = 'T';			/* notify gdb with signo, PC, FP and SP */
!   *ptr++ = hexchars[sigval >> 4];
!   *ptr++ = hexchars[sigval & 0xf];
! 
!   *ptr++ = hexchars[ESP]; 
!   *ptr++ = ':';
!   ptr = mem2hex((char *)&registers[ESP], ptr, 4, 0);	/* SP */
!   *ptr++ = ';';
! 
!   *ptr++ = hexchars[EBP]; 
!   *ptr++ = ':';
!   ptr = mem2hex((char *)&registers[EBP], ptr, 4, 0); 	/* FP */
!   *ptr++ = ';';
! 
!   *ptr++ = hexchars[PC]; 
!   *ptr++ = ':';
!   ptr = mem2hex((char *)&registers[PC], ptr, 4, 0); 	/* PC */
!   *ptr++ = ';';
! 
!   *ptr = '\0'
  
    putpacket (remcomOutBuffer);
  

-- 
J.T. Conklin
RedBack Networks



More information about the Gdb-patches mailing list