From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1082 invoked by alias); 3 Jun 2009 23:21:30 -0000 Received: (qmail 1074 invoked by uid 22791); 3 Jun 2009 23:21:29 -0000 X-SWARE-Spam-Status: No, hits=-1.3 required=5.0 tests=AWL,BAYES_50,SPF_PASS X-Spam-Check-By: sourceware.org Received: from fencepost.gnu.org (HELO fencepost.gnu.org) (140.186.70.10) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 03 Jun 2009 23:21:24 +0000 Received: from eliz by fencepost.gnu.org with local (Exim 4.67) (envelope-from ) id 1MBzlp-0003sy-TM; Wed, 03 Jun 2009 19:21:21 -0400 From: Eli Zaretskii To: "Pierre Muller" CC: gdb-patches@sourceware.org In-reply-to: <000301c9e49e$c479eba0$4d6dc2e0$@u-strasbg.fr> (muller@ics.u-strasbg.fr) Subject: Re: [RFA] Fix a windows bug if two watchpoints are used Reply-to: Eli Zaretskii References: <000301c9e49e$c479eba0$4d6dc2e0$@u-strasbg.fr> Message-Id: Date: Wed, 03 Jun 2009 23:21:00 -0000 X-IsSubscribed: yes 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/msg00055.txt.bz2 > From: "Pierre Muller" > Date: Thu, 4 Jun 2009 00:58:09 +0200 > > Now comes the tricky part, why does that generate a > SIGTRAP? > In i386_stopped_data_address, > the bits of dr_status_mirror (copied from current value of dr[6]) > are checked from 0 to 3, but if hit is found for I, > the address value is taken from dr_mirror array. > > Thus, according to dr[6], both debug registers 0 and 1 > have been hit. > at i=0, the correct address of ival3 is found in dr_mirror[0], > but after for i=1, the value of dr_mirror[1] is used, but this > value is 0, as only one watch is active. Shouldn't we instead fix the logic of i386_stopped_data_address, to get out of the loop on the first watchpoint that is found to be hit? The function does not support more than one watchpoint anyway, so why continue checking the bits in dr[6] after we've found one set already? Would such a change fix your problem without the other complications? Btw, I don't understand this part of i386_stopped_data_address: if (maint_show_dr && addr == 0) i386_show_dr ("stopped_data_addr", 0, 0, hw_write); Isn't that backwards? why display the address if it is zero?