From: Lancelot SIX via Gdb-patches <gdb-patches@sourceware.org>
To: Pedro Alves <pedro@palves.net>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 11/12] gdb/testsuite: Remove duplicates from gdb.mi/mi2-amd64-entry-value.exp
Date: Fri, 17 Dec 2021 22:57:53 +0000 [thread overview]
Message-ID: <20211217225753.jgzdrnq5fwgtx2ln@Plymouth> (raw)
In-Reply-To: <757f0aed-decd-ab44-619a-2e0d6df59cf1@palves.net>
>
> 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 <lsix@lancelotsix.com>
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="<optimized out>"},{name="born",value="10"}} \
+ .* .* {.* disp="keep"} "stop"
+ mi_gdb_test "-stack-list-variables --all-values" \
+ {\^done,variables=\[{name="lost",arg="1",value="<optimized out>"},{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="<optimized out>"}} .* .* {.* disp="keep"} \
+ "stop"
+ mi_gdb_test "-stack-list-variables --all-values" \
+ {\^done,variables=\[{name="inv",arg="1",value="<optimized out>"}\]} \
+ "-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="<optimized out>"},{name="born",value="10"}} .* .* {.* disp="keep"} "no: validity: stop"
-mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="lost",arg="1",value="<optimized out>"},{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="<optimized out>"}} .* .* {.* disp="keep"} "no: invalid: stop"
-mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="inv",arg="1",value="<optimized out>"}\]} "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="<optimized out>"}} \
+ .* .* {.* 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="<optimized out>"}\]} \
+ "-stack-list-variables"
+ }
+
+ with_test_prefix "invalid" {
+ mi_send_resuming_command "exec-continue" "continue"
+ mi_expect_stop "breakpoint-hit" .* \
+ {{name="inv@entry",value="<optimized out>"}} \
+ .* .* {.* disp="keep"} "stop"
+ mi_gdb_test "-stack-list-variables --all-values" \
+ {\^done,variables=\[{name="inv@entry",arg="1",value="<optimized out>"}\]} \
+ "-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="<optimized out>"}} .* .* {.* 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="<optimized out>"}\]} "only: validity: -stack-list-variables"
-mi_send_resuming_command "exec-continue" "only: invalid: continue"
-mi_expect_stop "breakpoint-hit" .* {{name="inv@entry",value="<optimized out>"}} .* .* {.* disp="keep"} "only: invalid: stop"
-mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="inv@entry",arg="1",value="<optimized out>"}\]} "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="<optimized out>"}} .* .* \
+ {.* disp="keep"} "stop"
+ mi_gdb_test "-stack-list-variables --all-values" \
+ {\^done,variables=\[{name="inv@entry",arg="1",value="<optimized out>"}\]} \
+ "-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="<optimized out>"}} .* .* {.* disp="keep"} "preferred: invalid: stop"
-mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="inv@entry",arg="1",value="<optimized out>"}\]} "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="<optimized out>"}} .* .* {.* disp="keep"} \
+ "stop"
+ mi_gdb_test "-stack-list-variables --all-values" \
+ {\^done,variables=\[{name="inv",arg="1",value="<optimized out>"}\]} \
+ "-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="<optimized out>"}} .* .* {.* disp="keep"} "if-needed: invalid: stop"
-mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="inv",arg="1",value="<optimized out>"}\]} "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="<optimized out>"},{name="lost@entry",value="5"},{name="born",value="10"},{name="born@entry",value="<optimized out>"}} \
+ .* .* {.* disp="keep"} "stop"
+ mi_gdb_test "-stack-list-variables --all-values" \
+ {\^done,variables=\[{name="lost",arg="1",value="<optimized out>"},{name="lost@entry",arg="1",value="5"},{name="born",arg="1",value="10"},{name="born@entry",arg="1",value="<optimized out>"}\]} \
+ "-stack-list-variables"
+ }
+
+ with_test_prefix "invalid" {
+ mi_send_resuming_command "exec-continue" "continue"
+ mi_expect_stop "breakpoint-hit" .* \
+ {{name="inv",value="<optimized out>"},{name="inv@entry",value="<optimized out>"}} \
+ .* .* {.* disp="keep"} "stop"
+ mi_gdb_test "-stack-list-variables --all-values" \
+ {\^done,variables=\[{name="inv",arg="1",value="<optimized out>"},{name="inv@entry",arg="1",value="<optimized out>"}\]} \
+ "-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="<optimized out>"},{name="lost@entry",value="5"},{name="born",value="10"},{name="born@entry",value="<optimized out>"}} .* .* {.* disp="keep"} "both: validity: stop"
-mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="lost",arg="1",value="<optimized out>"},{name="lost@entry",arg="1",value="5"},{name="born",arg="1",value="10"},{name="born@entry",arg="1",value="<optimized out>"}\]} "both: validity: -stack-list-variables"
-mi_send_resuming_command "exec-continue" "both: invalid: continue"
-mi_expect_stop "breakpoint-hit" .* {{name="inv",value="<optimized out>"},{name="inv@entry",value="<optimized out>"}} .* .* {.* disp="keep"} "both: invalid: stop"
-mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="inv",arg="1",value="<optimized out>"},{name="inv@entry",arg="1",value="<optimized out>"}\]} "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="<optimized out>"}} .* .* {.* disp="keep"} \
+ "stop"
+ mi_gdb_test "-stack-list-variables --all-values" \
+ {\^done,variables=\[{name="inv",arg="1",value="<optimized out>"}\]} \
+ "-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="<optimized out>"}} .* .* {.* disp="keep"} "compact: invalid: stop"
-mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="inv",arg="1",value="<optimized out>"}\]} "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="<optimized out>"},{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="<optimized out>"},{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="<optimized out>"}} .* .* {.* disp="keep"} \
+ "stop"
+ mi_gdb_test "-stack-list-variables --all-values" \
+ {\^done,variables=\[{name="inv",arg="1",value="<optimized out>"}\]} \
+ "-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="<optimized out>"},{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="<optimized out>"},{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="<optimized out>"}} .* .* {.* disp="keep"} "default: invalid: stop"
-mi_gdb_test "-stack-list-variables --all-values" {\^done,variables=\[{name="inv",arg="1",value="<optimized out>"}\]} "default: invalid: -stack-list-variables"
--
2.34.0
next prev parent reply other threads:[~2021-12-17 22:58 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-26 23:00 [PATCH 00/12] Remove DUPLICATEs warnings Lancelot SIX via Gdb-patches
2021-11-26 23:00 ` [PATCH 01/12] gdb/testsuite: Remove duplicates from gdb.mi/mi-syn-frame.exp Lancelot SIX via Gdb-patches
2021-11-26 23:00 ` [PATCH 02/12] gdb/testsuite: Remove duplicates from gdb.mi/mi-nsthrexec.exp Lancelot SIX via Gdb-patches
2021-11-26 23:00 ` [PATCH 03/12] gdb/testsuite: Remove duplicates from gdb.mi/mi-watch.exp Lancelot SIX via Gdb-patches
2021-11-26 23:00 ` [PATCH 04/12] gdb/testsuite: Remove duplicates from gdb.mi/mi-catch-load.exp Lancelot SIX via Gdb-patches
2021-12-10 21:55 ` Pedro Alves
2021-12-16 23:27 ` Lancelot SIX via Gdb-patches
2021-12-17 12:21 ` Pedro Alves
2021-11-26 23:00 ` [PATCH 05/12] gdb/testsuite: Remove duplicates from gdb.mi/mi-var-child.exp Lancelot SIX via Gdb-patches
2021-12-10 21:55 ` Pedro Alves
2021-12-16 23:40 ` Lancelot SIX via Gdb-patches
2021-12-17 13:00 ` [PATCH] gdb/testsuite: Remove some duplication " Pedro Alves
2021-12-17 23:24 ` Lancelot SIX via Gdb-patches
2022-01-06 16:44 ` Pedro Alves
2021-11-26 23:00 ` [PATCH 06/12] gdb/testsuite: Remove duplicates from gdb.mi/mi2-var-child.exp Lancelot SIX via Gdb-patches
2021-11-26 23:00 ` [PATCH 07/12] gdb/testsuite: Remove duplicates from gdb.mi/mi-nonstop.exp Lancelot SIX via Gdb-patches
2021-11-26 23:00 ` [PATCH 08/12] gdb/testsuite: Remove duplicates from gdb.mi/mi-nonstop-exit.exp Lancelot SIX via Gdb-patches
2021-12-10 21:56 ` Pedro Alves
2021-12-16 23:48 ` Lancelot SIX via Gdb-patches
2021-12-17 13:52 ` Pedro Alves
2021-11-26 23:00 ` [PATCH 09/12] gdb/testsuite: Remove duplicates from gdb.mi/mi-var-rtti.exp Lancelot SIX via Gdb-patches
2021-11-26 23:00 ` [PATCH 10/12] gdb/testsuite: Remove duplicates from gdb.mi/mi-language.exp Lancelot SIX via Gdb-patches
2021-12-10 21:56 ` Pedro Alves
2021-12-16 23:59 ` Lancelot SIX via Gdb-patches
2021-12-17 13:53 ` Pedro Alves
2021-11-26 23:00 ` [PATCH 11/12] gdb/testsuite: Remove duplicates from gdb.mi/mi2-amd64-entry-value.exp Lancelot SIX via Gdb-patches
2021-12-10 21:56 ` Pedro Alves
2021-12-17 22:57 ` Lancelot SIX via Gdb-patches [this message]
2022-01-06 16:49 ` Pedro Alves
2021-11-26 23:00 ` [PATCH 12/12] gdb/testsuite: Remove duplicates from gdb.threads/staticthreads.ex Lancelot SIX via Gdb-patches
2021-12-09 18:15 ` [PATCH 00/12] Remove DUPLICATEs warnings Tom Tromey
2021-12-10 22:01 ` Pedro Alves
2022-01-07 22:43 ` Lancelot SIX via Gdb-patches
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211217225753.jgzdrnq5fwgtx2ln@Plymouth \
--to=gdb-patches@sourceware.org \
--cc=lsix@lancelotsix.com \
--cc=pedro@palves.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox