From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19901 invoked by alias); 4 Jun 2009 06:34:06 -0000 Received: (qmail 19890 invoked by uid 22791); 4 Jun 2009 06:34:05 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_12 X-Spam-Check-By: sourceware.org Received: from mailhost.u-strasbg.fr (HELO mailhost.u-strasbg.fr) (130.79.200.152) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 04 Jun 2009 06:33:59 +0000 Received: from baal.u-strasbg.fr (baal.u-strasbg.fr [IPv6:2001:660:2402::41]) by mailhost.u-strasbg.fr (8.14.2/jtpda-5.5pre1) with ESMTP id n546Xr6g047547 ; Thu, 4 Jun 2009 08:33:53 +0200 (CEST) Received: from mailserver.u-strasbg.fr (ms1.u-strasbg.fr [IPv6:2001:660:2402:d::10]) by baal.u-strasbg.fr (8.14.0/jtpda-5.5pre1) with ESMTP id n546Xqwi069637 ; Thu, 4 Jun 2009 08:33:52 +0200 (CEST) (envelope-from muller@ics.u-strasbg.fr) Received: from d620muller (lec67-4-82-230-53-140.fbx.proxad.net [82.230.53.140]) (user=mullerp mech=LOGIN) by mailserver.u-strasbg.fr (8.14.3/jtpda-5.5pre1) with ESMTP id n546Xp3f039783 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) ; Thu, 4 Jun 2009 08:33:52 +0200 (CEST) (envelope-from muller@ics.u-strasbg.fr) From: "Pierre Muller" To: "'Eli Zaretskii'" Cc: References: <000301c9e49e$c479eba0$4d6dc2e0$@u-strasbg.fr> <000601c9e4a3$b2f2f980$18d8ec80$@u-strasbg.fr> In-Reply-To: Subject: [RFA-v2] Fix a windows bug if two watchpoints are used Date: Thu, 04 Jun 2009 06:34:00 -0000 Message-ID: <000001c9e4de$6e550cb0$4aff2610$@u-strasbg.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-06/txt/msg00060.txt.bz2 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 * 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