From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22659 invoked by alias); 15 Apr 2004 13:24:42 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 22618 invoked from network); 15 Apr 2004 13:24:40 -0000 Received: from unknown (HELO miranda.se.axis.com) (193.13.178.2) by sources.redhat.com with SMTP; 15 Apr 2004 13:24:40 -0000 Received: from axis.com (ironmaiden.se.axis.com [10.13.8.120]) by miranda.se.axis.com (8.12.9/8.12.9/Debian-5local0.1) with ESMTP id i3FDO0Um027672; Thu, 15 Apr 2004 15:24:00 +0200 Message-ID: <407E8CEF.2050007@axis.com> Date: Thu, 15 Apr 2004 13:24:00 -0000 From: Orjan Friberg Organization: Axis Communications User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040113 MIME-Version: 1.0 To: Eli Zaretskii CC: Daniel Jacobowitz , gdb-patches@sources.redhat.com Subject: Re: Display of read/access watchpoints when HAVE_NONSTEPPABLE_WATCHPOINT References: <407282F4.2080602@axis.com> <20040406142228.GA29473@nevyn.them.org> <6654-Thu15Apr2004111217+0300-eliz@gnu.org> In-Reply-To: <6654-Thu15Apr2004111217+0300-eliz@gnu.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2004-04/txt/msg00305.txt.bz2 Eli Zaretskii wrote: > > However, it seems to me that the right thing to do is to fix the cited > code in bpstat_stop_status (and perhaps elsewhere in breakpoint.c) to > DTRT for the test program posted by Orjan, since it clearly should > work with i386 as well, and since this specific failure of GDB has > nothing to do with read-only vs read-write watchpoints. The test program (repeated below) *does* work for i386 (though I didn't say that), because it also stops when foo is written (thus updating the value of foo when watchpoint_check is called), so by the time it stops when the second read happens the value hasn't changed since the last time and GDB decides it's a valid hit. volatile int foo = 0; int a; a = foo; foo = 1; a = foo; Question is how to fix this (comments are most welcome): 1. Add a check if the target cannot set "pure" read watchpoints to the b->type == bp_read_watchpoint check at WP_VALUE_CHANGED (my interpretation of Eli's suggestion). or 2. Somehow don't update the value in watchpoint_check when it's a false hit. (Then the b->type == bp_read_watchpoint check at WP_VALUE_CHANGED isn't needed.) or 3. Add some distinction between "wanted watchpoint type" and "actual watchpoint type". -- Orjan Friberg Axis Communications