From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x531.google.com (mail-ed1-x531.google.com [IPv6:2a00:1450:4864:20::531]) by sourceware.org (Postfix) with ESMTPS id CF5A93858D35 for ; Wed, 13 Mar 2024 20:49:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CF5A93858D35 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org CF5A93858D35 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::531 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1710362947; cv=none; b=MR2GXJcXfGmgpzhukKtwzDKXNPmyWOxn6cMU1Vxd6MQWUOn4pSKllc8IDaqu2Yk2UfeCvLkQ1+OzHGpNyXY9JWMB0UHtMciQXuRP9qnD1zXDGt0A/naifaYTRmLwqIcggocj+qft43Gl0V5Ypdh+D5V8t7bvOtQdictfvOj1ouA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1710362947; c=relaxed/simple; bh=aF7tYa0GytHQ9oKkxG7FLLEDoRzygY2oJrn/hOybPuE=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=hShaLOMk7JhAm7XhwOZgOFbF2uFHiQOioq0K6esi/jtEAcNBbt6JXj/hy7TAvSbczI3vmYpJC28beqHkQLjj9ZIG5gNZFQ//e00+nQydFMAsA+obHnJ7dftqJsuPc3wot1Mh2oDSi50143vePAFCnl5i47x+jyw/NHyiTkslcvQ= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-ed1-x531.google.com with SMTP id 4fb4d7f45d1cf-568967ff66cso346531a12.1 for ; Wed, 13 Mar 2024 13:49:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710362941; x=1710967741; darn=sourceware.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=HZ7ItdtF1vRaDqNZAncrSZQrqKPMH9ZSjNcjaR6X9UA=; b=c+rlJEcKKYDh5FnIHRrmQGapHJPcQmTou0H8GNBnFwRDb5CVTbpR5tpLMzxId1lzKp /TAMNJDAtH7JQyJ6H4sUDd+V5+dc4i65k/ZoWFrQ1LqubZYlpU2DYXHG2Pvb+EoVcM84 YeOeoYao3Chll27bgZLnKIA3yI8Tu81qXoiADIEdMwNlgIL2BNUqF2CNIBqKWvQPzr/J WA8Yn56VZwE6PU7Qq7bqJIY3ni61uybh3H5lnEScD23ImCfmHSYj9N3BWE4Tnx0z5i9H 4FZaQQ78aaYeKpa+r8j7vKkj/5leKlqlMBzlgEBM7bhrPT4/CQqoyX4VODMqXisIbA1C 8nJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710362941; x=1710967741; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=HZ7ItdtF1vRaDqNZAncrSZQrqKPMH9ZSjNcjaR6X9UA=; b=VK0hQXk2yev1J7Bgq66z4MqhPwyAGFR6Gip+q9YkjY8WgeH+HHpXMLuMt64ytERaQI vvhBX6dXQd4hFT/Tjr2qpX2BGid3b41eqz73HTl/4nxqG+WgJHzIw7xSMRSIWvt4GVee 9TrxUdyvC2Rl9fIu8iXLxqhsoCkGt7+QAQlPOK4PrkWO7tcH6Fo3fv5TBzMf5CwO6O7q vCsYd6cwc/d6/304LfjMYWuK6B4a7qCnBWWBcC6FeE8Q1VOCUGoU32qj28GPgKsbzeK/ gk+RA7nF3JBODOkZf/amcR4FCjCxF45Z6DLWwhzprj2lPBBH78DpMFUJG6Z2c5UsRt27 Jrww== X-Gm-Message-State: AOJu0Yyzm4LhB8yzHFfFxEKdGV82xolgGl2G2T/4XRflcUglgXH88mFD v+8cdt6061yyubCQ3qdqfMjUZwLGa4IEmxtNjcnGCLXkPam5IsZWqleHCBfo X-Google-Smtp-Source: AGHT+IFYBwjA1FqFcfXheZOOtCRrLrwcHBltjEUJ2ieYhpdMErJZROsV3hGvtePoF7c03SOrMSuV6Q== X-Received: by 2002:a17:907:c78f:b0:a46:4623:9b25 with SMTP id tz15-20020a170907c78f00b00a4646239b25mr4636740ejc.58.1710362940766; Wed, 13 Mar 2024 13:49:00 -0700 (PDT) Received: from localhost.localdomain (195-240-134-144.fixed.kpn.net. [195.240.134.144]) by smtp.gmail.com with ESMTPSA id mm28-20020a170906cc5c00b00a4669556a26sm7077ejb.94.2024.03.13.13.48.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 13:49:00 -0700 (PDT) From: Alex Chronopoulos To: gdb-patches@sourceware.org Cc: Alex Chronopoulos Subject: [PATCH] Change message when reaching end of reverse history. Date: Wed, 13 Mar 2024 21:48:30 +0100 Message-ID: <20240313204830.2521708-1-achronop@gmail.com> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-10.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,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: 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: "No more reverse-execution history for emulation. Going forward will continue executing and recording." The reason for this change is that the initial message was deceiving, making the user believe that forward debugging could not continue. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31224 --- 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..e129eb0582f 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 ("\nNo more reverse-execution history for emulation. " + "Going forward will continue executing and recording.\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..7ce3008c120 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 \ + "No more reverse-execution history for emulation\. Going forward will continue executing and recording\." \ + "\[^\\\r\\\n\]*" \ + "\[^\\\r\\\n\]*" \ + ] \ + $nthreads +} + # 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..6d3b95933d4 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 "No more reverse-execution history for emulation. Going forward will continue executing and recording.* 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 "No more reverse-execution history for emulation. Going forward will continue executing and recording.* 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..bf74d6f7d07 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 "No more reverse-execution history for emulation. Going forward will continue executing and recording.* 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..693c304bc18 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 "No more reverse-execution history for emulation. Going forward will continue executing and recording.* end main .*$gdb_prompt $" { pass "go to end of main forward" } } -- 2.42.0