+2002-08-16 Grace Sainsbury <graces@redhat.com>
+
+ * remote.c (remote_insert_hw_breakpoint)
+ (remote_remove_hw_breakpoint): Fix calculation of length field
+ for Z-packet.
+
2002-08-15 Michael Snyder <msnyder@redhat.com>
* irix5-nat.c (supply_gregset): Allocate plenty-big buffer
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. */
+
+ BREAKPOINT_FROM_PC (&addr, &len);
- len = strlen (shadow);
- len = len ? len : 1;
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,
struct remote_state *rs = get_remote_state ();
char *buf = alloca (rs->remote_packet_size);
char *p = buf;
-
- len = sizeof (shadow);
+
+ /* The length field should be set to the size of a breakpoint
+ instruction. */
+
+ 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,