Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Grace Sainsbury <graces@redhat.com>
To: gdb-patches@sources.redhat.com
Subject: [rfa] insert_hw_breakpoint
Date: Mon, 12 Aug 2002 13:04:00 -0000	[thread overview]
Message-ID: <20020812160423.A23001@tomago.toronto.redhat.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 257 bytes --]

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.

[-- Attachment #2: patch --]
[-- Type: text/plain, Size: 1190 bytes --]

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,

             reply	other threads:[~2002-08-12 20:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-08-12 13:04 Grace Sainsbury [this message]
2002-08-12 13:27 ` Kevin Buettner
2002-08-13  8:59   ` Andrew Cagney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020812160423.A23001@tomago.toronto.redhat.com \
    --to=graces@redhat.com \
    --cc=gdb-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox