From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 9epKBA8WvWHgIAAAWB0awg (envelope-from ) for ; Fri, 17 Dec 2021 17:58:23 -0500 Received: by simark.ca (Postfix, from userid 112) id 0162E1F0CE; Fri, 17 Dec 2021 17:58:22 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [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 7467B1E940 for ; Fri, 17 Dec 2021 17:58:21 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C0A2B385802B for ; Fri, 17 Dec 2021 22:58:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C0A2B385802B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1639781900; bh=DI1wXg6vswc2o7f9+s5NU0ubRG3lPj/m0ruo3DAHJeE=; h=Date:To:Subject:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=e4Dh1rdkYdVBaqZgw/c4mkiPvZ8jQveZTSIAEw4vXJySZcG6qGFL+AhO39gnWYIzu sYiL/eKeI3jckR3TifI6FauqQxN0wQpbik4e277jYKSdOQI3BW42YOScO0o0BZoc6x 9fObVoeZzl2M9YHchkHKjtQCVsfwQ+d1yPQcFMQA= Received: from lndn.lancelotsix.com (vps-42846194.vps.ovh.net [IPv6:2001:41d0:801:2000::2400]) by sourceware.org (Postfix) with ESMTPS id F0E173858033 for ; Fri, 17 Dec 2021 22:57:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org F0E173858033 Received: from Plymouth (unknown [IPv6:2a02:390:9086:0:413a:a3d0:a542:d809]) by lndn.lancelotsix.com (Postfix) with ESMTPSA id CDC1B80D5D; Fri, 17 Dec 2021 22:57:57 +0000 (UTC) Date: Fri, 17 Dec 2021 22:57:53 +0000 To: Pedro Alves Subject: Re: [PATCH 11/12] gdb/testsuite: Remove duplicates from gdb.mi/mi2-amd64-entry-value.exp Message-ID: <20211217225753.jgzdrnq5fwgtx2ln@Plymouth> References: <20211126230038.103225-1-lsix@lancelotsix.com> <20211126230038.103225-12-lsix@lancelotsix.com> <757f0aed-decd-ab44-619a-2e0d6df59cf1@palves.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <757f0aed-decd-ab44-619a-2e0d6df59cf1@palves.net> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.11 (lndn.lancelotsix.com [0.0.0.0]); Fri, 17 Dec 2021 22:57:58 +0000 (UTC) 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: Lancelot SIX via Gdb-patches Reply-To: Lancelot SIX Cc: gdb-patches@sourceware.org Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" > > IWBN to get this grouped properly while at it. Would you mind removing the "only:" etc. > manual prefixes instead, converting that to the with_test_prefix prefix? Like: > > with_test_prefix "only" { > if {[mi_runto_main] == -1} { > return -1 > } > > - mi_gdb_test "-gdb-set print entry-values only" {\^done} "only: set print entry-values" > - mi_send_resuming_command "exec-continue" "only: entry_equal: continue" > + mi_gdb_test "-gdb-set print entry-values only" {\^done} "set print entry-values" > + mi_send_resuming_command "exec-continue" "entry_equal: continue" > } > > etc? Hi, Yes. Looking at the file it is posssible to go even one step further and have a second level of with_test_prefix. This is what I have done in the revision of this patch (which makes the patch much longer, but I think it is worth). See below. Thanks, Lancelot. --- >From 15a5eb28aae0b7a926fe04a97cd7359a76e40fca Mon Sep 17 00:00:00 2001 From: Lancelot SIX Date: Tue, 23 Nov 2021 15:26:18 +0000 Subject: [PATCH] gdb/testsuite: Remove duplicates from gdb.mi/mi2-amd64-entry-value.exp When running the testsuite, I have: Running .../gdb/testsuite/gdb.mi/mi2-amd64-entry-value.exp ... DUPLICATE: gdb.mi/mi2-amd64-entry-value.exp: breakpoint at main DUPLICATE: gdb.mi/mi2-amd64-entry-value.exp: mi runto main DUPLICATE: gdb.mi/mi2-amd64-entry-value.exp: breakpoint at main DUPLICATE: gdb.mi/mi2-amd64-entry-value.exp: mi runto main DUPLICATE: gdb.mi/mi2-amd64-entry-value.exp: breakpoint at main DUPLICATE: gdb.mi/mi2-amd64-entry-value.exp: mi runto main DUPLICATE: gdb.mi/mi2-amd64-entry-value.exp: breakpoint at main DUPLICATE: gdb.mi/mi2-amd64-entry-value.exp: mi runto main DUPLICATE: gdb.mi/mi2-amd64-entry-value.exp: breakpoint at main DUPLICATE: gdb.mi/mi2-amd64-entry-value.exp: mi runto main DUPLICATE: gdb.mi/mi2-amd64-entry-value.exp: breakpoint at main DUPLICATE: gdb.mi/mi2-amd64-entry-value.exp: mi runto main Fix by enclosing the various 'mi_runto_main' calls (which are responsible for the DUPLICATEs warnings) in 'with_test_prefix'. All the test did have a name prefix manually baked in the test name. So while at it, remove it and group the tests in with_test_prefix. The result is a clearer file organization. Tested on x86_64-linux. --- .../gdb.mi/mi2-amd64-entry-value.exp | 431 +++++++++++++----- 1 file changed, 320 insertions(+), 111 deletions(-) diff --git a/gdb/testsuite/gdb.mi/mi2-amd64-entry-value.exp b/gdb/testsuite/gdb.mi/mi2-amd64-entry-value.exp index 4505bfada67..a4e1e3fea8e 100644 --- a/gdb/testsuite/gdb.mi/mi2-amd64-entry-value.exp +++ b/gdb/testsuite/gdb.mi/mi2-amd64-entry-value.exp @@ -49,121 +49,330 @@ foreach name {different breakhere_different breakhere_validity breakhere_invalid # Test various kinds of `set print entry-values'. -if {[mi_runto_main] == -1} { - return -1 +with_test_prefix "no" { + if {[mi_runto_main] == -1} { + return -1 + } + mi_gdb_test "-gdb-set print entry-values no" {\^done} \ + "set print entry-values" + + with_test_prefix "entry_equal" { + mi_send_resuming_command "exec-continue" "continue" + mi_expect_stop "breakpoint-hit" .* \ + {{name="val",value="5"}} .* .* {.* disp="keep"} "stop" + mi_gdb_test "-stack-list-variables --all-values" \ + {\^done,variables=\[{name="val",arg="1",value="5"}\]} \ + "-stack-list-variables" + } + + with_test_prefix "entry_different" { + mi_send_resuming_command "exec-continue" "continue" + mi_expect_stop "breakpoint-hit" .* \ + {{name="val",value="6"}} .* .* {.* disp="keep"} "stop" + mi_gdb_test "-stack-list-variables --all-values" \ + {\^done,variables=\[{name="val",arg="1",value="6"}\]} \ + "-stack-list-variables" + } + + with_test_prefix "validity" { + mi_send_resuming_command "exec-continue" "continue" + mi_expect_stop "breakpoint-hit" .* \ + {{name="lost",value=""},{name="born",value="10"}} \ + .* .* {.* disp="keep"} "stop" + mi_gdb_test "-stack-list-variables --all-values" \ + {\^done,variables=\[{name="lost",arg="1",value=""},{name="born",arg="1",value="10"}\]} \ + "-stack-list-variables" + } + + with_test_prefix "invalid" { + mi_send_resuming_command "exec-continue" "continue" + mi_expect_stop "breakpoint-hit" .* \ + {{name="inv",value=""}} .* .* {.* disp="keep"} \ + "stop" + mi_gdb_test "-stack-list-variables --all-values" \ + {\^done,variables=\[{name="inv",arg="1",value=""}\]} \ + "-stack-list-variables" + } } -mi_gdb_test "-gdb-set print entry-values no" {\^done} "no: set print entry-values" -mi_send_resuming_command "exec-continue" "no: entry_equal: continue" -mi_expect_stop "breakpoint-hit" .* {{name="val",value="5"}} .* .* {.* disp="keep"} "no: entry_equal: stop" -mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="val",arg="1",value="5"}\]} "no: entry_equal: -stack-list-variables" -mi_send_resuming_command "exec-continue" "no: entry_different: continue" -mi_expect_stop "breakpoint-hit" .* {{name="val",value="6"}} .* .* {.* disp="keep"} "no: entry_different: stop" -mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="val",arg="1",value="6"}\]} "no: entry_different: -stack-list-variables" -mi_send_resuming_command "exec-continue" "no: validity: continue" -mi_expect_stop "breakpoint-hit" .* {{name="lost",value=""},{name="born",value="10"}} .* .* {.* disp="keep"} "no: validity: stop" -mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="lost",arg="1",value=""},{name="born",arg="1",value="10"}\]} "no: validity: -stack-list-variables" -mi_send_resuming_command "exec-continue" "no: invalid: continue" -mi_expect_stop "breakpoint-hit" .* {{name="inv",value=""}} .* .* {.* disp="keep"} "no: invalid: stop" -mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="inv",arg="1",value=""}\]} "no: invalid: -stack-list-variables" - -if {[mi_runto_main] == -1} { - return -1 + +with_test_prefix "only" { + if {[mi_runto_main] == -1} { + return -1 + } + mi_gdb_test "-gdb-set print entry-values only" {\^done} \ + "set print entry-values" + + with_test_prefix "entry_equal" { + mi_send_resuming_command "exec-continue" \ + "continue" + mi_expect_stop "breakpoint-hit" .* {{name="val@entry",value="5"}} \ + .* .* {.* disp="keep"} "stop" + mi_gdb_test "-stack-list-variables --all-values" \ + {\^done,variables=\[{name="val@entry",arg="1",value="5"}\]} \ + "-stack-list-variables" + } + + with_test_prefix "entry_different" { + mi_send_resuming_command "exec-continue" "continue" + mi_expect_stop "breakpoint-hit" .* {{name="val@entry",value="5"}} \ + .* .* {.* disp="keep"} "stop" + mi_gdb_test "-stack-list-variables --all-values" \ + {\^done,variables=\[{name="val@entry",arg="1",value="5"}\]} \ + "-stack-list-variables" + } + + with_test_prefix "validity" { + mi_send_resuming_command "exec-continue" "continue" + mi_expect_stop "breakpoint-hit" .* \ + {{name="lost@entry",value="5"},{name="born@entry",value=""}} \ + .* .* {.* disp="keep"} "stop" + mi_gdb_test "-stack-list-variables --all-values" \ + {\^done,variables=\[{name="lost@entry",arg="1",value="5"},{name="born@entry",arg="1",value=""}\]} \ + "-stack-list-variables" + } + + with_test_prefix "invalid" { + mi_send_resuming_command "exec-continue" "continue" + mi_expect_stop "breakpoint-hit" .* \ + {{name="inv@entry",value=""}} \ + .* .* {.* disp="keep"} "stop" + mi_gdb_test "-stack-list-variables --all-values" \ + {\^done,variables=\[{name="inv@entry",arg="1",value=""}\]} \ + "-stack-list-variables" + } } -mi_gdb_test "-gdb-set print entry-values only" {\^done} "only: set print entry-values" -mi_send_resuming_command "exec-continue" "only: entry_equal: continue" -mi_expect_stop "breakpoint-hit" .* {{name="val@entry",value="5"}} .* .* {.* disp="keep"} "only: entry_equal: stop" -mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="val@entry",arg="1",value="5"}\]} "only: entry_equal: -stack-list-variables" -mi_send_resuming_command "exec-continue" "only: entry_different: continue" -mi_expect_stop "breakpoint-hit" .* {{name="val@entry",value="5"}} .* .* {.* disp="keep"} "only: entry_different: stop" -mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="val@entry",arg="1",value="5"}\]} "only: entry_different: -stack-list-variables" -mi_send_resuming_command "exec-continue" "only: validity: continue" -mi_expect_stop "breakpoint-hit" .* {{name="lost@entry",value="5"},{name="born@entry",value=""}} .* .* {.* disp="keep"} "only: validity: stop" -mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="lost@entry",arg="1",value="5"},{name="born@entry",arg="1",value=""}\]} "only: validity: -stack-list-variables" -mi_send_resuming_command "exec-continue" "only: invalid: continue" -mi_expect_stop "breakpoint-hit" .* {{name="inv@entry",value=""}} .* .* {.* disp="keep"} "only: invalid: stop" -mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="inv@entry",arg="1",value=""}\]} "only: invalid: -stack-list-variables" - -if {[mi_runto_main] == -1} { - return -1 + +with_test_prefix "preferred" { + if {[mi_runto_main] == -1} { + return -1 + } + mi_gdb_test "-gdb-set print entry-values preferred" {\^done} \ + "set print entry-values" + + with_test_prefix "entry_equal" { + mi_send_resuming_command "exec-continue" "continue" + mi_expect_stop "breakpoint-hit" .* \ + {{name="val@entry",value="5"}} .* .* {.* disp="keep"} "stop" + mi_gdb_test "-stack-list-variables --all-values" \ + {\^done,variables=\[{name="val@entry",arg="1",value="5"}\]} \ + "-stack-list-variables" + } + + with_test_prefix "entry_different" { + mi_send_resuming_command "exec-continue" "continue" + mi_expect_stop "breakpoint-hit" .* {{name="val@entry",value="5"}} \ + .* .* {.* disp="keep"} "stop" + mi_gdb_test "-stack-list-variables --all-values" \ + {\^done,variables=\[{name="val@entry",arg="1",value="5"}\]} \ + "-stack-list-variables" + } + + with_test_prefix "validity" { + mi_send_resuming_command "exec-continue" "continue" + mi_expect_stop "breakpoint-hit" .* \ + {{name="lost@entry",value="5"},{name="born",value="10"}} .* .* \ + {.* disp="keep"} "stop" + mi_gdb_test "-stack-list-variables --all-values" \ + {\^done,variables=\[{name="lost@entry",arg="1",value="5"},{name="born",arg="1",value="10"}\]} \ + "-stack-list-variables" + } + + with_test_prefix "invalid" { + mi_send_resuming_command "exec-continue" "continue" + mi_expect_stop "breakpoint-hit" .* \ + {{name="inv@entry",value=""}} .* .* \ + {.* disp="keep"} "stop" + mi_gdb_test "-stack-list-variables --all-values" \ + {\^done,variables=\[{name="inv@entry",arg="1",value=""}\]} \ + "-stack-list-variables" + } } -mi_gdb_test "-gdb-set print entry-values preferred" {\^done} "preferred: set print entry-values" -mi_send_resuming_command "exec-continue" "preferred: entry_equal: continue" -mi_expect_stop "breakpoint-hit" .* {{name="val@entry",value="5"}} .* .* {.* disp="keep"} "preferred: entry_equal: stop" -mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="val@entry",arg="1",value="5"}\]} "preferred: entry_equal: -stack-list-variables" -mi_send_resuming_command "exec-continue" "preferred: entry_different: continue" -mi_expect_stop "breakpoint-hit" .* {{name="val@entry",value="5"}} .* .* {.* disp="keep"} "preferred: entry_different: stop" -mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="val@entry",arg="1",value="5"}\]} "preferred: entry_different: -stack-list-variables" -mi_send_resuming_command "exec-continue" "preferred: validity: continue" -mi_expect_stop "breakpoint-hit" .* {{name="lost@entry",value="5"},{name="born",value="10"}} .* .* {.* disp="keep"} "preferred: validity: stop" -mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="lost@entry",arg="1",value="5"},{name="born",arg="1",value="10"}\]} "preferred: validity: -stack-list-variables" -mi_send_resuming_command "exec-continue" "preferred: invalid: continue" -mi_expect_stop "breakpoint-hit" .* {{name="inv@entry",value=""}} .* .* {.* disp="keep"} "preferred: invalid: stop" -mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="inv@entry",arg="1",value=""}\]} "preferred: invalid: -stack-list-variables" - -if {[mi_runto_main] == -1} { - return -1 + +with_test_prefix "if-needed" { + if {[mi_runto_main] == -1} { + return -1 + } + mi_gdb_test "-gdb-set print entry-values if-needed" {\^done} \ + "set print entry-values" + + with_test_prefix "entry_equal" { + mi_send_resuming_command "exec-continue" "continue" + mi_expect_stop "breakpoint-hit" .* {{name="val",value="5"}} .* .* \ + {.* disp="keep"} "stop" + mi_gdb_test "-stack-list-variables --all-values" \ + {\^done,variables=\[{name="val",arg="1",value="5"}\]} \ + "-stack-list-variables" + } + + with_test_prefix "entry_different" { + mi_send_resuming_command "exec-continue" "continue" + mi_expect_stop "breakpoint-hit" .* {{name="val",value="6"}} .* .* \ + {.* disp="keep"} "stop" + mi_gdb_test "-stack-list-variables --all-values" \ + {\^done,variables=\[{name="val",arg="1",value="6"}\]} \ + "-stack-list-variables" + } + + with_test_prefix "validity" { + mi_send_resuming_command "exec-continue" "continue" + mi_expect_stop "breakpoint-hit" .* \ + {{name="lost@entry",value="5"},{name="born",value="10"}} .* .* \ + {.* disp="keep"} "stop" + mi_gdb_test "-stack-list-variables --all-values" \ + {\^done,variables=\[{name="lost@entry",arg="1",value="5"},{name="born",arg="1",value="10"}\]} \ + "-stack-list-variables" + } + + with_test_prefix "invalid" { + mi_send_resuming_command "exec-continue" "continue" + mi_expect_stop "breakpoint-hit" .* \ + {{name="inv",value=""}} .* .* {.* disp="keep"} \ + "stop" + mi_gdb_test "-stack-list-variables --all-values" \ + {\^done,variables=\[{name="inv",arg="1",value=""}\]} \ + "-stack-list-variables" + } } -mi_gdb_test "-gdb-set print entry-values if-needed" {\^done} "if-needed: set print entry-values" -mi_send_resuming_command "exec-continue" "if-needed: entry_equal: continue" -mi_expect_stop "breakpoint-hit" .* {{name="val",value="5"}} .* .* {.* disp="keep"} "if-needed: entry_equal: stop" -mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="val",arg="1",value="5"}\]} "if-needed: entry_equal: -stack-list-variables" -mi_send_resuming_command "exec-continue" "if-needed: entry_different: continue" -mi_expect_stop "breakpoint-hit" .* {{name="val",value="6"}} .* .* {.* disp="keep"} "if-needed: entry_different: stop" -mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="val",arg="1",value="6"}\]} "if-needed: entry_different: -stack-list-variables" -mi_send_resuming_command "exec-continue" "if-needed: validity: continue" -mi_expect_stop "breakpoint-hit" .* {{name="lost@entry",value="5"},{name="born",value="10"}} .* .* {.* disp="keep"} "if-needed: validity: stop" -mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="lost@entry",arg="1",value="5"},{name="born",arg="1",value="10"}\]} "if-needed: validity: -stack-list-variables" -mi_send_resuming_command "exec-continue" "if-needed: invalid: continue" -mi_expect_stop "breakpoint-hit" .* {{name="inv",value=""}} .* .* {.* disp="keep"} "if-needed: invalid: stop" -mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="inv",arg="1",value=""}\]} "if-needed: invalid: -stack-list-variables" - -if {[mi_runto_main] == -1} { - return -1 + +with_test_prefix "both" { + if {[mi_runto_main] == -1} { + return -1 + } + mi_gdb_test "-gdb-set print entry-values both" {\^done} \ + "set print entry-values" + + with_test_prefix "entry_equal" { + mi_send_resuming_command "exec-continue" "continue" + mi_expect_stop "breakpoint-hit" .* \ + {{name="val",value="5"},{name="val@entry",value="5"}} .* .* \ + {.* disp="keep"} "stop" + mi_gdb_test "-stack-list-variables --all-values" \ + {\^done,variables=\[{name="val",arg="1",value="5"},{name="val@entry",arg="1",value="5"}\]} \ + "-stack-list-variables" + } + + with_test_prefix "entry_different" { + mi_send_resuming_command "exec-continue" "continue" + mi_expect_stop "breakpoint-hit" .* \ + {{name="val",value="6"},{name="val@entry",value="5"}} .* .* \ + {.* disp="keep"} "stop" + mi_gdb_test "-stack-list-variables --all-values" \ + {\^done,variables=\[{name="val",arg="1",value="6"},{name="val@entry",arg="1",value="5"}\]} \ + "-stack-list-variables" + } + + with_test_prefix "validity" { + mi_send_resuming_command "exec-continue" "continue" + mi_expect_stop "breakpoint-hit" .* \ + {{name="lost",value=""},{name="lost@entry",value="5"},{name="born",value="10"},{name="born@entry",value=""}} \ + .* .* {.* disp="keep"} "stop" + mi_gdb_test "-stack-list-variables --all-values" \ + {\^done,variables=\[{name="lost",arg="1",value=""},{name="lost@entry",arg="1",value="5"},{name="born",arg="1",value="10"},{name="born@entry",arg="1",value=""}\]} \ + "-stack-list-variables" + } + + with_test_prefix "invalid" { + mi_send_resuming_command "exec-continue" "continue" + mi_expect_stop "breakpoint-hit" .* \ + {{name="inv",value=""},{name="inv@entry",value=""}} \ + .* .* {.* disp="keep"} "stop" + mi_gdb_test "-stack-list-variables --all-values" \ + {\^done,variables=\[{name="inv",arg="1",value=""},{name="inv@entry",arg="1",value=""}\]} \ + "-stack-list-variables" + } } -mi_gdb_test "-gdb-set print entry-values both" {\^done} "both: set print entry-values" -mi_send_resuming_command "exec-continue" "both: entry_equal: continue" -mi_expect_stop "breakpoint-hit" .* {{name="val",value="5"},{name="val@entry",value="5"}} .* .* {.* disp="keep"} "both: entry_equal: stop" -mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="val",arg="1",value="5"},{name="val@entry",arg="1",value="5"}\]} "both: entry_equal: -stack-list-variables" -mi_send_resuming_command "exec-continue" "both: entry_different: continue" -mi_expect_stop "breakpoint-hit" .* {{name="val",value="6"},{name="val@entry",value="5"}} .* .* {.* disp="keep"} "both: entry_different: stop" -mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="val",arg="1",value="6"},{name="val@entry",arg="1",value="5"}\]} "both: entry_different: -stack-list-variables" -mi_send_resuming_command "exec-continue" "both: validity: continue" -mi_expect_stop "breakpoint-hit" .* {{name="lost",value=""},{name="lost@entry",value="5"},{name="born",value="10"},{name="born@entry",value=""}} .* .* {.* disp="keep"} "both: validity: stop" -mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="lost",arg="1",value=""},{name="lost@entry",arg="1",value="5"},{name="born",arg="1",value="10"},{name="born@entry",arg="1",value=""}\]} "both: validity: -stack-list-variables" -mi_send_resuming_command "exec-continue" "both: invalid: continue" -mi_expect_stop "breakpoint-hit" .* {{name="inv",value=""},{name="inv@entry",value=""}} .* .* {.* disp="keep"} "both: invalid: stop" -mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="inv",arg="1",value=""},{name="inv@entry",arg="1",value=""}\]} "both: invalid: -stack-list-variables" - -if {[mi_runto_main] == -1} { - return -1 + +with_test_prefix "compact" { + if {[mi_runto_main] == -1} { + return -1 + } + mi_gdb_test "-gdb-set print entry-values compact" {\^done} \ + "set print entry-values" + + with_test_prefix "entry_equal" { + mi_send_resuming_command "exec-continue" "continue" + mi_expect_stop "breakpoint-hit" .* \ + {{name="val",value="5"},{name="val@entry",value="5"}} .* .* \ + {.* disp="keep"} "stop" + mi_gdb_test "-stack-list-variables --all-values" \ + {\^done,variables=\[{name="val",arg="1",value="5"},{name="val@entry",arg="1",value="5"}\]} \ + "-stack-list-variables" + } + + with_test_prefix "entry_different" { + mi_send_resuming_command "exec-continue" "continue" + mi_expect_stop "breakpoint-hit" .* {{name="val",value="6"},{name="val@entry",value="5"}} \ + .* .* {.* disp="keep"} "stop" + mi_gdb_test "-stack-list-variables --all-values" \ + {\^done,variables=\[{name="val",arg="1",value="6"},{name="val@entry",arg="1",value="5"}\]} \ + "-stack-list-variables" + } + + with_test_prefix "validity" { + mi_send_resuming_command "exec-continue" "continue" + mi_expect_stop "breakpoint-hit" .* \ + {{name="lost@entry",value="5"},{name="born",value="10"}} \ + .* .* {.* disp="keep"} "stop" + mi_gdb_test "-stack-list-variables --all-values" \ + {\^done,variables=\[{name="lost@entry",arg="1",value="5"},{name="born",arg="1",value="10"}\]} \ + "-stack-list-variables" + } + + with_test_prefix "invalid" { + mi_send_resuming_command "exec-continue" "continue" + mi_expect_stop "breakpoint-hit" .* \ + {{name="inv",value=""}} .* .* {.* disp="keep"} \ + "stop" + mi_gdb_test "-stack-list-variables --all-values" \ + {\^done,variables=\[{name="inv",arg="1",value=""}\]} \ + "-stack-list-variables" + } } -mi_gdb_test "-gdb-set print entry-values compact" {\^done} "compact: set print entry-values" -mi_send_resuming_command "exec-continue" "compact: entry_equal: continue" -mi_expect_stop "breakpoint-hit" .* {{name="val",value="5"},{name="val@entry",value="5"}} .* .* {.* disp="keep"} "compact: entry_equal: stop" -mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="val",arg="1",value="5"},{name="val@entry",arg="1",value="5"}\]} "compact: entry_equal: -stack-list-variables" -mi_send_resuming_command "exec-continue" "compact: entry_different: continue" -mi_expect_stop "breakpoint-hit" .* {{name="val",value="6"},{name="val@entry",value="5"}} .* .* {.* disp="keep"} "compact: entry_different: stop" -mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="val",arg="1",value="6"},{name="val@entry",arg="1",value="5"}\]} "compact: entry_different: -stack-list-variables" -mi_send_resuming_command "exec-continue" "compact: validity: continue" -mi_expect_stop "breakpoint-hit" .* {{name="lost@entry",value="5"},{name="born",value="10"}} .* .* {.* disp="keep"} "compact: validity: stop" -mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="lost@entry",arg="1",value="5"},{name="born",arg="1",value="10"}\]} "compact: validity: -stack-list-variables" -mi_send_resuming_command "exec-continue" "compact: invalid: continue" -mi_expect_stop "breakpoint-hit" .* {{name="inv",value=""}} .* .* {.* disp="keep"} "compact: invalid: stop" -mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="inv",arg="1",value=""}\]} "compact: invalid: -stack-list-variables" - -if {[mi_runto_main] == -1} { - return -1 + +with_test_prefix "default" { + if {[mi_runto_main] == -1} { + return -1 + } + mi_gdb_test "-gdb-set print entry-values default" {\^done} \ + "set print entry-values" + + with_test_prefix "entry_equal" { + mi_send_resuming_command "exec-continue" "continue" + mi_expect_stop "breakpoint-hit" .* \ + {{name="val",value="5"},{name="val@entry",value="5"}} .* .* \ + {.* disp="keep"} "stop" + mi_gdb_test "-stack-list-variables --all-values" \ + {\^done,variables=\[{name="val",arg="1",value="5"},{name="val@entry",arg="1",value="5"}\]} \ + "-stack-list-variables" + } + + with_test_prefix "entry_different" { + mi_send_resuming_command "exec-continue" "continue" + mi_expect_stop "breakpoint-hit" .* \ + {{name="val",value="6"},{name="val@entry",value="5"}} .* .* \ + {.* disp="keep"} "stop" + mi_gdb_test "-stack-list-variables --all-values" \ + {\^done,variables=\[{name="val",arg="1",value="6"},{name="val@entry",arg="1",value="5"}\]} \ + "-stack-list-variables" + } + + with_test_prefix "validity" { + mi_send_resuming_command "exec-continue" "continue" + mi_expect_stop "breakpoint-hit" .* \ + {{name="lost",value=""},{name="lost@entry",value="5"},{name="born",value="10"}} \ + .* .* {.* disp="keep"} "stop" + mi_gdb_test "-stack-list-variables --all-values" \ + {\^done,variables=\[{name="lost",arg="1",value=""},{name="lost@entry",arg="1",value="5"},{name="born",arg="1",value="10"}\]} \ + "-stack-list-variables" + } + + with_test_prefix "invalid" { + mi_send_resuming_command "exec-continue" "continue" + mi_expect_stop "breakpoint-hit" .* \ + {{name="inv",value=""}} .* .* {.* disp="keep"} \ + "stop" + mi_gdb_test "-stack-list-variables --all-values" \ + {\^done,variables=\[{name="inv",arg="1",value=""}\]} \ + "-stack-list-variables" + } } -mi_gdb_test "-gdb-set print entry-values default" {\^done} "default: set print entry-values" -mi_send_resuming_command "exec-continue" "default: entry_equal: continue" -mi_expect_stop "breakpoint-hit" .* {{name="val",value="5"},{name="val@entry",value="5"}} .* .* {.* disp="keep"} "default: entry_equal: stop" -mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="val",arg="1",value="5"},{name="val@entry",arg="1",value="5"}\]} "default: entry_equal: -stack-list-variables" -mi_send_resuming_command "exec-continue" "default: entry_different: continue" -mi_expect_stop "breakpoint-hit" .* {{name="val",value="6"},{name="val@entry",value="5"}} .* .* {.* disp="keep"} "default: entry_different: stop" -mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="val",arg="1",value="6"},{name="val@entry",arg="1",value="5"}\]} "default: entry_different: -stack-list-variables" -mi_send_resuming_command "exec-continue" "default: validity: continue" -mi_expect_stop "breakpoint-hit" .* {{name="lost",value=""},{name="lost@entry",value="5"},{name="born",value="10"}} .* .* {.* disp="keep"} "default: validity: stop" -mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="lost",arg="1",value=""},{name="lost@entry",arg="1",value="5"},{name="born",arg="1",value="10"}\]} "default: validity: -stack-list-variables" -mi_send_resuming_command "exec-continue" "default: invalid: continue" -mi_expect_stop "breakpoint-hit" .* {{name="inv",value=""}} .* .* {.* disp="keep"} "default: invalid: stop" -mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="inv",arg="1",value=""}\]} "default: invalid: -stack-list-variables" -- 2.34.0