From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) by sourceware.org (Postfix) with ESMTPS id B0B993858D20 for ; Thu, 11 Apr 2024 16:46:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B0B993858D20 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 B0B993858D20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::335 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712854015; cv=none; b=PyEEv2NO9+1WpYYxkNTKL3OAACvWfpwpzbrt+fYavopbeeS3HGK5/3rUhvDDiI3n/nWJ83vSAlIwU0sJ/keW2pwYKh58BQf3I7ALhg9aSb2pfDF8iU8VsdqrdsBpELokyxKGjb8heanEe70ObuYRACGWvnJTqHFz6t1sGssqK+I= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712854015; c=relaxed/simple; bh=FzXsmFf3w7RCRqpnZqOUYxnORyV6s6ArlWiLAW3Mi2E=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=JrTyHGlclYo01p25KDl6X7n3/u8IRlRBmHFOtRQL/3XIyFtePVGFGREC6QmgBcQvRFpN17ChCzs8tiJ2x8qpIV4tam4bOy84Bk+Eq+V/LZ0rsOk+MqvreL2sTnz6kecEdqK+Hzf5NanEF+SQlRPgz0iGm1MDe4SCZsWD5wRYjgw= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-417d73dedb6so385505e9.2 for ; Thu, 11 Apr 2024 09:46:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712854010; x=1713458810; darn=sourceware.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=89P2Z8+6Ycv4CDJmxGkJGAFSUprDs29mAUwDS6DFFq4=; b=R3FmEYxFO3+YET2JZTs/iJk6i4khhwqiL5o1Vk5ZQg/+EyXr1/P/cQrKxO8ZHBn5tn ynhdyRl0P7V2Ob0WQRN9J4BB1gVHBsi/BXBwn5/6hAviT9Az8DvCqCMsVE1OorhzRsb0 ZLFCcE5sbXtje54g3VPWinh5ulqNsGxA2s3J4EymQKo5QJBWBK5aXZ0c83LmjW35dWLV D9hqKNQxNsGXgWfihg0mGlqLvKTVN6C0xu4pj1W0XdbL7WbfcT/13AaFfP/YhFNXxNvd KXw1r+aEpCnmHIydrKR7bN6eI3ufiYrcBPtiUUhkUhHp0IDjPtkuKV4wcTXjroOpMqZd NaTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712854010; x=1713458810; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=89P2Z8+6Ycv4CDJmxGkJGAFSUprDs29mAUwDS6DFFq4=; b=eeGuE8GVYNDbim3pt9t3pUfpZP0bpO1zUVIQ/6CGqhc2YMtmAIZQ1H7vr6nLxy1PAS 9agPHdE+PXjuY9ZApErz4e1eLEeOeLg/CPzpbaI9wfoet8FPeIydla3CYbumz2IAG3YL qxr66pc8wN39X23oJctKg9gu+50m54MQ90+FCoxZiwpZgU2CvMun8XkomLrJ9QNBUcwh ymYL5fsq57WmHDglUlMaM9S/VEt9vKZoDf38yzV7jqnLcccKWd1IE3TgvIu5RPRhT5xN 9P5StMJCqnl3ZwowQkxFS17i3BzyH19Y7YP6+IFTw+aGlekz2rRhndo2bzzR0OBommdj ye3Q== X-Forwarded-Encrypted: i=1; AJvYcCX3QXh8sWBUA/J3yTUwx98uUKluKfz7cdK+bqecGBnGmO8M7HOhqaAj6MP+u0Y5udK9O5AKnhx/aeJbsD/pPDb3L1/8Fv1NKseyaA== X-Gm-Message-State: AOJu0YynAhOV3cWjywLmZuTiR/QBMOYlKuZUAYkz7Y8LgjemQ98ebGQq /x7u8oL0O2GwDQ1iO5y5Tcb+56e2R3PsmEx9sOexj1ARdupoqCqOFDqWy7lMhgQDY0LkfaDq0U5 wmFUtoh8HEpXVAKXzp+xr2jWFcBRRZe+QU6mrPA== X-Google-Smtp-Source: AGHT+IEyb6cQRnlwK9HD9tHI3j3f6LPhdzl+AO8AxuB+8qkGQ+pV7cNq6ixtIUt6YVcSbDKFaJECEpnmyzSTsnd+1x4= X-Received: by 2002:a05:600c:1e25:b0:417:e155:1a3e with SMTP id ay37-20020a05600c1e2500b00417e1551a3emr213337wmb.9.1712854010099; Thu, 11 Apr 2024 09:46:50 -0700 (PDT) MIME-Version: 1.0 References: <20240407195501.3240775-1-achronop@gmail.com> In-Reply-To: From: Alex Chronopoulos Date: Thu, 11 Apr 2024 18:46:38 +0200 Message-ID: Subject: Re: [PATCH v2] Change message when reaching end of reverse history. To: "Metzger, Markus T" Cc: Eli Zaretskii , "gdb-patches@sourceware.org" Content-Type: multipart/alternative; boundary="000000000000d300720615d4e6f2" X-Spam-Status: No, score=-9.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,GIT_PATCH_0,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,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: --000000000000d300720615d4e6f2 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thank you, Markus. > This line got too long. All these are *.exp files and I cannot find an easy way to reduce the line length without breaking the expectations test. On the other hand, I see more *.exp files with much longer lines. Do you know how to make the line shorter in his case? On Mon, Apr 8, 2024 at 9:15=E2=80=AFAM Metzger, Markus T 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 n= ot > >continue. > > > >Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=3D31224 > > Looks good to me with a small formatting nit. CLI and documentation is > typically approved by Eli. > > > >--- > > 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 =3D=3D 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 =3D=3D 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 > >+} > >+ > > # 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 $" { > > This line got too long. > > > 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 $" { > > This line got too long. > > > 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 $" { > > This line got too long. > > > 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 $" { > > This line got too long. > > > pass "go to end of main forward" > > } > > } > >-- > >2.42.0 > > Intel Deutschland GmbH > Registered Address: Am Campeon 10, 85579 Neubiberg, Germany > Tel: +49 89 99 8853-0, www.intel.de > Managing Directors: Christin Eisenschmid, Sharon Heck, Tiffany Doon Silva > Chairperson of the Supervisory Board: Nicole Lau > Registered Office: Munich > Commercial Register: Amtsgericht Muenchen HRB 186928 > > --000000000000d300720615d4e6f2--