From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from sonic311-31.consmr.mail.ir2.yahoo.com (sonic311-31.consmr.mail.ir2.yahoo.com [77.238.176.163]) by sourceware.org (Postfix) with ESMTPS id D72583858C52 for ; Thu, 14 Sep 2023 16:08:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D72583858C52 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=yahoo.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=yahoo.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.de; s=s2048; t=1694707734; bh=QJWWG/0pTTD1QJaRffDvQXQR2dVnDAZBI7XKzgL4xo4=; h=Date:From:To:In-Reply-To:References:Subject:From:Subject:Reply-To; b=mBrxE7IzvVkp/1Obm060/YKHrd/BJd4wO3pwAvZOskO9SzmfWix4hd41GSXHtv+Ml+fwx8FVpl1LqdSdqi744omm587/bAod80fN2XdJ82VTUOS/H3ujCsK+8uXNZbDxGTp5Uc1wK89Io+BHzk6BFotmFYy+fxWBpPbagq/qiQ2EecDOw/JQrhhvYljE0n+Qn2N+zzbL2WA3ZnoS1MGTLkYv88WYl6mQU40JfXi71YOTDL69+yNDYOeQhB+4wD19eC8FV2RYx5U/831NdzT467vXvo0KKZ5pwdkRWHlHyDeAXpTqyJctrQ//ZRY/1x0XITlFqyQw8MibpMg0O7dnbw== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1694707734; bh=T1ygg92kQcY/8N9N0i+RJo5rGbe0IUBNrYQ5A3Iyurk=; h=X-Sonic-MF:Date:From:To:Subject:From:Subject; b=S+0MFFIPSW8XmIZvd+SijtGZ/G2BRdxv2NGiEI/hQJGPIwtjWXhxuorzYJ0uRjTX1HS9zR5EpkhPSJTlIsHFiaZm29tRkYk6DNFy/DdMUP1ewyMEXWhvxSBuGacVUAoXmYjT9/LrP30NeVJYe2xBN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UnkDbIiDntXOFXGFKacqlVrhhJJLbnOgYpZCshgupclzaif7nBDXp0KM49F8fHkO. hDmf8s3FbYnvwUqMlIMB8g7iyg7fq92.q1zrEZLaFh31ImOzX2Y10_wPBxBU89ZUYnogOZwoEN1K RqBVvZ0RBbuI_OIyS7_A0wNaqzeY57pGOEuTMDTqe_UoNE.1juLKKQ8pgPMumADOA4VIBi_GnqtZ lQfrFCfd42ljJSWzAE17dj9d9v_BYGHXQvGKPfDC7o5nYSgWu.fnm1p.FTqK_lqKNKNLn_fTHaR7 o0HNm2QHoSlaODGo- X-Sonic-MF: X-Sonic-ID: 34164614-da2a-4144-a5a8-3c5843c9a991 Received: from sonic.gate.mail.ne1.yahoo.com by sonic311.consmr.mail.ir2.yahoo.com with HTTP; Thu, 14 Sep 2023 16:08:54 +0000 Date: Thu, 14 Sep 2023 16:08:52 +0000 (UTC) From: Hannes Domani To: "gdb-patches@sourceware.org" , Guinevere Larsen Message-ID: <466010665.600713.1694707732645@mail.yahoo.com> In-Reply-To: <87896aa8-da82-3409-b675-ba0779de32ce@redhat.com> References: <20230913155330.1558-1-ssbssa.ref@yahoo.de> <20230913155330.1558-1-ssbssa@yahoo.de> <87896aa8-da82-3409-b675-ba0779de32ce@redhat.com> Subject: Re: [PATCH] Fix hardware watchpoints in replay mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Mailer: WebService/1.1.21797 YMailNorrin X-Spam-Status: No, score=-8.7 required=5.0 tests=BAYES_00,BODY_8BITS,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Am Donnerstag, 14. September 2023, 14:20:54 MESZ hat Guinevere Larsen Folgendes geschrieben: > On 13/09/2023 17:53, Hannes Domani via Gdb-patches wrote: > > This regression was introduced by 9e8915c6cee5c37637521b424d723e990e06d= 597. > > > > The problem is that record_check_stopped_by_breakpoint always > > overwrites record_full_stop_reason, thus loosing the > > TARGET_STOPPED_BY_WATCHPOINT value which would be checked afterwards. > > > > Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=3D21969 > > Hi! Thanks for working on this! > > In general, when writing a commit message, its best to summarize the > problem again, even if it is described in a bug tracker, because the > next time this comes up, someone who already has the sources might have > no internet access for a while, for example. In this situation, I would > normally summarize this bug, explain the issue (that's not covered in > the bug), then explain the solution, like so: > > "Recent changes introduced by commit > 9e8915c6cee5c37637521b424d723e990e06d597 caused a regression that meant > hardware watchpoint stops would not trigger in reverse execution or > replay mode. This was documented in PR breakpoints/21969. The problem is > that record_check_stopped_by_breakpoint always overwrites > record_full_stop_reason, thus loosing the TARGET_STOPPED_BY_WATCHPOINT > value which would be checked afterwards. > > This commit fixes that by checking if record_full_stop_reason is > TARGET_STOPPED_BY_BREAKPOINT and, if so, not overriding it." > > and adding the "Bug:" trailer at the end. OK, I will add this. > You are, of course, free to change this wording as much as you like, but > having a fuller context is very useful when things like bug tracker > changes break links in the commit history, for example. > > > Additionally, have you tried making a testcase for this issue? I see > that gdb.reverse/watch-reverse.exp tests hardware watchpoints in theory, > but since this bug isn't triggered by it, it could probably do with some > changes , so this doesn't regress again. My guess is that you need to > clean the execution history before switching to hardware watchpoints, so > that they get properly saved, but I haven't tested that yet. I just found out why it works in watch-reverse.exp, it's because after `set can-use-hw-watchpoints 1` the watchpoint has to be disabled & enabled, otherwise it will stay a non-hw watchpoint. Once I added this, there were 12 failures without my fix. So I will add this to the v2. > > --- > >=C2=A0 gdb/record-full.c | 4 +++- > >=C2=A0 1 file changed, 3 insertions(+), 1 deletion(-) > > > > diff --git a/gdb/record-full.c b/gdb/record-full.c > > index faf8b595d22..da785ef4b2a 100644 > > --- a/gdb/record-full.c > > +++ b/gdb/record-full.c > > @@ -1382,7 +1382,9 @@ record_full_wait_1 (struct target_ops *ops, > > > >=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 /* check breakpoint */ > >=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 tmp_pc =3D regcache_read_pc (regcache); > > -=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 if (record_check_stopped_by_breakpoint > > +=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 if (record_full_stop_reason > > +=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 !=3D TARGET_STOPPED_BY_WATCHPOINT > > +=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 && record_check_stopped_by_breakpoint > >=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 (aspace, tmp_pc, &record_full_stop_reason)) > >=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=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 if (record_debug) > > I think a simpler solution would be to move the hw watchpoint check > further up, you won't need to check twice for the STOPPED_BY_WATCHPOINT > reason. I just tried this, with this change it suddenly shows SIGTRAP instead of hit watchpoints, so I will keep it as it is now. Regards Hannes