From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id IHKJBbaTPmr5WhkAWB0awg (envelope-from ) for ; Fri, 26 Jun 2026 10:59:02 -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=PMFh69C9; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 05CDF1E024; Fri, 26 Jun 2026 10:59:02 -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,RCVD_IN_MSPIKE_H2 autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.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 CD3FE1E024 for ; Fri, 26 Jun 2026 10:58:59 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 582204BA23C7 for ; Fri, 26 Jun 2026 14:58:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 582204BA23C7 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=PMFh69C9 Received: from sonic311-30.consmr.mail.ir2.yahoo.com (sonic311-30.consmr.mail.ir2.yahoo.com [77.238.176.162]) by sourceware.org (Postfix) with ESMTPS id 338324BA2E37 for ; Fri, 26 Jun 2026 14:58:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 338324BA2E37 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 338324BA2E37 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=77.238.176.162 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1782485889; cv=none; b=D5O/5kspDgrKSo8ltchIJeEtf1Et+QFg4BAjyhjxm0/kGoC95BGWz2KhQBHW8mYvZMcicciis+G/v6c8Bbi+CwZID3kvogQ20oUxCVYHmrLmP919j592kxgeSVnAC+q9KqXTw/Su6UNSZ3fo9Mwz67oIACCo6PhFZmGguChcKqw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1782485889; c=relaxed/simple; bh=vGF89WY/uOPRKoMwF2OQxbzNse1rUPgNsRI/5PTRGfI=; h=DKIM-Signature:Date:From:To:Message-ID:Subject:MIME-Version; b=PGkiNdjS2QT6k01lK2smE4PF5mcOfraXL/zK46cQv2Grulcouz1cx9DrkYbcEPnMo3k2CNVD9t2ueKjQwUes1GAPQcE1I+SxN0fDaRGRNaVbEcxGAhymUnEPtZ2rUdKzAn+Ftc7VJ2lCM3xTcwRZQr8BWAJYRbCNEJSf6FiFhMY= 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=PMFh69C9 DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 338324BA2E37 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.de; s=s2048; t=1782485887; bh=vGF89WY/uOPRKoMwF2OQxbzNse1rUPgNsRI/5PTRGfI=; h=Date:From:To:In-Reply-To:References:Subject:From:Subject:Reply-To; b=PMFh69C9Wr9JhZSEZhsPWJ2twqUlkld5WOyFljCdaX85WPnNz603bNqKWXNqw4zGi4t/E3K7dUuwe5mq8ZcBc+OPwajzm414f8dqwB69E3JaNxrN+evP0OdAneG0bzhMGu8RBlvZVNhm/41umnfTtq5JBSvnWwl0W4pc14itYmW1ivC66VY6NrLAtjalnB4v99XDo0Qy+YO6moS6gGTAUZaaQkVH+GqCwKyFisajLmi8ZH8SLJAhxoz8FcN+FwitOlV08juAEX9HDnaxIKKW/+9N52KSRRrPZi2kHfEUZ+VfGbUALg7y7FW0iVze3vNPOJHeNu7IwdTvy6Xymm7yyA== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1782485887; bh=G8rHZi2yIhxZqEbMrTRphgsEPlSX48ITIMkT1BL4UaQ=; h=X-Sonic-MF:Date:From:To:Subject:From:Subject; b=qpCt9PLGY7alTFcw9aK8uqP2jVny0/99C2E3POMgkmIQvtrgceoAP7kY32s47OXPmT+JSTi4erk/U7Diy0guKqRuNXqAzulgx7LPEzIcpVZQ6GtnIqs3IljY8yBvUkDX8sgTHVUl7a2iBU1rdfs7DOld7tL+5jehmuOsGcrhBnHWuiG9gGRdH75whYSBh/384fbT/Iz0LS3GQKMv/0x2MoQbyUhcv7SxEGQ6VObTWOIZIlU8Rg6bbIJ1DSyTfUhVb/6HT1RNHIIUbum44jJflVEtk+X28g0aEMBfBAjZ7/rilae2s8e8ZDm7axUcBZ9ViymApMKDR1CQASLsiVTFGw== X-YMail-OSG: DURqf40VM1lPt5ptc5C9A7BpWyb12gMCDZjqrL1TYMEGNdyypakmgqQlBdAbwbE VCIDtLQXyTccyAh.E.ykw_Up08LO65pGDJEL1_tDs9_pF3eBiR5C.JaG94.0083jE8UdOwUwL0OP 8_W7euDhBJdL8woCa6rKhVH_8Hq_.0B6ObuZNmHTPhM_7Tk609K.zITdzRa1KUvqyH9AQ4aaa4AW MCP7hH9Eu9pp49cuCkfec6QPhNPGjdr85Y4i.aiqHt5nIeyS0AKSNunsMbB3oDHjNdjL1bPmtoV5 LL3fHwVyH2gH8P.Ftub7IpshbtZXdOSks0KPpXKup3edBbpJwsYj7LNG6dP.cUVx6Ymka.OcpXAJ Tog.ZzOPcF09ev8NC3VT8WqNDUe.WAefHef9G7Mw8rmdIZiVQu.oIdMFGNRaM4tOXequPIj.J.zz 4sAXiMbU5AkwC0iPrSGXiFAHB7tds2ZOSgLr8OasFyezOW0s3cPFX9fv86oXm2lDiLs4ja0Ez77U RJM2Cfcal_D2EM794g8p3TzaB3GqEvqhyBV796mLZ5JgVSIv8vq_awysGssuoG3fVGZvEq5MPS16 3QPMfi.0tj_9u4GGXp7sOB_G6gMx3LWPtfKJ7F5hd8YG9R3t8bR_34hzsM4ClYmOhKJfRLk.jbZx Anj8DePqz4wdTg_GLqzJQVojrFKetZijixNRdfBg4mJO.XvLzzY3Bd_k2JZ.y9OjXEXxbBq4qwo7 nX_2QgJBYbc7fHoFSB9BFcmVONd4dKI6U3iA3xbWQ3DL7O5AepfJ2JA0rAZqzcs6CcGF1_l0f98Q uaK4.JBnMJ7TuUB3S2CA3ff9amgGqBTgwJEBPO5ZLN56ZgXq6B_tmXRhMGB8K.VOrcf8YVWHwIOA sfKXLEsihV3s99AwozS6GAw2R16_bjKd4CPfrQAzEv02xuy4fkos5.gZrGjjyeTYuZ57ZXvTXASs XuXgfyZSt88irPFR2Gj366zq9nH54p2QkNzJ3OjI9XEHI5ESAkiubJucf3Fq9AtTU8F.JBibPrT6 BKqWAi21JwN2Hw5icEaTqZXFqH_AttNfcS2CJ2UvnXuhUOa3GDBwJNnDbMANA4X4arWy26vqvIC5 O8Ly4NP9ZKMjQ9y6EWLGu_Hd9zCqPpZnZnkP364zCI4TawZiP.WSWXMdMJCbTVmqkMfY1epOsj20 zLFaoWQ7KqcczSIbA4Oypd30oMythVb8C4Bup49z8Uyoa_6xEKkEImNxPkdccfuGoE9XL0glHejP erCVpYfUm8CnxtDCHBNloKduLoYCk3YjWYIck.zspokbPca9bNffV1xzHqPdqj0Cbca8j7qi_fBC 9i9_VJv1dxODYvbb0uDPQbMP2_OF4K8RNfOpWv94FS3Drvqe77jUNYlNexk5SM0JjFqPiNtk.aeN a30QepO4NENEt67BKHP.t6YxL2CfrktLW1jJ8QgZBNjrMifmpRsU11HPJ39GYuVMMPZWfFYt1K5a ouSiNOswJIaxkoqzOUWxuf4y.mZViSsb_orW8cyDq7neyWagwMrNPA1gd36P_YKzYFFSY._Q0y6f OOppJwj_OKwc.O8ngRGqU_SO79O2WynZCl_5fd06k5faQMFddfuX.H9uZwe3PwUjfel0EqPx6k1j qtaKi_XhWeUaYqmXYLY0TzUIMODh1mYaBUYc6NL_J0gFYbI8iQ.Y9l947dTuIinOStHX8oU4Iiqc giS3IpoTk9B50Fn2OEhWKwryNnIDGaDoE9W_Ipv.fe7Lr0EDLT0WH67YVTAxx8N9PRR3VBZSq.9u MFeKmqLEUnKwoVwF2vWqUkIy2mhMkdHCuuA4S6SRcYEk4OOJV2OdlNKgVqypew6YleXKTfApSM.3 HlW7PMbLMAz3FISEvkHV.cbkQidWo2JIxOhG7S1KFC8G1g5MK7hCMeH1EIiaW4gyllAx7fWKgDhK ei.A0sOFkeAPMtx9edoemh2gaFKwQh7XeTXWp1SBW_IHfj0yCcPsUeXODeNdQyMV3jb9NQuA2vNI ouAQBHXY8HUFvmVNgzJArR8as7EAgVSN0RN7IHUivQOUZkdr.boOKzy46NTTqt0hdblGoFJf8Snb BEpZMqucXcXR5ADvKh2qHRt.pzyrizhTu91s4v17NzbToJp00CKpkbxt0Ud9Y_C8m3Mhydu8Xpit uLxfNa05IjMb.AuNdF7elkE_iiC1vt4TdGd2FLCGJzXCT_.4f2NyqwQCe96GnW8DV3OWHB.xfguB hVt8HqDYkkaqn5XMeTJo5VcTyEa6coNO6o5BfayJLVzWUmQ-- X-Sonic-MF: X-Sonic-ID: 67e83cbe-d559-4ccb-b6c3-afc6608870d8 Received: from sonic.gate.mail.ne1.yahoo.com by sonic311.consmr.mail.ir2.yahoo.com with HTTP; Fri, 26 Jun 2026 14:58:07 +0000 Date: Fri, 26 Jun 2026 14:58:03 +0000 (UTC) From: Hannes Domani To: "gdb-patches@sourceware.org" Message-ID: <356352544.2612091.1782485883337@mail.yahoo.com> In-Reply-To: <20260109194839.1598134-1-ssbssa@yahoo.de> References: <20260109194839.1598134-1-ssbssa.ref@yahoo.de> <20260109194839.1598134-1-ssbssa@yahoo.de> 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.26016 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 Late ping, because I forgot about this patch myself. Am Freitag, 9. Januar 2026 um 20:50:29 MEZ 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 > --- > 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 af4de248ab6..13d95325604 100644 > --- a/gdb/breakpoint.c > +++ b/gdb/breakpoint.c > @@ -2293,11 +2293,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 > @@ -10716,12 +10715,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..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 > +} > + > +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 a52d4a6742c..c076617d102 100644 > --- a/gdb/value.c > +++ b/gdb/value.c > @@ -1546,6 +1546,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; > @@ -4122,6 +4123,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 8dc3192f637..77919082fe3 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 > @@ -681,6 +688,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 sucessfully.=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.52.0