[rfa] insert_hw_breakpoint

Grace Sainsbury graces@redhat.com
Mon Aug 12 13:04:00 GMT 2002


I fixed a little bug in the insert/remove_hw_breakpoint functions.

ok to commit?

grace

2002-08-12  Grace Sainsbury  <graces@redhat.com>

	* remote.c (remote_insert_hw_breakpoint)
	(remote_remove_hw_breakpoint): Fix calculation of length field
	Z-packet.
-------------- next part --------------
Index: remote.c
===================================================================
RCS file: /cvs/src/src/gdb/remote.c,v
retrieving revision 1.91
diff -u -r1.91 remote.c
--- remote.c	9 Aug 2002 16:41:24 -0000	1.91
+++ remote.c	12 Aug 2002 20:00:30 -0000
@@ -4985,11 +4985,11 @@
   char *buf = alloca (rs->remote_packet_size);
   char *p = buf;
       
-  /* The length field should be set to soething so that the packet is
-     well formed.  */
+  /* The length field should be set to the size of a breakpoint
+     instruction.  */
 
-  len = strlen (shadow);
-  len = len ? len : 1;
+  BREAKPOINT_FROM_PC (&addr, &len);
+  
   if (remote_protocol_Z[Z_PACKET_HARDWARE_BP].support == PACKET_DISABLE)
     error ("Can't set hardware breakpoint without the '%s' (%s) packet\n",
 	   remote_protocol_Z[Z_PACKET_HARDWARE_BP].name,
@@ -5027,7 +5027,8 @@
   char *buf = alloca (rs->remote_packet_size);
   char *p = buf;
   
-  len = sizeof (shadow);
+  BREAKPOINT_FROM_PC (&addr, &len);
+ 
   if (remote_protocol_Z[Z_PACKET_HARDWARE_BP].support == PACKET_DISABLE)
     error ("Can't clear hardware breakpoint without the '%s' (%s) packet\n",
 	   remote_protocol_Z[Z_PACKET_HARDWARE_BP].name,


More information about the Gdb-patches mailing list