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.133.124]) by sourceware.org (Postfix) with ESMTPS id 2402D3858D20 for ; Tue, 9 Apr 2024 18:05:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2402D3858D20 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 2402D3858D20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712685921; cv=none; b=MMU7CUwNY3TcKwVQ/imRbdFGXka9xgltCC2UQsE9CVxjTzpXCup1kbvmaSiwjBCysY3ekz0tj2mXii8lHH1nn67USu3MqHZfVN2ULxxAnsMzsDCE109w1wvUKY+vfa9kY8dO2PqlKvTLMP8Si1K220yIvv7w7hx6DZIjsYAgcwc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712685921; c=relaxed/simple; bh=6PbHm4IJBa3U0Mp02w0yL5YJWsf3xocHc89UKdaVAbE=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=etkL8Zo6k2mYXfGBixka8LX0bAOju6fO0+jMogLvA8SyD+qowAAA78JymhKK7zCdhD5GI2Gsy5uvyCMN8Pm9buHFnG1JIOMNqx/eoGJLL6mZrG6OZmlL2bcN6CMJBx2fB8AfLth/++iPXdpm9zvBRfBIoV5vQ++AOgVJm72Kqeg= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1712685918; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6h00z+yllrXmLl1R+3UEcff638Yb0GP20UqhIZ8gopw=; b=PhZAi8mJYmvHpROYqF3eeXdp3xqrWWMihh0FtZrwJKA71ejC+y5hwhqRpOBHn5gNh1RNWU Z4e6Th8vTW043FKgfH/eN9ZPwzAnmTIkd4tR5WW9KQi/gjK5bgOVTzG3AsDeDJSie25rG+ V+y8Uzx2pdMmN7ikGQQar5tg85yMILY= Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-508-1y3ZDrp_P5ya8L3zp7TMVg-1; Tue, 09 Apr 2024 14:05:17 -0400 X-MC-Unique: 1y3ZDrp_P5ya8L3zp7TMVg-1 Received: by mail-qt1-f198.google.com with SMTP id d75a77b69052e-4347187e8b3so36612871cf.3 for ; Tue, 09 Apr 2024 11:05:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712685916; x=1713290716; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=6h00z+yllrXmLl1R+3UEcff638Yb0GP20UqhIZ8gopw=; b=wUyuLiwt5w3AhVSeJnQ3ox0muwalxu775CiMghClBKK/ObAWFp/hH+VNpkV9G12BlV KwQxvgP0QxDRnbSz2x1zmmWSY9gRDT9uwUEPyWhSUsSVG3Mw61SOgSDNtuZEmDkAO1IC Yd8qUV2+RcGiLgc5v95/g7msn7SnP/itNQ1oNHvI/LsA3y8ycIAPcTTJmMFci7ynrzyx nID+y/k2joaXhOgl1CuJMB0p3nuq+YiRaQ2LbR/KNYBzGMJ2jpgNi6WK6dCpyuyEXCgM 1Eg1dZB6AFZa+ou4/sIq0/nJPJcayY547/ol6C1O7hg9yOafFkomLSZbvV5+9H9MeVJ0 aACA== X-Forwarded-Encrypted: i=1; AJvYcCWmIrV0tBY+D0nmIfD5Vic57NJ55kJSLOy5GBrcImceKvkZqtgASLpu7GCrDQmE7ZXUDMclYrcwLeARcLIepvtk+EENK1t/FIK89Q== X-Gm-Message-State: AOJu0Yx3mD+BqGNhO0hvzgExRiCgSBqqUdKOj+49elxSlp929fqd2EYt 4bFUipPcSQ9wBYSUmQebkeP91my3OE1uDS4KESVezuKWaqQNPQPuj5nVjpvb5G/+EQ39psl4Sjt EIB0B+m0k5qWw2phi80zzBsQVhXPz+32O4rq0AggfephHuD8vYpxneNjtikro1XNzaAvwaw== X-Received: by 2002:ac8:7d91:0:b0:434:a104:5209 with SMTP id c17-20020ac87d91000000b00434a1045209mr488670qtd.22.1712685916476; Tue, 09 Apr 2024 11:05:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHcTBFW/V5SRvoJiHl4sYDICPvtv3mE9QkSjt1YrN9YzQbZ0L6oudCVQXVQVRiq03QPrDj4Mw== X-Received: by 2002:ac8:7d91:0:b0:434:a104:5209 with SMTP id c17-20020ac87d91000000b00434a1045209mr488647qtd.22.1712685916110; Tue, 09 Apr 2024 11:05:16 -0700 (PDT) Received: from ?IPV6:2804:14d:8084:92c5::1000? ([2804:14d:8084:92c5::1000]) by smtp.gmail.com with ESMTPSA id e2-20020ac81302000000b004343d542598sm259737qtj.62.2024.04.09.11.05.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 09 Apr 2024 11:05:15 -0700 (PDT) Message-ID: <80fac9e4-2ff3-49f3-9289-1edfeea523b7@redhat.com> Date: Tue, 9 Apr 2024 15:05:13 -0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] Change message when reaching end of reverse history. To: Alex Chronopoulos , gdb-patches@sourceware.org References: <20240407195501.3240775-1-achronop@gmail.com> From: Guinevere Larsen In-Reply-To: <20240407195501.3240775-1-achronop@gmail.com> 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.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,RCVD_IN_SORBS_WEB,SPF_HELO_NONE,SPF_NONE,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: On 4/7/24 16:55, Alex Chronopoulos wrote: > In a record session, when we move backward, GDB switches from normal > execution to simulation. Moving forward again, the emulation continues > until the end of the reverse history. When the end is reached, the > execution stops, and a warning message is shown. This message has been > modified to indicate that the forward emulation has reached the end, but > the execution can continue as normal, and the recording will also continue. > > Before this patch, the warning message shown in that case was the same as > in the reverse case. This meant that when the end of history was reached in > either backward or forward emulation, the same message was displayed: > > "No more reverse-execution history." > > This message remains for backward emulation. However, in forward emulation, > it has been modified to: > > "End of recorded history; following steps will be added to history." > > The reason for this change is that the initial message was deceiving, for > the forward case, making the user believe that forward debugging could not > continue. > > Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31224 I tested this and it adds no regressions. I have one small nit inlined, but with that solved, you can add my review tag. Reviewed-By: Guinevere Larsen Once Markus is satisfied, I think this will be ready for merging. > --- > gdb/NEWS | 5 ++++ > gdb/infrun.c | 8 ++++- > gdb/testsuite/gdb.btrace/non-stop.exp | 30 ++++++++++++------- > gdb/testsuite/gdb.reverse/break-precsave.exp | 4 +-- > gdb/testsuite/gdb.reverse/break-reverse.exp | 2 +- > .../gdb.reverse/machinestate-precsave.exp | 2 +- > 6 files changed, 36 insertions(+), 15 deletions(-) > > diff --git a/gdb/NEWS b/gdb/NEWS > index 2638b3e0d9c..f2e85776a53 100644 > --- a/gdb/NEWS > +++ b/gdb/NEWS > @@ -13,6 +13,11 @@ > the background, resulting in faster startup. This can be controlled > using "maint set dwarf synchronous". > > +* In a record session, when a forward emulation reaches the end of the reverse > + history, the warning message has been changed to indicate that the end of the > + history has been reached. It also specifies that the forward execution can > + continue, and the recording will also continue. > + > * Changed commands > > disassemble > diff --git a/gdb/infrun.c b/gdb/infrun.c > index bbb98f6dcdb..c0f037c11a2 100644 > --- a/gdb/infrun.c > +++ b/gdb/infrun.c > @@ -9244,8 +9244,14 @@ print_no_history_reason (struct ui_out *uiout) > { > if (uiout->is_mi_like_p ()) > uiout->field_string ("reason", async_reason_lookup (EXEC_ASYNC_NO_HISTORY)); > + else if (execution_direction == EXEC_FORWARD) > + uiout->text ("\nEnd of recorded history; following steps will be added to " > + "history.\n"); > else > - uiout->text ("\nNo more reverse-execution history.\n"); > + { > + gdb_assert (execution_direction == EXEC_REVERSE); > + uiout->text ("\nNo more reverse-execution history.\n"); > + } > } > > /* Print current location without a level number, if we have changed > diff --git a/gdb/testsuite/gdb.btrace/non-stop.exp b/gdb/testsuite/gdb.btrace/non-stop.exp > index 62c940e4cd6..e4c91b793ae 100644 > --- a/gdb/testsuite/gdb.btrace/non-stop.exp > +++ b/gdb/testsuite/gdb.btrace/non-stop.exp > @@ -79,7 +79,7 @@ proc gdb_cont_to_bp_line { line threads nthreads } { > $nthreads > } > > -proc gdb_cont_to_no_history { threads cmd nthreads } { > +proc gdb_cont_to_no_history_backward { threads cmd nthreads } { > gdb_cont_to $threads $cmd \ > [multi_line \ > "No more reverse-execution history\." \ > @@ -89,6 +89,16 @@ proc gdb_cont_to_no_history { threads cmd nthreads } { > $nthreads > } > > +proc gdb_cont_to_no_history_forward { threads cmd nthreads } { > + gdb_cont_to $threads $cmd \ > + [multi_line \ > + "End of recorded history; following steps will be added to history\." \ > + "\[^\\\r\\\n\]*" \ > + "\[^\\\r\\\n\]*" \ > + ] \ > + $nthreads > +} These should use tab indentations for every 8 spaces. -- Cheers, Guinevere Larsen She/Her/Hers > + > # trace the code between the two breakpoints > with_test_prefix "prepare" { > gdb_cont_to_bp_line "$srcfile:$bp_1" all 2 > @@ -176,14 +186,14 @@ with_test_prefix "reverse-step" { > with_test_prefix "continue" { > with_test_prefix "thread 1" { > with_test_prefix "continue" { > - gdb_cont_to_no_history 1 "continue" 1 > + gdb_cont_to_no_history_forward 1 "continue" 1 > gdb_test "thread apply 1 info record" \ > ".*Recorded \[0-9\]+ instructions \[^\\\r\\\n\]*" > gdb_test "thread apply 2 info record" \ > ".*Replay in progress\. At instruction 5\." > } > with_test_prefix "reverse-continue" { > - gdb_cont_to_no_history 1 "reverse-continue" 1 > + gdb_cont_to_no_history_backward 1 "reverse-continue" 1 > gdb_test "thread apply 1 info record" \ > ".*Replay in progress\. At instruction 1\." > gdb_test "thread apply 2 info record" \ > @@ -193,14 +203,14 @@ with_test_prefix "continue" { > > with_test_prefix "thread 2" { > with_test_prefix "continue" { > - gdb_cont_to_no_history 2 "continue" 1 > + gdb_cont_to_no_history_forward 2 "continue" 1 > gdb_test "thread apply 1 info record" \ > ".*Replay in progress\. At instruction 1\." > gdb_test "thread apply 2 info record" \ > ".*Recorded \[0-9\]+ instructions \[^\\\r\\\n\]*" > } > with_test_prefix "reverse-continue" { > - gdb_cont_to_no_history 2 "reverse-continue" 1 > + gdb_cont_to_no_history_backward 2 "reverse-continue" 1 > gdb_test "thread apply 1 info record" \ > ".*Replay in progress\. At instruction 1\." > gdb_test "thread apply 2 info record" \ > @@ -215,8 +225,8 @@ with_test_prefix "no progress" { > gdb_test "thread apply 1 record goto end" ".*" > gdb_test "thread apply 2 record goto begin" ".*" > > - gdb_cont_to_no_history 1 "continue" 1 > - gdb_cont_to_no_history 1 "step" 1 > + gdb_cont_to_no_history_forward 1 "continue" 1 > + gdb_cont_to_no_history_forward 1 "step" 1 > gdb_test "thread apply 1 info record" \ > ".*Recorded \[0-9\]+ instructions \[^\\\r\\\n\]*" > gdb_test "thread apply 2 info record" \ > @@ -227,8 +237,8 @@ with_test_prefix "no progress" { > gdb_test "thread apply 1 record goto begin" ".*" > gdb_test "thread apply 2 record goto end" ".*" > > - gdb_cont_to_no_history 2 "continue" 1 > - gdb_cont_to_no_history 2 "step" 1 > + gdb_cont_to_no_history_forward 2 "continue" 1 > + gdb_cont_to_no_history_forward 2 "step" 1 > gdb_test "thread apply 1 info record" \ > ".*Replay in progress\. At instruction 1\." > gdb_test "thread apply 2 info record" \ > @@ -238,7 +248,7 @@ with_test_prefix "no progress" { > with_test_prefix "all" { > gdb_test "thread apply all record goto begin" ".*" > > - gdb_cont_to_no_history all "continue" 2 > + gdb_cont_to_no_history_forward all "continue" 2 > gdb_test "thread apply 1 info record" \ > ".*Recorded \[0-9\]+ instructions \[^\\\r\\\n\]*" > gdb_test "thread apply 2 info record" \ > diff --git a/gdb/testsuite/gdb.reverse/break-precsave.exp b/gdb/testsuite/gdb.reverse/break-precsave.exp > index b9d94681247..89ce9d7e854 100644 > --- a/gdb/testsuite/gdb.reverse/break-precsave.exp > +++ b/gdb/testsuite/gdb.reverse/break-precsave.exp > @@ -73,7 +73,7 @@ proc precsave_tests {} { > -re ".*Breakpoint $decimal,.*$srcfile:$end_location.*$gdb_prompt $" { > pass "go to end of main forward" > } > - -re "No more reverse-execution history.* end of main .*$gdb_prompt $" { > + -re "End of recorded history; following steps will be added to history.* end of main .*$gdb_prompt $" { > pass "go to end of main forward" > } > } > @@ -103,7 +103,7 @@ proc precsave_tests {} { > -re ".*Breakpoint $decimal,.*$srcfile:$end_location.*$gdb_prompt $" { > pass "end of record log" > } > - -re "No more reverse-execution history.* end of main .*$gdb_prompt $" { > + -re "End of recorded history; following steps will be added to history.* end of main .*$gdb_prompt $" { > pass "end of record log" > } > } > diff --git a/gdb/testsuite/gdb.reverse/break-reverse.exp b/gdb/testsuite/gdb.reverse/break-reverse.exp > index 1dd327ca654..e9c799a506d 100644 > --- a/gdb/testsuite/gdb.reverse/break-reverse.exp > +++ b/gdb/testsuite/gdb.reverse/break-reverse.exp > @@ -80,7 +80,7 @@ gdb_test_multiple "continue" "end of record log" { > -re ".*Breakpoint $decimal,.*$srcfile:$end_location.*$gdb_prompt $" { > pass "end of record log" > } > - -re "No more reverse-execution history.* end of main .*$gdb_prompt $" { > + -re "End of recorded history; following steps will be added to history.* end of main .*$gdb_prompt $" { > pass "end of record log" > } > } > diff --git a/gdb/testsuite/gdb.reverse/machinestate-precsave.exp b/gdb/testsuite/gdb.reverse/machinestate-precsave.exp > index 19c5934bfdf..6b3a949e23a 100644 > --- a/gdb/testsuite/gdb.reverse/machinestate-precsave.exp > +++ b/gdb/testsuite/gdb.reverse/machinestate-precsave.exp > @@ -85,7 +85,7 @@ gdb_test_multiple "continue" "go to end of main forward" { > -re ".*Breakpoint $decimal,.*$srcfile:$endmain.*$gdb_prompt $" { > pass "go to end of main forward" > } > - -re "No more reverse-execution history.* end main .*$gdb_prompt $" { > + -re "End of recorded history; following steps will be added to history.* end main .*$gdb_prompt $" { > pass "go to end of main forward" > } > }