From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id SMHmLigLSGr2HyQAWB0awg (envelope-from ) for ; Fri, 03 Jul 2026 15:19:04 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=yahoo.de header.i=@yahoo.de header.a=rsa-sha256 header.s=s2048 header.b=B2UZmzOd; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id ABB921E098; Fri, 03 Jul 2026 15:19:04 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [IPv6:2620:52:6:3111::32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 0D2631E024 for ; Fri, 03 Jul 2026 15:19:03 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 667F54BA2E3F for ; Fri, 3 Jul 2026 19:19:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 667F54BA2E3F Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=yahoo.de header.i=@yahoo.de header.a=rsa-sha256 header.s=s2048 header.b=B2UZmzOd Received: from sonic302-21.consmr.mail.ir2.yahoo.com (sonic302-21.consmr.mail.ir2.yahoo.com [87.248.110.84]) by sourceware.org (Postfix) with ESMTPS id 1F0CE4BA5439 for ; Fri, 3 Jul 2026 19:18:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1F0CE4BA5439 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=yahoo.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=yahoo.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 1F0CE4BA5439 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=87.248.110.84 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1783106314; cv=none; b=ltFS68HjZfOIReuf6BCwVkdXYosSUTZQDK1eddFOGcWmA5P4n1XHwOOn+Yacm5MhNGYYxuCXUhj+LXHNCGCx8eBMbvoSMaJoku67tSa+Ix1yiR6uqf1sIIaL0X3PsT2MDvEuKdgZnaYswFKrFcuSp7Ibc4lR/xheNHGdgbwsirE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1783106314; c=relaxed/simple; bh=e43XagHF1O2PoFtOLQ6BGF0T7LOqCg1dBTEOZnf8SW0=; h=DKIM-Signature:Date:From:To:Message-ID:Subject:MIME-Version; b=EaXACmOiU9ET8vuz/99iBr2CVxtFlQHADTaPQxsmXbz/NO6XdYvHN2Z//xvK7j3WssIAn7Y/qiFnzGpagkngj3oUBHjcuJEv4sNTUsFUuVeuQYeH4TzmIzbEPrJHYzLImYiCw9NZwbc6H2m3PUr/8hX5tmRpU/yIwZqwLdd7Mxs= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=yahoo.de header.i=@yahoo.de header.a=rsa-sha256 header.s=s2048 header.b=B2UZmzOd DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1F0CE4BA5439 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.de; s=s2048; t=1783106312; bh=e43XagHF1O2PoFtOLQ6BGF0T7LOqCg1dBTEOZnf8SW0=; h=Date:From:To:Cc:In-Reply-To:References:Subject:From:Subject:Reply-To; b=B2UZmzOdmNFmz0bePsOTJqjPnSA+dn78NcswMZpbfY4nDgQ0gV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mr.mail.ir2.yahoo.com with HTTP; Fri, 3 Jul 2026 19:18:32 +0000 Date: Fri, 3 Jul 2026 19:18:31 +0000 (UTC) From: Hannes Domani To: Thiago Jung Bauermann Cc: "gdb-patches@sourceware.org" Message-ID: <2003489748.2238776.1783106311866@mail.yahoo.com> In-Reply-To: <87a4s8oj60.fsf@linaro.org> References: <20260109194839.1598134-1-ssbssa.ref@yahoo.de> <20260109194839.1598134-1-ssbssa@yahoo.de> <87a4s8oj60.fsf@linaro.org> Subject: Re: [PATCH] Prevent downgrading of hardware watchpoints if possible MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Mailer: WebService/1.1.26086 YMailNorrin X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org Am Freitag, 3. Juli 2026 um 05:18:19 MESZ hat Thiago Jung Bauermann Folgendes geschrieben: > Hannes Domani writes: >=C2=A0 > > The lazy flag of a value can tell us if the value contents are availabl= e. > > But this could be either because it was simply never actually accessed, > > or it tried to be accessed, and failed. > > The latter are interesting for watchpoints, the former are not. > > > > Currently it only uses lazy values if they are at the head of the value > > chain, but this is fragile logic, and degrades some watchpoints to > > software watchpoints where it's actually not necessary. > > > > So this adds a new value flag 'm_fetch_lazy_failed' which tells if the > > watchpoint expression actually tried to access the value and failed. > > And this is used instead of the value chain location to tell if a lazy > > value should be used as a watchpoint location. > > > > Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=3D27423 > > --- > >=C2=A0 gdb/breakpoint.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 | 11 ++-- > >=C2=A0 .../gdb.base/watchpoint-hw-no-degradation.c=C2=A0 | 51 ++++++++++= +++++++++ > >=C2=A0 .../gdb.base/watchpoint-hw-no-degradation.exp | 38 ++++++++++++++ > >=C2=A0 gdb/value.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2=A0 = 3 ++ > >=C2=A0 gdb/value.h=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 | 12 +++= +- > >=C2=A0 5 files changed, 108 insertions(+), 7 deletions(-) > >=C2=A0 create mode 100644 gdb/testsuite/gdb.base/watchpoint-hw-no-degrad= ation.c > >=C2=A0 create mode 100644 gdb/testsuite/gdb.base/watchpoint-hw-no-degrad= ation.exp >=C2=A0 > I like the solution, thanks! >=C2=A0 > Reviewed-by: Thiago Jung Bauermann >=C2=A0 > Just one nit in the testcase: >=C2=A0 > > diff --git a/gdb/testsuite/gdb.base/watchpoint-hw-no-degradation.exp b/= gdb/testsuite/gdb.base/watchpoint-hw-no-degradation.exp > > new file mode 100644 > > index 00000000000..94ef335c77f > > --- /dev/null > > +++ b/gdb/testsuite/gdb.base/watchpoint-hw-no-degradation.exp > > @@ -0,0 +1,38 @@ > > +# Copyright 2009-2026 Free Software Foundation, Inc. > > + > > +# This program is free software; you can redistribute it and/or modify > > +# it under the terms of the GNU General Public License as published by > > +# the Free Software Foundation; either version 3 of the License, or > > +# (at your option) any later version. > > +# > > +# This program is distributed in the hope that it will be useful, > > +# but WITHOUT ANY WARRANTY; without even the implied warranty of > > +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.=C2=A0 See the > > +# GNU General Public License for more details. > > +# > > +# You should have received a copy of the GNU General Public License > > +# along with this program.=C2=A0 If not, see . > > + > > +# Test if watchpoint doesn't degrade to a software watchpoint if part = of > > +# expression isn't accessible at time of watchpoint creation. > > + > > +require allow_hw_watchpoint_access_tests > > + > > +standard_testfile > > + > > +if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]= } { > > +=C2=A0 =C2=A0 return -1 > > +} > > + > > +if {![runto_main]} { > > +=C2=A0 =C2=A0 return -1 > > +} >=C2=A0 > There's no need to return a value from the top-level. Please change the > returns above to just "return". I've made these changes. Hannes