From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id F0DA23858D38 for ; Wed, 6 Dec 2023 12:00:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org F0DA23858D38 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org F0DA23858D38 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701864057; cv=none; b=tPLESo/W5uZDbdetKRwYQCtzZwRmR1JO6PyhP9mYFBSwdTpyr0yITHcfRgUQav4gjNQ6o++ag4E0MDD6fJ5UKswbPHWH2057ffffqI0Ic7bu5Xz0ds3MEhJdJBlhZS/QxzPnzkOgvJVUAfehQv0ub04w68RGy+u9Vd6vZtK/0TY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701864057; c=relaxed/simple; bh=C/uK+9+E21mImWB7yICjOeKApq/3gdOkiwZyvu5fzRo=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=juv9np5+so8PcsB3wPhOFJF9vfVE9WYrd9rMZlLiyZVivAorvC/KYduKu0rahH72x3GZtpYaLISZrg/YlLCZOKmW4b3Vtxqf+rZdkcoi0pjBfPz3NVLe+bbNFUPY1blvy6TrSSwxqn9/FGNlML6d+kmH6s6LPqhynsTF2unoUFo= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1701864055; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uW5JpCh/q1MpsZuD8v2K/0ursb1r76TctzxJyyRz6I8=; b=YFI8LGNr+PmJ5GD29SaaUbfEBbv77bqnLfyP8d5dVvNPGyv7Wep2yI2GNM5R6MTbqMcoKX iERe7APLmG4ePS9odHHgRh0d71RVx6iffijP35dhg486UJAnqSSvHLY8xl5uQfpLVUCOZK mqJOY7+oZHl4mGoBDHHfc2pfC27Z5ww= Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-687-qZv7uL9FOGm_j6omfQJduA-1; Wed, 06 Dec 2023 07:00:54 -0500 X-MC-Unique: qZv7uL9FOGm_j6omfQJduA-1 Received: by mail-ej1-f69.google.com with SMTP id a640c23a62f3a-a1b760ce3e3so38951166b.3 for ; Wed, 06 Dec 2023 04:00:54 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701864053; x=1702468853; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=uW5JpCh/q1MpsZuD8v2K/0ursb1r76TctzxJyyRz6I8=; b=qEz2YzpywksD/7KcqOgVS411pTCX3QTQSuy27dkPyPk/y2ByoBEICx1LJ/LaCJRQwd Q7F0x1H00VcX6pwDEbH8fz5QeJbAQKmzjfGiQOYJYloGhzKWoHBJxJuIMqwMOXGed3Nn YT33z50pT9Q3GR3bprRJ3JioAFtBYvtDZ+GsjkBE5zZhWf5mVT0bISN6e693RrwpmF74 qMKLK3sHQ7f1xqtiLHOaOd8INXAU+9xdVabSNnBD2UDUbNB9ScAoNiHnlJ2vGopXDO3I f+MVpaS6v0S5Frse3xblOMEEQYKGCnhi/4o/L+sXoZy5PDhs22YuXzahl8WeuIJtZrRR 0Wyw== X-Gm-Message-State: AOJu0Yy7dXnkF+4Qz1VHt90NoN6FMb5/sT44duDaJqaXPxB6nyLk2HzP gOpXa0YBysoe1LrtgdpygsbEHVBMx45QkSnWSn10v+vb3Hj7Ol2DQMLukJB4rdxTsxgDhRs3fol siT88ocN2Ze34VRBSSUmHeg== X-Received: by 2002:a17:906:284:b0:a18:b780:cd03 with SMTP id 4-20020a170906028400b00a18b780cd03mr573566ejf.18.1701864053169; Wed, 06 Dec 2023 04:00:53 -0800 (PST) X-Google-Smtp-Source: AGHT+IEjfjrkz9wFQbi6jjXP4CDZOK0mWFOHr7guPXIf5grzkhY3wBZPsq7ujLYxUHOypwn2UknucA== X-Received: by 2002:a17:906:284:b0:a18:b780:cd03 with SMTP id 4-20020a170906028400b00a18b780cd03mr573556ejf.18.1701864052821; Wed, 06 Dec 2023 04:00:52 -0800 (PST) Received: from [192.168.0.129] (ip-94-112-227-180.bb.vodafone.cz. [94.112.227.180]) by smtp.gmail.com with ESMTPSA id i14-20020a170906090e00b009fd77d78f7fsm8181595ejd.116.2023.12.06.04.00.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 06 Dec 2023 04:00:52 -0800 (PST) Message-ID: <5de7b5a5-376e-d751-8c36-84de4995b572@redhat.com> Date: Wed, 6 Dec 2023 13:00:51 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [PATCH v3] Fix hardware watchpoints in replay mode To: Hannes Domani , gdb-patches@sourceware.org Cc: pedro@palves.net References: <20231121164241.302-1-ssbssa.ref@yahoo.de> <20231121164241.302-1-ssbssa@yahoo.de> From: Guinevere Larsen In-Reply-To: <20231121164241.302-1-ssbssa@yahoo.de> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,NICE_REPLY_A,RCVD_IN_BARRACUDACENTRAL,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE 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: On 21/11/2023 17:42, Hannes Domani wrote: > 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 not overwriting the stop-reason in > record_full_stop_reason if we're not stopped at a breakpoint. > > And the test for hw watchpoints in gdb.reverse/watch-reverse.exp actually > tested sw watchpoints again, since "set can-use-hw-watchpoints 1" > doesn't convert enabled watchpoints to use hardware. > This is fixed by disabling said watchpoint while enabling hw watchpoints. > The same is not done for gdb.reverse/watch-precsave.exp, since it's not > possible to use hw watchpoints in restored recordings anyways. > > Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=21969 > --- I checked again; this patch adds no regression, and fixes the issue that you described. Since this patch only relates to reverse execution, I say its ready for upstreaming. Approved-by: Guinevere Larsen -- Cheers, Guinevere Larsen She/Her/Hers > gdb/record.c | 1 - > gdb/testsuite/gdb.reverse/watch-reverse.exp | 4 ++++ > 2 files changed, 4 insertions(+), 1 deletion(-) > > diff --git a/gdb/record.c b/gdb/record.c > index f7c82665b05..88235e36da7 100644 > --- a/gdb/record.c > +++ b/gdb/record.c > @@ -248,7 +248,6 @@ record_check_stopped_by_breakpoint (const address_space *aspace, > return 1; > } > > - *reason = TARGET_STOPPED_BY_NO_REASON; > return 0; > } > > diff --git a/gdb/testsuite/gdb.reverse/watch-reverse.exp b/gdb/testsuite/gdb.reverse/watch-reverse.exp > index 6b81a6fdf88..a7126ac9b1d 100644 > --- a/gdb/testsuite/gdb.reverse/watch-reverse.exp > +++ b/gdb/testsuite/gdb.reverse/watch-reverse.exp > @@ -118,8 +118,12 @@ gdb_test "continue" \ > ".*\[Ww\]atchpoint.*ival3.*Old value = 0.*New value = -1.*ival3 = count; ival4 = count;.*" \ > "watchpoint hit in reverse, fifth time" > > +gdb_test_no_output "disable \$bpnum" "disable non-hw watchpoint" > + > gdb_test_no_output "set can-use-hw-watchpoints 1" "enable hw watchpoints" > > +gdb_test_no_output "enable \$bpnum" "enable hw watchpoint" > + > ### > ### > ###