From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28084 invoked by alias); 13 Oct 2009 16:02:56 -0000 Received: (qmail 28021 invoked by uid 22791); 13 Oct 2009 16:02:54 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 13 Oct 2009 16:02:50 +0000 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n9DG20KQ012302; Tue, 13 Oct 2009 12:02:00 -0400 Received: from host0.dyn.jankratochvil.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n9DG1uAO007800 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 13 Oct 2009 12:01:59 -0400 Received: from host0.dyn.jankratochvil.net (localhost [127.0.0.1]) by host0.dyn.jankratochvil.net (8.14.3/8.14.3) with ESMTP id n9DG1u2H031858; Tue, 13 Oct 2009 18:01:56 +0200 Received: (from jkratoch@localhost) by host0.dyn.jankratochvil.net (8.14.3/8.14.3/Submit) id n9DG1tZB031853; Tue, 13 Oct 2009 18:01:55 +0200 Date: Tue, 13 Oct 2009 16:02:00 -0000 From: Jan Kratochvil To: Joel Brobecker Cc: gdb-patches@sourceware.org Subject: Re: [patch 2/4] Fix hw watchpoints: reordered / simultaneously hit [fixup #1] Message-ID: <20091013160154.GA29316@host0.dyn.jankratochvil.net> References: <20090817194612.GC10694@host0.dyn.jankratochvil.net> <20091002221254.GA7767@host0.dyn.jankratochvil.net> <20091002230124.GG10338@adacore.com> <20091003172302.GD26203@host0.dyn.jankratochvil.net> <20091007183858.GR5689@adacore.com> <20091012155916.GA20031@host0.dyn.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091012155916.GA20031@host0.dyn.jankratochvil.net> User-Agent: Mutt/1.5.20 (2009-08-17) 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-10/txt/msg00274.txt.bz2 On Mon, 12 Oct 2009 17:59:16 +0200, Jan Kratochvil wrote: > This patch also changes the former sentence in the doc which I was not aware > of before as internally x86 was violating this rule: > Then @value{GDBN} calls @code{target_stopped_data_address} exactly > once. > But maybe if this rule is still valid linux_nat_stopped_data_address can be > dropped and I should rework the patchset including this patch instead. While thinking about it: * GDB already was violating this rule calling it twice "if (debug_infrun)" (infrun.c line 2836) block of handle_inferior_event. * GDB already was violating this rule calling it zero times both by "if (stepped_after_stopped_by_watchpoint)" (infrun.c line 3100) and in other cases of "return;" above this line. * From a design point of view I do not find it right that the only function to query a value (target_stopped_data_address) also does + must reset it. * The comment at update_watchpoint() describes that for modifying watchpoints GDB needs the LWP to be stopped and so remove+reinsert cannot hurt the LWP. remove+reinsert is now always done and the trigger must be reset on watchpoint remove so there is no need to reset the trigger earlier. It may start to be an issue only of someone optimizes update_watchpoint() so that it no longer does remove+reinsert, it would need to explicitely reset the trigger that time. So I stand behind the patch to remove the trigger-reset from target_stopped_data_address. In current HEAD it is missing in i386_stopped_data_address which can be visible as a bug in my patch 1/4 testcase. The reset is present in s390_stopped_by_watchpoint - but for the s390 it is wrong anyway as it is now in target_stopped_by_watchpoint while gdbint.texinfo says it should be in target_stopped_data_address which is missing on s390. Thanks, Jan