From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id mSL9FXIIempNOhsAWB0awg (envelope-from ) for ; Mon, 10 Aug 2026 13:20:50 -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=PyHTDoDQ; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 5607E1E166; Mon, 10 Aug 2026 13:20:50 -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 2EB961E09B for ; Mon, 10 Aug 2026 13:20:48 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4DEC54B99F5A for ; Mon, 10 Aug 2026 17:20:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4DEC54B99F5A 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=PyHTDoDQ Received: from sonic308-18.consmr.mail.ir2.yahoo.com (sonic308-18.consmr.mail.ir2.yahoo.com [77.238.178.146]) by sourceware.org (Postfix) with ESMTPS id 75AD84BA2E18 for ; Mon, 10 Aug 2026 17:20:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 75AD84BA2E18 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 75AD84BA2E18 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=77.238.178.146 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1786382420; cv=none; b=jk8wm5dKf+XXwHNtWH0mFKi5fzyittd7w6ImMJcsa1PwOlFBbGuFjVe1pWfYiconFwpZ5tZ86SfVnGZsiIoFsroFrN8WXUd1TPtAvNSju/KZqWm4Yji23n44QYn9C9EkT+zawlEfeZch2d2nguuzfOYXiRGfLDmruXyx6p1U/mc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1786382420; c=relaxed/simple; bh=ViRiZ9gsfYluNmT0NJq2dvWzVzsCXyPVFz5Gra73ibk=; h=DKIM-Signature:Date:From:To:Message-ID:Subject:MIME-Version; b=sE7ExZ+NCPP3mi769GE3OQ1fe4TwA+PQWgaVE1k9zt3IFI1v5XYaD5N2UCG3mWplc/7zuczVZzsW5Wpegs9BuXtXhFSWHSljorkBLj5AVE6DdKnH3gboxLM6RHMJHO84jKOMFXVyij1ZkK5QjwaNMiietPnuAPf5LE8fbNC1cX4= 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=PyHTDoDQ DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 75AD84BA2E18 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.de; s=s2048; t=1786382416; bh=ViRiZ9gsfYluNmT0NJq2dvWzVzsCXyPVFz5Gra73ibk=; h=Date:From:To:Cc:In-Reply-To:References:Subject:From:Subject:Reply-To; b=PyHTDoDQjs84vnfmEeS4F5mJ1E0q7UFnOpafBnKcz8kgP8DOAqD/LHF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.com by sonic308.consmr.mail.ir2.yahoo.com with HTTP; Mon, 10 Aug 2026 17:20:16 +0000 Date: Mon, 10 Aug 2026 17:20:14 +0000 (UTC) From: Hannes Domani To: "gdb-patches@sourceware.org" Cc: Guinevere Larsen , Thiago Jung Bauermann Message-ID: <1571871089.1548412.1786382414159@mail.yahoo.com> In-Reply-To: <20260727150150.1014621-1-ssbssa@yahoo.de> References: <20260727150150.1014621-1-ssbssa.ref@yahoo.de> <20260727150150.1014621-1-ssbssa@yahoo.de> Subject: Re: [PATCH v2] 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.26254 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 Ping. Am Montag, 27. Juli 2026 um 17:02:56 MESZ hat Hannes Domani Folgendes geschrieben: > The lazy flag of a value can tell us if the value contents are available. > 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. >=C2=A0 > 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. >=C2=A0 > 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. >=C2=A0 > Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=3D27423 > Tested-By: Guinevere Larsen > Reviewed-by: Thiago Jung Bauermann > --- > v2: >=C2=A0 =C2=A0- value.h: fixed typo in comment >=C2=A0 =C2=A0- watchpoint-hw-no-degradation.exp: fixed copyright year and = removed >=C2=A0 =C2=A0 =C2=A0values from top-level returns > --- > 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 ++-- > .../gdb.base/watchpoint-hw-no-degradation.c=C2=A0 | 51 ++++++++++++++++++= + > .../gdb.base/watchpoint-hw-no-degradation.exp | 38 ++++++++++++++ > 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 ++ > 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 ++++- > 5 files changed, 108 insertions(+), 7 deletions(-) > create mode 100644 gdb/testsuite/gdb.base/watchpoint-hw-no-degradation.c > create mode 100644 gdb/testsuite/gdb.base/watchpoint-hw-no-degradation.ex= p >=C2=A0 > diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c > index e4df4df04a7..462c16df7c5 100644 > --- a/gdb/breakpoint.c > +++ b/gdb/breakpoint.c > @@ -2305,11 +2305,10 @@ update_watchpoint (struct watchpoint *b, bool rep= arse) >=C2=A0 >=C2=A0 =C2=A0 =C2=A0 =C2=A0/* If it's a memory location, and GDB actually = needed >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0its contents to evaluate the expression,= then we > -=C2=A0 =C2=A0 =C2=A0 =C2=A0 must watch it.=C2=A0 If the first value retu= rned is > -=C2=A0 =C2=A0 =C2=A0 =C2=A0 still lazy, that means an error occurred rea= ding it; > +=C2=A0 =C2=A0 =C2=A0 =C2=A0 must watch it.=C2=A0 If an error occurred re= ading it, >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0watch it anyway in case it becomes reada= ble.=C2=A0 */ >=C2=A0 =C2=A0 =C2=A0 =C2=A0if (v->lval () =3D=3D lval_memory > -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 && (v =3D=3D val_chain[0] || ! v->laz= y ())) > +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 && (! v->lazy () || v->fetch_lazy_fai= led ())) >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0{ >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0struct type *vtype =3D check_type= def (v->type ()); >=C2=A0 > @@ -10708,12 +10707,12 @@ can_use_hardware_watchpoint (const std::vector<= value_ref_ptr> &vals) >=C2=A0 >=C2=A0 =C2=A0 =C2=A0 =C2=A0if (v->lval () =3D=3D lval_memory) >=C2=A0 =C2=A0 =C2=A0{ > -=C2=A0 =C2=A0 =C2=A0 if (v !=3D head && v->lazy ()) > +=C2=A0 =C2=A0 =C2=A0 if (v->lazy () && ! v->fetch_lazy_failed ()) >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0/* A lazy memory lvalue in the chain is = one that GDB never >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0needed to fetch; we either just u= sed its address (e.g., >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0`a' in `a.b') or we never needed = it at all (e.g., `a' > -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 in `a,b').=C2=A0 This doesn't apply t= o HEAD; if that is > -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 lazy then it was not readable, but wa= tch it anyway.=C2=A0 */ > +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 in `a,b').=C2=A0 If it failed to fetc= h a lazy value, then it > +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 was not readable, so watch it in this= case as well.=C2=A0 */ >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0; >=C2=A0 =C2=A0 =C2=A0 =C2=A0else >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0{ > diff --git a/gdb/testsuite/gdb.base/watchpoint-hw-no-degradation.c b/gdb/= testsuite/gdb.base/watchpoint-hw-no-degradation.c > new file mode 100644 > index 00000000000..cfff2a44f90 > --- /dev/null > +++ b/gdb/testsuite/gdb.base/watchpoint-hw-no-degradation.c > @@ -0,0 +1,51 @@ > +/* This testcase is part of GDB, the GNU debugger. > + > +=C2=A0 Copyright 2026 Free Software Foundation, Inc. > + > +=C2=A0 This program is free software; you can redistribute it and/or mod= ify > +=C2=A0 it under the terms of the GNU General Public License as published= by > +=C2=A0 the Free Software Foundation; either version 3 of the License, or > +=C2=A0 (at your option) any later version. > + > +=C2=A0 This program is distributed in the hope that it will be useful, > +=C2=A0 but WITHOUT ANY WARRANTY; without even the implied warranty of > +=C2=A0 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.=C2=A0 See th= e > +=C2=A0 GNU General Public License for more details. > + > +=C2=A0 You should have received a copy of the GNU General Public License > +=C2=A0 along with this program.=C2=A0 If not, see . > + > +*/ > + > +#include > +#include > +#include > + > +int > +main (void) > +{ > +=C2=A0 size_t len =3D sysconf(_SC_PAGESIZE); > + > +=C2=A0 /* Map and unmap memory block to get address.=C2=A0 */ > +=C2=A0 void *p =3D mmap (0, len, PROT_READ|PROT_WRITE, MAP_ANON|MAP_PRIV= ATE, -1, 0); > +=C2=A0 if (p =3D=3D MAP_FAILED) > +=C2=A0 =C2=A0 { > +=C2=A0 =C2=A0 =C2=A0 perror ("mmap"); > +=C2=A0 =C2=A0 =C2=A0 return 1; > +=C2=A0 =C2=A0 } > +=C2=A0 munmap (p, len); > + > +=C2=A0 /* Now memory block at address P is inaccessible. > +=C2=A0 =C2=A0 Remap block at same address, so it becomes accessible agai= n.=C2=A0 */ > +=C2=A0 p =3D mmap (p, len, PROT_READ|PROT_WRITE, > +=C2=A0 =C2=A0 =C2=A0 =C2=A0 MAP_ANON|MAP_PRIVATE|MAP_FIXED, -1, 0); > +=C2=A0 if (p =3D=3D MAP_FAILED) > +=C2=A0 =C2=A0 { > +=C2=A0 =C2=A0 =C2=A0 perror ("mmap"); > +=C2=A0 =C2=A0 =C2=A0 return 1; > +=C2=A0 =C2=A0 } > + > +=C2=A0 *(int *) p =3D 1; > + > +=C2=A0 return 0; > +} > diff --git a/gdb/testsuite/gdb.base/watchpoint-hw-no-degradation.exp b/gd= b/testsuite/gdb.base/watchpoint-hw-no-degradation.exp > new file mode 100644 > index 00000000000..9c545e22e2d > --- /dev/null > +++ b/gdb/testsuite/gdb.base/watchpoint-hw-no-degradation.exp > @@ -0,0 +1,38 @@ > +# Copyright 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 > +} > + > +if {![runto_main]} { > +=C2=A0 =C2=A0 return > +} > + > +gdb_breakpoint [gdb_get_line_number "mmap (p, len"] > +gdb_continue_to_breakpoint "mmap" > + > +gdb_test "eval \"watch *(int *)%p =3D=3D 0\",p" \ > +=C2=A0 =C2=A0 "Hardware watchpoint $decimal: .*" > + > +gdb_test "continue" \ > +=C2=A0 =C2=A0 "Old value =3D .*New value =3D 0.*" > diff --git a/gdb/value.c b/gdb/value.c > index 1f6d7949d4d..e4e3e407ddc 100644 > --- a/gdb/value.c > +++ b/gdb/value.c > @@ -1552,6 +1552,7 @@ value::copy () const >=C2=A0 =C2=A0val->m_bitpos =3D m_bitpos; >=C2=A0 =C2=A0val->m_bitsize =3D m_bitsize; >=C2=A0 =C2=A0val->m_lazy =3D m_lazy; > +=C2=A0 val->m_fetch_lazy_failed =3D m_fetch_lazy_failed; >=C2=A0 =C2=A0val->m_embedded_offset =3D embedded_offset (); >=C2=A0 =C2=A0val->m_pointed_to_offset =3D m_pointed_to_offset; >=C2=A0 =C2=A0val->m_modifiable =3D m_modifiable; > @@ -4119,6 +4120,8 @@ value::fetch_lazy () >=C2=A0 =C2=A0 =C2=A0 =C2=A0value.=C2=A0 */ >=C2=A0 =C2=A0gdb_assert (m_optimized_out.empty ()); >=C2=A0 =C2=A0gdb_assert (m_unavailable.empty ()); > +=C2=A0 /* Will be reset with set_lazy () at the end if successful.=C2=A0= */ > +=C2=A0 m_fetch_lazy_failed =3D true; >=C2=A0 =C2=A0if (m_is_zero) >=C2=A0 =C2=A0 =C2=A0{ >=C2=A0 =C2=A0 =C2=A0 =C2=A0/* Nothing.=C2=A0 */ > diff --git a/gdb/value.h b/gdb/value.h > index 4cc0d7d0902..01a4c00d722 100644 > --- a/gdb/value.h > +++ b/gdb/value.h > @@ -138,6 +138,7 @@ struct value >=C2=A0 =C2=A0 =C2=A0 =C2=A0m_stack (false), >=C2=A0 =C2=A0 =C2=A0 =C2=A0m_is_zero (false), >=C2=A0 =C2=A0 =C2=A0 =C2=A0m_in_history (false), > +=C2=A0 =C2=A0 =C2=A0 m_fetch_lazy_failed (false), >=C2=A0 =C2=A0 =C2=A0 =C2=A0m_type (type_), >=C2=A0 =C2=A0 =C2=A0 =C2=A0m_enclosing_type (type_) >=C2=A0 =C2=A0{ > @@ -279,7 +280,13 @@ struct value >=C2=A0 =C2=A0{ return m_lazy; } >=C2=A0 >=C2=A0 =C2=A0void set_lazy (bool val) > -=C2=A0 { m_lazy =3D val; } > +=C2=A0 { > +=C2=A0 =C2=A0 m_lazy =3D val; > +=C2=A0 =C2=A0 m_fetch_lazy_failed =3D false; > +=C2=A0 } > + > +=C2=A0 bool fetch_lazy_failed () const > +=C2=A0 { return m_fetch_lazy_failed; } >=C2=A0 >=C2=A0 =C2=A0/* If a value represents a C++ object, then the `type' field = gives the >=C2=A0 =C2=A0 =C2=A0 =C2=A0object's compile-time type.=C2=A0 If the object= actually belongs to some > @@ -689,6 +696,9 @@ struct value >=C2=A0 =C2=A0/* True if this a value recorded in value history; false othe= rwise.=C2=A0 */ >=C2=A0 =C2=A0bool m_in_history : 1; >=C2=A0 > +=C2=A0 /* True if fetch_lazy () did not finish successfully.=C2=A0 */ > +=C2=A0 bool m_fetch_lazy_failed : 1; > + >=C2=A0 =C2=A0/* Location of value (if lval).=C2=A0 */ >=C2=A0 =C2=A0union >=C2=A0 =C2=A0{ > --=C2=A0 > 2.54.0