Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Pierre Muller" <muller@ics.u-strasbg.fr>
To: "'Eli Zaretskii'" <eliz@gnu.org>
Cc: <gdb-patches@sourceware.org>
Subject: [RFA-v2] Fix a windows bug if two watchpoints are used
Date: Thu, 04 Jun 2009 06:34:00 -0000	[thread overview]
Message-ID: <000001c9e4de$6e550cb0$4aff2610$@u-strasbg.fr> (raw)
In-Reply-To: <E1MC3RX-0003Di-Hj@fencepost.gnu.org>

  Considering the objections to my first patch, I
here submit another patch that
make i386_stopped_data_address
return as soon as one hit is found.

  The change in I386_DR_DISABLE is still 
useful for the second test inside the i386_stopped_data_address
function.

  This patch does fix my windows specific problem.

  Is this OK?

Pierre



2009-06-04  Pierre Muller  <muller@ics.u-strasbg.fr>

	* i386-nat.c (I386_DR_DISABLE): Also reset the
	RW_LEN part of the control register.
	(i386_stopped_data_address): Return at the first hit.

Index: i386-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/i386-nat.c,v
retrieving revision 1.22
diff -u -p -r1.22 i386-nat.c
--- i386-nat.c	14 May 2009 09:37:00 -0000	1.22
+++ i386-nat.c	4 Jun 2009 06:25:20 -0000
@@ -124,8 +124,9 @@ struct i386_dr_low_type i386_dr_low;
 
 /* Disable the break/watchpoint in the I'th debug register.  */
 #define I386_DR_DISABLE(i) \
-  dr_control_mirror &= ~(3 << (DR_ENABLE_SIZE * (i)))
-
+  dr_control_mirror &= ~(3 << (DR_ENABLE_SIZE * (i)) | \
+		         0xf << (DR_CONTROL_SHIFT+DR_CONTROL_SIZE*(i)))
+ 
 /* Set in DR7 the RW and LEN fields for the I'th debug register.  */
 #define I386_DR_SET_RW_LEN(i,rwlen) \
   do { \
@@ -542,7 +543,6 @@ i386_stopped_data_address (struct target
 {
   CORE_ADDR addr = 0;
   int i;
-  int rc = 0;
 
   dr_status_mirror = i386_dr_low.get_status ();
 
@@ -557,17 +557,16 @@ i386_stopped_data_address (struct target
 	  && I386_DR_GET_RW_LEN (i) != 0)
 	{
 	  addr = dr_mirror[i];
-	  rc = 1;
+	  *addr_p = addr;
 	  if (maint_show_dr)
 	    i386_show_dr ("watchpoint_hit", addr, -1, hw_write);
+	  return 1;
 	}
     }
-  if (maint_show_dr && addr == 0)
+  if (maint_show_dr)
     i386_show_dr ("stopped_data_addr", 0, 0, hw_write);
 
-  if (rc)
-    *addr_p = addr;
-  return rc;
+  return 0;
 }
 
 static int


  parent reply	other threads:[~2009-06-04  6:34 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-03 22:58 [RFA] " Pierre Muller
2009-06-03 23:21 ` Eli Zaretskii
2009-06-03 23:33   ` Pierre Muller
2009-06-04  3:16     ` Eli Zaretskii
2009-06-04  3:29       ` Christopher Faylor
2009-06-04  6:34       ` Pierre Muller [this message]
2009-06-04  7:12         ` [RFA-v2] " Eli Zaretskii
2009-06-04  7:33           ` Pierre Muller
2009-06-04 10:31             ` Eli Zaretskii
2009-06-04 14:52               ` Pierre Muller
2009-06-04 15:22                 ` Eli Zaretskii
2009-06-16 22:43                   ` [PING][RFA-v2] " Pierre Muller
2009-06-22 20:56                     ` Joel Brobecker
2009-06-23  1:04                       ` Eli Zaretskii
2009-09-22 12:55                         ` [RFA-v3] " Pierre Muller
2009-09-24  3:04                           ` Eli Zaretskii
2009-09-24 17:54                           ` Joel Brobecker
2009-09-24 22:08                             ` Pierre Muller
2009-09-25  1:53                               ` Joel Brobecker
2009-09-25 15:32                                 ` Pierre Muller
2009-09-25 16:07                                   ` Joel Brobecker

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='000001c9e4de$6e550cb0$4aff2610$@u-strasbg.fr' \
    --to=muller@ics.u-strasbg.fr \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    /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