From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id iMLjOr9121/TSwAAWB0awg (envelope-from ) for ; Thu, 17 Dec 2020 10:14:07 -0500 Received: by simark.ca (Postfix, from userid 112) id ECC111F0AA; Thu, 17 Dec 2020 10:14:07 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_NONE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from sourceware.org (unknown [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 29A101E965 for ; Thu, 17 Dec 2020 10:14:07 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DB0B2389602B; Thu, 17 Dec 2020 15:14:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DB0B2389602B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1608218046; bh=/OiaRfzUj/ApChjMT1vUrnjU2MMw1BUe8q0TJuIqdP0=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=TDd7CK2tP42NLMBfXkO9Rbn6SAE2MpU6oi6lQ1gBRTOvC1eNLLash5f6x4Ybst0kZ 6UGfOvS63VFu4FuZm9iwSBbbVjU9yjumpmdQ9cRu2gN2O0RKNBs7j5plU/iN6IeAF7 5QJJuSJ8SGFLBvUWIgwoBwkJ+OHhwITKGPDpBtc8= Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by sourceware.org (Postfix) with ESMTPS id A8FE4389602D for ; Thu, 17 Dec 2020 15:14:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org A8FE4389602D IronPort-SDR: wmSCz6jRi7p0AjmCPvO/VkeUeA2rBf4g0axcENaPKhao4SDMD7HYS6Kn2c8GnwNFBY7wrz/Q39 H2gn15y9GNBg== X-IronPort-AV: E=McAfee;i="6000,8403,9837"; a="193661407" X-IronPort-AV: E=Sophos;i="5.78,428,1599548400"; d="scan'208";a="193661407" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Dec 2020 07:13:56 -0800 IronPort-SDR: 6sviQEG20JC3JfTTnrVBTawHRquw1qz2aALds2oNZmjVyhdJdRCDrJcBbaB+yjgdIrtDyUNNci UhOKHHmBn1yA== X-IronPort-AV: E=Sophos;i="5.78,428,1599548400"; d="scan'208";a="369869374" Received: from labpc2407.iul.intel.com (HELO localhost) ([172.28.50.61]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Dec 2020 07:13:55 -0800 To: gdb-patches@sourceware.org Subject: [PATCH 1/4] testsuite, gdb.btrace: make test names unique Date: Thu, 17 Dec 2020 16:12:09 +0100 Message-Id: <20201217151212.1179058-2-markus.t.metzger@intel.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201217151212.1179058-1-markus.t.metzger@intel.com> References: <20201217151212.1179058-1-markus.t.metzger@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Markus Metzger via Gdb-patches Reply-To: Markus Metzger Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" gdb/testsuite/ChangeLog: 2020-12-04 Markus Metzger * gdb.btrace/data.exp: Make test names unique. * gdb.btrace/delta.exp: Likewise. * gdb.btrace/enable.exp: Likewise. * gdb.btrace/function_call_history.exp: Likewise. * gdb.btrace/nohist.exp: Likewise. * gdb.btrace/non-stop.exp: Likewise. * gdb.btrace/rn-dl-bind.exp: Likewise. * gdb.btrace/step.exp: Likewise. * gdb.btrace/stepi.exp: Likewise. * gdb.btrace/tailcall.exp: Likewise. --- gdb/testsuite/gdb.btrace/data.exp | 24 ++- gdb/testsuite/gdb.btrace/delta.exp | 30 ++-- gdb/testsuite/gdb.btrace/enable.exp | 2 +- .../gdb.btrace/function_call_history.exp | 2 +- gdb/testsuite/gdb.btrace/nohist.exp | 8 +- gdb/testsuite/gdb.btrace/non-stop.exp | 72 +++++---- gdb/testsuite/gdb.btrace/rn-dl-bind.exp | 14 +- gdb/testsuite/gdb.btrace/step.exp | 26 ++-- gdb/testsuite/gdb.btrace/stepi.exp | 146 +++++++++++------- gdb/testsuite/gdb.btrace/tailcall.exp | 30 ++-- 10 files changed, 215 insertions(+), 139 deletions(-) diff --git a/gdb/testsuite/gdb.btrace/data.exp b/gdb/testsuite/gdb.btrace/data.exp index b10970f6760..28ac1ad46ad 100644 --- a/gdb/testsuite/gdb.btrace/data.exp +++ b/gdb/testsuite/gdb.btrace/data.exp @@ -40,16 +40,24 @@ gdb_test "next" ".*main\.3.*" gdb_test "reverse-step" ".*test\.4.*" # we can't read memory while we're replaying -gdb_test "print glob" "unavailable\[^\\\r\\\n\]*" -gdb_test "print loc" "unavailable\[^\\\r\\\n\]*" +with_test_prefix "replay" { + with_test_prefix "default" { + gdb_test "print glob" "unavailable\[^\\\r\\\n\]*" + gdb_test "print loc" "unavailable\[^\\\r\\\n\]*" + } -# we can read memory if we explicitly allow it. -gdb_test_no_output "set record btrace replay-memory-access read-write" -gdb_test "print glob" "1" + # we can read memory if we explicitly allow it. + with_test_prefix "read-write" { + gdb_test_no_output "set record btrace replay-memory-access read-write" + gdb_test "print glob" "1" + } -# we can't if we don't explicitly allow it. -gdb_test_no_output "set record btrace replay-memory-access read-only" -gdb_test "print glob" "unavailable\[^\\\r\\\n\]*" + # we can't if we don't explicitly allow it. + with_test_prefix "read-only" { + gdb_test_no_output "set record btrace replay-memory-access read-only" + gdb_test "print glob" "unavailable\[^\\\r\\\n\]*" + } +} # stop replaying and try again gdb_test "record goto end" ".*main\.3.*" diff --git a/gdb/testsuite/gdb.btrace/delta.exp b/gdb/testsuite/gdb.btrace/delta.exp index 0fe0e99f9ac..54891214653 100644 --- a/gdb/testsuite/gdb.btrace/delta.exp +++ b/gdb/testsuite/gdb.btrace/delta.exp @@ -73,18 +73,22 @@ with_test_prefix "twice" { } # check that we can reverse-stepi that instruction -gdb_test "reverse-stepi" -gdb_test "info record" [multi_line \ - "Active record target: record-btrace" \ - "Recording format: .*" \ - "Recorded 1 instructions in 1 functions \\\(0 gaps\\\) for .*" \ - "Replay in progress\. At instruction 1\." \ - ] "reverse-stepi" +with_test_prefix "reverse" { + gdb_test "reverse-stepi" + gdb_test "info record" [multi_line \ + "Active record target: record-btrace" \ + "Recording format: .*" \ + "Recorded 1 instructions in 1 functions \\\(0 gaps\\\) for .*" \ + "Replay in progress\. At instruction 1\." \ + ] +} # and back -gdb_test "stepi" -gdb_test "info record" [multi_line \ - "Active record target: record-btrace" \ - "Recording format: .*" \ - "Recorded 1 instructions in 1 functions \\\(0 gaps\\\) for .*" \ - ] "and back" +with_test_prefix "forward" { + gdb_test "stepi" + gdb_test "info record" [multi_line \ + "Active record target: record-btrace" \ + "Recording format: .*" \ + "Recorded 1 instructions in 1 functions \\\(0 gaps\\\) for .*" \ + ] +} diff --git a/gdb/testsuite/gdb.btrace/enable.exp b/gdb/testsuite/gdb.btrace/enable.exp index 8ce1dab076f..d147e90874a 100644 --- a/gdb/testsuite/gdb.btrace/enable.exp +++ b/gdb/testsuite/gdb.btrace/enable.exp @@ -100,7 +100,7 @@ if ![runto_main] { untested "failed to run to main" return -1 } -gdb_test_no_output "record btrace" +gdb_test_no_output "record btrace" "enable after restart" if ![runto_main] { untested "failed to run to main" return -1 diff --git a/gdb/testsuite/gdb.btrace/function_call_history.exp b/gdb/testsuite/gdb.btrace/function_call_history.exp index bc28ec7cccd..51536ff6035 100644 --- a/gdb/testsuite/gdb.btrace/function_call_history.exp +++ b/gdb/testsuite/gdb.btrace/function_call_history.exp @@ -240,7 +240,7 @@ gdb_continue_to_breakpoint "cont to fib.3" gdb_continue_to_breakpoint "cont to fib.4" # start tracing -gdb_test_no_output "record btrace" +gdb_test_no_output "record btrace" "start recording after rerun" # continue until line 30 above delete_breakpoints diff --git a/gdb/testsuite/gdb.btrace/nohist.exp b/gdb/testsuite/gdb.btrace/nohist.exp index 0273ceef815..90883c06973 100644 --- a/gdb/testsuite/gdb.btrace/nohist.exp +++ b/gdb/testsuite/gdb.btrace/nohist.exp @@ -42,8 +42,12 @@ proc check_not_replaying {} { gdb_test_no_output "record btrace" -check_not_replaying +with_test_prefix "forward" { + check_not_replaying +} gdb_test "reverse-continue" "No more reverse-execution history\.\r\n.*" -check_not_replaying +with_test_prefix "backward" { + check_not_replaying +} diff --git a/gdb/testsuite/gdb.btrace/non-stop.exp b/gdb/testsuite/gdb.btrace/non-stop.exp index 1637fab888a..f3bf005f9eb 100644 --- a/gdb/testsuite/gdb.btrace/non-stop.exp +++ b/gdb/testsuite/gdb.btrace/non-stop.exp @@ -52,7 +52,7 @@ set loop_line "$loop\[^\\\r\\\n\]*/\\\* loop \\\*/" # make sure $line matches the full expected output per thread. # and let's hope that GDB never mixes the output from different threads. -proc gdb_cont_to { threads cmd line nthreads } { +proc gdb_cont_to { threads cmd line nthreads message } { global gdb_prompt set full_cmd "thread apply $threads $cmd" @@ -60,13 +60,13 @@ proc gdb_cont_to { threads cmd line nthreads } { # the prompt precedes any further output except some errors. gdb_test_multiple "$full_cmd &" "$full_cmd: prompt" { -re "$gdb_prompt " { - pass "$full_cmd: prompt" + pass "$full_cmd ($message): prompt" } } # now check for the expected line - one per thread. for {set i 0} {$i < $nthreads} {incr i} { - set test "$full_cmd: thread $i" + set test "$full_cmd ($message): thread $i" gdb_test_multiple "" $test { -re "$line\[^\\\r\\\n\]*\r\n" { @@ -82,7 +82,7 @@ proc gdb_cont_to_bp_line { line threads nthreads } { "Breakpoint\[^\\\r\\\n\]*$line" \ "\[^\\\r\\\n\]*" \ ] \ - $nthreads + $nthreads "to $line" } proc gdb_cont_to_no_history { threads cmd nthreads } { @@ -92,7 +92,7 @@ proc gdb_cont_to_no_history { threads cmd nthreads } { "\[^\\\r\\\n\]*" \ "\[^\\\r\\\n\]*" \ ] \ - $nthreads + $nthreads "to end of history" } # trace the code between the two breakpoints @@ -112,15 +112,15 @@ with_test_prefix "navigate" { gdb_test "thread apply 1 record goto 2" "$loop_line" gdb_test "thread apply 2 record goto 4" "$loop_line" gdb_test "thread apply 1 info record" \ - ".*Replay in progress\. At instruction 2\." + ".*Replay in progress\. At instruction 2\." "thread 1 at insn 2" gdb_test "thread apply 2 info record" \ - ".*Replay in progress\. At instruction 4\." + ".*Replay in progress\. At instruction 4\." "thread 2 at insn 4" gdb_test "thread apply all record goto 5" "$loop_line" gdb_test "thread apply 1 info record" \ - ".*Replay in progress\. At instruction 5\." + ".*Replay in progress\. At instruction 5\." "thread 1 at insn 5" gdb_test "thread apply 2 info record" \ - ".*Replay in progress\. At instruction 5\." + ".*Replay in progress\. At instruction 5\." "thread 2 at insn 5" } with_test_prefix "step" { @@ -141,7 +141,7 @@ with_test_prefix "step" { } with_test_prefix "all" { - gdb_cont_to all "stepi 4" "$loop_line" 2 + gdb_cont_to all "stepi 4" "$loop_line" 2 "to $srcfile:$loop" gdb_test "thread apply 1 info record" \ ".*Replay in progress\. At instruction 11\." gdb_test "thread apply 2 info record" \ @@ -167,7 +167,7 @@ with_test_prefix "reverse-step" { } with_test_prefix "all" { - gdb_cont_to all "reverse-stepi 4" "$loop_line" 2 + gdb_cont_to all "reverse-stepi 4" "$loop_line" 2 "to $srcfile:$loop" gdb_test "thread apply 1 info record" \ ".*Replay in progress\. At instruction 5\." gdb_test "thread apply 2 info record" \ @@ -177,31 +177,37 @@ with_test_prefix "reverse-step" { with_test_prefix "continue" { with_test_prefix "thread 1" { - gdb_cont_to_no_history 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\." - - gdb_cont_to_no_history 1 "reverse-continue" 1 - gdb_test "thread apply 1 info record" \ - ".*Replay in progress\. At instruction 1\." - gdb_test "thread apply 2 info record" \ - ".*Replay in progress\. At instruction 5\." + with_test_prefix "continue" { + gdb_cont_to_no_history 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_test "thread apply 1 info record" \ + ".*Replay in progress\. At instruction 1\." + gdb_test "thread apply 2 info record" \ + ".*Replay in progress\. At instruction 5\." + } } with_test_prefix "thread 2" { - gdb_cont_to_no_history 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\]*" - - gdb_cont_to_no_history 2 "reverse-continue" 1 - gdb_test "thread apply 1 info record" \ - ".*Replay in progress\. At instruction 1\." - gdb_test "thread apply 2 info record" \ - ".*Replay in progress\. At instruction 1\." + with_test_prefix "continue" { + gdb_cont_to_no_history 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_test "thread apply 1 info record" \ + ".*Replay in progress\. At instruction 1\." + gdb_test "thread apply 2 info record" \ + ".*Replay in progress\. At instruction 1\." + } } } diff --git a/gdb/testsuite/gdb.btrace/rn-dl-bind.exp b/gdb/testsuite/gdb.btrace/rn-dl-bind.exp index ab2dda413ef..46804864026 100644 --- a/gdb/testsuite/gdb.btrace/rn-dl-bind.exp +++ b/gdb/testsuite/gdb.btrace/rn-dl-bind.exp @@ -38,18 +38,18 @@ if ![runto_main] { # trace the code for the call to test gdb_test_no_output "record btrace" -gdb_test "next" ".*main\.2.*" +gdb_test "next" ".*main\.2.*" "next.1" # just dump the function-call-history to help debugging gdb_test_no_output "set record function-call-history-size 0" gdb_test "record function-call-history /cli 1" ".*" # check that we can reverse-next and next -gdb_test "reverse-next" ".*main\.1.*" -gdb_test "next" ".*main\.2.*" +gdb_test "reverse-next" ".*main\.1.*" "reverse-next.1" +gdb_test "next" ".*main\.2.*" "next.2" # now go into test and try to reverse-next and next over the library call -gdb_test "reverse-step" ".*test\.3.*" -gdb_test "reverse-step" ".*test\.2.*" -gdb_test "reverse-next" ".*test\.1.*" -gdb_test "next" ".*test\.2.*" +gdb_test "reverse-step" ".*test\.3.*" "reverse-step.1" +gdb_test "reverse-step" ".*test\.2.*" "reverse-step.2" +gdb_test "reverse-next" ".*test\.1.*" "reverse-next.2" +gdb_test "next" ".*test\.2.*" "next.3" diff --git a/gdb/testsuite/gdb.btrace/step.exp b/gdb/testsuite/gdb.btrace/step.exp index 19850256590..a71c46dde6b 100644 --- a/gdb/testsuite/gdb.btrace/step.exp +++ b/gdb/testsuite/gdb.btrace/step.exp @@ -33,16 +33,20 @@ if ![runto_main] { } # trace the call to the test function -gdb_test_no_output "record btrace" -gdb_test "next" +with_test_prefix "record" { + gdb_test_no_output "record btrace" + gdb_test "next" +} # let's step around a bit -gdb_test "reverse-next" ".*main\.2.*" -gdb_test "step" ".*fun4\.2.*" -gdb_test "next" ".*fun4\.3.*" -gdb_test "step" ".*fun2\.2.*" -gdb_test "finish" ".*fun4\.4.*" -gdb_test "reverse-step" ".*fun2\.3.*" -gdb_test "reverse-finish" ".*fun4\.3.*" -gdb_test "reverse-next" ".*fun4\.2.*" -gdb_test "reverse-finish" ".*main\.2.*" +with_test_prefix "replay" { + gdb_test "reverse-next" ".*main\.2.*" "reverse-next.1" + gdb_test "step" ".*fun4\.2.*" "step.1" + gdb_test "next" ".*fun4\.3.*" "next.1" + gdb_test "step" ".*fun2\.2.*" "step.2" + gdb_test "finish" ".*fun4\.4.*" "finish.1" + gdb_test "reverse-step" ".*fun2\.3.*" "reverse-step.1" + gdb_test "reverse-finish" ".*fun4\.3.*" "reverse-finish.1" + gdb_test "reverse-next" ".*fun4\.2.*" "reverse-next.2" + gdb_test "reverse-finish" ".*main\.2.*" "reverse-finish.2" +} diff --git a/gdb/testsuite/gdb.btrace/stepi.exp b/gdb/testsuite/gdb.btrace/stepi.exp index 1ab1b9adfa1..4e2bf1a8e81 100644 --- a/gdb/testsuite/gdb.btrace/stepi.exp +++ b/gdb/testsuite/gdb.btrace/stepi.exp @@ -61,82 +61,122 @@ proc check_replay_at { insn } { ".*" \ "Recorded 40 instructions in 16 functions \\\(0 gaps\\\) for .*" \ "Replay in progress\. At instruction $insn\." \ - ] + ] "check replay at $insn" } # trace the call to the test function -gdb_test_no_output "record btrace" -gdb_test "next" +with_test_prefix "record" { + gdb_test_no_output "record btrace" + gdb_test "next" ".*" "next.1" +} # we start with stepping to make sure that the trace is fetched automatically -gdb_test "reverse-stepi" ".*fun4\.5.*" -gdb_test "reverse-stepi" ".*fun4\.5.*" +with_test_prefix "fetch" { + gdb_test "reverse-stepi" ".*fun4\.5.*" "reverse-stepi.1" + gdb_test "reverse-stepi" ".*fun4\.5.*" "reverse-stepi.2" -# let's check where we are in the trace -with_test_prefix "reverse-stepi to 39" { check_replay_at 39 } + # let's check where we are in the trace + check_replay_at 39 +} # let's step forward and check again -gdb_test "stepi" ".*fun4\.5.*" -with_test_prefix "stepi to 40" { check_replay_at 40 } +with_test_prefix "stepi" { + gdb_test "stepi" ".*fun4\.5.*" + check_replay_at 40 +} # with the next step, we stop replaying -gdb_test "stepi" ".*main\.3.*" -gdb_test "info record" [multi_line \ - "Active record target: record-btrace" \ - ".*" \ - "Recorded 40 instructions in 16 functions \\\(0 gaps\\\) for \[^\\\r\\\n\]*" \ - ] "stepi to live" +with_test_prefix "end" { + gdb_test "stepi" ".*main\.3.*" + gdb_test "info record" [multi_line \ + "Active record target: record-btrace" \ + ".*" \ + "Recorded 40 instructions in 16 functions \\\(0 gaps\\\) for \[^\\\r\\\n\]*" \ + ] +} # let's try nexti -gdb_test "reverse-nexti" ".*main\.2.*" -with_test_prefix "reverse-nexti - 1" { check_replay_at 1 } +with_test_prefix "reverse-nexti.1" { + gdb_test "reverse-nexti" ".*main\.2.*" + check_replay_at 1 +} # we can't reverse-nexti any further -gdb_test "reverse-nexti" "No more reverse-execution history\.\r\n.*main\.2.*" -with_test_prefix "reverse-nexti - 1" { check_replay_at 1 } +with_test_prefix "reverse-nexti.2" { + gdb_test "reverse-nexti" \ + "No more reverse-execution history\.\r\n.*main\.2.*" \ + "reverse-nexti.2" + check_replay_at 1 +} # but we can step back again -gdb_test "nexti" ".*main\.3.*" "next, 1.5" -gdb_test "info record" [multi_line \ - "Active record target: record-btrace" \ - ".*" \ - "Recorded 40 instructions in 16 functions \\\(0 gaps\\\) for \[^\\\r\\\n\]*" \ - ] "nexti back" +with_test_prefix "nexti" { + gdb_test "nexti" ".*main\.3.*" + gdb_test "info record" [multi_line \ + "Active record target: record-btrace" \ + ".*" \ + "Recorded 40 instructions in 16 functions \\\(0 gaps\\\) for \[^\\\r\\\n\]*" \ + ] +} # let's step from a goto position somewhere in the middle -gdb_test "record goto 22" ".*fun3\.2.*" -with_test_prefix "goto 22" { check_replay_at 22 } +with_test_prefix "goto" { + gdb_test "record goto 22" ".*fun3\.2.*" + with_test_prefix "goto 22" { check_replay_at 22 } -gdb_test "stepi" ".*fun1\.1.*" -with_test_prefix "stepi to 23" { check_replay_at 23 } + gdb_test "stepi" ".*fun1\.1.*" "stepi.3" + with_test_prefix "stepi to 23" { check_replay_at 23 } -gdb_test "reverse-stepi" ".*fun3\.2.*" -with_test_prefix "reverse-stepi to 22" { check_replay_at 22 } + gdb_test "reverse-stepi" ".*fun3\.2.*" "reverse-stepi.3" + with_test_prefix "reverse-stepi to 22" { check_replay_at 22 } -gdb_test "nexti" ".*fun3\.3.*" -with_test_prefix "nexti to 27" { check_replay_at 27 } + gdb_test "nexti" ".*fun3\.3.*" + with_test_prefix "nexti to 27" { check_replay_at 27 } -gdb_test "reverse-nexti" ".*fun3\.2.*" -with_test_prefix "reverse-nexti to 22" { check_replay_at 22 } + gdb_test "reverse-nexti" ".*fun3\.2.*" "reverse-nexti.3" + with_test_prefix "reverse-nexti to 22" { check_replay_at 22 } +} # let's try to step off the left end -gdb_test "record goto begin" ".*main\.2.*" -with_test_prefix "goto begin" { check_replay_at 1 } - -gdb_test "reverse-stepi" "No more reverse-execution history\.\r\n.*main\.2.*" -gdb_test "reverse-stepi" "No more reverse-execution history\.\r\n.*main\.2.*" -with_test_prefix "reverse-stepi at begin" { check_replay_at 1 } - -gdb_test "reverse-nexti" "No more reverse-execution history\.\r\n.*main\.2.*" -gdb_test "reverse-nexti" "No more reverse-execution history\.\r\n.*main\.2.*" -with_test_prefix "reverse-nexti at begin" { check_replay_at 1 } - -# we can step forward, though -gdb_test "stepi" ".*fun4\.1.*" -with_test_prefix "stepi to 2" { check_replay_at 2 } +with_test_prefix "goto begin" { + gdb_test "record goto begin" ".*main\.2.*" + check_replay_at 1 + + with_test_prefix "reverse-stepi" { + gdb_test "reverse-stepi" \ + "No more reverse-execution history\.\r\n.*main\.2.*" \ + "reverse-stepi.1" + gdb_test "reverse-stepi" \ + "No more reverse-execution history\.\r\n.*main\.2.*" \ + "reverse-stepi.2" + check_replay_at 1 + } + + with_test_prefix "reverse-nexti" { + gdb_test "reverse-nexti" \ + "No more reverse-execution history\.\r\n.*main\.2.*" \ + "reverse-nexti.1" + gdb_test "reverse-nexti" \ + "No more reverse-execution history\.\r\n.*main\.2.*" \ + "reverse-nexti.2" + check_replay_at 1 + } + + # we can step forward, though + with_test_prefix "stepi" { + gdb_test "stepi" ".*fun4\.1.*" + check_replay_at 2 + } +} # let's try to step off the left end again -gdb_test "reverse-stepi" ".*main\.2.*" -gdb_test "reverse-stepi" "No more reverse-execution history\.\r\n.*main\.2.*" -gdb_test "reverse-stepi" "No more reverse-execution history\.\r\n.*main\.2.*" -with_test_prefix "reverse-stepi at begin" { check_replay_at 1 } +with_test_prefix "reverse-stepi" { + gdb_test "reverse-stepi" ".*main\.2.*" "reverse-stepi.1" + gdb_test "reverse-stepi" \ + "No more reverse-execution history\.\r\n.*main\.2.*" \ + "reverse-stepi.2" + gdb_test "reverse-stepi" \ + "No more reverse-execution history\.\r\n.*main\.2.*" \ + "reverse-stepi.3" + check_replay_at 1 +} diff --git a/gdb/testsuite/gdb.btrace/tailcall.exp b/gdb/testsuite/gdb.btrace/tailcall.exp index 2937a3b4fe9..4f86a6f2088 100644 --- a/gdb/testsuite/gdb.btrace/tailcall.exp +++ b/gdb/testsuite/gdb.btrace/tailcall.exp @@ -93,13 +93,23 @@ gdb_test "up" "#2\[^\r\n\]*main \\(\\) at tailcall.c:37\r\n.*" "up to main" gdb_test "down" "#1\[^\r\n\]*foo \\(\\) at tailcall.c:29\r\n.*" "down to foo" # test stepping into and out of tailcalls. -gdb_test "finish" "\[^\r\n\]*main \\(\\) at tailcall.c:38\r\n.*" -gdb_test "reverse-step" "\[^\r\n\]*bar \\(\\) at tailcall.c:24\r\n.*" -gdb_test "reverse-finish" "\[^\r\n\]*foo \\(\\) at tailcall.c:29\r\n.*" -gdb_test "reverse-step" "\[^\r\n\]*main \\(\\) at tailcall.c:37\r\n.*" -gdb_test "next" "\[^\r\n\]*38.*" -gdb_test "reverse-next" "\[^\r\n\]*main \\(\\) at tailcall.c:37\r\n.*" -gdb_test "step" "\[^\r\n\]*foo \\(\\) at tailcall.c:29\r\n.*" -gdb_test "finish" "\[^\r\n\]*main \\(\\) at tailcall.c:38\r\n.*" -gdb_test "reverse-step" "\[^\r\n\]*bar \\(\\) at tailcall.c:24\r\n.*" -gdb_test "finish" "\[^\r\n\]*main \\(\\) at tailcall.c:38\r\n.*" +gdb_test "finish" "\[^\r\n\]*main \\(\\) at tailcall.c:38\r\n.*" \ + "finish.1" +gdb_test "reverse-step" "\[^\r\n\]*bar \\(\\) at tailcall.c:24\r\n.*" \ + "reverse-step.1" +gdb_test "reverse-finish" "\[^\r\n\]*foo \\(\\) at tailcall.c:29\r\n.*" \ + "reverse-finish.1" +gdb_test "reverse-step" "\[^\r\n\]*main \\(\\) at tailcall.c:37\r\n.*" \ + "reverse-step.2" +gdb_test "next" "\[^\r\n\]*38.*" \ + "next.1" +gdb_test "reverse-next" "\[^\r\n\]*main \\(\\) at tailcall.c:37\r\n.*" \ + "reverse-next.1" +gdb_test "step" "\[^\r\n\]*foo \\(\\) at tailcall.c:29\r\n.*" \ + "step.1" +gdb_test "finish" "\[^\r\n\]*main \\(\\) at tailcall.c:38\r\n.*" \ + "finish.2" +gdb_test "reverse-step" "\[^\r\n\]*bar \\(\\) at tailcall.c:24\r\n.*" \ + "reverse-step.3" +gdb_test "finish" "\[^\r\n\]*main \\(\\) at tailcall.c:38\r\n.*" \ + "finish.3" -- 2.26.2 Intel Deutschland GmbH Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany Tel: +49 89 99 8853-0, www.intel.de Managing Directors: Christin Eisenschmid, Gary Kershaw Chairperson of the Supervisory Board: Nicole Lau Registered Office: Munich Commercial Register: Amtsgericht Muenchen HRB 186928