public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 00/29] Remove DUPLICATEs from testsuite/gdb.base/*.exp
@ 2021-11-21 17:56 Lancelot SIX
  2021-11-21 17:56 ` [PATCH 01/29] gdb/testsuite: Remove duplicates from gdb.base/stack-checking.exp Lancelot SIX
                   ` (30 more replies)
  0 siblings, 31 replies; 74+ messages in thread
From: Lancelot SIX @ 2021-11-21 17:56 UTC (permalink / raw)
  To: gdb-patches; +Cc: Lancelot SIX

Hi,

When running the tests in the gdb.base sub directory, I see many
DUPLICATE warnings:

	                === gdb Summary ==

	...
	# of duplicate test names       48

This patch series is meant to do some cleaning so actual errors stand
out more easily in the output.

All the fixes in this series are quite straight forward.  The majority
of duplications are fixed by adjusting the test names or giving
appropriate names to the test cases.  Some of the warnings actually
report redundant tests, in which case the extra test case is removed.

This series also fixes minor formatting issues in the test files when I
came across them (trailing white spaces, erroneous space/tab
indentation...).

After this series, I do not have duplicates anymore in the gdb.base
sub directory.

Tested on x86_64-linux.

All feedbacks are welcome.

Best,
Lancelot.

Lancelot SIX (29):
  gdb/testsuite: Remove duplicates from gdb.base/stack-checking.exp
  gdb/testsuite: Remove duplicates from gdb.base/miscexprs.exp
  gdb/testsuite: Remove duplicates from gdb.base/interp.exp
  gdb/testsuite: Remove duplicates from gdb.base/realname-expand.exp
  gdb/testsuite: Remove duplicates from gdb.base/pie-fork.exp
  gdb/testsuite: Remove duplicates from gdb.base/checkpoint.exp
  gdb/testsuite: Remove duplicates from gdb.base/pending.exp
  gdb/testsuite: Remove duplicates from gdb.base/decl-before-def.exp
  gdb/testsuite: Remove duplicates from gdb.base/solib-display.exp
  gdb/testsuite: Remove duplicates from gdb.base/del.exp
  gdb/testsuite: Remove duplicates from gdb.base/dfp-test.exp
  gdb/testsuite: Remove duplicates from gdb.base/ptype.exp
  gdb/testsuite: Remove duplicates from gdb.base/dfp-exprs.exp
  gdb/testsuite: Remove duplicates from gdb.base/subst.exp
  gdb/testsuite: Remove duplicates from gdb.base/complete-empty.exp
  gdb/testsuite: Remove duplicates from gdb.base/ui-redirect.exp
  gdb/testsuite: Remove duplicates from gdb.base/pretty-array.exp
  gdb/testsuite: Remove duplicates from gdb.base/readline.exp
  gdb/testsuite: Remove duplicates from gdb.base/exprs.exp
  gdb/testsuite: Remove duplicates from gdb.base/set-cfd.exp
  gdb/testsuite: Remove duplicates from gdb.base/shlib-call.exp
  gdb/testsuite: Remove duplicates from gdb.base/funcargs.exp
  gdb/testsuite: Remove duplicates from gdb.base/define-prefix.exp
  gdb/testsuite: Remove duplicates from gdb.base/unload.exp
  gdb/testsuite: Remove duplicates from gdb.base/pointers.exp
  gdb/testsuite: Remove duplicates from gdb.base/call-signal-resume.exp
  gdb/testsuite: Remove duplicates from gdb.base/nested-subp2.exp
  gdb/testsuite: Remove duplicates from gdb.base/watchpoints.exp
  gdb/testsuite: Remove duplicates from gdb.base/corefile-buildid.exp

 gdb/testsuite/gdb.base/call-signal-resume.exp |  7 ++---
 gdb/testsuite/gdb.base/checkpoint.exp         | 22 +++++++--------
 gdb/testsuite/gdb.base/complete-empty.exp     | 12 +++++++-
 gdb/testsuite/gdb.base/corefile-buildid.exp   |  2 +-
 gdb/testsuite/gdb.base/decl-before-def.exp    |  4 +--
 gdb/testsuite/gdb.base/define-prefix.exp      |  2 +-
 gdb/testsuite/gdb.base/del.exp                | 22 +++++++--------
 gdb/testsuite/gdb.base/dfp-exprs.exp          |  1 -
 gdb/testsuite/gdb.base/dfp-test.exp           | 20 ++++++-------
 gdb/testsuite/gdb.base/exprs.exp              |  4 ++-
 gdb/testsuite/gdb.base/funcargs.exp           |  2 +-
 gdb/testsuite/gdb.base/interp.exp             |  4 +--
 gdb/testsuite/gdb.base/miscexprs.exp          |  4 +--
 gdb/testsuite/gdb.base/nested-subp2.exp       | 28 ++++++++++---------
 gdb/testsuite/gdb.base/pending.exp            |  4 +--
 gdb/testsuite/gdb.base/pie-fork.exp           |  6 ++--
 gdb/testsuite/gdb.base/pointers.exp           |  4 +--
 gdb/testsuite/gdb.base/pretty-array.exp       |  6 ++--
 gdb/testsuite/gdb.base/ptype.exp              |  6 ++--
 gdb/testsuite/gdb.base/readline.exp           |  2 +-
 gdb/testsuite/gdb.base/realname-expand.exp    | 12 ++++----
 gdb/testsuite/gdb.base/set-cwd.exp            | 22 +++++++--------
 gdb/testsuite/gdb.base/shlib-call.exp         | 13 +++++----
 gdb/testsuite/gdb.base/solib-display.exp      |  6 ++--
 gdb/testsuite/gdb.base/stack-checking.exp     |  6 ++--
 gdb/testsuite/gdb.base/subst.exp              |  2 +-
 gdb/testsuite/gdb.base/ui-redirect.exp        |  2 +-
 gdb/testsuite/gdb.base/unload.exp             |  2 +-
 gdb/testsuite/gdb.base/watchpoints.exp        |  4 +--
 29 files changed, 126 insertions(+), 105 deletions(-)

-- 
2.33.1


^ permalink raw reply	[flat|nested] 74+ messages in thread

* [PATCH 01/29] gdb/testsuite: Remove duplicates from gdb.base/stack-checking.exp
  2021-11-21 17:56 [PATCH 00/29] Remove DUPLICATEs from testsuite/gdb.base/*.exp Lancelot SIX
@ 2021-11-21 17:56 ` Lancelot SIX
  2022-01-04 13:59   ` Andrew Burgess
  2021-11-21 17:56 ` [PATCH 02/29] gdb/testsuite: Remove duplicates from gdb.base/miscexprs.exp Lancelot SIX
                   ` (29 subsequent siblings)
  30 siblings, 1 reply; 74+ messages in thread
From: Lancelot SIX @ 2021-11-21 17:56 UTC (permalink / raw)
  To: gdb-patches; +Cc: Lancelot SIX

When running the testsuite I have:

    Running .../gdb/testsuite/gdb.base/stack-checking.exp ...
    DUPLICATE: gdb.base/stack-checking.exp: bt
    DUPLICATE: gdb.base/stack-checking.exp: bt

Fix by using with_test_prefix.

Tested on x86_64-linux.
---
 gdb/testsuite/gdb.base/stack-checking.exp | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/gdb/testsuite/gdb.base/stack-checking.exp b/gdb/testsuite/gdb.base/stack-checking.exp
index ca66617009f..634e4be2e6b 100644
--- a/gdb/testsuite/gdb.base/stack-checking.exp
+++ b/gdb/testsuite/gdb.base/stack-checking.exp
@@ -31,8 +31,10 @@ if ![runto_main] then {
 # Test that the debugger is able to unwind to "main" at the next breakpoint
 # hit. The frame number of "main" should be passed into MAIN_FRAME_NUMBER."
 proc backtrace_test {name main_frame_number} {
-    gdb_continue_to_breakpoint "breakpoint for $name"
-    gdb_test "bt" "#${main_frame_number}.*in main ().*"
+    with_test_prefix $name {
+	gdb_continue_to_breakpoint "breakpoint for $name"
+	gdb_test "bt" "#${main_frame_number}.*in main ().*"
+    }
 }
 
 gdb_breakpoint [gdb_get_line_number "set breakpoint here"]
-- 
2.33.1


^ permalink raw reply	[flat|nested] 74+ messages in thread

* [PATCH 02/29] gdb/testsuite: Remove duplicates from gdb.base/miscexprs.exp
  2021-11-21 17:56 [PATCH 00/29] Remove DUPLICATEs from testsuite/gdb.base/*.exp Lancelot SIX
  2021-11-21 17:56 ` [PATCH 01/29] gdb/testsuite: Remove duplicates from gdb.base/stack-checking.exp Lancelot SIX
@ 2021-11-21 17:56 ` Lancelot SIX
  2021-12-10 22:06   ` Pedro Alves
  2022-01-04 14:00   ` Andrew Burgess
  2021-11-21 17:56 ` [PATCH 03/29] gdb/testsuite: Remove duplicates from gdb.base/interp.exp Lancelot SIX
                   ` (28 subsequent siblings)
  30 siblings, 2 replies; 74+ messages in thread
From: Lancelot SIX @ 2021-11-21 17:56 UTC (permalink / raw)
  To: gdb-patches; +Cc: Lancelot SIX

When running the testsuite I see:

    Running .../gdb/testsuite/gdb.base/miscexprs.exp ...
    DUPLICATE: gdb.base/miscexprs.exp: print value of !ibig.i[100]
    DUPLICATE: gdb.base/miscexprs.exp: print value of !ibig.i[100]

Fix the name of some misnamed tests.

Tested on x86_64.
---
 gdb/testsuite/gdb.base/miscexprs.exp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gdb/testsuite/gdb.base/miscexprs.exp b/gdb/testsuite/gdb.base/miscexprs.exp
index 86f41215283..c1fc7420545 100644
--- a/gdb/testsuite/gdb.base/miscexprs.exp
+++ b/gdb/testsuite/gdb.base/miscexprs.exp
@@ -118,10 +118,10 @@ gdb_test "print !sbig.s\[90\]" " = $false" \
     "print value of !sbig.s\[90\]"
 
 gdb_test "print !fbig.f\[100\]" " = $false" \
-    "print value of !ibig.i\[100\]"
+    "print value of !fbig.f\[100\]"
 
 gdb_test "print !dbig.d\[202\]" " = $false" \
-    "print value of !ibig.i\[100\]"
+    "print value of !dbig.d\[202\]"
 
 gdb_test "print sbig.s\[90\] * 10" " = 2550" \
     "print value of !sbig.s\[90\] * 10"
-- 
2.33.1


^ permalink raw reply	[flat|nested] 74+ messages in thread

* [PATCH 03/29] gdb/testsuite: Remove duplicates from gdb.base/interp.exp
  2021-11-21 17:56 [PATCH 00/29] Remove DUPLICATEs from testsuite/gdb.base/*.exp Lancelot SIX
  2021-11-21 17:56 ` [PATCH 01/29] gdb/testsuite: Remove duplicates from gdb.base/stack-checking.exp Lancelot SIX
  2021-11-21 17:56 ` [PATCH 02/29] gdb/testsuite: Remove duplicates from gdb.base/miscexprs.exp Lancelot SIX
@ 2021-11-21 17:56 ` Lancelot SIX
  2021-11-22 14:13   ` Pedro Alves
  2021-11-21 17:56 ` [PATCH 04/29] gdb/testsuite: Remove duplicates from gdb.base/realname-expand.exp Lancelot SIX
                   ` (27 subsequent siblings)
  30 siblings, 1 reply; 74+ messages in thread
From: Lancelot SIX @ 2021-11-21 17:56 UTC (permalink / raw)
  To: gdb-patches; +Cc: Lancelot SIX

When running the testsuite I have:

    Running .../gdb/testsuite/gdb.base/interp.exp ...
    DUPLICATE: gdb.base/interp.exp: interpreter-exec mi "-var-update *"

This is due to the fact that two successive instances of
gdb_test_multiple use 'pass $cmd', but the second test forgets to reset
$cmd.

Fix by updating the value of cmd where appropriate.

Tested on x86_64-linux.
---
 gdb/testsuite/gdb.base/interp.exp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gdb/testsuite/gdb.base/interp.exp b/gdb/testsuite/gdb.base/interp.exp
index fc95ee113c2..3d28232c522 100644
--- a/gdb/testsuite/gdb.base/interp.exp
+++ b/gdb/testsuite/gdb.base/interp.exp
@@ -34,8 +34,8 @@ gdb_test_multiple $cmd $cmd {
 gdb_test "interpreter-exec console \"show version\"" "GNU gdb .*"
 
 # Regression test for crash when an exception occurs in mi_parse.
-gdb_test_multiple "interpreter-exec mi \"-break-insert --thread a\"" \
-    "regression test for mi_parse crash" {
+set cmd "interpreter-exec mi \"-break-insert --thread a\""
+gdb_test_multiple $cmd "regression test for mi_parse crash" {
 	-re ".error,msg=.Invalid value for the '--thread' option.\r\n$gdb_prompt " {
 	    pass "$cmd"
 	    gdb_expect 1 {
-- 
2.33.1


^ permalink raw reply	[flat|nested] 74+ messages in thread

* [PATCH 04/29] gdb/testsuite: Remove duplicates from gdb.base/realname-expand.exp
  2021-11-21 17:56 [PATCH 00/29] Remove DUPLICATEs from testsuite/gdb.base/*.exp Lancelot SIX
                   ` (2 preceding siblings ...)
  2021-11-21 17:56 ` [PATCH 03/29] gdb/testsuite: Remove duplicates from gdb.base/interp.exp Lancelot SIX
@ 2021-11-21 17:56 ` Lancelot SIX
  2022-01-04 14:06   ` Andrew Burgess
  2021-11-21 17:56 ` [PATCH 05/29] gdb/testsuite: Remove duplicates from gdb.base/pie-fork.exp Lancelot SIX
                   ` (26 subsequent siblings)
  30 siblings, 1 reply; 74+ messages in thread
From: Lancelot SIX @ 2021-11-21 17:56 UTC (permalink / raw)
  To: gdb-patches; +Cc: Lancelot SIX

When running the testsuite, I have:

    Running .../gdb/testsuite/gdb.base/realname-expand.exp ...
    DUPLICATE: gdb.base/realname-expand.exp: set basenames-may-differ on

This is due to the fact that the test restarts GDB twice and each time
sets the basenames-may-differ setting.  This patch proposes to fix this
by not restarting GDB so the setting is maintained.  It just clears the
breakpoints between the two tests and updates the breakpoints number as
required.

This patch also perform some minor refactorings to improve visibility.

Tested on x86_64-linux.
---
 gdb/testsuite/gdb.base/realname-expand.exp | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/gdb/testsuite/gdb.base/realname-expand.exp b/gdb/testsuite/gdb.base/realname-expand.exp
index ffe2f85e812..80bc4e0ab22 100644
--- a/gdb/testsuite/gdb.base/realname-expand.exp
+++ b/gdb/testsuite/gdb.base/realname-expand.exp
@@ -40,10 +40,12 @@ clean_restart ${testfile}
 
 gdb_test_no_output "set basenames-may-differ on"
 
-gdb_test "rbreak realname-expand-real.c:func" "^rbreak realname-expand-real.c:func\r\nBreakpoint 1 at 0x\[0-9a-f\]+: file \[^\r\n\]*/realname-expand-link\\.c, line \[0-9\]+\\.\r\nvoid func\\(void\\);"
+gdb_test "rbreak realname-expand-real.c:func" \
+    [multi_line "" \
+		"Breakpoint 1 at $hex: file \[^\r\n\]*/realname-expand-link\\.c, line $decimal\\." \
+		"void func\\(void\\);"]
 
-clean_restart ${testfile}
-
-gdb_test_no_output "set basenames-may-differ on"
+delete_breakpoints
 
-gdb_test "break realname-expand-real.c:func" "^break realname-expand-real.c:func\r\nBreakpoint 1 at 0x\[0-9a-f\]+: file \[^\r\n\]*/realname-expand-link\\.c, line \[0-9\]+\\."
+gdb_test "break realname-expand-real.c:func" \
+    "\r\nBreakpoint 2 at $hex: file \[^\r\n\]*/realname-expand-link\\.c, line $decimal\\."
-- 
2.33.1


^ permalink raw reply	[flat|nested] 74+ messages in thread

* [PATCH 05/29] gdb/testsuite: Remove duplicates from gdb.base/pie-fork.exp
  2021-11-21 17:56 [PATCH 00/29] Remove DUPLICATEs from testsuite/gdb.base/*.exp Lancelot SIX
                   ` (3 preceding siblings ...)
  2021-11-21 17:56 ` [PATCH 04/29] gdb/testsuite: Remove duplicates from gdb.base/realname-expand.exp Lancelot SIX
@ 2021-11-21 17:56 ` Lancelot SIX
  2022-01-04 14:07   ` Andrew Burgess
  2021-11-21 17:56 ` [PATCH 06/29] gdb/testsuite: Remove duplicates from gdb.base/checkpoint.exp Lancelot SIX
                   ` (25 subsequent siblings)
  30 siblings, 1 reply; 74+ messages in thread
From: Lancelot SIX @ 2021-11-21 17:56 UTC (permalink / raw)
  To: gdb-patches; +Cc: Lancelot SIX

When running the testsuite, I have:

    Running .../gdb/testsuite/gdb.base/pie-fork.exp ...
    DUPLICATE: gdb.base/pie-fork.exp: test_no_detach_on_fork: continue

Fix by giving explicit names to the 'continue' commands that cause the
duplicate message.

Tested on x86_64-linux.
---
 gdb/testsuite/gdb.base/pie-fork.exp | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/gdb/testsuite/gdb.base/pie-fork.exp b/gdb/testsuite/gdb.base/pie-fork.exp
index 2bbdaa48be9..0910da18b42 100644
--- a/gdb/testsuite/gdb.base/pie-fork.exp
+++ b/gdb/testsuite/gdb.base/pie-fork.exp
@@ -54,9 +54,11 @@ proc_with_prefix test_detach_on_fork_follow_child {} {
 proc_with_prefix test_no_detach_on_fork {} {
     setup_test "off"
 
-    gdb_test "continue" "\r\nThread 1.1 .* hit Breakpoint 2, break_here.*"
+    gdb_test "continue" "\r\nThread 1.1 .* hit Breakpoint 2, break_here.*" \
+	     "continue from thread 1.1"
     gdb_test "thread 2.1"
-    gdb_test "continue" "\r\nThread 2.1 .* hit Breakpoint 2, break_here.*"
+    gdb_test "continue" "\r\nThread 2.1 .* hit Breakpoint 2, break_here.*" \
+	     "continue from thread 2.1"
 }
 
 test_detach_on_fork_follow_parent
-- 
2.33.1


^ permalink raw reply	[flat|nested] 74+ messages in thread

* [PATCH 06/29] gdb/testsuite: Remove duplicates from gdb.base/checkpoint.exp
  2021-11-21 17:56 [PATCH 00/29] Remove DUPLICATEs from testsuite/gdb.base/*.exp Lancelot SIX
                   ` (4 preceding siblings ...)
  2021-11-21 17:56 ` [PATCH 05/29] gdb/testsuite: Remove duplicates from gdb.base/pie-fork.exp Lancelot SIX
@ 2021-11-21 17:56 ` Lancelot SIX
  2022-01-04 14:11   ` Andrew Burgess
  2021-11-21 17:56 ` [PATCH 07/29] gdb/testsuite: Remove duplicates from gdb.base/pending.exp Lancelot SIX
                   ` (24 subsequent siblings)
  30 siblings, 1 reply; 74+ messages in thread
From: Lancelot SIX @ 2021-11-21 17:56 UTC (permalink / raw)
  To: gdb-patches; +Cc: Lancelot SIX

When running the testsuite, I have:

    Running .../gdb/testsuite/gdb.base/checkpoint.exp ...
    DUPLICATE: gdb.base/checkpoint.exp: verify lines 5 two
    DUPLICATE: gdb.base/checkpoint.exp: restart 0 one

This patch fixes the various erroneous incorrect test names.

While at it, this patch also remove some trailing white spaces across
the file.

Tested on x86_64-linux.
---
 gdb/testsuite/gdb.base/checkpoint.exp | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/gdb/testsuite/gdb.base/checkpoint.exp b/gdb/testsuite/gdb.base/checkpoint.exp
index 46042a9f345..6a1ec22aee3 100644
--- a/gdb/testsuite/gdb.base/checkpoint.exp
+++ b/gdb/testsuite/gdb.base/checkpoint.exp
@@ -65,7 +65,7 @@ gdb_test "checkpoint" ".*" ""
 gdb_test "continue 10" "breakpoint 1.*" "break1 three"
 
 gdb_test "checkpoint" ".*" ""
-gdb_test "continue 10" "breakpoint 1.*" "break1 four" 
+gdb_test "continue 10" "breakpoint 1.*" "break1 four"
 
 gdb_test "checkpoint" ".*" ""
 gdb_test "continue 10" "breakpoint 1.*" "break1 five"
@@ -146,7 +146,7 @@ gdb_test "print i + 1 == lines * 79" " = 1" "verify i 10 one"
 gdb_test "print lines" " = 91.*" "verify lines 10 one"
 
 #
-# Now let the files be closed by the original process, 
+# Now let the files be closed by the original process,
 # and diff them.
 
 gdb_test "restart 0" "Switching to .*breakpoint 2.*" "restart 0 one"
@@ -158,7 +158,7 @@ gdb_test "shell diff -s $pi_txt $copy1_txt" \
     "diff input and output one"
 
 #
-# And now run from various checkpoints, allowing 
+# And now run from various checkpoints, allowing
 # various amounts of input and output.
 #
 
@@ -198,7 +198,7 @@ gdb_test "restart 6" "Switching to .*c == EOF.*" "restart 6 two"
 gdb_test "continue" ".*" ""
 gdb_test "continue 1000" "breakpoint 1.*" "breakpoint 1 6 one"
 gdb_test "step" "if .c == EOF.*" "step in 6 two"
-gdb_test "print lines" " = 1052.*" "verify lines 5 two"
+gdb_test "print lines" " = 1052.*" "verify lines 6 two"
 
 gdb_test "restart 7" "Switching to .*c == EOF.*" "restart 7 two"
 gdb_test "continue" ".*" ""
@@ -210,12 +210,12 @@ gdb_test "shell diff -s $pi_txt $copy1_txt" \
     "Files .*pi.txt and .*copy1.txt are identical.*" \
     "diff input and output two"
 
-# 
-# OK, now allow the original program to delete the output file, 
+#
+# OK, now allow the original program to delete the output file,
 # and verify that the checkpoints can still write to it.
-# 
+#
 
-gdb_test "restart 0" "Switching to .*breakpoint 3.*" "restart 0 one"
+gdb_test "restart 0" "Switching to .*breakpoint 3.*" "restart 0 two"
 gdb_breakpoint $break4_loc
 gdb_test "continue" "breakpoint 4.*" "break4 one"
 
@@ -259,7 +259,7 @@ gdb_test "continue" \
 
 #
 # There should be still at least five forks left
-# 
+#
 
 gdb_test "info checkpoints" " 1 .* 2 .* 3 .* 4 .* 5 .*" \
     "info checkpoints two"
@@ -271,7 +271,7 @@ gdb_test "info checkpoints" " 1 .* 2 .* 3 .* 4 .* 5 .*" \
 gdb_test "kill" "" "kill all one" \
     "Kill the program being debugged.*y or n. $" "y"
 
-# 
+#
 # and confirm that all are gone
 #
 
@@ -324,7 +324,7 @@ gdb_test_multiple "info checkpoints" $msg {
 	    fail $msg
 	}
     }
-}    
+}
 
 #
 # OK, kill 'em all...
-- 
2.33.1


^ permalink raw reply	[flat|nested] 74+ messages in thread

* [PATCH 07/29] gdb/testsuite: Remove duplicates from gdb.base/pending.exp
  2021-11-21 17:56 [PATCH 00/29] Remove DUPLICATEs from testsuite/gdb.base/*.exp Lancelot SIX
                   ` (5 preceding siblings ...)
  2021-11-21 17:56 ` [PATCH 06/29] gdb/testsuite: Remove duplicates from gdb.base/checkpoint.exp Lancelot SIX
@ 2021-11-21 17:56 ` Lancelot SIX
  2022-01-04 14:12   ` Andrew Burgess
  2021-11-21 17:56 ` [PATCH 08/29] gdb/testsuite: Remove duplicates from gdb.base/decl-before-def.exp Lancelot SIX
                   ` (23 subsequent siblings)
  30 siblings, 1 reply; 74+ messages in thread
From: Lancelot SIX @ 2021-11-21 17:56 UTC (permalink / raw)
  To: gdb-patches; +Cc: Lancelot SIX

When running the testsuite, I have:

    Running .../gdb/testsuite/gdb.base/pending.exp ...
    DUPLICATE: gdb.base/pending.exp: disable other breakpoints

Fix by adjusting the test names.

Tested on x86_64-linux.
---
 gdb/testsuite/gdb.base/pending.exp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gdb/testsuite/gdb.base/pending.exp b/gdb/testsuite/gdb.base/pending.exp
index cf3496492f6..8d1c2dce6e3 100644
--- a/gdb/testsuite/gdb.base/pending.exp
+++ b/gdb/testsuite/gdb.base/pending.exp
@@ -244,8 +244,8 @@ gdb_test "continue" \
 # be 3 then.
 #
 
-gdb_test "disable 7" "" "disable other breakpoints"
-gdb_test "disable 5" "" "disable other breakpoints"
+gdb_test "disable 7" "" "disable breakpoint 7"
+gdb_test "disable 5" "" "disable breakpoint 5"
 
 gdb_test "continue" \
 	 ".*Breakpoint.*pendfunc1.*\\\(x=3\\\) at.*pendshr.c:$bp3_loc.*printf.*;" \
-- 
2.33.1


^ permalink raw reply	[flat|nested] 74+ messages in thread

* [PATCH 08/29] gdb/testsuite: Remove duplicates from gdb.base/decl-before-def.exp
  2021-11-21 17:56 [PATCH 00/29] Remove DUPLICATEs from testsuite/gdb.base/*.exp Lancelot SIX
                   ` (6 preceding siblings ...)
  2021-11-21 17:56 ` [PATCH 07/29] gdb/testsuite: Remove duplicates from gdb.base/pending.exp Lancelot SIX
@ 2021-11-21 17:56 ` Lancelot SIX
  2022-01-04 14:13   ` Andrew Burgess
  2021-11-21 17:56 ` [PATCH 09/29] gdb/testsuite: Remove duplicates from gdb.base/solib-display.exp Lancelot SIX
                   ` (22 subsequent siblings)
  30 siblings, 1 reply; 74+ messages in thread
From: Lancelot SIX @ 2021-11-21 17:56 UTC (permalink / raw)
  To: gdb-patches; +Cc: Lancelot SIX

When running the testsuite, I have:

    Running .../gdb/testsuite/gdb.base/decl-before-def.exp ...
    DUPLICATE: gdb.base/decl-before-def.exp: p a

Fix by giving explicit names to the two tests that use the same command.

Tested on x86_64-linux.
---
 gdb/testsuite/gdb.base/decl-before-def.exp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gdb/testsuite/gdb.base/decl-before-def.exp b/gdb/testsuite/gdb.base/decl-before-def.exp
index d907e656e33..0b3f0435b2e 100644
--- a/gdb/testsuite/gdb.base/decl-before-def.exp
+++ b/gdb/testsuite/gdb.base/decl-before-def.exp
@@ -23,10 +23,10 @@ if {[prepare_for_testing "failed to prepare" $testfile $sources]} {
 # This is required due to PR25764.
 gdb_test "maint expand-symtabs"
 
-gdb_test "p a" { = \{1, 2\}}
+gdb_test "p a" { = \{1, 2\}} "no running process: p a"
 
 if ![runto_main] then {
     return 0
 }
 
-gdb_test "p a" { = \{1, 2\}}
+gdb_test "p a" { = \{1, 2\}} "running process: p a"
-- 
2.33.1


^ permalink raw reply	[flat|nested] 74+ messages in thread

* [PATCH 09/29] gdb/testsuite: Remove duplicates from gdb.base/solib-display.exp
  2021-11-21 17:56 [PATCH 00/29] Remove DUPLICATEs from testsuite/gdb.base/*.exp Lancelot SIX
                   ` (7 preceding siblings ...)
  2021-11-21 17:56 ` [PATCH 08/29] gdb/testsuite: Remove duplicates from gdb.base/decl-before-def.exp Lancelot SIX
@ 2021-11-21 17:56 ` Lancelot SIX
  2022-01-04 14:17   ` Andrew Burgess
  2021-11-21 17:56 ` [PATCH 10/29] gdb/testsuite: Remove duplicates from gdb.base/del.exp Lancelot SIX
                   ` (21 subsequent siblings)
  30 siblings, 1 reply; 74+ messages in thread
From: Lancelot SIX @ 2021-11-21 17:56 UTC (permalink / raw)
  To: gdb-patches; +Cc: Lancelot SIX

When running the testsuite, I have:

    Running .../gdb/testsuite/gdb.base/solib-display.exp ...
    DUPLICATE: gdb.base/solib-display.exp: NO: break 25
    DUPLICATE: gdb.base/solib-display.exp: NO: continue
    DUPLICATE: gdb.base/solib-display.exp: IN: break 25
    DUPLICATE: gdb.base/solib-display.exp: IN: continue
    DUPLICATE: gdb.base/solib-display.exp: SEP: break 25
    DUPLICATE: gdb.base/solib-display.exp: SEP: continue

The 'break 25' appears because the test inserts two breakpoints at the
same location.  Fix this by only inserting the breakpoint once.

Fix the 'continue' DUPLICATE by giving a phony name to the second
continue: 'continue two'.

While at it, this commit also removes a trailing space.

Tested on x86_64-linux.
---
 gdb/testsuite/gdb.base/solib-display.exp | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/gdb/testsuite/gdb.base/solib-display.exp b/gdb/testsuite/gdb.base/solib-display.exp
index 54de334357f..f075b295899 100644
--- a/gdb/testsuite/gdb.base/solib-display.exp
+++ b/gdb/testsuite/gdb.base/solib-display.exp
@@ -140,7 +140,7 @@ foreach libsepdebug {NO IN SEP} { with_test_prefix "$libsepdebug" {
     # are not cleared permaturely.
 
     gdb_test "break [gdb_get_line_number "break here" ${testfile}.c]" \
-	    ".*Breakpoint.* at .*" 
+	    ".*Breakpoint.* at .*"
 
     gdb_test "continue"
     gdb_test "display main_global" "4: main_global = 44"
@@ -153,11 +153,9 @@ foreach libsepdebug {NO IN SEP} { with_test_prefix "$libsepdebug" {
     }
 
     gdb_test "" "6: a_static = 46\\r\\n4: main_global = 44\\r\\n.*"
-    gdb_test "break [gdb_get_line_number "break here" ${testfile}.c]" \
-	    ".*Breakpoint.* at .*" 
     gdb_test "continue" [multi_line \
 			     "4: main_global = 44" \
 			     "5: a_local = 45" \
 			     "6: a_static = 46" \
-			    ]
+			    ] "continue two"
 }}
-- 
2.33.1


^ permalink raw reply	[flat|nested] 74+ messages in thread

* [PATCH 10/29] gdb/testsuite: Remove duplicates from gdb.base/del.exp
  2021-11-21 17:56 [PATCH 00/29] Remove DUPLICATEs from testsuite/gdb.base/*.exp Lancelot SIX
                   ` (8 preceding siblings ...)
  2021-11-21 17:56 ` [PATCH 09/29] gdb/testsuite: Remove duplicates from gdb.base/solib-display.exp Lancelot SIX
@ 2021-11-21 17:56 ` Lancelot SIX
  2022-01-04 14:20   ` Andrew Burgess
  2021-11-21 17:56 ` [PATCH 11/29] gdb/testsuite: Remove duplicates from gdb.base/dfp-test.exp Lancelot SIX
                   ` (20 subsequent siblings)
  30 siblings, 1 reply; 74+ messages in thread
From: Lancelot SIX @ 2021-11-21 17:56 UTC (permalink / raw)
  To: gdb-patches; +Cc: Lancelot SIX

When running the testsuite, I have:

    Running .../gdb/testsuite/gdb.base/del.exp ...
    DUPLICATE: gdb.base/del.exp: info break after removing break on main

Refactor slightly this test to run the various configurations under
foreach_with_prefix so each variant is automatically prefixed, ensuring
that the forgotten custom test name cannot happen.

Tested on x86_64-linux.
---
 gdb/testsuite/gdb.base/del.exp | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/gdb/testsuite/gdb.base/del.exp b/gdb/testsuite/gdb.base/del.exp
index 7b1f24b8686..8dc12b7089b 100644
--- a/gdb/testsuite/gdb.base/del.exp
+++ b/gdb/testsuite/gdb.base/del.exp
@@ -32,30 +32,30 @@ proc test_delete_alias { alias } {
     # First of all, remove all previous breakpoints if there were any,
     # and then verify that we do not have any breakpoint lying around.
     gdb_test_no_output "delete" \
-             "remove all breakpoints ($alias)"
+             "remove all breakpoints"
 
     gdb_test "info break" \
              "No breakpoints or watchpoints." \
-             "info break after removing break on main"
+             "info break after clearing breakpoints"
+
 
-    
     # Now, insert a breakpoint at an easy location, and then remove it
     # using $alias. We verified that the removal worked by checking
     # the list of breakpoints.
     gdb_test "break -q main" \
              "Breakpoint.*at.* file .*$srcfile, line.*" \
-             "breakpoint insertion ($alias)"
-    
+             "breakpoint insertion"
+
     gdb_test_no_output "$alias \$bpnum" \
-             "Remove last breakpoint ($alias)"
-    
+             "Remove last breakpoint"
+
     gdb_test "info break" \
              "No breakpoints or watchpoints." \
-             "info break after removing break on main ($alias)"
+             "info break after removing break on main"
 }
 
 # Test various shortcut forms of the "delete" command.
 
-test_delete_alias "del"
-test_delete_alias "d"
-
+foreach_with_prefix alias {"del" "d"} {
+    test_delete_alias $alias
+}
-- 
2.33.1


^ permalink raw reply	[flat|nested] 74+ messages in thread

* [PATCH 11/29] gdb/testsuite: Remove duplicates from gdb.base/dfp-test.exp
  2021-11-21 17:56 [PATCH 00/29] Remove DUPLICATEs from testsuite/gdb.base/*.exp Lancelot SIX
                   ` (9 preceding siblings ...)
  2021-11-21 17:56 ` [PATCH 10/29] gdb/testsuite: Remove duplicates from gdb.base/del.exp Lancelot SIX
@ 2021-11-21 17:56 ` Lancelot SIX
  2022-01-04 14:26   ` Andrew Burgess
  2021-11-21 17:56 ` [PATCH 12/29] gdb/testsuite: Remove duplicates from gdb.base/ptype.exp Lancelot SIX
                   ` (19 subsequent siblings)
  30 siblings, 1 reply; 74+ messages in thread
From: Lancelot SIX @ 2021-11-21 17:56 UTC (permalink / raw)
  To: gdb-patches; +Cc: Lancelot SIX

When running the testsuite, I have:

    Running .../gdb/testsuite/gdb.base/dfp-test.exp ...
    DUPLICATE: gdb.base/dfp-test.exp: 1.23E is an invalid number
    DUPLICATE: gdb.base/dfp-test.exp: 1.23E45A is an invalid number
    DUPLICATE: gdb.base/dfp-test.exp: 1.23E is an invalid number
    DUPLICATE: gdb.base/dfp-test.exp: 1.23E45A is an invalid number

Fix by adjusting the test names.

Tested on x86_64-linux.
---
 gdb/testsuite/gdb.base/dfp-test.exp | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/gdb/testsuite/gdb.base/dfp-test.exp b/gdb/testsuite/gdb.base/dfp-test.exp
index 379794a1b31..c2ca7e7f032 100644
--- a/gdb/testsuite/gdb.base/dfp-test.exp
+++ b/gdb/testsuite/gdb.base/dfp-test.exp
@@ -61,10 +61,10 @@ proc d32_set_tests {} {
     gdb_test "p d32=1.234567E+97df" " = Infinity" "1.234567E+97 is Infinity"
 
     # Test that gdb could detect the errors in the string representation of _Decimal32
-    gdb_test "p d32=12345.df" " = 12345" "12345. is a valid number"
-    gdb_test "p d32=12345df" ".*Invalid number.*" "12345 is an invalid number"
-    gdb_test "p d32=1.23Edf" ".*Conversion syntax.*" "1.23E is an invalid number"
-    gdb_test "p d32=1.23E45Adf" ".*Conversion syntax.*" "1.23E45A is an invalid number"
+    gdb_test "p d32=12345.df" " = 12345" "12345. is a valid Decimal32 number"
+    gdb_test "p d32=12345df" ".*Invalid number.*" "12345 is an invalid Decimal32 number"
+    gdb_test "p d32=1.23Edf" ".*Conversion syntax.*" "1.23E is an invalid Decimal32 number"
+    gdb_test "p d32=1.23E45Adf" ".*Conversion syntax.*" "1.23E45A is an invalid Decimal32 number"
 }
 
 proc d64_set_tests {} {
@@ -92,9 +92,9 @@ proc d64_set_tests {} {
     gdb_test "p d64=1.234567890123456E385dd" " = Infinity" "d64=1.234567890123456E385 is Infinity"
 
     # Test that gdb could detect the errors in the string representation of _Decimal64
-    gdb_test "p d64=12345dd" ".*Invalid number.*" "12345dd is an invalid number"
-    gdb_test "p d64=1.23Edd" ".*Conversion syntax.*" "1.23E is an invalid number"
-    gdb_test "p d64=1.23E45Add" ".*Conversion syntax.*" "1.23E45A is an invalid number"
+    gdb_test "p d64=12345dd" ".*Invalid number.*" "12345 is an invalid Decimal64 number"
+    gdb_test "p d64=1.23Edd" ".*Conversion syntax.*" "1.23E is an invalid Decimal64 number"
+    gdb_test "p d64=1.23E45Add" ".*Conversion syntax.*" "1.23E45A is an invalid Decimal64 number"
 }
 
 proc d128_set_tests {} {
@@ -121,9 +121,9 @@ proc d128_set_tests {} {
     gdb_test "p d128=1.234567890123456E6145dl" "Infinity" "d128=1.234567890123456E6145 is Infinity"
 
     # Test that gdb could detect the errors in the string representation of _Decimal128
-    gdb_test "p d128=12345dl" ".*Invalid number.*" "12345dl is an invalid number"
-    gdb_test "p d128=1.23Edl" ".*Conversion syntax.*" "1.23E is an invalid number"
-    gdb_test "p d128=1.23E45Adl" ".*Conversion syntax.*" "1.23E45A is an invalid number"
+    gdb_test "p d128=12345dl" ".*Invalid number.*" "12345dl is an invalid Decimal128 number"
+    gdb_test "p d128=1.23Edl" ".*Conversion syntax.*" "1.23E is an invalid Decimal128 number"
+    gdb_test "p d128=1.23E45Adl" ".*Conversion syntax.*" "1.23E45A is an invalid Decimal128 number"
 }
 
 # Different tests on 32-bits decimal floating point, including the printing
-- 
2.33.1


^ permalink raw reply	[flat|nested] 74+ messages in thread

* [PATCH 12/29] gdb/testsuite: Remove duplicates from gdb.base/ptype.exp
  2021-11-21 17:56 [PATCH 00/29] Remove DUPLICATEs from testsuite/gdb.base/*.exp Lancelot SIX
                   ` (10 preceding siblings ...)
  2021-11-21 17:56 ` [PATCH 11/29] gdb/testsuite: Remove duplicates from gdb.base/dfp-test.exp Lancelot SIX
@ 2021-11-21 17:56 ` Lancelot SIX
  2022-01-04 15:13   ` Andrew Burgess
  2021-11-21 17:56 ` [PATCH 13/29] gdb/testsuite: Remove duplicates from gdb.base/dfp-exprs.exp Lancelot SIX
                   ` (18 subsequent siblings)
  30 siblings, 1 reply; 74+ messages in thread
From: Lancelot SIX @ 2021-11-21 17:56 UTC (permalink / raw)
  To: gdb-patches; +Cc: Lancelot SIX

When running the testsuite, I have:

    Running .../gdb/testsuite/gdb.base/ptype.exp ...
    DUPLICATE: gdb.base/ptype.exp: ptype the_highest
    DUPLICATE: gdb.base/ptype.exp: list intfoo
    DUPLICATE: gdb.base/ptype.exp: list charfoo

Fix by adjusting the offending test names.

Tested on x86_64-linux.
---
 gdb/testsuite/gdb.base/ptype.exp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/gdb/testsuite/gdb.base/ptype.exp b/gdb/testsuite/gdb.base/ptype.exp
index 375a9431aa4..5408abae192 100644
--- a/gdb/testsuite/gdb.base/ptype.exp
+++ b/gdb/testsuite/gdb.base/ptype.exp
@@ -509,7 +509,7 @@ gdb_test "ptype the_highest" \
 
 gdb_test "ptype the_highest.anonymous_level_1" \
          "type = struct \{.*\[\r\n\] *int b;.*\[\r\n\] *struct \{.*\[\r\n\] *int c;.*\[\r\n\] *\} anonymous_level_2;.*\[\r\n\]}.*" \
-         "ptype the_highest" 
+         "ptype the_highest.anonymous_level_1"
 
 get_debug_format
 
@@ -578,9 +578,9 @@ gdb_test "list intfoo" ".*"
 gdb_test "ptype foo" "type = int" "ptype foo typedef after first list of intfoo"
 gdb_test "list charfoo" ".*"
 gdb_test "ptype foo" "type = char" "ptype foo typedef after first list of charfoo"
-gdb_test "list intfoo" ".*"
+gdb_test "list intfoo" ".*" "second list intfoo"
 gdb_test "ptype foo" "type = int" "ptype foo typedef after second list of intfoo"
-gdb_test "list charfoo" ".*"
+gdb_test "list charfoo" ".*" "second list charfoo"
 gdb_test "ptype foo" "type = char" "ptype foo typedef after second list of charfoo"
 
 # Test printing type of string constants and array constants, but
-- 
2.33.1


^ permalink raw reply	[flat|nested] 74+ messages in thread

* [PATCH 13/29] gdb/testsuite: Remove duplicates from gdb.base/dfp-exprs.exp
  2021-11-21 17:56 [PATCH 00/29] Remove DUPLICATEs from testsuite/gdb.base/*.exp Lancelot SIX
                   ` (11 preceding siblings ...)
  2021-11-21 17:56 ` [PATCH 12/29] gdb/testsuite: Remove duplicates from gdb.base/ptype.exp Lancelot SIX
@ 2021-11-21 17:56 ` Lancelot SIX
  2021-12-10 23:03   ` Pedro Alves
  2021-11-21 17:56 ` [PATCH 14/29] gdb/testsuite: Remove duplicates from gdb.base/subst.exp Lancelot SIX
                   ` (17 subsequent siblings)
  30 siblings, 1 reply; 74+ messages in thread
From: Lancelot SIX @ 2021-11-21 17:56 UTC (permalink / raw)
  To: gdb-patches; +Cc: Lancelot SIX

When I run the testsuite, I have:

    Running ../gdb/testsuite/gdb.base/dfp-exprs.exp ...
    DUPLICATE: gdb.base/dfp-exprs.exp: p 1.2dl < 1.3df

Fix by removing the duplicated test.

Tested on x86_64-linux.
---
 gdb/testsuite/gdb.base/dfp-exprs.exp | 1 -
 1 file changed, 1 deletion(-)

diff --git a/gdb/testsuite/gdb.base/dfp-exprs.exp b/gdb/testsuite/gdb.base/dfp-exprs.exp
index 355b8f04a1f..cce743d3ffe 100644
--- a/gdb/testsuite/gdb.base/dfp-exprs.exp
+++ b/gdb/testsuite/gdb.base/dfp-exprs.exp
@@ -154,7 +154,6 @@ proc test_dfp_arithmetic_expressions {} {
     gdb_test "p 1.2dd < 1.3dd" " = 1"
     gdb_test "p 1.2dd < 1.3dl" " = 1"
     gdb_test "p 1.2dl < 1.3dl" " = 1"
-    gdb_test "p 1.2dl < 1.3df" " = 1"
     gdb_test "p 1.2df > 1" " = 1"
     gdb_test "p 1.2dl > 2" " = 0"
     gdb_test "p 2 > 1.2dd" " = 1"
-- 
2.33.1


^ permalink raw reply	[flat|nested] 74+ messages in thread

* [PATCH 14/29] gdb/testsuite: Remove duplicates from gdb.base/subst.exp
  2021-11-21 17:56 [PATCH 00/29] Remove DUPLICATEs from testsuite/gdb.base/*.exp Lancelot SIX
                   ` (12 preceding siblings ...)
  2021-11-21 17:56 ` [PATCH 13/29] gdb/testsuite: Remove duplicates from gdb.base/dfp-exprs.exp Lancelot SIX
@ 2021-11-21 17:56 ` Lancelot SIX
  2021-11-21 17:56 ` [PATCH 15/29] gdb/testsuite: Remove duplicates from gdb.base/complete-empty.exp Lancelot SIX
                   ` (16 subsequent siblings)
  30 siblings, 0 replies; 74+ messages in thread
From: Lancelot SIX @ 2021-11-21 17:56 UTC (permalink / raw)
  To: gdb-patches; +Cc: Lancelot SIX

When I run the testsuite, I have:

    Running .../gdb/testsuite/gdb.base/subst.ex ...
    DUPLICATE: gdb.base/subst.exp: unset substitute-path from, no rule entered yet

Fix by adjusting the problematic test name.

Tested on x86_64-linux.
---
 gdb/testsuite/gdb.base/subst.exp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/testsuite/gdb.base/subst.exp b/gdb/testsuite/gdb.base/subst.exp
index 040c7f40f46..9182068c1b3 100644
--- a/gdb/testsuite/gdb.base/subst.exp
+++ b/gdb/testsuite/gdb.base/subst.exp
@@ -50,7 +50,7 @@ gdb_test_no_output "unset substitute-path" \
 
 gdb_test "unset substitute-path from" \
          "No substitution rule defined for `from'" \
-         "unset substitute-path from, no rule entered yet"
+         "unset substitute-path from, after unset substitute-path"
 
 gdb_test "unset substitute-path from to" \
          "Incorrect usage, too many arguments in command" \
-- 
2.33.1


^ permalink raw reply	[flat|nested] 74+ messages in thread

* [PATCH 15/29] gdb/testsuite: Remove duplicates from gdb.base/complete-empty.exp
  2021-11-21 17:56 [PATCH 00/29] Remove DUPLICATEs from testsuite/gdb.base/*.exp Lancelot SIX
                   ` (13 preceding siblings ...)
  2021-11-21 17:56 ` [PATCH 14/29] gdb/testsuite: Remove duplicates from gdb.base/subst.exp Lancelot SIX
@ 2021-11-21 17:56 ` Lancelot SIX
  2021-11-21 17:56 ` [PATCH 16/29] gdb/testsuite: Remove duplicates from gdb.base/ui-redirect.exp Lancelot SIX
                   ` (15 subsequent siblings)
  30 siblings, 0 replies; 74+ messages in thread
From: Lancelot SIX @ 2021-11-21 17:56 UTC (permalink / raw)
  To: gdb-patches; +Cc: Lancelot SIX

When I run the testsuite, I have:

    Running .../gdb/testsuite/gdb.base/complete-empty.exp ...
    DUPLICATE: gdb.base/complete-empty.exp: empty-input-line: cmd complete ""

This comes from how test_gdb_complete_unique works (more specifically,
how test_gdb_complete_unique_re works).  In this proc we can see:

    # Trim INPUT_LINE and COMPLETE LINE, for the case we're completing
    # a command with leading whitespace.  Leading command whitespace
    # is discarded by GDB.
    set input_line [string trimleft $input_line]
    set expected_output_re [string trimleft $complete_line_re]

This test is trying to test how a buffer containing no commands is
completed.  A buffer containing no command can be an empty buffer (first
scenario tested) or a buffer containing only white spaces.

Given the behavior of the test procedure described above (required
because the 'complete' command will trim anyway), our second test
(buffer containing only white spaces) is turned into the first test case
(empty buffer), leading to the DUPLICATE warning.

I see two options to solve this:

  1) Only test the tab-based completion for the test case with leading
     white spaces.
  2) Run the test with a prefix the second time we test an empty buffer,
     so it is registered under a different name.

I went for the first option which seems cleaner.

Tested on x86_64-linux.
---
 gdb/testsuite/gdb.base/complete-empty.exp | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/gdb/testsuite/gdb.base/complete-empty.exp b/gdb/testsuite/gdb.base/complete-empty.exp
index 4620ec2adc9..60f8e3f1a9e 100644
--- a/gdb/testsuite/gdb.base/complete-empty.exp
+++ b/gdb/testsuite/gdb.base/complete-empty.exp
@@ -42,7 +42,17 @@ proc_with_prefix empty-input-line {} {
     test_gdb_complete_unique "" "!" " " 1
 
     # Same, but with some leading whitespace.
-    test_gdb_complete_unique "   " "   !" " " 1
+
+    # This scenario is only tested using tab-completion and not the 'complete'
+    # command (as test_gdb_complete_tab_unique would do).  This is due to the
+    # fact that GDB will in fine trim its input (producing a trimmed output).
+    # Knowing that the testing framework trims the input and expected output,
+    # turning this test case into the one we just did above.
+    if { [readline_is_used] } {
+	if { [test_gdb_complete_tab_unique "   " "   !" " "] == -1 } {
+	    return -1
+	}
+    }
 }
 
 proc test_driver {} {
-- 
2.33.1


^ permalink raw reply	[flat|nested] 74+ messages in thread

* [PATCH 16/29] gdb/testsuite: Remove duplicates from gdb.base/ui-redirect.exp
  2021-11-21 17:56 [PATCH 00/29] Remove DUPLICATEs from testsuite/gdb.base/*.exp Lancelot SIX
                   ` (14 preceding siblings ...)
  2021-11-21 17:56 ` [PATCH 15/29] gdb/testsuite: Remove duplicates from gdb.base/complete-empty.exp Lancelot SIX
@ 2021-11-21 17:56 ` Lancelot SIX
  2021-12-10 23:15   ` Pedro Alves
  2021-11-21 17:56 ` [PATCH 17/29] gdb/testsuite: Remove duplicates from gdb.base/pretty-array.exp Lancelot SIX
                   ` (14 subsequent siblings)
  30 siblings, 1 reply; 74+ messages in thread
From: Lancelot SIX @ 2021-11-21 17:56 UTC (permalink / raw)
  To: gdb-patches; +Cc: Lancelot SIX

When running the testsuite, I have:

    Running .../gdb/testsuite/gdb.base/ui-redirect.exp ...
    DUPLICATE: gdb.base/ui-redirect.exp: redirect while already logging: set logging redirect off

Fix by moving the first 'set logging redirect off' at the end of the
previous [with_test_prefix] test block. The statement's purpose is to
clean the on flag set in this previous block, so moving it there makes
sense and does not change the sequence of commands in the test file..

Tested on x86_64-linux.
---
 gdb/testsuite/gdb.base/ui-redirect.exp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/testsuite/gdb.base/ui-redirect.exp b/gdb/testsuite/gdb.base/ui-redirect.exp
index 363c563a5a1..6ed9c49c427 100644
--- a/gdb/testsuite/gdb.base/ui-redirect.exp
+++ b/gdb/testsuite/gdb.base/ui-redirect.exp
@@ -95,10 +95,10 @@ with_test_prefix "redirect" {
     gdb_test_no_output "userdefined"
     gdb_test "set logging off" "Done logging to /dev/null\\."
     gdb_test "help" "List of classes of commands:.*"
+    gdb_test_no_output "set logging redirect off"
 }
 
 with_test_prefix "redirect while already logging" {
-    gdb_test_no_output "set logging redirect off"
     gdb_test "set logging on" \
     "Copying output to /dev/null.*Copying debug output to /dev/null\\."
     gdb_test "set logging redirect on" \
-- 
2.33.1


^ permalink raw reply	[flat|nested] 74+ messages in thread

* [PATCH 17/29] gdb/testsuite: Remove duplicates from gdb.base/pretty-array.exp
  2021-11-21 17:56 [PATCH 00/29] Remove DUPLICATEs from testsuite/gdb.base/*.exp Lancelot SIX
                   ` (15 preceding siblings ...)
  2021-11-21 17:56 ` [PATCH 16/29] gdb/testsuite: Remove duplicates from gdb.base/ui-redirect.exp Lancelot SIX
@ 2021-11-21 17:56 ` Lancelot SIX
  2021-11-21 17:56 ` [PATCH 18/29] gdb/testsuite: Remove duplicates from gdb.base/readline.exp Lancelot SIX
                   ` (13 subsequent siblings)
  30 siblings, 0 replies; 74+ messages in thread
From: Lancelot SIX @ 2021-11-21 17:56 UTC (permalink / raw)
  To: gdb-patches; +Cc: Lancelot SIX

When I run the testsuite, I have:

    Running .../gdb/testsuite/gdb.base/pretty-array.exp ...
    DUPLICATE: gdb.base/pretty-array.exp: print nums
    DUPLICATE: gdb.base/pretty-array.exp: print nums

Fix by giving a name to the test cases.

Tested on x86_64-linux.
---
 gdb/testsuite/gdb.base/pretty-array.exp | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/gdb/testsuite/gdb.base/pretty-array.exp b/gdb/testsuite/gdb.base/pretty-array.exp
index 4a29a361b32..a5eb25e8a83 100644
--- a/gdb/testsuite/gdb.base/pretty-array.exp
+++ b/gdb/testsuite/gdb.base/pretty-array.exp
@@ -44,7 +44,8 @@ gdb_test "print nums" \
 	 "    22," \
 	 "    23" \
 	 "  }" \
-	 "}" ]
+	 "}" ] \
+    "print nums with print array on"
 
 gdb_test_no_output "set print array-indexes on"
 
@@ -61,4 +62,5 @@ gdb_test "print nums" \
 	 "    \\\[1\\\] = 22," \
 	 "    \\\[2\\\] = 23" \
 	 "  }" \
-	 "}" ]
+	 "}" ] \
+    "print nums with print array on, print array-indexes on"
-- 
2.33.1


^ permalink raw reply	[flat|nested] 74+ messages in thread

* [PATCH 18/29] gdb/testsuite: Remove duplicates from gdb.base/readline.exp
  2021-11-21 17:56 [PATCH 00/29] Remove DUPLICATEs from testsuite/gdb.base/*.exp Lancelot SIX
                   ` (16 preceding siblings ...)
  2021-11-21 17:56 ` [PATCH 17/29] gdb/testsuite: Remove duplicates from gdb.base/pretty-array.exp Lancelot SIX
@ 2021-11-21 17:56 ` Lancelot SIX
  2021-11-21 17:56 ` [PATCH 19/29] gdb/testsuite: Remove duplicates from gdb.base/exprs.exp Lancelot SIX
                   ` (12 subsequent siblings)
  30 siblings, 0 replies; 74+ messages in thread
From: Lancelot SIX @ 2021-11-21 17:56 UTC (permalink / raw)
  To: gdb-patches; +Cc: Lancelot SIX

When running the testsuite, I have:

    Running .../gdb/testsuite/gdb.base/readline.exp ...
    DUPLICATE: gdb.base/readline.exp: Simple operate-and-get-next - final prompt

Fix by adjusting the prefix given to the second 'simple' call to
operate_and_get_next.

Tested on x86_64-linux.
---
 gdb/testsuite/gdb.base/readline.exp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/testsuite/gdb.base/readline.exp b/gdb/testsuite/gdb.base/readline.exp
index d3c53f9854d..9849a9c6050 100644
--- a/gdb/testsuite/gdb.base/readline.exp
+++ b/gdb/testsuite/gdb.base/readline.exp
@@ -193,7 +193,7 @@ save_vars { env(TERM) } {
 	gdb_start
 	gdb_reinitialize_dir $srcdir/$subdir
 
-	operate_and_get_next "Simple operate-and-get-next" \
+	operate_and_get_next "Simple operate-and-get-next, two" \
 	    "p 7" ".* = 7" \
 	    "p 8" ".* = 8" \
 	    "p 9" ".* = 9"
-- 
2.33.1


^ permalink raw reply	[flat|nested] 74+ messages in thread

* [PATCH 19/29] gdb/testsuite: Remove duplicates from gdb.base/exprs.exp
  2021-11-21 17:56 [PATCH 00/29] Remove DUPLICATEs from testsuite/gdb.base/*.exp Lancelot SIX
                   ` (17 preceding siblings ...)
  2021-11-21 17:56 ` [PATCH 18/29] gdb/testsuite: Remove duplicates from gdb.base/readline.exp Lancelot SIX
@ 2021-11-21 17:56 ` Lancelot SIX
  2021-12-10 23:15   ` Pedro Alves
  2021-11-21 17:56 ` [PATCH 20/29] gdb/testsuite: Remove duplicates from gdb.base/set-cfd.exp Lancelot SIX
                   ` (11 subsequent siblings)
  30 siblings, 1 reply; 74+ messages in thread
From: Lancelot SIX @ 2021-11-21 17:56 UTC (permalink / raw)
  To: gdb-patches; +Cc: Lancelot SIX

When running the testsuite, I have:

    Running .../gdb/testsuite/gdb.base/exprs.exp ...
    DUPLICATE: gdb.base/exprs.exp: \$[0-9]* = red (setup)

Fix by using with_test_prefix where appropriate.

Tested on x86_64-linux.
---
 gdb/testsuite/gdb.base/exprs.exp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gdb/testsuite/gdb.base/exprs.exp b/gdb/testsuite/gdb.base/exprs.exp
index 50272d133a2..0525f76a44c 100644
--- a/gdb/testsuite/gdb.base/exprs.exp
+++ b/gdb/testsuite/gdb.base/exprs.exp
@@ -238,7 +238,9 @@ test_expr "print \"x\" \"y\" \"z\"" "\\$\[0-9\]* = \"xyz\""
 # Enum formatting tests.
 test_expr "print red" "\\$\[0-9\]* = red"
 gdb_test "set output-radix 8" ".*"
-test_expr "print red" "\\$\[0-9\]* = red"
+with_test_prefix "with output-radix 8" {
+    test_expr "print red" "\\$\[0-9\]* = red"
+}
 test_expr "print/d red" "\\$\[0-9\]* = 0"
 gdb_test "set output-radix 10" ".*"
 
-- 
2.33.1


^ permalink raw reply	[flat|nested] 74+ messages in thread

* [PATCH 20/29] gdb/testsuite: Remove duplicates from gdb.base/set-cfd.exp
  2021-11-21 17:56 [PATCH 00/29] Remove DUPLICATEs from testsuite/gdb.base/*.exp Lancelot SIX
                   ` (18 preceding siblings ...)
  2021-11-21 17:56 ` [PATCH 19/29] gdb/testsuite: Remove duplicates from gdb.base/exprs.exp Lancelot SIX
@ 2021-11-21 17:56 ` Lancelot SIX
  2021-11-21 17:56 ` [PATCH 21/29] gdb/testsuite: Remove duplicates from gdb.base/shlib-call.exp Lancelot SIX
                   ` (10 subsequent siblings)
  30 siblings, 0 replies; 74+ messages in thread
From: Lancelot SIX @ 2021-11-21 17:56 UTC (permalink / raw)
  To: gdb-patches; +Cc: Lancelot SIX

When running the testsuite, I have:

    Running .../gdb/testsuite/gdb.base/set-cwd.exp ...
    DUPLICATE: gdb.base/set-cwd.exp: test_cwd_reset: continue to breakpoint: break-here

Fix by moving the tests after the 'runto_main' within the same
with_test_prefix scope.

While at it, I fix some indentation issues.

Tested on x86_64-linux.
---
 gdb/testsuite/gdb.base/set-cwd.exp | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/gdb/testsuite/gdb.base/set-cwd.exp b/gdb/testsuite/gdb.base/set-cwd.exp
index eb8835b29bb..67492d73b72 100644
--- a/gdb/testsuite/gdb.base/set-cwd.exp
+++ b/gdb/testsuite/gdb.base/set-cwd.exp
@@ -43,15 +43,15 @@ proc_with_prefix test_tilde_expansion { } {
     set home ""
     set test "print home var"
     gdb_test_multiple "print home" $test {
-    	-re "\\\$$decimal = $hex \"\(.+\)\"\r\n$gdb_prompt $" {
-    	    set home $expect_out(1,string)
-    	    pass $test
-    	}
+	-re "\\\$$decimal = $hex \"\(.+\)\"\r\n$gdb_prompt $" {
+	    set home $expect_out(1,string)
+	    pass $test
+	}
     }
 
     if { $home == "" } {
-    	untested "could not retrieve home var"
-    	return
+	untested "could not retrieve home var"
+	return
     }
 
     set curdir ""
@@ -177,13 +177,13 @@ proc_with_prefix test_cwd_reset { } {
 	if { ![runto_main] } {
 	    return -1
 	}
-    }
 
-    gdb_breakpoint [gdb_get_line_number "break-here"]
-    gdb_continue_to_breakpoint "break-here" ".* break-here .*"
+	gdb_breakpoint [gdb_get_line_number "break-here"]
+	gdb_continue_to_breakpoint "break-here" ".* break-here .*"
 
-    gdb_test "print dir" "\\\$$decimal = \"$gdb_cwd\", .*" \
-	"inferior cwd got reset correctly"
+	gdb_test "print dir" "\\\$$decimal = \"$gdb_cwd\", .*" \
+	    "inferior cwd got reset correctly"
+    }
 }
 
 test_cd_into_dir
-- 
2.33.1


^ permalink raw reply	[flat|nested] 74+ messages in thread

* [PATCH 21/29] gdb/testsuite: Remove duplicates from gdb.base/shlib-call.exp
  2021-11-21 17:56 [PATCH 00/29] Remove DUPLICATEs from testsuite/gdb.base/*.exp Lancelot SIX
                   ` (19 preceding siblings ...)
  2021-11-21 17:56 ` [PATCH 20/29] gdb/testsuite: Remove duplicates from gdb.base/set-cfd.exp Lancelot SIX
@ 2021-11-21 17:56 ` Lancelot SIX
  2021-12-10 23:24   ` Pedro Alves
  2021-11-21 17:56 ` [PATCH 22/29] gdb/testsuite: Remove duplicates from gdb.base/funcargs.exp Lancelot SIX
                   ` (9 subsequent siblings)
  30 siblings, 1 reply; 74+ messages in thread
From: Lancelot SIX @ 2021-11-21 17:56 UTC (permalink / raw)
  To: gdb-patches; +Cc: Lancelot SIX

When I run the testsuite, I have:

    Running .../gdb/testsuite/gdb.base/shlib-call.exp ...
    DUPLICATE: gdb.base/shlib-call.exp: print g
    DUPLICATE: gdb.base/shlib-call.exp: set print sevenbit-strings
    DUPLICATE: gdb.base/shlib-call.exp: set print address off
    DUPLICATE: gdb.base/shlib-call.exp: set width 0
    DUPLICATE: gdb.base/shlib-call.exp: continue until exit

Fix by adjusting the test names.

Tested on x86_64-linux.
---
 gdb/testsuite/gdb.base/shlib-call.exp | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/gdb/testsuite/gdb.base/shlib-call.exp b/gdb/testsuite/gdb.base/shlib-call.exp
index 0a5a1c336c1..f7f20cc0127 100644
--- a/gdb/testsuite/gdb.base/shlib-call.exp
+++ b/gdb/testsuite/gdb.base/shlib-call.exp
@@ -90,7 +90,7 @@ if ![gdb_skip_stdio_test "next over shr1"] {
 
 
 #print g
-gdb_test "print g" "\[0-9\]* = 2"
+gdb_test "print g" "\[0-9\]* = 2" "print g two"
 
 #print shr1(1)
 if ![gdb_skip_stdio_test "print shr1(1)"] {
@@ -166,9 +166,12 @@ gdb_exit
 gdb_start
 gdb_reinitialize_dir $srcdir/$subdir
 gdb_load ${binfile}
-gdb_test_no_output "set print sevenbit-strings"
-gdb_test_no_output "set print address off"
-gdb_test_no_output "set width 0"
+gdb_test_no_output "set print sevenbit-strings" \
+    "set print sevenbit-strings, after restart"
+gdb_test_no_output "set print address off" \
+    "set print address off, after restart"
+gdb_test_no_output "set width 0" \
+    "set width 0, after restart"
 
 
 # PR's 16495, 18213
@@ -193,4 +196,4 @@ gdb_test_multiple "" $test {
     }
 }
 
-gdb_continue_to_end "" continue 1
+gdb_continue_to_end "after re-run" continue 1
-- 
2.33.1


^ permalink raw reply	[flat|nested] 74+ messages in thread

* [PATCH 22/29] gdb/testsuite: Remove duplicates from gdb.base/funcargs.exp
  2021-11-21 17:56 [PATCH 00/29] Remove DUPLICATEs from testsuite/gdb.base/*.exp Lancelot SIX
                   ` (20 preceding siblings ...)
  2021-11-21 17:56 ` [PATCH 21/29] gdb/testsuite: Remove duplicates from gdb.base/shlib-call.exp Lancelot SIX
@ 2021-11-21 17:56 ` Lancelot SIX
  2021-12-10 23:26   ` Pedro Alves
  2021-11-21 17:56 ` [PATCH 23/29] gdb/testsuite: Remove duplicates from gdb.base/define-prefix.exp Lancelot SIX
                   ` (8 subsequent siblings)
  30 siblings, 1 reply; 74+ messages in thread
From: Lancelot SIX @ 2021-11-21 17:56 UTC (permalink / raw)
  To: gdb-patches; +Cc: Lancelot SIX

When running the testsuite, I have:

    Running .../gdb/testsuite/gdb.base/funcargs.exp ...
    DUPLICATE: gdb.base/funcargs.exp: run to call2a

Fix by adjusting test name.

Tested on x86_64-linux.
---
 gdb/testsuite/gdb.base/funcargs.exp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/testsuite/gdb.base/funcargs.exp b/gdb/testsuite/gdb.base/funcargs.exp
index 7031e02b0e5..c5753836466 100644
--- a/gdb/testsuite/gdb.base/funcargs.exp
+++ b/gdb/testsuite/gdb.base/funcargs.exp
@@ -213,7 +213,7 @@ proc complex_args {} {
 
     # Run; should stop at call1a and print actual arguments.
     gdb_run_cmd
-    gdb_test "" " callca \\(f1=1 \\+ 2i, f2=1 \\+ 2i, f3=1 \\+ 2i\\) .*" "run to call2a"
+    gdb_test "" " callca \\(f1=1 \\+ 2i, f2=1 \\+ 2i, f3=1 \\+ 2i\\) .*" "run to call2a (complex_arg)"
 
     gdb_test "cont" ".* callcb \\(d1=3 \\+ 4i, d2=3 \\+ 4i, d3=3 \\+ 4i\\) .*" "continue to callcb"
     gdb_test "cont" ".* callcc \\(ld1=5 \\+ 6i, ld2=5 \\+ 6i, ld3=5 \\+ 6i\\) .*" "continue to callcc"
-- 
2.33.1


^ permalink raw reply	[flat|nested] 74+ messages in thread

* [PATCH 23/29] gdb/testsuite: Remove duplicates from gdb.base/define-prefix.exp
  2021-11-21 17:56 [PATCH 00/29] Remove DUPLICATEs from testsuite/gdb.base/*.exp Lancelot SIX
                   ` (21 preceding siblings ...)
  2021-11-21 17:56 ` [PATCH 22/29] gdb/testsuite: Remove duplicates from gdb.base/funcargs.exp Lancelot SIX
@ 2021-11-21 17:56 ` Lancelot SIX
  2021-11-21 17:56 ` [PATCH 24/29] gdb/testsuite: Remove duplicates from gdb.base/unload.exp Lancelot SIX
                   ` (7 subsequent siblings)
  30 siblings, 0 replies; 74+ messages in thread
From: Lancelot SIX @ 2021-11-21 17:56 UTC (permalink / raw)
  To: gdb-patches; +Cc: Lancelot SIX

When running the testsuite, I have:

    Running .../gdb/testsuite/gdb.base/define-prefix.exp ...
    DUPLICATE: gdb.base/define-prefix.exp: define user command: ghi-prefix-cmd

Fix by adjusting test names.

Tested on x86_64-linux.
---
 gdb/testsuite/gdb.base/define-prefix.exp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/testsuite/gdb.base/define-prefix.exp b/gdb/testsuite/gdb.base/define-prefix.exp
index 71369caaed6..0db1311e619 100644
--- a/gdb/testsuite/gdb.base/define-prefix.exp
+++ b/gdb/testsuite/gdb.base/define-prefix.exp
@@ -58,7 +58,7 @@ gdb_test_multiple "define abc-prefix def-prefix ghi-prefix-cmd" \
     "define user command: abc-prefix def-prefix ghi-prefix-cmd" {
 	-re "Type commands for definition of \"abc-prefix def-prefix ghi-prefix-cmd\".\r\nEnd with a line saying just \"end\".\r\n>$" {
 	    gdb_test "end" "" \
-		"define user command: ghi-prefix-cmd"
+		"define empty user command: ghi-prefix-cmd"
 	}
     }
 gdb_test_no_output "define-prefix abc-prefix def-prefix ghi-prefix-cmd"
-- 
2.33.1


^ permalink raw reply	[flat|nested] 74+ messages in thread

* [PATCH 24/29] gdb/testsuite: Remove duplicates from gdb.base/unload.exp
  2021-11-21 17:56 [PATCH 00/29] Remove DUPLICATEs from testsuite/gdb.base/*.exp Lancelot SIX
                   ` (22 preceding siblings ...)
  2021-11-21 17:56 ` [PATCH 23/29] gdb/testsuite: Remove duplicates from gdb.base/define-prefix.exp Lancelot SIX
@ 2021-11-21 17:56 ` Lancelot SIX
  2021-11-21 17:56 ` [PATCH 25/29] gdb/testsuite: Remove duplicates from gdb.base/pointers.exp Lancelot SIX
                   ` (6 subsequent siblings)
  30 siblings, 0 replies; 74+ messages in thread
From: Lancelot SIX @ 2021-11-21 17:56 UTC (permalink / raw)
  To: gdb-patches; +Cc: Lancelot SIX

When running the testsuite, I have:

    Running .../gdb/testsuite/gdb.base/unload.exp ...
    DUPLICATE: gdb.base/unload.exp: continuing to unloaded libfile

Fix by adjusting the test name.

Tested on x86_64-linux.
---
 gdb/testsuite/gdb.base/unload.exp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/testsuite/gdb.base/unload.exp b/gdb/testsuite/gdb.base/unload.exp
index 97424699f52..ab5f548f748 100644
--- a/gdb/testsuite/gdb.base/unload.exp
+++ b/gdb/testsuite/gdb.base/unload.exp
@@ -119,7 +119,7 @@ gdb_breakpoint "$testfile.c:[gdb_get_line_number "y-set-1" $testfile.c]" tempora
 
 gdb_test "continue" \
 "Continuing.*warning: Temporarily disabling breakpoints for.*${lib_syms}.*y-set-1.*" \
-"continuing to unloaded libfile"
+"continuing to unloaded libfile, two"
 
 set unloadshr_line2 [gdb_get_line_number "unloadshr2 break" ${libsrcfile2}]
 
-- 
2.33.1


^ permalink raw reply	[flat|nested] 74+ messages in thread

* [PATCH 25/29] gdb/testsuite: Remove duplicates from gdb.base/pointers.exp
  2021-11-21 17:56 [PATCH 00/29] Remove DUPLICATEs from testsuite/gdb.base/*.exp Lancelot SIX
                   ` (23 preceding siblings ...)
  2021-11-21 17:56 ` [PATCH 24/29] gdb/testsuite: Remove duplicates from gdb.base/unload.exp Lancelot SIX
@ 2021-11-21 17:56 ` Lancelot SIX
  2021-12-10 23:27   ` Pedro Alves
  2021-11-21 17:56 ` [PATCH 26/29] gdb/testsuite: Remove duplicates from gdb.base/call-signal-resume.exp Lancelot SIX
                   ` (5 subsequent siblings)
  30 siblings, 1 reply; 74+ messages in thread
From: Lancelot SIX @ 2021-11-21 17:56 UTC (permalink / raw)
  To: gdb-patches; +Cc: Lancelot SIX

When I run the testsuite, I have :

    Running .../gdb/testsuite/gdb.base/pointers.exp ...
    DUPLICATE: gdb.base/pointers.exp: pointer assignment

Fix by adjusting the test names.

Tested on x86_64-linux.
---
 gdb/testsuite/gdb.base/pointers.exp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gdb/testsuite/gdb.base/pointers.exp b/gdb/testsuite/gdb.base/pointers.exp
index fa7531d0f85..cd10a721964 100644
--- a/gdb/testsuite/gdb.base/pointers.exp
+++ b/gdb/testsuite/gdb.base/pointers.exp
@@ -147,14 +147,14 @@ gdb_test "print v_int_pointer > v_int_pointer2" " = $false" \
 
 gdb_test_no_output "set variable y = *v_int_pointer++" \
     "set y = *v_int_pointer++"
-gdb_test "print y" " = 6" "pointer assignment"
+gdb_test "print y" " = 6" "pointer assignment (after y = *v_int_pointer++)"
 gdb_test "print *v_int_pointer" " = 18" "and post-increment"
 
 
 
 gdb_test_no_output "set variable y = *--v_int_pointer2" \
     "set y = *--v_int_pointer2"
-gdb_test "print y" " = 6" "pointer assignment"
+gdb_test "print y" " = 6" "pointer assignment (after y = *--v_int_pointer2)"
 gdb_test "print *v_int_pointer2" " = 6" "and pre-decrement"
 
 
-- 
2.33.1


^ permalink raw reply	[flat|nested] 74+ messages in thread

* [PATCH 26/29] gdb/testsuite: Remove duplicates from gdb.base/call-signal-resume.exp
  2021-11-21 17:56 [PATCH 00/29] Remove DUPLICATEs from testsuite/gdb.base/*.exp Lancelot SIX
                   ` (24 preceding siblings ...)
  2021-11-21 17:56 ` [PATCH 25/29] gdb/testsuite: Remove duplicates from gdb.base/pointers.exp Lancelot SIX
@ 2021-11-21 17:56 ` Lancelot SIX
  2021-11-21 17:56 ` [PATCH 27/29] gdb/testsuite: Remove duplicates from gdb.base/nested-subp2.exp Lancelot SIX
                   ` (4 subsequent siblings)
  30 siblings, 0 replies; 74+ messages in thread
From: Lancelot SIX @ 2021-11-21 17:56 UTC (permalink / raw)
  To: gdb-patches; +Cc: Lancelot SIX

When running the testsuite, I have:

    Running .../gdb/testsuite/gdb.base/call-signal-resume.exp ...
    DUPLICATE: gdb.base/call-signal-resume.exp: dummy stack frame number
    DUPLICATE: gdb.base/call-signal-resume.exp: set confirm off
    DUPLICATE: gdb.base/call-signal-resume.exp: return

This is due to the fact that a pattern was probably copy/pasted to
re-use the logic while not adjusting the test names to avoid the
duplication.

Fix by removing the redundant tests ('set confirm off' only needs to be
used once) and adjusting the test names where appropriate.

Tested on x86_64-linux.
---
 gdb/testsuite/gdb.base/call-signal-resume.exp | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/gdb/testsuite/gdb.base/call-signal-resume.exp b/gdb/testsuite/gdb.base/call-signal-resume.exp
index 7218858135c..a7e9c203ca7 100644
--- a/gdb/testsuite/gdb.base/call-signal-resume.exp
+++ b/gdb/testsuite/gdb.base/call-signal-resume.exp
@@ -116,18 +116,17 @@ gdb_test "call null_hand_call ()" "Breakpoint \[0-9\]*, null_hand_call.*" \
 
 set frame_number [get_dummy_frame_number]
 if { "$frame_number" == "" } {
-    fail "dummy stack frame number"
+    fail "dummy stack frame number, two"
     setup_xfail "*-*-*"
     # Need something.
     set frame_number 0
 } else {
-    pass "dummy stack frame number"
+    pass "dummy stack frame number, two"
 }
 
 # Pop the dummy frame.
 gdb_test "frame $frame_number" ".*"
-gdb_test_no_output "set confirm off"
-gdb_test "return" ""
+gdb_test "return" "" "return, two"
 
 # Continue again, this time we should get to the signal handler.
 
-- 
2.33.1


^ permalink raw reply	[flat|nested] 74+ messages in thread

* [PATCH 27/29] gdb/testsuite: Remove duplicates from gdb.base/nested-subp2.exp
  2021-11-21 17:56 [PATCH 00/29] Remove DUPLICATEs from testsuite/gdb.base/*.exp Lancelot SIX
                   ` (25 preceding siblings ...)
  2021-11-21 17:56 ` [PATCH 26/29] gdb/testsuite: Remove duplicates from gdb.base/call-signal-resume.exp Lancelot SIX
@ 2021-11-21 17:56 ` Lancelot SIX
  2021-11-21 17:56 ` [PATCH 28/29] gdb/testsuite: Remove duplicates from gdb.base/watchpoints.exp Lancelot SIX
                   ` (3 subsequent siblings)
  30 siblings, 0 replies; 74+ messages in thread
From: Lancelot SIX @ 2021-11-21 17:56 UTC (permalink / raw)
  To: gdb-patches; +Cc: Lancelot SIX

When running the testsuite, I have:

    Running .../gdb/testsuite/gdb.base/nested-subp2.exp ...
    DUPLICATE: gdb.base/nested-subp2.exp: continue to the STOP marker
    DUPLICATE: gdb.base/nested-subp2.exp: print c
    DUPLICATE: gdb.base/nested-subp2.exp: print count

Fix by using with_test_prefix to differentiate the test that are
performed at different points during the execution of the debuggee.

Tested on x86_64-linux.
---
 gdb/testsuite/gdb.base/nested-subp2.exp | 28 +++++++++++++------------
 1 file changed, 15 insertions(+), 13 deletions(-)

diff --git a/gdb/testsuite/gdb.base/nested-subp2.exp b/gdb/testsuite/gdb.base/nested-subp2.exp
index d9393da6f10..2c4cdf86efa 100644
--- a/gdb/testsuite/gdb.base/nested-subp2.exp
+++ b/gdb/testsuite/gdb.base/nested-subp2.exp
@@ -49,21 +49,23 @@ set bp_location [gdb_get_line_number "STOP" "${testcase}.c"]
 gdb_test "break ${testcase}.c:${bp_location}" \
          "Breakpoint \[0-9\]+ at 0x\[0-9a-fA-F\]+: .*" \
          "breakpoint to the STOP marker"
-gdb_test "continue" \
-         "Breakpoint \[0-9\]+, increment .*" \
-         "continue to the STOP marker"
 
+with_test_prefix "stop at first iteration" {
+    gdb_test "continue" \
+	     "Breakpoint \[0-9\]+, increment .*" \
+	     "continue to the STOP marker"
 
-# Check we get correct values for both local and non-local variable references.
-
-gdb_test "print c"     "102 'f'"
-gdb_test "print count" "0"
+    # Check we get correct values for both local and non-local variable references.
+    gdb_test "print c"     "102 'f'"
+    gdb_test "print count" "0"
+}
 
 
 # Same but a little later: make sure we were looking at the proper places.
-
-gdb_test "continue" \
-         "Breakpoint \[0-9\]+, increment .*" \
-         "continue to the STOP marker"
-gdb_test "print c"     "111 'o'"
-gdb_test "print count" "1"
+with_test_prefix "stop at second iteration" {
+    gdb_test "continue" \
+	     "Breakpoint \[0-9\]+, increment .*" \
+	     "continue to the STOP marker"
+    gdb_test "print c"     "111 'o'"
+    gdb_test "print count" "1"
+}
-- 
2.33.1


^ permalink raw reply	[flat|nested] 74+ messages in thread

* [PATCH 28/29] gdb/testsuite: Remove duplicates from gdb.base/watchpoints.exp
  2021-11-21 17:56 [PATCH 00/29] Remove DUPLICATEs from testsuite/gdb.base/*.exp Lancelot SIX
                   ` (26 preceding siblings ...)
  2021-11-21 17:56 ` [PATCH 27/29] gdb/testsuite: Remove duplicates from gdb.base/nested-subp2.exp Lancelot SIX
@ 2021-11-21 17:56 ` Lancelot SIX
  2021-12-10 23:30   ` Pedro Alves
  2021-11-21 17:56 ` [PATCH 29/29] gdb/testsuite: Remove duplicates from gdb.base/corefile-buildid.exp Lancelot SIX
                   ` (2 subsequent siblings)
  30 siblings, 1 reply; 74+ messages in thread
From: Lancelot SIX @ 2021-11-21 17:56 UTC (permalink / raw)
  To: gdb-patches; +Cc: Lancelot SIX

When running the testsuite, I have:

    Running ../gdb/testsuite/gdb.base/watchpoints.exp ...
    DUPLICATE: gdb.base/watchpoints.exp: watchpoint hit, first time

Fix by adjusting the test nanes where appropriate.

Tested on x86_64-linux.
---
 gdb/testsuite/gdb.base/watchpoints.exp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gdb/testsuite/gdb.base/watchpoints.exp b/gdb/testsuite/gdb.base/watchpoints.exp
index 4f4e4980eb1..6582c60b37d 100644
--- a/gdb/testsuite/gdb.base/watchpoints.exp
+++ b/gdb/testsuite/gdb.base/watchpoints.exp
@@ -63,9 +63,9 @@ with_test_prefix "before inferior start" {
     set prev_timeout $timeout
     set timeout 600
 
-    gdb_test "cont" "Continuing.*\[Ww\]atchpoint.*ival1.*Old value = -1.*New value = 0.*ival1 = count; ival2 = count;.*" "watchpoint hit, first time"
+    gdb_test "cont" "Continuing.*\[Ww\]atchpoint.*ival1.*Old value = -1.*New value = 0.*ival1 = count; ival2 = count;.*" "watchpoint ival1 hit, first time"
 
-    gdb_test "cont" "Continuing.*\[Ww\]atchpoint.*ival3.*Old value = -1.*New value = 0.*ival3 = count; ival4 = count;.*" "watchpoint hit, first time"
+    gdb_test "cont" "Continuing.*\[Ww\]atchpoint.*ival3.*Old value = -1.*New value = 0.*ival3 = count; ival4 = count;.*" "watchpoint ival3 hit, first time"
 
     # Check that the ival3 hit count is reported correctly
     gdb_test "info break" ".*watchpoint\[ \t\]+keep\[ \t\]+y\[ \t\]+ival3\r\n\[ \t]+breakpoint already hit 1 time.*" "watchpoint hit count is 1"
-- 
2.33.1


^ permalink raw reply	[flat|nested] 74+ messages in thread

* [PATCH 29/29] gdb/testsuite: Remove duplicates from gdb.base/corefile-buildid.exp
  2021-11-21 17:56 [PATCH 00/29] Remove DUPLICATEs from testsuite/gdb.base/*.exp Lancelot SIX
                   ` (27 preceding siblings ...)
  2021-11-21 17:56 ` [PATCH 28/29] gdb/testsuite: Remove duplicates from gdb.base/watchpoints.exp Lancelot SIX
@ 2021-11-21 17:56 ` Lancelot SIX
  2021-12-10 23:38   ` Pedro Alves
  2021-12-10 23:40 ` [PATCH 00/29] Remove DUPLICATEs from testsuite/gdb.base/*.exp Pedro Alves
  2022-01-07 22:36 ` Lancelot SIX
  30 siblings, 1 reply; 74+ messages in thread
From: Lancelot SIX @ 2021-11-21 17:56 UTC (permalink / raw)
  To: gdb-patches; +Cc: Lancelot SIX

When running the testsuite, I have:

    Running .../gdb/testsuite/gdb.base/corefile-buildid.exp ...
    WARNING: can't generate a core file - core tests suppressed - check ulimit -c
    WARNING: can't generate a core file - core tests suppressed - check ulimit -c
    DUPLICATE: gdb.base/corefile-buildid.exp: could not generate core file
    WARNING: can't generate a core file - core tests suppressed - check ulimit -c
    DUPLICATE: gdb.base/corefile-buildid.exp: could not generate core file
    WARNING: can't generate a core file - core tests suppressed - check ulimit -c
    DUPLICATE: gdb.base/corefile-buildid.exp: could not generate core file

The WARNING itself is related to my test environment, not the test
istelf so I do not try to address it here.

Fix the DUPLICATEs by ensuring the test name is generated consistently
with the rest of the file (i.e. by using $prefix in the name).

Tested on x86_64-linux.
---
 gdb/testsuite/gdb.base/corefile-buildid.exp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/testsuite/gdb.base/corefile-buildid.exp b/gdb/testsuite/gdb.base/corefile-buildid.exp
index 15509be7039..bb1d4051b07 100644
--- a/gdb/testsuite/gdb.base/corefile-buildid.exp
+++ b/gdb/testsuite/gdb.base/corefile-buildid.exp
@@ -260,7 +260,7 @@ proc do_corefile_buildid_tests {args} {
     # Find the core file.
     set corefile [core_find $program_to_run]
     if {$corefile == ""} {
-	untested "could not generate core file"
+	untested "$suffix: could not generate core file"
 	return
     }
     verbose -log "corefile is $corefile"
-- 
2.33.1


^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 03/29] gdb/testsuite: Remove duplicates from gdb.base/interp.exp
  2021-11-21 17:56 ` [PATCH 03/29] gdb/testsuite: Remove duplicates from gdb.base/interp.exp Lancelot SIX
@ 2021-11-22 14:13   ` Pedro Alves
  2021-11-22 17:33     ` Lancelot SIX
  0 siblings, 1 reply; 74+ messages in thread
From: Pedro Alves @ 2021-11-22 14:13 UTC (permalink / raw)
  To: Lancelot SIX, gdb-patches

On 2021-11-21 17:56, Lancelot SIX via Gdb-patches wrote:
>  # Regression test for crash when an exception occurs in mi_parse.
> -gdb_test_multiple "interpreter-exec mi \"-break-insert --thread a\"" \
> -    "regression test for mi_parse crash" {
> +set cmd "interpreter-exec mi \"-break-insert --thread a\""
> +gdb_test_multiple $cmd "regression test for mi_parse crash" {

This "regression test for mi_parse crash" message is used if this
gdb_test_multiple detects an internal error, a timeout, etc.

>  	-re ".error,msg=.Invalid value for the '--thread' option.\r\n$gdb_prompt " {
>  	    pass "$cmd"

... while here we use $cmd.

This means that this test can have its result oscillate like this:

 -FAIL: regression test for mi_parse crash"
 +PASS: interpreter-exec mi "-break-insert --thread a"
...
 +PASS: interpreter-exec mi "-break-insert --thread a"
 -FAIL: regression test for mi_parse crash"


The "modern" pattern would be to not have a $cmd variable at all, pass an empty
string as second argument to gdb_test_multiple, and then passing $gdb_test_name
to "pass".  Like:

gdb_test_multiple "interpreter-exec mi \"-break-insert --thread a\"" "" {
   -re .... {
       pass $gdb_test_multiple
   }
}


Though simplest is to pass $cmd as second argument too like other
gdb_test_multiple invocations in the file:

 gdb_test_multiple $cmd $cmd {
 ...



Could you take care of this while at it?

Pedro Alves

^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 03/29] gdb/testsuite: Remove duplicates from gdb.base/interp.exp
  2021-11-22 14:13   ` Pedro Alves
@ 2021-11-22 17:33     ` Lancelot SIX
  2021-12-10 22:01       ` Pedro Alves
  0 siblings, 1 reply; 74+ messages in thread
From: Lancelot SIX @ 2021-11-22 17:33 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 5315 bytes --]

On Mon, Nov 22, 2021 at 02:13:59PM +0000, Pedro Alves wrote:
> On 2021-11-21 17:56, Lancelot SIX via Gdb-patches wrote:
> >  # Regression test for crash when an exception occurs in mi_parse.
> > -gdb_test_multiple "interpreter-exec mi \"-break-insert --thread a\"" \
> > -    "regression test for mi_parse crash" {
> > +set cmd "interpreter-exec mi \"-break-insert --thread a\""
> > +gdb_test_multiple $cmd "regression test for mi_parse crash" {
> 
> This "regression test for mi_parse crash" message is used if this
> gdb_test_multiple detects an internal error, a timeout, etc.
> 
> >  	-re ".error,msg=.Invalid value for the '--thread' option.\r\n$gdb_prompt " {
> >  	    pass "$cmd"
> 
> ... while here we use $cmd.
> 
> This means that this test can have its result oscillate like this:
> 
>  -FAIL: regression test for mi_parse crash"
>  +PASS: interpreter-exec mi "-break-insert --thread a"
> ...
>  +PASS: interpreter-exec mi "-break-insert --thread a"
>  -FAIL: regression test for mi_parse crash"
> 
> 
> The "modern" pattern would be to not have a $cmd variable at all, pass an empty
> string as second argument to gdb_test_multiple, and then passing $gdb_test_name
> to "pass".  Like:
> 
> gdb_test_multiple "interpreter-exec mi \"-break-insert --thread a\"" "" {
>    -re .... {
>        pass $gdb_test_multiple
>    }
> }
> 
> 
> Though simplest is to pass $cmd as second argument too like other
> gdb_test_multiple invocations in the file:
> 
>  gdb_test_multiple $cmd $cmd {
>  ...
> 
> 
> 
> Could you take care of this while at it?
> 
> Pedro Alves

Hi,

Thanks for the inputs.

I have updated the patch as follows.

This could maybe be split into two independent patches (one to fix the
DUPLICATE, which is a one-liner, and to refactor the various uses of
gdb_test_multiple), but I stayed with one which does the fix and
enforces consistency across the file.

Lancelot.

---
gdb/testsuite: Remove duplicates from gdb.base/interp.exp

    When running the testsuite I have:

        Running .../gdb/testsuite/gdb.base/interp.exp ...
        DUPLICATE: gdb.base/interp.exp: interpreter-exec mi "-var-update *"

    This is due to the fact that multiple successive instances of
    gdb_test_multiple use 'pass $cmd', but one of them forgets to reset $cmd
    to a new test name.

    Fix by using 'pass $gdb_test_name', given that the gdb_test_name is set
    by gdb_test_multiple.

    While fixing this, this patch refactors all occurrences of the following
    pattern:

        set cmd foo
        gdb_test_multiple $cmd $cmd {
            -re ... {
                pass $cmd
            }
        }

    into

        gdb_test_multiple foo "" {
            -re ... {
                pass $gdb_test_name
             }
        }

    This makes this test file coherent in its use of $gdb_test_name.

    Tested on x86_64-linux.
---
 gdb/testsuite/gdb.base/interp.exp | 27 +++++++++++----------------
 1 file changed, 11 insertions(+), 16 deletions(-)

diff --git a/gdb/testsuite/gdb.base/interp.exp b/gdb/testsuite/gdb.base/interp.exp
index fc95ee113c2..1f2bde250fc 100644
--- a/gdb/testsuite/gdb.base/interp.exp
+++ b/gdb/testsuite/gdb.base/interp.exp
@@ -22,10 +22,9 @@ if { [prepare_for_testing "failed to prepare" ${testfile} $srcfile {debug}] } {
 }
 
 # Do not use gdb_test for this test, since it has two prompts.
-set cmd "interpreter-exec mi \"-var-update *\""
-gdb_test_multiple $cmd $cmd {
+gdb_test_multiple "interpreter-exec mi \"-var-update *\"" "" {
     -re "\\^done,changelist=\\\[\\\]\r\n$gdb_prompt " {
-	pass "$cmd"
+	pass $gdb_test_name
 	gdb_expect 1 {
 	    -re "\r\n$gdb_prompt $" { }
 	}
@@ -37,47 +36,43 @@ gdb_test "interpreter-exec console \"show version\"" "GNU gdb .*"
 gdb_test_multiple "interpreter-exec mi \"-break-insert --thread a\"" \
     "regression test for mi_parse crash" {
 	-re ".error,msg=.Invalid value for the '--thread' option.\r\n$gdb_prompt " {
-	    pass "$cmd"
+	    pass $gdb_test_name
 	    gdb_expect 1 {
 		-re "\r\n$gdb_prompt $" { }
 	    }
 	}
     }
 
-set cmd "interpreter-exec mi \"-stack-info-frame\""
-gdb_test_multiple $cmd $cmd {
+gdb_test_multiple "interpreter-exec mi \"-stack-info-frame\"" "" {
     -re ".error,msg=.No registers\..\r\n$gdb_prompt " {
-	pass "$cmd"
+	pass $gdb_test_name
 	gdb_expect 1 {
 	    -re "\r\n$gdb_prompt $" { }
 	}
     }
 }
 
-set cmd "interpreter-exec mi1 \"-break-insert main\""
-gdb_test_multiple $cmd $cmd {
+gdb_test_multiple "interpreter-exec mi1 \"-break-insert main\"" "" {
     -re ".done.bkpt=.number=.\[0-9\]\[^\n\]+\r\n$gdb_prompt " {
-	pass "$cmd"
+	pass $gdb_test_name
 	gdb_expect 1 {
 	    -re "\r\n$gdb_prompt $" { }
 	}
     }
 }
 
-set cmd "interpreter-exec mi2 \"-break-insert main\""
-gdb_test_multiple $cmd $cmd {
+gdb_test_multiple "interpreter-exec mi2 \"-break-insert main\"" "" {
     -re ".done.bkpt=.number=.\[0-9\]\[^\n\]+\r\n$gdb_prompt " {
-	pass "$cmd"
+	pass $gdb_test_name
 	gdb_expect 1 {
 	    -re "\r\n$gdb_prompt $" { }
 	}
     }
 }
 
-set cmd "interpreter-exec mi3 \"-break-insert main\""
-gdb_test_multiple $cmd $cmd {
+gdb_test_multiple "interpreter-exec mi3 \"-break-insert main\"" "" {
     -re ".done.bkpt=.number=.\[0-9\]\[^\n\]+\r\n$gdb_prompt " {
-	pass "$cmd"
+	pass $gdb_test_name
 	gdb_expect 1 {
 	    -re "\r\n$gdb_prompt $" { }
 	}
-- 
2.33.1

[-- Attachment #2: v2-0001-gdb-testsuite-Remove-duplicates-from-gdb.base-int.patch --]
[-- Type: text/plain, Size: 3496 bytes --]

From 318524ca1ac8fe3eeb2555f59f0b15fe88edcd74 Mon Sep 17 00:00:00 2001
From: Lancelot SIX <lsix@lancelotsix.com>
Date: Fri, 19 Nov 2021 19:55:05 +0000
Subject: [PATCH v2] gdb/testsuite: Remove duplicates from gdb.base/interp.exp

When running the testsuite I have:

    Running .../gdb/testsuite/gdb.base/interp.exp ...
    DUPLICATE: gdb.base/interp.exp: interpreter-exec mi "-var-update *"

This is due to the fact that multiple successive instances of
gdb_test_multiple use 'pass $cmd', but one of them forgets to reset $cmd
to a new test name.

Fix by using 'pass $gdb_test_name', given that the gdb_test_name is set
by gdb_test_multiple.

While fixing this, this patch refactors all occurrences of the following
pattern:

    set cmd foo
    gdb_test_multiple $cmd $cmd {
        -re ... {
            pass $cmd
        }
    }

into

    gdb_test_multiple foo "" {
        -re ... {
            pass $gdb_test_name
         }
    }

This makes this test file coherent in its use of $gdb_test_name.

Tested on x86_64-linux.
---
 gdb/testsuite/gdb.base/interp.exp | 27 +++++++++++----------------
 1 file changed, 11 insertions(+), 16 deletions(-)

diff --git a/gdb/testsuite/gdb.base/interp.exp b/gdb/testsuite/gdb.base/interp.exp
index fc95ee113c2..1f2bde250fc 100644
--- a/gdb/testsuite/gdb.base/interp.exp
+++ b/gdb/testsuite/gdb.base/interp.exp
@@ -22,10 +22,9 @@ if { [prepare_for_testing "failed to prepare" ${testfile} $srcfile {debug}] } {
 }
 
 # Do not use gdb_test for this test, since it has two prompts.
-set cmd "interpreter-exec mi \"-var-update *\""
-gdb_test_multiple $cmd $cmd {
+gdb_test_multiple "interpreter-exec mi \"-var-update *\"" "" {
     -re "\\^done,changelist=\\\[\\\]\r\n$gdb_prompt " {
-	pass "$cmd"
+	pass $gdb_test_name
 	gdb_expect 1 {
 	    -re "\r\n$gdb_prompt $" { }
 	}
@@ -37,47 +36,43 @@ gdb_test "interpreter-exec console \"show version\"" "GNU gdb .*"
 gdb_test_multiple "interpreter-exec mi \"-break-insert --thread a\"" \
     "regression test for mi_parse crash" {
 	-re ".error,msg=.Invalid value for the '--thread' option.\r\n$gdb_prompt " {
-	    pass "$cmd"
+	    pass $gdb_test_name
 	    gdb_expect 1 {
 		-re "\r\n$gdb_prompt $" { }
 	    }
 	}
     }
 
-set cmd "interpreter-exec mi \"-stack-info-frame\""
-gdb_test_multiple $cmd $cmd {
+gdb_test_multiple "interpreter-exec mi \"-stack-info-frame\"" "" {
     -re ".error,msg=.No registers\..\r\n$gdb_prompt " {
-	pass "$cmd"
+	pass $gdb_test_name
 	gdb_expect 1 {
 	    -re "\r\n$gdb_prompt $" { }
 	}
     }
 }
 
-set cmd "interpreter-exec mi1 \"-break-insert main\""
-gdb_test_multiple $cmd $cmd {
+gdb_test_multiple "interpreter-exec mi1 \"-break-insert main\"" "" {
     -re ".done.bkpt=.number=.\[0-9\]\[^\n\]+\r\n$gdb_prompt " {
-	pass "$cmd"
+	pass $gdb_test_name
 	gdb_expect 1 {
 	    -re "\r\n$gdb_prompt $" { }
 	}
     }
 }
 
-set cmd "interpreter-exec mi2 \"-break-insert main\""
-gdb_test_multiple $cmd $cmd {
+gdb_test_multiple "interpreter-exec mi2 \"-break-insert main\"" "" {
     -re ".done.bkpt=.number=.\[0-9\]\[^\n\]+\r\n$gdb_prompt " {
-	pass "$cmd"
+	pass $gdb_test_name
 	gdb_expect 1 {
 	    -re "\r\n$gdb_prompt $" { }
 	}
     }
 }
 
-set cmd "interpreter-exec mi3 \"-break-insert main\""
-gdb_test_multiple $cmd $cmd {
+gdb_test_multiple "interpreter-exec mi3 \"-break-insert main\"" "" {
     -re ".done.bkpt=.number=.\[0-9\]\[^\n\]+\r\n$gdb_prompt " {
-	pass "$cmd"
+	pass $gdb_test_name
 	gdb_expect 1 {
 	    -re "\r\n$gdb_prompt $" { }
 	}
-- 
2.33.1


^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 03/29] gdb/testsuite: Remove duplicates from gdb.base/interp.exp
  2021-11-22 17:33     ` Lancelot SIX
@ 2021-12-10 22:01       ` Pedro Alves
  0 siblings, 0 replies; 74+ messages in thread
From: Pedro Alves @ 2021-12-10 22:01 UTC (permalink / raw)
  To: Lancelot SIX; +Cc: gdb-patches

On 2021-11-22 17:33, Lancelot SIX wrote:
> On Mon, Nov 22, 2021 at 02:13:59PM +0000, Pedro Alves wrote:
>> On 2021-11-21 17:56, Lancelot SIX via Gdb-patches wrote:
>>>  # Regression test for crash when an exception occurs in mi_parse.
>>> -gdb_test_multiple "interpreter-exec mi \"-break-insert --thread a\"" \
>>> -    "regression test for mi_parse crash" {
>>> +set cmd "interpreter-exec mi \"-break-insert --thread a\""
>>> +gdb_test_multiple $cmd "regression test for mi_parse crash" {
>>
>> This "regression test for mi_parse crash" message is used if this
>> gdb_test_multiple detects an internal error, a timeout, etc.
>>
>>>  	-re ".error,msg=.Invalid value for the '--thread' option.\r\n$gdb_prompt " {
>>>  	    pass "$cmd"
>>
>> ... while here we use $cmd.
>>
>> This means that this test can have its result oscillate like this:
>>
>>  -FAIL: regression test for mi_parse crash"
>>  +PASS: interpreter-exec mi "-break-insert --thread a"
>> ...
>>  +PASS: interpreter-exec mi "-break-insert --thread a"
>>  -FAIL: regression test for mi_parse crash"
>>
>>
>> The "modern" pattern would be to not have a $cmd variable at all, pass an empty
>> string as second argument to gdb_test_multiple, and then passing $gdb_test_name
>> to "pass".  Like:
>>
>> gdb_test_multiple "interpreter-exec mi \"-break-insert --thread a\"" "" {
>>    -re .... {
>>        pass $gdb_test_multiple
>>    }
>> }
>>
>>
>> Though simplest is to pass $cmd as second argument too like other
>> gdb_test_multiple invocations in the file:
>>
>>  gdb_test_multiple $cmd $cmd {
>>  ...
>>
>>
>>
>> Could you take care of this while at it?
>>
>> Pedro Alves
> 
> Hi,
> 
> Thanks for the inputs.
> 
> I have updated the patch as follows.

Thanks, this is OK.

^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 02/29] gdb/testsuite: Remove duplicates from gdb.base/miscexprs.exp
  2021-11-21 17:56 ` [PATCH 02/29] gdb/testsuite: Remove duplicates from gdb.base/miscexprs.exp Lancelot SIX
@ 2021-12-10 22:06   ` Pedro Alves
  2021-12-14 23:28     ` Lancelot SIX
  2022-01-04 14:00   ` Andrew Burgess
  1 sibling, 1 reply; 74+ messages in thread
From: Pedro Alves @ 2021-12-10 22:06 UTC (permalink / raw)
  To: Lancelot SIX, gdb-patches

On 2021-11-21 17:56, Lancelot SIX via Gdb-patches wrote:
> When running the testsuite I see:
> 
>     Running .../gdb/testsuite/gdb.base/miscexprs.exp ...
>     DUPLICATE: gdb.base/miscexprs.exp: print value of !ibig.i[100]
>     DUPLICATE: gdb.base/miscexprs.exp: print value of !ibig.i[100]
> 
> Fix the name of some misnamed tests.
> 
> Tested on x86_64.
> ---
>  gdb/testsuite/gdb.base/miscexprs.exp | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/gdb/testsuite/gdb.base/miscexprs.exp b/gdb/testsuite/gdb.base/miscexprs.exp
> index 86f41215283..c1fc7420545 100644
> --- a/gdb/testsuite/gdb.base/miscexprs.exp
> +++ b/gdb/testsuite/gdb.base/miscexprs.exp
> @@ -118,10 +118,10 @@ gdb_test "print !sbig.s\[90\]" " = $false" \
>      "print value of !sbig.s\[90\]"
>  
>  gdb_test "print !fbig.f\[100\]" " = $false" \
> -    "print value of !ibig.i\[100\]"
> +    "print value of !fbig.f\[100\]"
>  
>  gdb_test "print !dbig.d\[202\]" " = $false" \
> -    "print value of !ibig.i\[100\]"
> +    "print value of !dbig.d\[202\]"
>  
>  gdb_test "print sbig.s\[90\] * 10" " = 2550" \
>      "print value of !sbig.s\[90\] * 10"
> 

Can you just drop the explicit names instead?

That's the actual problem, the duplication, and
us humans failing at it.  Removing the duplication nips the problem in the bud, so it doesn't
ever happen again if someone adds more tests.

So we'd just have:

  gdb_test "print sbig.s\[90\] * 10" " = 2550"

etc.

We lose the "value of" part but that seems harmless.

^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 13/29] gdb/testsuite: Remove duplicates from gdb.base/dfp-exprs.exp
  2021-11-21 17:56 ` [PATCH 13/29] gdb/testsuite: Remove duplicates from gdb.base/dfp-exprs.exp Lancelot SIX
@ 2021-12-10 23:03   ` Pedro Alves
  2021-12-15  0:01     ` Lancelot SIX
  0 siblings, 1 reply; 74+ messages in thread
From: Pedro Alves @ 2021-12-10 23:03 UTC (permalink / raw)
  To: Lancelot SIX, gdb-patches

On 2021-11-21 17:56, Lancelot SIX via Gdb-patches wrote:
> When I run the testsuite, I have:
> 
>     Running ../gdb/testsuite/gdb.base/dfp-exprs.exp ...
>     DUPLICATE: gdb.base/dfp-exprs.exp: p 1.2dl < 1.3df
> 
> Fix by removing the duplicated test.
> 
> Tested on x86_64-linux.
> ---
>  gdb/testsuite/gdb.base/dfp-exprs.exp | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/gdb/testsuite/gdb.base/dfp-exprs.exp b/gdb/testsuite/gdb.base/dfp-exprs.exp
> index 355b8f04a1f..cce743d3ffe 100644
> --- a/gdb/testsuite/gdb.base/dfp-exprs.exp
> +++ b/gdb/testsuite/gdb.base/dfp-exprs.exp
> @@ -154,7 +154,6 @@ proc test_dfp_arithmetic_expressions {} {
>      gdb_test "p 1.2dd < 1.3dd" " = 1"
>      gdb_test "p 1.2dd < 1.3dl" " = 1"
>      gdb_test "p 1.2dl < 1.3dl" " = 1"
> -    gdb_test "p 1.2dl < 1.3df" " = 1"

Hmm, it's not super obvious to me what the intention was here.  For one, I can't spot a pattern in
the sequence here.  Am I missing it?  

If we alpha sort the lines (sort-lines in emacs), and then add the missing combinations, we end up with:

    # Keep the list alpha sorted.
    gdb_test "p 1.2dd < 1.3dd" " = 1"
    gdb_test "p 1.2dd < 1.3df" " = 1"
    gdb_test "p 1.2dd < 1.3dl" " = 1"
    gdb_test "p 1.2df < 1.3dd" " = 1"
    gdb_test "p 1.2df < 1.3df" " = 1"
    gdb_test "p 1.2df < 1.3dl" " = 1"
    gdb_test "p 1.2dl < 1.3dd" " = 1"
    gdb_test "p 1.2dl < 1.3df" " = 1"
    gdb_test "p 1.2dl < 1.3dl" " = 1"

But then, the == tests are also missing some combinations.  I think that if we do this
programmatically with a for loop, we can exercise all the combinations in much clearer code,
removing the need to eyeball for all suffixes.  See patch below.

I've also added a lot more combinations, testing all comparison operators comprehensively.

The result is 262 unique tests vs 104 today.

Let me know what you think.

>      gdb_test "p 1.2df > 1" " = 1"
>      gdb_test "p 1.2dl > 2" " = 0"
>      gdb_test "p 2 > 1.2dd" " = 1"
> 

From fe8eed9a83b6c5608bc3b7d496a438628e7fc3a5 Mon Sep 17 00:00:00 2001
From: Pedro Alves <pedro@palves.net>
Date: Fri, 10 Dec 2021 22:41:54 +0000
Subject: [PATCH] Programmatic

Change-Id: Id215a3d610aa8e032bf06ee160b5e3aed4a92d1e
---
 gdb/testsuite/gdb.base/dfp-exprs.exp | 94 +++++++++++++++++-----------
 1 file changed, 57 insertions(+), 37 deletions(-)

diff --git a/gdb/testsuite/gdb.base/dfp-exprs.exp b/gdb/testsuite/gdb.base/dfp-exprs.exp
index 355b8f04a1f..e735e6df6d8 100644
--- a/gdb/testsuite/gdb.base/dfp-exprs.exp
+++ b/gdb/testsuite/gdb.base/dfp-exprs.exp
@@ -122,43 +122,63 @@ proc test_dfp_arithmetic_expressions {} {
     gdb_test "p 1.2df + 1.2f" "Mixing decimal floating types with other floating types is not allowed."
 
     # Test other operations with DFP operands
-    gdb_test "p !0.df" " = 1"
-    gdb_test "p !0.dd" " = 1"
-    gdb_test "p !0.dl" " = 1"
-    gdb_test "p !0.5df" " = 0"
-    gdb_test "p !0.5dd" " = 0"
-    gdb_test "p !0.5dl" " = 0"
-
-    gdb_test "p 1.2df == 1.2df" " = 1"
-    gdb_test "p 1.2df == 1.2dd" " = 1"
-    gdb_test "p 1.2df == 1.2dl" " = 1"
-    gdb_test "p 1.2dd == 1.2df" " = 1"
-    gdb_test "p 1.2dd == 1.2dl" " = 1"
-    gdb_test "p 1.2dl == 1.2df" " = 1"
-    gdb_test "p 1.2dl == 1.2dd" " = 1"
-    gdb_test "p 1.2df == 1.3df" " = 0"
-    gdb_test "p 1.2df == 1.3dd" " = 0"
-    gdb_test "p 1.2df == 1.3dl" " = 0"
-    gdb_test "p 1.2dd == 1.3df" " = 0"
-    gdb_test "p 1.2dd == 1.3dl" " = 0"
-    gdb_test "p 1.2dl == 1.3df" " = 0"
-    gdb_test "p 1.2dl == 1.3dd" " = 0"
-
-    gdb_test "p +1.2df" " = 1.2"
-    gdb_test "p +1.2dd" " = 1.2"
-    gdb_test "p +1.2dl" " = 1.2"
-
-    gdb_test "p 1.2df < 1.3df" " = 1"
-    gdb_test "p 1.2df < 1.3dd" " = 1"
-    gdb_test "p 1.2dl < 1.3df" " = 1"
-    gdb_test "p 1.2dd < 1.3dd" " = 1"
-    gdb_test "p 1.2dd < 1.3dl" " = 1"
-    gdb_test "p 1.2dl < 1.3dl" " = 1"
-    gdb_test "p 1.2dl < 1.3df" " = 1"
-    gdb_test "p 1.2df > 1" " = 1"
-    gdb_test "p 1.2dl > 2" " = 0"
-    gdb_test "p 2 > 1.2dd" " = 1"
-    gdb_test "p 2 > 3.1dl" " = 0"
+
+    set dsuffix {"dd" "df" "dl"}
+
+    foreach l $dsuffix {
+        foreach r $dsuffix {
+	    gdb_test "p 1.2${l} == 1.2${r}" " = 1"
+	    gdb_test "p 1.2${l} == 1.3${r}" " = 0"
+
+	    gdb_test "p 1.2${l} < 1.2${r}" " = 0"
+	    gdb_test "p 1.2${l} < 1.3${r}" " = 1"
+	    gdb_test "p 1.3${l} < 1.2${r}" " = 0"
+
+	    gdb_test "p 1.2${l} > 1.2${r}" " = 0"
+	    gdb_test "p 1.2${l} > 1.3${r}" " = 0"
+	    gdb_test "p 1.3${l} > 1.2${r}" " = 1"
+
+	    gdb_test "p 1.2${l} <= 1.2${r}" " = 1"
+	    gdb_test "p 1.2${l} <= 1.3${r}" " = 1"
+	    gdb_test "p 1.3${l} <= 1.2${r}" " = 0"
+
+	    gdb_test "p 1.2${l} >= 1.2${r}" " = 1"
+	    gdb_test "p 1.2${l} >= 1.3${r}" " = 0"
+	    gdb_test "p 1.3${l} >= 1.2${r}" " = 1"
+	}
+
+	gdb_test "p !0.${l}" " = 1"
+	gdb_test "p !0.5${l}" " = 0"
+
+	gdb_test "p +1.2${l}" " = 1.2"
+
+	# This checks GDB doesn't convert to int and rounds up/down.
+	gdb_test "p 1.2${l} == 1" " = 0"
+	gdb_test "p 1.2${l} == 2" " = 0"
+
+	gdb_test "p 1.2${l} == 1.2" \
+	    "Mixing decimal floating types with other floating types is not allowed\\."
+
+	gdb_test "p 1.2${l} > 1" " = 1"
+	gdb_test "p 1.2${l} > 2" " = 0"
+	gdb_test "p 1.2${l} >= 1" " = 1"
+	gdb_test "p 1.2${l} >= 2" " = 0"
+
+	gdb_test "p 1.2${l} < 1" " = 0"
+	gdb_test "p 1.2${l} < 2" " = 1"
+	gdb_test "p 1.2${l} <= 1" " = 0"
+	gdb_test "p 1.2${l} <= 2" " = 1"
+
+	gdb_test "p 1 < 1.2${l}" " = 1"
+	gdb_test "p 2 < 1.2${l}" " = 0"
+	gdb_test "p 1 <= 1.2${l}" " = 1"
+	gdb_test "p 2 <= 1.2${l}" " = 0"
+
+	gdb_test "p 1 > 1.2${l}" " = 0"
+	gdb_test "p 2 > 1.2${l}" " = 1"
+	gdb_test "p 1 >= 1.2${l}" " = 0"
+	gdb_test "p 2 >= 1.2${l}" " = 1"
+    }
 }
 
 proc test_dfp_conversions {} {

base-commit: 43f7c3581f5c615b65f7c15c298c9be20c2597cf
-- 
2.26.2


^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 19/29] gdb/testsuite: Remove duplicates from gdb.base/exprs.exp
  2021-11-21 17:56 ` [PATCH 19/29] gdb/testsuite: Remove duplicates from gdb.base/exprs.exp Lancelot SIX
@ 2021-12-10 23:15   ` Pedro Alves
  2021-12-15  0:21     ` Lancelot SIX
  0 siblings, 1 reply; 74+ messages in thread
From: Pedro Alves @ 2021-12-10 23:15 UTC (permalink / raw)
  To: Lancelot SIX, gdb-patches

On 2021-11-21 17:56, Lancelot SIX via Gdb-patches wrote:
> When running the testsuite, I have:
> 
>     Running .../gdb/testsuite/gdb.base/exprs.exp ...
>     DUPLICATE: gdb.base/exprs.exp: \$[0-9]* = red (setup)
> 
> Fix by using with_test_prefix where appropriate.
> 
> Tested on x86_64-linux.
> ---
>  gdb/testsuite/gdb.base/exprs.exp | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/gdb/testsuite/gdb.base/exprs.exp b/gdb/testsuite/gdb.base/exprs.exp
> index 50272d133a2..0525f76a44c 100644
> --- a/gdb/testsuite/gdb.base/exprs.exp
> +++ b/gdb/testsuite/gdb.base/exprs.exp
> @@ -238,7 +238,9 @@ test_expr "print \"x\" \"y\" \"z\"" "\\$\[0-9\]* = \"xyz\""
>  # Enum formatting tests.
>  test_expr "print red" "\\$\[0-9\]* = red"
>  gdb_test "set output-radix 8" ".*"
> -test_expr "print red" "\\$\[0-9\]* = red"
> +with_test_prefix "with output-radix 8" {
> +    test_expr "print red" "\\$\[0-9\]* = red"
> +}
>  test_expr "print/d red" "\\$\[0-9\]* = 0"

The following test_expr is also under output-radix 8.  This seems to be begging for:

with_test_prefix "output-radix 8" {
  gdb_test "set output-radix 8" ".*"
  test_expr "print red" "\\$\[0-9\]* = red"
  test_expr "print/d red" "\\$\[0-9\]* = 0"
  gdb_test "set output-radix 10" ".*"
}

WDYT?

>  
> 


^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 16/29] gdb/testsuite: Remove duplicates from gdb.base/ui-redirect.exp
  2021-11-21 17:56 ` [PATCH 16/29] gdb/testsuite: Remove duplicates from gdb.base/ui-redirect.exp Lancelot SIX
@ 2021-12-10 23:15   ` Pedro Alves
  2021-12-15  0:26     ` Lancelot SIX
  0 siblings, 1 reply; 74+ messages in thread
From: Pedro Alves @ 2021-12-10 23:15 UTC (permalink / raw)
  To: Lancelot SIX, gdb-patches

On 2021-11-21 17:56, Lancelot SIX via Gdb-patches wrote:
> When running the testsuite, I have:
> 
>     Running .../gdb/testsuite/gdb.base/ui-redirect.exp ...
>     DUPLICATE: gdb.base/ui-redirect.exp: redirect while already logging: set logging redirect off
> 
> Fix by moving the first 'set logging redirect off' at the end of the

"at the end" -> "to the end".  "at" changes meaning completely, confusing.

OK with that change.

> previous [with_test_prefix] test block. The statement's purpose is to
> clean the on flag set in this previous block, so moving it there makes
> sense and does not change the sequence of commands in the test file..
> 
> Tested on x86_64-linux.
> ---
>  gdb/testsuite/gdb.base/ui-redirect.exp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/gdb/testsuite/gdb.base/ui-redirect.exp b/gdb/testsuite/gdb.base/ui-redirect.exp
> index 363c563a5a1..6ed9c49c427 100644
> --- a/gdb/testsuite/gdb.base/ui-redirect.exp
> +++ b/gdb/testsuite/gdb.base/ui-redirect.exp
> @@ -95,10 +95,10 @@ with_test_prefix "redirect" {
>      gdb_test_no_output "userdefined"
>      gdb_test "set logging off" "Done logging to /dev/null\\."
>      gdb_test "help" "List of classes of commands:.*"
> +    gdb_test_no_output "set logging redirect off"
>  }
>  
>  with_test_prefix "redirect while already logging" {
> -    gdb_test_no_output "set logging redirect off"
>      gdb_test "set logging on" \
>      "Copying output to /dev/null.*Copying debug output to /dev/null\\."
>      gdb_test "set logging redirect on" \
> 


^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 21/29] gdb/testsuite: Remove duplicates from gdb.base/shlib-call.exp
  2021-11-21 17:56 ` [PATCH 21/29] gdb/testsuite: Remove duplicates from gdb.base/shlib-call.exp Lancelot SIX
@ 2021-12-10 23:24   ` Pedro Alves
  2021-12-16 22:57     ` Lancelot SIX
  0 siblings, 1 reply; 74+ messages in thread
From: Pedro Alves @ 2021-12-10 23:24 UTC (permalink / raw)
  To: Lancelot SIX, gdb-patches

On 2021-11-21 17:56, Lancelot SIX via Gdb-patches wrote:
> When I run the testsuite, I have:
> 
>     Running .../gdb/testsuite/gdb.base/shlib-call.exp ...
>     DUPLICATE: gdb.base/shlib-call.exp: print g
>     DUPLICATE: gdb.base/shlib-call.exp: set print sevenbit-strings
>     DUPLICATE: gdb.base/shlib-call.exp: set print address off
>     DUPLICATE: gdb.base/shlib-call.exp: set width 0
>     DUPLICATE: gdb.base/shlib-call.exp: continue until exit
> 
> Fix by adjusting the test names.
> 
> Tested on x86_64-linux.
> ---
>  gdb/testsuite/gdb.base/shlib-call.exp | 13 ++++++++-----
>  1 file changed, 8 insertions(+), 5 deletions(-)
> 
> diff --git a/gdb/testsuite/gdb.base/shlib-call.exp b/gdb/testsuite/gdb.base/shlib-call.exp
> index 0a5a1c336c1..f7f20cc0127 100644
> --- a/gdb/testsuite/gdb.base/shlib-call.exp
> +++ b/gdb/testsuite/gdb.base/shlib-call.exp
> @@ -90,7 +90,7 @@ if ![gdb_skip_stdio_test "next over shr1"] {
>  
>  
>  #print g
> -gdb_test "print g" "\[0-9\]* = 2"
> +gdb_test "print g" "\[0-9\]* = 2" "print g two"
>  
>  #print shr1(1)
>  if ![gdb_skip_stdio_test "print shr1(1)"] {
> @@ -166,9 +166,12 @@ gdb_exit
>  gdb_start
>  gdb_reinitialize_dir $srcdir/$subdir
>  gdb_load ${binfile}
> -gdb_test_no_output "set print sevenbit-strings"
> -gdb_test_no_output "set print address off"
> -gdb_test_no_output "set width 0"
> +gdb_test_no_output "set print sevenbit-strings" \
> +    "set print sevenbit-strings, after restart"
> +gdb_test_no_output "set print address off" \
> +    "set print address off, after restart"
> +gdb_test_no_output "set width 0" \
> +    "set width 0, after restart"

Let's not fix DUPLICATEs with duplication.  :-)  Write instead:

with_test_prefix "after restart" {
  gdb_test_no_output "set print sevenbit-strings"
  gdb_test_no_output "set print address off"
  gdb_test_no_output "set width 0"
}

Actually, I take that back.  We should just delete these 3 "set" commands and the same ones
at the bottom too.  Setting width to 0 is already done centrally.  The other two make
no difference in this test.  I strongly suspect this is very very old test code.

The "Start with a fresh gdb" block could just use clean_restart.

>  
>  
>  # PR's 16495, 18213
> @@ -193,4 +196,4 @@ gdb_test_multiple "" $test {
>      }
>  }
>  
> -gdb_continue_to_end "" continue 1
> +gdb_continue_to_end "after re-run" continue 1
> 


^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 22/29] gdb/testsuite: Remove duplicates from gdb.base/funcargs.exp
  2021-11-21 17:56 ` [PATCH 22/29] gdb/testsuite: Remove duplicates from gdb.base/funcargs.exp Lancelot SIX
@ 2021-12-10 23:26   ` Pedro Alves
  2021-12-16 23:08     ` Lancelot SIX
  0 siblings, 1 reply; 74+ messages in thread
From: Pedro Alves @ 2021-12-10 23:26 UTC (permalink / raw)
  To: Lancelot SIX, gdb-patches

On 2021-11-21 17:56, Lancelot SIX via Gdb-patches wrote:
> --- a/gdb/testsuite/gdb.base/funcargs.exp
> +++ b/gdb/testsuite/gdb.base/funcargs.exp
> @@ -213,7 +213,7 @@ proc complex_args {} {
>  
>      # Run; should stop at call1a and print actual arguments.
>      gdb_run_cmd
> -    gdb_test "" " callca \\(f1=1 \\+ 2i, f2=1 \\+ 2i, f3=1 \\+ 2i\\) .*" "run to call2a"
> +    gdb_test "" " callca \\(f1=1 \\+ 2i, f2=1 \\+ 2i, f3=1 \\+ 2i\\) .*" "run to call2a (complex_arg)"

No tail parens, please.  See:

https://sourceware.org/gdb/wiki/GDBTestcaseCookbook#Do_not_use_.22tail_parentheses.22_on_test_messages

^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 25/29] gdb/testsuite: Remove duplicates from gdb.base/pointers.exp
  2021-11-21 17:56 ` [PATCH 25/29] gdb/testsuite: Remove duplicates from gdb.base/pointers.exp Lancelot SIX
@ 2021-12-10 23:27   ` Pedro Alves
  2021-12-16 23:14     ` Lancelot SIX
  0 siblings, 1 reply; 74+ messages in thread
From: Pedro Alves @ 2021-12-10 23:27 UTC (permalink / raw)
  To: Lancelot SIX, gdb-patches

On 2021-11-21 17:56, Lancelot SIX via Gdb-patches wrote:
> When I run the testsuite, I have :
> 
>     Running .../gdb/testsuite/gdb.base/pointers.exp ...
>     DUPLICATE: gdb.base/pointers.exp: pointer assignment
> 
> Fix by adjusting the test names.
> 
> Tested on x86_64-linux.
> ---
>  gdb/testsuite/gdb.base/pointers.exp | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/gdb/testsuite/gdb.base/pointers.exp b/gdb/testsuite/gdb.base/pointers.exp
> index fa7531d0f85..cd10a721964 100644
> --- a/gdb/testsuite/gdb.base/pointers.exp
> +++ b/gdb/testsuite/gdb.base/pointers.exp
> @@ -147,14 +147,14 @@ gdb_test "print v_int_pointer > v_int_pointer2" " = $false" \
>  
>  gdb_test_no_output "set variable y = *v_int_pointer++" \
>      "set y = *v_int_pointer++"
> -gdb_test "print y" " = 6" "pointer assignment"
> +gdb_test "print y" " = 6" "pointer assignment (after y = *v_int_pointer++)"
>  gdb_test "print *v_int_pointer" " = 18" "and post-increment"

Tail parens bad.  :-)

>  
>  
>  
>  gdb_test_no_output "set variable y = *--v_int_pointer2" \
>      "set y = *--v_int_pointer2"
> -gdb_test "print y" " = 6" "pointer assignment"
> +gdb_test "print y" " = 6" "pointer assignment (after y = *--v_int_pointer2)"
>  gdb_test "print *v_int_pointer2" " = 6" "and pre-decrement"
>  
>  
> 


^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 28/29] gdb/testsuite: Remove duplicates from gdb.base/watchpoints.exp
  2021-11-21 17:56 ` [PATCH 28/29] gdb/testsuite: Remove duplicates from gdb.base/watchpoints.exp Lancelot SIX
@ 2021-12-10 23:30   ` Pedro Alves
  2021-12-16 23:15     ` Lancelot SIX
  0 siblings, 1 reply; 74+ messages in thread
From: Pedro Alves @ 2021-12-10 23:30 UTC (permalink / raw)
  To: Lancelot SIX, gdb-patches

On 2021-11-21 17:56, Lancelot SIX via Gdb-patches wrote:
> When running the testsuite, I have:
> 
>     Running ../gdb/testsuite/gdb.base/watchpoints.exp ...
>     DUPLICATE: gdb.base/watchpoints.exp: watchpoint hit, first time
> 
> Fix by adjusting the test nanes where appropriate.

"test names"

OK.
+
> 
> Tested on x86_64-linux.
> ---
>  gdb/testsuite/gdb.base/watchpoints.exp | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/gdb/testsuite/gdb.base/watchpoints.exp b/gdb/testsuite/gdb.base/watchpoints.exp
> index 4f4e4980eb1..6582c60b37d 100644
> --- a/gdb/testsuite/gdb.base/watchpoints.exp
> +++ b/gdb/testsuite/gdb.base/watchpoints.exp
> @@ -63,9 +63,9 @@ with_test_prefix "before inferior start" {
>      set prev_timeout $timeout
>      set timeout 600
>  
> -    gdb_test "cont" "Continuing.*\[Ww\]atchpoint.*ival1.*Old value = -1.*New value = 0.*ival1 = count; ival2 = count;.*" "watchpoint hit, first time"
> +    gdb_test "cont" "Continuing.*\[Ww\]atchpoint.*ival1.*Old value = -1.*New value = 0.*ival1 = count; ival2 = count;.*" "watchpoint ival1 hit, first time"
>  
> -    gdb_test "cont" "Continuing.*\[Ww\]atchpoint.*ival3.*Old value = -1.*New value = 0.*ival3 = count; ival4 = count;.*" "watchpoint hit, first time"
> +    gdb_test "cont" "Continuing.*\[Ww\]atchpoint.*ival3.*Old value = -1.*New value = 0.*ival3 = count; ival4 = count;.*" "watchpoint ival3 hit, first time"
>  
>      # Check that the ival3 hit count is reported correctly
>      gdb_test "info break" ".*watchpoint\[ \t\]+keep\[ \t\]+y\[ \t\]+ival3\r\n\[ \t]+breakpoint already hit 1 time.*" "watchpoint hit count is 1"
> 


^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 29/29] gdb/testsuite: Remove duplicates from gdb.base/corefile-buildid.exp
  2021-11-21 17:56 ` [PATCH 29/29] gdb/testsuite: Remove duplicates from gdb.base/corefile-buildid.exp Lancelot SIX
@ 2021-12-10 23:38   ` Pedro Alves
  0 siblings, 0 replies; 74+ messages in thread
From: Pedro Alves @ 2021-12-10 23:38 UTC (permalink / raw)
  To: Lancelot SIX, gdb-patches

On 2021-11-21 17:56, Lancelot SIX via Gdb-patches wrote:
> When running the testsuite, I have:
> 
>     Running .../gdb/testsuite/gdb.base/corefile-buildid.exp ...
>     WARNING: can't generate a core file - core tests suppressed - check ulimit -c
>     WARNING: can't generate a core file - core tests suppressed - check ulimit -c
>     DUPLICATE: gdb.base/corefile-buildid.exp: could not generate core file
>     WARNING: can't generate a core file - core tests suppressed - check ulimit -c
>     DUPLICATE: gdb.base/corefile-buildid.exp: could not generate core file
>     WARNING: can't generate a core file - core tests suppressed - check ulimit -c
>     DUPLICATE: gdb.base/corefile-buildid.exp: could not generate core file
> 
> The WARNING itself is related to my test environment, not the test
> istelf so I do not try to address it here.
> 
> Fix the DUPLICATEs by ensuring the test name is generated consistently
> with the rest of the file (i.e. by using $prefix in the name).
> 
> Tested on x86_64-linux.
> ---
>  gdb/testsuite/gdb.base/corefile-buildid.exp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/gdb/testsuite/gdb.base/corefile-buildid.exp b/gdb/testsuite/gdb.base/corefile-buildid.exp
> index 15509be7039..bb1d4051b07 100644
> --- a/gdb/testsuite/gdb.base/corefile-buildid.exp
> +++ b/gdb/testsuite/gdb.base/corefile-buildid.exp
> @@ -260,7 +260,7 @@ proc do_corefile_buildid_tests {args} {
>      # Find the core file.
>      set corefile [core_find $program_to_run]
>      if {$corefile == ""} {
> -	untested "could not generate core file"
> +	untested "$suffix: could not generate core file"

There's another untested call below that would need the same treatment.  I was going to suggest
with_test_prefix, but realized the code is already using that.  Turns out Simon already
did that change meanwhile:

 https://sourceware.org/pipermail/gdb-patches/2021-December/183982.html

So you can drop this patch.

>  	return
>      }
>      verbose -log "corefile is $corefile"
> 


^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 00/29] Remove DUPLICATEs from testsuite/gdb.base/*.exp
  2021-11-21 17:56 [PATCH 00/29] Remove DUPLICATEs from testsuite/gdb.base/*.exp Lancelot SIX
                   ` (28 preceding siblings ...)
  2021-11-21 17:56 ` [PATCH 29/29] gdb/testsuite: Remove duplicates from gdb.base/corefile-buildid.exp Lancelot SIX
@ 2021-12-10 23:40 ` Pedro Alves
  2021-12-18  0:39   ` Lancelot SIX
  2022-01-07 22:36 ` Lancelot SIX
  30 siblings, 1 reply; 74+ messages in thread
From: Pedro Alves @ 2021-12-10 23:40 UTC (permalink / raw)
  To: Lancelot SIX, gdb-patches

On 2021-11-21 17:56, Lancelot SIX via Gdb-patches wrote:
> Hi,
> 
> When running the tests in the gdb.base sub directory, I see many
> DUPLICATE warnings:
> 
> 	                === gdb Summary ==
> 
> 	...
> 	# of duplicate test names       48
> 
> This patch series is meant to do some cleaning so actual errors stand
> out more easily in the output.
> 
> All the fixes in this series are quite straight forward.  The majority
> of duplications are fixed by adjusting the test names or giving
> appropriate names to the test cases.  Some of the warnings actually
> report redundant tests, in which case the extra test case is removed.
> 
> This series also fixes minor formatting issues in the test files when I
> came across them (trailing white spaces, erroneous space/tab
> indentation...).
> 
> After this series, I do not have duplicates anymore in the gdb.base
> sub directory.
> 
> Tested on x86_64-linux.
> 
> All feedbacks are welcome.
> 

I reviewed all patches except patch #15 (gdb.base/complete-empty.exp).  I left that for
last as I think I'll need look a bit in more detail, but I ran out of time for now.
I sent a few comments.  Patches that I didn't comment on (other than #15) looks
OK to me.

Thanks a lot for doing this.

> Best,
> Lancelot.
> 
> Lancelot SIX (29):
>   gdb/testsuite: Remove duplicates from gdb.base/stack-checking.exp
>   gdb/testsuite: Remove duplicates from gdb.base/miscexprs.exp
>   gdb/testsuite: Remove duplicates from gdb.base/interp.exp
>   gdb/testsuite: Remove duplicates from gdb.base/realname-expand.exp
>   gdb/testsuite: Remove duplicates from gdb.base/pie-fork.exp
>   gdb/testsuite: Remove duplicates from gdb.base/checkpoint.exp
>   gdb/testsuite: Remove duplicates from gdb.base/pending.exp
>   gdb/testsuite: Remove duplicates from gdb.base/decl-before-def.exp
>   gdb/testsuite: Remove duplicates from gdb.base/solib-display.exp
>   gdb/testsuite: Remove duplicates from gdb.base/del.exp
>   gdb/testsuite: Remove duplicates from gdb.base/dfp-test.exp
>   gdb/testsuite: Remove duplicates from gdb.base/ptype.exp
>   gdb/testsuite: Remove duplicates from gdb.base/dfp-exprs.exp
>   gdb/testsuite: Remove duplicates from gdb.base/subst.exp
>   gdb/testsuite: Remove duplicates from gdb.base/complete-empty.exp
>   gdb/testsuite: Remove duplicates from gdb.base/ui-redirect.exp
>   gdb/testsuite: Remove duplicates from gdb.base/pretty-array.exp
>   gdb/testsuite: Remove duplicates from gdb.base/readline.exp
>   gdb/testsuite: Remove duplicates from gdb.base/exprs.exp
>   gdb/testsuite: Remove duplicates from gdb.base/set-cfd.exp
>   gdb/testsuite: Remove duplicates from gdb.base/shlib-call.exp
>   gdb/testsuite: Remove duplicates from gdb.base/funcargs.exp
>   gdb/testsuite: Remove duplicates from gdb.base/define-prefix.exp
>   gdb/testsuite: Remove duplicates from gdb.base/unload.exp
>   gdb/testsuite: Remove duplicates from gdb.base/pointers.exp
>   gdb/testsuite: Remove duplicates from gdb.base/call-signal-resume.exp
>   gdb/testsuite: Remove duplicates from gdb.base/nested-subp2.exp
>   gdb/testsuite: Remove duplicates from gdb.base/watchpoints.exp
>   gdb/testsuite: Remove duplicates from gdb.base/corefile-buildid.exp
> 
>  gdb/testsuite/gdb.base/call-signal-resume.exp |  7 ++---
>  gdb/testsuite/gdb.base/checkpoint.exp         | 22 +++++++--------
>  gdb/testsuite/gdb.base/complete-empty.exp     | 12 +++++++-
>  gdb/testsuite/gdb.base/corefile-buildid.exp   |  2 +-
>  gdb/testsuite/gdb.base/decl-before-def.exp    |  4 +--
>  gdb/testsuite/gdb.base/define-prefix.exp      |  2 +-
>  gdb/testsuite/gdb.base/del.exp                | 22 +++++++--------
>  gdb/testsuite/gdb.base/dfp-exprs.exp          |  1 -
>  gdb/testsuite/gdb.base/dfp-test.exp           | 20 ++++++-------
>  gdb/testsuite/gdb.base/exprs.exp              |  4 ++-
>  gdb/testsuite/gdb.base/funcargs.exp           |  2 +-
>  gdb/testsuite/gdb.base/interp.exp             |  4 +--
>  gdb/testsuite/gdb.base/miscexprs.exp          |  4 +--
>  gdb/testsuite/gdb.base/nested-subp2.exp       | 28 ++++++++++---------
>  gdb/testsuite/gdb.base/pending.exp            |  4 +--
>  gdb/testsuite/gdb.base/pie-fork.exp           |  6 ++--
>  gdb/testsuite/gdb.base/pointers.exp           |  4 +--
>  gdb/testsuite/gdb.base/pretty-array.exp       |  6 ++--
>  gdb/testsuite/gdb.base/ptype.exp              |  6 ++--
>  gdb/testsuite/gdb.base/readline.exp           |  2 +-
>  gdb/testsuite/gdb.base/realname-expand.exp    | 12 ++++----
>  gdb/testsuite/gdb.base/set-cwd.exp            | 22 +++++++--------
>  gdb/testsuite/gdb.base/shlib-call.exp         | 13 +++++----
>  gdb/testsuite/gdb.base/solib-display.exp      |  6 ++--
>  gdb/testsuite/gdb.base/stack-checking.exp     |  6 ++--
>  gdb/testsuite/gdb.base/subst.exp              |  2 +-
>  gdb/testsuite/gdb.base/ui-redirect.exp        |  2 +-
>  gdb/testsuite/gdb.base/unload.exp             |  2 +-
>  gdb/testsuite/gdb.base/watchpoints.exp        |  4 +--
>  29 files changed, 126 insertions(+), 105 deletions(-)
> 


^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 02/29] gdb/testsuite: Remove duplicates from gdb.base/miscexprs.exp
  2021-12-10 22:06   ` Pedro Alves
@ 2021-12-14 23:28     ` Lancelot SIX
  2021-12-15 11:52       ` Pedro Alves
  0 siblings, 1 reply; 74+ messages in thread
From: Lancelot SIX @ 2021-12-14 23:28 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches

> 
> Can you just drop the explicit names instead?
> 
> That's the actual problem, the duplication, and
> us humans failing at it.  Removing the duplication nips the problem in the bud, so it doesn't
> ever happen again if someone adds more tests.
> 
> So we'd just have:
> 
>   gdb_test "print sbig.s\[90\] * 10" " = 2550"
> 
> etc.
> 
> We lose the "value of" part but that seems harmless.

Hi,

Indeed, the exp file is much cleaner after removing the smewhat useless
explicit test names (but the patch itself is longer).

I have replaced this patch locally with the following.

Thanks for the feedback.

Best,
Lancelot.

---
From 986d73aab7c604033b98ca8c0bbd472ae92ada66 Mon Sep 17 00:00:00 2001
From: Lancelot SIX <lsix@lancelotsix.com>
Date: Fri, 19 Nov 2021 19:05:37 +0000
Subject: [PATCH] gdb/testsuite: Remove duplicates from gdb.base/miscexprs.exp

When running the testsuite I see:

    Running .../gdb/testsuite/gdb.base/miscexprs.exp ...
    DUPLICATE: gdb.base/miscexprs.exp: print value of !ibig.i[100]
    DUPLICATE: gdb.base/miscexprs.exp: print value of !ibig.i[100]

This is due to an explicit test name repeated across multiple tests.
The actual test explicit names do not add much over the command from
wich default test names are derived.

Fix by removing the explicit test names across the file where they do
not add value.  While at doing some cleaning, also use $gdb_test_name in
the various uses of gdb_test_multiple.

Tested on x86_64-linux.
---
 gdb/testsuite/gdb.base/miscexprs.exp | 73 +++++++++++-----------------
 1 file changed, 28 insertions(+), 45 deletions(-)

diff --git a/gdb/testsuite/gdb.base/miscexprs.exp b/gdb/testsuite/gdb.base/miscexprs.exp
index 86f41215283..dd67d05e9e5 100644
--- a/gdb/testsuite/gdb.base/miscexprs.exp
+++ b/gdb/testsuite/gdb.base/miscexprs.exp
@@ -69,85 +69,68 @@ gdb_test "up" " main .*" "up from marker1"
 
 global hex
 
-gdb_test "print &ibig.i\[0\]" " = \\(int \\*\\) $hex" \
-    "print value of &ibig.i\[0\]"
+gdb_test "print &ibig.i\[0\]" " = \\(int \\*\\) $hex"
 
-gdb_test_multiple "print &cbig.c\[0\]" "print value of &cbig.c\[0\]" {
+gdb_test_multiple "print &cbig.c\[0\]" "" {
     -re ".\[0-9\]* = $hex \"\".*$gdb_prompt $" {
-        pass "print value of &cbig.c\[0\]"
+        pass $gdb_test_name
     }
     -re ".\[0-9\]* = $hex \"*\".*$gdb_prompt $" {
-        pass "print value of &cbig.c\[0\]"
+        pass $gdb_test_name
     }
 }
 
-gdb_test "print &fbig.f\[0\]" " = \\(float \\*\\) $hex" \
-    "print value of &fbig.f\[0\]"
+gdb_test "print &fbig.f\[0\]" " = \\(float \\*\\) $hex"
 
-gdb_test "print &dbig.d\[0\]" " = \\(double \\*\\) $hex" \
-    "print value of &dbig.d\[0\]"
+gdb_test "print &dbig.d\[0\]" " = \\(double \\*\\) $hex"
 
-gdb_test_multiple "print &sbig.s\[0\]" "print value of &sbig.s\[0\]" {
+gdb_test_multiple "print &sbig.s\[0\]" "" {
     -re ".\[0-9\]* = \\(short \\*\\) $hex.*$gdb_prompt $" {
-        pass "print value of &sbig.s\[0\]"
+        pass $gdb_test_name
     }
     -re ".\[0-9\]* = \\(short int \\*\\) $hex.*$gdb_prompt $" {
-        pass "print value of &sbig.s\[0\]"
+        pass $gdb_test_name
     }
 }
 
-gdb_test_multiple "print &lbig.l\[0\]" "print value of &lbig.l\[0\]" {
+gdb_test_multiple "print &lbig.l\[0\]" "" {
     -re ".\[0-9\]* = \\(long \\*\\) $hex.*$gdb_prompt $" {
-        pass "print value of &lbig.l\[0\]"
+        pass $gdb_test_name
     }
     -re ".\[0-9\]* = \\(long int \\*\\) $hex.*$gdb_prompt $" {
-        pass "print value of &lbig.l\[0\]"
+        pass $gdb_test_name
     }
 }
 
-gdb_test "print ibig.i\[100\] | 1" " = 5" \
-    "print value of ibig.i\[100\] | 1"
+gdb_test "print ibig.i\[100\] | 1" " = 5"
 
-gdb_test "print sbig.s\[90\] & 127" " = 127" \
-    "print value of sbig.s\[90\] & 127"
+gdb_test "print sbig.s\[90\] & 127" " = 127"
 
-gdb_test "print !ibig.i\[100\]" " = $false" \
-    "print value of !ibig.i\[100\]"
+gdb_test "print !ibig.i\[100\]" " = $false"
 
-gdb_test "print !sbig.s\[90\]" " = $false" \
-    "print value of !sbig.s\[90\]"
+gdb_test "print !sbig.s\[90\]" " = $false"
 
-gdb_test "print !fbig.f\[100\]" " = $false" \
-    "print value of !ibig.i\[100\]"
+gdb_test "print !fbig.f\[100\]" " = $false"
 
-gdb_test "print !dbig.d\[202\]" " = $false" \
-    "print value of !ibig.i\[100\]"
+gdb_test "print !dbig.d\[202\]" " = $false"
 
-gdb_test "print sbig.s\[90\] * 10" " = 2550" \
-    "print value of !sbig.s\[90\] * 10"
+gdb_test "print sbig.s\[90\] * 10" " = 2550"
 
-gdb_test "print ibig.i\[100\] * sbig.s\[90\]" " = 1275" \
-    "print value of ibig.i\[100\] * sbig.s\[90\]"
+gdb_test "print ibig.i\[100\] * sbig.s\[90\]" " = 1275"
 
-gdb_test "print fbig.f\[100\] * dbig.d\[202\]" " = 119.99\[0-9\]*" \
-    "print value of fbig.f\[100\] * dbig.d\[202\]"
+gdb_test "print fbig.f\[100\] * dbig.d\[202\]" " = 119.99\[0-9\]*"
 
-gdb_test "print !(sbig.s\[90\] * 2)" " = $false" \
-    "print value of !(sbig.s\[90\] * 2)"
+gdb_test "print !(sbig.s\[90\] * 2)" " = $false"
 
-gdb_test "print sizeof(sbig)" " = 800" "print value of sizeof sbig"
+gdb_test "print sizeof(sbig)" " = 800"
 
-gdb_test "print sizeof(cbig)" " = 100" "print value of sizeof cbig"
+gdb_test "print sizeof(cbig)" " = 100"
 
-gdb_test "print sizeof(lbig)/sizeof(long)" " = 900" \
-    "print value of sizeof lbig / sizeof long"
+gdb_test "print sizeof(lbig)/sizeof(long)" " = 900"
 
-gdb_test "print ibig.i\[100\] << 2" " = 20" \
-    "print value of ibig.i\[100\] << 2"
+gdb_test "print ibig.i\[100\] << 2" " = 20"
 
-gdb_test "print sbig.s\[90\] >> 4" " = 15" \
-    "print value of sbig.s\[90\] >> 4"
+gdb_test "print sbig.s\[90\] >> 4" " = 15"
 
-gdb_test "print lbig.l\[333\] >> 6" " = 15624999" \
-    "print value of lbig.l\[333\] >> 6"
+gdb_test "print lbig.l\[333\] >> 6" " = 15624999"
 
-- 
2.34.0

^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 13/29] gdb/testsuite: Remove duplicates from gdb.base/dfp-exprs.exp
  2021-12-10 23:03   ` Pedro Alves
@ 2021-12-15  0:01     ` Lancelot SIX
  2021-12-15 11:54       ` Pedro Alves
  0 siblings, 1 reply; 74+ messages in thread
From: Lancelot SIX @ 2021-12-15  0:01 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches

> Hmm, it's not super obvious to me what the intention was here.  For one, I can't spot a pattern in
> the sequence here.  Am I missing it?  
> 
> If we alpha sort the lines (sort-lines in emacs), and then add the missing combinations, we end up with:
> 
>     # Keep the list alpha sorted.
>     gdb_test "p 1.2dd < 1.3dd" " = 1"
>     gdb_test "p 1.2dd < 1.3df" " = 1"
>     gdb_test "p 1.2dd < 1.3dl" " = 1"
>     gdb_test "p 1.2df < 1.3dd" " = 1"
>     gdb_test "p 1.2df < 1.3df" " = 1"
>     gdb_test "p 1.2df < 1.3dl" " = 1"
>     gdb_test "p 1.2dl < 1.3dd" " = 1"
>     gdb_test "p 1.2dl < 1.3df" " = 1"
>     gdb_test "p 1.2dl < 1.3dl" " = 1"
> 
> But then, the == tests are also missing some combinations.  I think that if we do this
> programmatically with a for loop, we can exercise all the combinations in much clearer code,
> removing the need to eyeball for all suffixes.  See patch below.
> 
> I've also added a lot more combinations, testing all comparison operators comprehensively.
> 
> The result is 262 unique tests vs 104 today.
> 
> Let me know what you think.
> 

Hi,

I actually like your approach very much.  I goes beyond what I was
looking for when I started this series, but I see no reason not to go
the extra step.  I am not sure if there an intention to be exhaustive in
the test as it was.

I have replaced my previous patch with yours locally (after adjusting
the commit message, and re-testing).

Thanks!
Lancelot.

---
From 93433e04fb6ae38addf744b6b99602d689781f5a Mon Sep 17 00:00:00 2001
From: Pedro Alves <pedro@palves.net>
Date: Fri, 10 Dec 2021 22:41:54 +0000
Subject: [PATCH] gdb/testsuite: Remove duplicates from gdb.base/dfp-exprs.exp

When I run the testsuite, I have:

    Running ../gdb/testsuite/gdb.base/dfp-exprs.exp ...
    DUPLICATE: gdb.base/dfp-exprs.exp: p 1.2dl < 1.3df

Replace hand-written tests checking various comparison operators between
various decimal floating point types with a loop to programmatically
generate all the combinations.  This removes the need to eyeball for all
suffixes, which lead to the original duplication.

Also add a lot more combinations, testing all comparison operators
comprehensively.  The result is 262 unique tests vs 104 before this
patch.

Tested on x86_86-linux.

Change-Id: Id215a3d610aa8e032bf06ee160b5e3aed4a92d1e
---
 gdb/testsuite/gdb.base/dfp-exprs.exp | 94 +++++++++++++++++-----------
 1 file changed, 57 insertions(+), 37 deletions(-)

diff --git a/gdb/testsuite/gdb.base/dfp-exprs.exp b/gdb/testsuite/gdb.base/dfp-exprs.exp
index 355b8f04a1f..e735e6df6d8 100644
--- a/gdb/testsuite/gdb.base/dfp-exprs.exp
+++ b/gdb/testsuite/gdb.base/dfp-exprs.exp
@@ -122,43 +122,63 @@ proc test_dfp_arithmetic_expressions {} {
     gdb_test "p 1.2df + 1.2f" "Mixing decimal floating types with other floating types is not allowed."
 
     # Test other operations with DFP operands
-    gdb_test "p !0.df" " = 1"
-    gdb_test "p !0.dd" " = 1"
-    gdb_test "p !0.dl" " = 1"
-    gdb_test "p !0.5df" " = 0"
-    gdb_test "p !0.5dd" " = 0"
-    gdb_test "p !0.5dl" " = 0"
-
-    gdb_test "p 1.2df == 1.2df" " = 1"
-    gdb_test "p 1.2df == 1.2dd" " = 1"
-    gdb_test "p 1.2df == 1.2dl" " = 1"
-    gdb_test "p 1.2dd == 1.2df" " = 1"
-    gdb_test "p 1.2dd == 1.2dl" " = 1"
-    gdb_test "p 1.2dl == 1.2df" " = 1"
-    gdb_test "p 1.2dl == 1.2dd" " = 1"
-    gdb_test "p 1.2df == 1.3df" " = 0"
-    gdb_test "p 1.2df == 1.3dd" " = 0"
-    gdb_test "p 1.2df == 1.3dl" " = 0"
-    gdb_test "p 1.2dd == 1.3df" " = 0"
-    gdb_test "p 1.2dd == 1.3dl" " = 0"
-    gdb_test "p 1.2dl == 1.3df" " = 0"
-    gdb_test "p 1.2dl == 1.3dd" " = 0"
-
-    gdb_test "p +1.2df" " = 1.2"
-    gdb_test "p +1.2dd" " = 1.2"
-    gdb_test "p +1.2dl" " = 1.2"
-
-    gdb_test "p 1.2df < 1.3df" " = 1"
-    gdb_test "p 1.2df < 1.3dd" " = 1"
-    gdb_test "p 1.2dl < 1.3df" " = 1"
-    gdb_test "p 1.2dd < 1.3dd" " = 1"
-    gdb_test "p 1.2dd < 1.3dl" " = 1"
-    gdb_test "p 1.2dl < 1.3dl" " = 1"
-    gdb_test "p 1.2dl < 1.3df" " = 1"
-    gdb_test "p 1.2df > 1" " = 1"
-    gdb_test "p 1.2dl > 2" " = 0"
-    gdb_test "p 2 > 1.2dd" " = 1"
-    gdb_test "p 2 > 3.1dl" " = 0"
+
+    set dsuffix {"dd" "df" "dl"}
+
+    foreach l $dsuffix {
+        foreach r $dsuffix {
+	    gdb_test "p 1.2${l} == 1.2${r}" " = 1"
+	    gdb_test "p 1.2${l} == 1.3${r}" " = 0"
+
+	    gdb_test "p 1.2${l} < 1.2${r}" " = 0"
+	    gdb_test "p 1.2${l} < 1.3${r}" " = 1"
+	    gdb_test "p 1.3${l} < 1.2${r}" " = 0"
+
+	    gdb_test "p 1.2${l} > 1.2${r}" " = 0"
+	    gdb_test "p 1.2${l} > 1.3${r}" " = 0"
+	    gdb_test "p 1.3${l} > 1.2${r}" " = 1"
+
+	    gdb_test "p 1.2${l} <= 1.2${r}" " = 1"
+	    gdb_test "p 1.2${l} <= 1.3${r}" " = 1"
+	    gdb_test "p 1.3${l} <= 1.2${r}" " = 0"
+
+	    gdb_test "p 1.2${l} >= 1.2${r}" " = 1"
+	    gdb_test "p 1.2${l} >= 1.3${r}" " = 0"
+	    gdb_test "p 1.3${l} >= 1.2${r}" " = 1"
+	}
+
+	gdb_test "p !0.${l}" " = 1"
+	gdb_test "p !0.5${l}" " = 0"
+
+	gdb_test "p +1.2${l}" " = 1.2"
+
+	# This checks GDB doesn't convert to int and rounds up/down.
+	gdb_test "p 1.2${l} == 1" " = 0"
+	gdb_test "p 1.2${l} == 2" " = 0"
+
+	gdb_test "p 1.2${l} == 1.2" \
+	    "Mixing decimal floating types with other floating types is not allowed\\."
+
+	gdb_test "p 1.2${l} > 1" " = 1"
+	gdb_test "p 1.2${l} > 2" " = 0"
+	gdb_test "p 1.2${l} >= 1" " = 1"
+	gdb_test "p 1.2${l} >= 2" " = 0"
+
+	gdb_test "p 1.2${l} < 1" " = 0"
+	gdb_test "p 1.2${l} < 2" " = 1"
+	gdb_test "p 1.2${l} <= 1" " = 0"
+	gdb_test "p 1.2${l} <= 2" " = 1"
+
+	gdb_test "p 1 < 1.2${l}" " = 1"
+	gdb_test "p 2 < 1.2${l}" " = 0"
+	gdb_test "p 1 <= 1.2${l}" " = 1"
+	gdb_test "p 2 <= 1.2${l}" " = 0"
+
+	gdb_test "p 1 > 1.2${l}" " = 0"
+	gdb_test "p 2 > 1.2${l}" " = 1"
+	gdb_test "p 1 >= 1.2${l}" " = 0"
+	gdb_test "p 2 >= 1.2${l}" " = 1"
+    }
 }
 
 proc test_dfp_conversions {} {

^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 19/29] gdb/testsuite: Remove duplicates from gdb.base/exprs.exp
  2021-12-10 23:15   ` Pedro Alves
@ 2021-12-15  0:21     ` Lancelot SIX
  0 siblings, 0 replies; 74+ messages in thread
From: Lancelot SIX @ 2021-12-15  0:21 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches

> The following test_expr is also under output-radix 8.  This seems to be begging for:
> 
> with_test_prefix "output-radix 8" {
>   gdb_test "set output-radix 8" ".*"
>   test_expr "print red" "\\$\[0-9\]* = red"
>   test_expr "print/d red" "\\$\[0-9\]* = 0"
>   gdb_test "set output-radix 10" ".*"
> }
> 
> WDYT?

Yes, it makes sense.  Thanks.  I have updated my patch locally
accordingly.

Lancelot.

^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 16/29] gdb/testsuite: Remove duplicates from gdb.base/ui-redirect.exp
  2021-12-10 23:15   ` Pedro Alves
@ 2021-12-15  0:26     ` Lancelot SIX
  0 siblings, 0 replies; 74+ messages in thread
From: Lancelot SIX @ 2021-12-15  0:26 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches

On Fri, Dec 10, 2021 at 11:15:32PM +0000, Pedro Alves wrote:
> On 2021-11-21 17:56, Lancelot SIX via Gdb-patches wrote:
> > When running the testsuite, I have:
> > 
> >     Running .../gdb/testsuite/gdb.base/ui-redirect.exp ...
> >     DUPLICATE: gdb.base/ui-redirect.exp: redirect while already logging: set logging redirect off
> > 
> > Fix by moving the first 'set logging redirect off' at the end of the
> 
> "at the end" -> "to the end".  "at" changes meaning completely, confusing.

Thanks, changed locally.

Lancerot.
> 
> OK with that change.
>

^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 02/29] gdb/testsuite: Remove duplicates from gdb.base/miscexprs.exp
  2021-12-14 23:28     ` Lancelot SIX
@ 2021-12-15 11:52       ` Pedro Alves
  0 siblings, 0 replies; 74+ messages in thread
From: Pedro Alves @ 2021-12-15 11:52 UTC (permalink / raw)
  To: Lancelot SIX; +Cc: gdb-patches

On 2021-12-14 23:28, Lancelot SIX wrote:
>>
>> Can you just drop the explicit names instead?
>>
>> That's the actual problem, the duplication, and
>> us humans failing at it.  Removing the duplication nips the problem in the bud, so it doesn't
>> ever happen again if someone adds more tests.
>>
>> So we'd just have:
>>
>>   gdb_test "print sbig.s\[90\] * 10" " = 2550"
>>
>> etc.
>>
>> We lose the "value of" part but that seems harmless.
> 
> Hi,
> 
> Indeed, the exp file is much cleaner after removing the smewhat useless
> explicit test names (but the patch itself is longer).
> 
> I have replaced this patch locally with the following.
> 
> Thanks for the feedback.
> 
> Best,
> Lancelot.
> 
> ---
> From 986d73aab7c604033b98ca8c0bbd472ae92ada66 Mon Sep 17 00:00:00 2001
> From: Lancelot SIX <lsix@lancelotsix.com>
> Date: Fri, 19 Nov 2021 19:05:37 +0000
> Subject: [PATCH] gdb/testsuite: Remove duplicates from gdb.base/miscexprs.exp
> 
> When running the testsuite I see:
> 
>     Running .../gdb/testsuite/gdb.base/miscexprs.exp ...
>     DUPLICATE: gdb.base/miscexprs.exp: print value of !ibig.i[100]
>     DUPLICATE: gdb.base/miscexprs.exp: print value of !ibig.i[100]
> 
> This is due to an explicit test name repeated across multiple tests.
> The actual test explicit names do not add much over the command from
> wich default test names are derived.
> 
> Fix by removing the explicit test names across the file where they do
> not add value.  While at doing some cleaning, also use $gdb_test_name in
> the various uses of gdb_test_multiple.
> 
> Tested on x86_64-linux.

OK.

^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 13/29] gdb/testsuite: Remove duplicates from gdb.base/dfp-exprs.exp
  2021-12-15  0:01     ` Lancelot SIX
@ 2021-12-15 11:54       ` Pedro Alves
  0 siblings, 0 replies; 74+ messages in thread
From: Pedro Alves @ 2021-12-15 11:54 UTC (permalink / raw)
  To: Lancelot SIX; +Cc: gdb-patches

On 2021-12-15 00:01, Lancelot SIX wrote:
>> Hmm, it's not super obvious to me what the intention was here.  For one, I can't spot a pattern in
>> the sequence here.  Am I missing it?  
>>
>> If we alpha sort the lines (sort-lines in emacs), and then add the missing combinations, we end up with:
>>
>>     # Keep the list alpha sorted.
>>     gdb_test "p 1.2dd < 1.3dd" " = 1"
>>     gdb_test "p 1.2dd < 1.3df" " = 1"
>>     gdb_test "p 1.2dd < 1.3dl" " = 1"
>>     gdb_test "p 1.2df < 1.3dd" " = 1"
>>     gdb_test "p 1.2df < 1.3df" " = 1"
>>     gdb_test "p 1.2df < 1.3dl" " = 1"
>>     gdb_test "p 1.2dl < 1.3dd" " = 1"
>>     gdb_test "p 1.2dl < 1.3df" " = 1"
>>     gdb_test "p 1.2dl < 1.3dl" " = 1"
>>
>> But then, the == tests are also missing some combinations.  I think that if we do this
>> programmatically with a for loop, we can exercise all the combinations in much clearer code,
>> removing the need to eyeball for all suffixes.  See patch below.
>>
>> I've also added a lot more combinations, testing all comparison operators comprehensively.
>>
>> The result is 262 unique tests vs 104 today.
>>
>> Let me know what you think.
>>
> 
> Hi,
> 
> I actually like your approach very much.  I goes beyond what I was
> looking for when I started this series, but I see no reason not to go
> the extra step.  I am not sure if there an intention to be exhaustive in
> the test as it was.
> 
> I have replaced my previous patch with yours locally (after adjusting
> the commit message, and re-testing).

Great, thanks.  Feel free to merge it.

^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 21/29] gdb/testsuite: Remove duplicates from gdb.base/shlib-call.exp
  2021-12-10 23:24   ` Pedro Alves
@ 2021-12-16 22:57     ` Lancelot SIX
  2021-12-17 11:58       ` Pedro Alves
  0 siblings, 1 reply; 74+ messages in thread
From: Lancelot SIX @ 2021-12-16 22:57 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches

> Let's not fix DUPLICATEs with duplication.  :-)  Write instead:
> 
> with_test_prefix "after restart" {
>   gdb_test_no_output "set print sevenbit-strings"
>   gdb_test_no_output "set print address off"
>   gdb_test_no_output "set width 0"
> }
> 
> Actually, I take that back.  We should just delete these 3 "set" commands and the same ones
> at the bottom too.  Setting width to 0 is already done centrally.  The other two make
> no difference in this test.  I strongly suspect this is very very old test code.
> 
> The "Start with a fresh gdb" block could just use clean_restart.

Hi,

I did the changes and added some more cleanup (removed trailing
whitespaces).

Thanks,
Lancelot.

---
From 9648f0f6164059dac483c217c8e82784a2a2b7c1 Mon Sep 17 00:00:00 2001
From: Lancelot SIX <lsix@lancelotsix.com>
Date: Sun, 21 Nov 2021 01:33:13 +0000
Subject: [PATCH] gdb/testsuite: Remove duplicates from gdb.base/shlib-call.exp

When I run the testsuite, I have:

    Running .../gdb/testsuite/gdb.base/shlib-call.exp ...
    DUPLICATE: gdb.base/shlib-call.exp: print g
    DUPLICATE: gdb.base/shlib-call.exp: set print sevenbit-strings
    DUPLICATE: gdb.base/shlib-call.exp: set print address off
    DUPLICATE: gdb.base/shlib-call.exp: set width 0
    DUPLICATE: gdb.base/shlib-call.exp: continue until exit

Fix by adjusting the test names when required, and by removing
un-necessary commands.

While at it, do some cleanup:
- Replace an explicit GDB restart sequence with a call to clean_restart.
- Remove trailing whitespaces.
- Use $gdb_test_name in gdb_test_multiple.

Tested on x86_64-linux.
---
 gdb/testsuite/gdb.base/shlib-call.exp | 21 +++++++--------------
 1 file changed, 7 insertions(+), 14 deletions(-)

diff --git a/gdb/testsuite/gdb.base/shlib-call.exp b/gdb/testsuite/gdb.base/shlib-call.exp
index 0a5a1c336c1..3fe9932af99 100644
--- a/gdb/testsuite/gdb.base/shlib-call.exp
+++ b/gdb/testsuite/gdb.base/shlib-call.exp
@@ -90,7 +90,7 @@ if ![gdb_skip_stdio_test "next over shr1"] {
 
 
 #print g
-gdb_test "print g" "\[0-9\]* = 2"
+gdb_test "print g" "\[0-9\]* = 2" "print g two"
 
 #print shr1(1)
 if ![gdb_skip_stdio_test "print shr1(1)"] {
@@ -137,7 +137,7 @@ gdb_test "print mainshr1(1)" "\[0-9\]* = 2" \
 # behavior will differ depending upon upon whether or not
 # the compiler emits line number information for the epilogue.
 gdb_test_multiple "step" "step out of shr2 to main" {
-    -re "main \\(\\) at.*g = mainshr1\\(g\\);.*$gdb_prompt $" { 
+    -re "main \\(\\) at.*g = mainshr1\\(g\\);.*$gdb_prompt $" {
 	pass "step out of shr2 to main"
     }
     -re ".*\\\}.*$gdb_prompt $" {
@@ -152,7 +152,7 @@ gdb_test_multiple "step" "step out of shr2 to main" {
 	}
     }
 }
-    
+
 #print mainshr1(1)
 gdb_test "print mainshr1(1)" "\[0-9\]* = 2"
 
@@ -162,14 +162,7 @@ gdb_test "step" "mainshr1 \\(g=4\\) at.*return 2.g;" \
 
 # Start with a fresh gdb.
 
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
-gdb_test_no_output "set print sevenbit-strings"
-gdb_test_no_output "set print address off"
-gdb_test_no_output "set width 0"
-
+clean_restart $binfile
 
 # PR's 16495, 18213
 # test that we can re-set breakpoints in shared libraries
@@ -179,7 +172,7 @@ set test "run to bp in shared library"
 gdb_run_cmd
 gdb_test_multiple "" $test {
     -re "Breakpoint .,.*${gdb_prompt} " {
-	pass $test
+	pass $gdb_test_name
     }
 }
 
@@ -189,8 +182,8 @@ set test "re-run to bp in shared library (PR's 16495, 18213)"
 gdb_run_cmd
 gdb_test_multiple "" $test {
     -re "Breakpoint .,.*${gdb_prompt} " {
-	pass $test
+	pass $gdb_test_name
     }
 }
 
-gdb_continue_to_end "" continue 1
+gdb_continue_to_end "after re-run" continue 1

^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 22/29] gdb/testsuite: Remove duplicates from gdb.base/funcargs.exp
  2021-12-10 23:26   ` Pedro Alves
@ 2021-12-16 23:08     ` Lancelot SIX
  2021-12-17 12:00       ` Pedro Alves
  0 siblings, 1 reply; 74+ messages in thread
From: Lancelot SIX @ 2021-12-16 23:08 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches

On Fri, Dec 10, 2021 at 11:26:23PM +0000, Pedro Alves wrote:
> On 2021-11-21 17:56, Lancelot SIX via Gdb-patches wrote:
> > --- a/gdb/testsuite/gdb.base/funcargs.exp
> > +++ b/gdb/testsuite/gdb.base/funcargs.exp
> > @@ -213,7 +213,7 @@ proc complex_args {} {
> >  
> >      # Run; should stop at call1a and print actual arguments.
> >      gdb_run_cmd
> > -    gdb_test "" " callca \\(f1=1 \\+ 2i, f2=1 \\+ 2i, f3=1 \\+ 2i\\) .*" "run to call2a"
> > +    gdb_test "" " callca \\(f1=1 \\+ 2i, f2=1 \\+ 2i, f3=1 \\+ 2i\\) .*" "run to call2a (complex_arg)"
> 
> No tail parens, please.  See:
> 
> https://sourceware.org/gdb/wiki/GDBTestcaseCookbook#Do_not_use_.22tail_parentheses.22_on_test_messages

Sorry, I did forget about this.

I have changed the way I refactor this code.  Mode of the tests are
already grouped into procs, so I replace plain procs with
proc_with_prefix.  It also makes it easier to find the problematic
portion of the file when a FAIL pop up.

Thanks for the review,
Lancelot

---
From 4b916043924efe7615fd16ff8440bafdd9cb163f Mon Sep 17 00:00:00 2001
From: Lancelot SIX <lsix@lancelotsix.com>
Date: Sun, 21 Nov 2021 01:38:43 +0000
Subject: [PATCH] gdb/testsuite: Remove duplicates from gdb.base/funcargs.exp
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

When running the testsuite, I have:

    Running .../gdb/testsuite/gdb.base/funcargs.exp ...
    DUPLICATE: gdb.base/funcargs.exp: run to call2a

Fix by using proc_with_prefix instead on plain proc to create logical
function blocks.

Tested on x86_64-linux.
---
 gdb/testsuite/gdb.base/funcargs.exp | 30 ++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/gdb/testsuite/gdb.base/funcargs.exp b/gdb/testsuite/gdb.base/funcargs.exp
index 7031e02b0e5..4df87fb43cf 100644
--- a/gdb/testsuite/gdb.base/funcargs.exp
+++ b/gdb/testsuite/gdb.base/funcargs.exp
@@ -39,7 +39,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile $compile_flags]}
 # Locate actual args; integral types.
 #
 
-proc integral_args {} {
+proc_with_prefix integral_args {} {
     global gdb_prompt
     global det_file
     global gcc_compiled
@@ -199,7 +199,7 @@ proc float_and_integral_args {} {
 # Locate actual args; _Complex types.
 #
 
-proc complex_args {} {
+proc_with_prefix complex_args {} {
     global gdb_prompt
 
     delete_breakpoints
@@ -226,7 +226,7 @@ proc complex_args {} {
 #
 # Locate actual args; _Complex types and integral.
 #
-proc complex_integral_args {} {
+proc_with_prefix complex_integral_args {} {
     global gdb_prompt
 
     delete_breakpoints
@@ -244,7 +244,7 @@ proc complex_integral_args {} {
 #
 # Locate actual args; _Complex types and integral/float.
 #
-proc complex_float_integral_args {} {
+proc_with_prefix complex_float_integral_args {} {
     global gdb_prompt
 
     delete_breakpoints
@@ -263,7 +263,7 @@ proc complex_float_integral_args {} {
 # Locate actual args; dereference pointers to ints and floats.
 #
 
-proc pointer_args {} {
+proc_with_prefix pointer_args {} {
     global gdb_prompt
     global hex
     global det_file
@@ -306,7 +306,7 @@ proc pointer_args {} {
 # Locate actual args; structures and unions passed by reference.
 #
 
-proc structs_by_reference {} {
+proc_with_prefix structs_by_reference {} {
     global gdb_prompt
     global hex
     global det_file
@@ -355,7 +355,7 @@ proc structs_by_reference {} {
 # Locate actual args; structures and unions passed by value.
 #
 
-proc structs_by_value {} {
+proc_with_prefix structs_by_value {} {
     global gdb_prompt
     global hex
     global det_file
@@ -415,7 +415,7 @@ proc structs_by_value {} {
 # Locate actual args; discard, shuffle, and call
 #
 
-proc discard_and_shuffle {} {
+proc_with_prefix discard_and_shuffle {} {
     global gdb_prompt
     global hex
     global decimal
@@ -617,7 +617,7 @@ proc discard_and_shuffle {} {
 # Locate actual args; shuffle round robin and call
 #
 
-proc shuffle_round_robin {} {
+proc_with_prefix shuffle_round_robin {} {
     global gdb_prompt
     global hex
     global decimal
@@ -814,7 +814,7 @@ proc shuffle_round_robin {} {
 # Locate actual args; recursive passing of structs by value
 #
 
-proc recursive_structs_by_value {} {
+proc_with_prefix recursive_structs_by_value {} {
     global gdb_prompt
     global hex
     global decimal
@@ -844,7 +844,7 @@ proc recursive_structs_by_value {} {
 #
 # Test for accessing local stack variables in functions which call alloca
 #
-proc localvars_after_alloca { } {
+proc_with_prefix localvars_after_alloca { } {
     global gdb_prompt
     global hex
     global decimal
@@ -878,7 +878,7 @@ proc localvars_after_alloca { } {
     gdb_test "backtrace 8" "#0.*localvars_after_alloca \\(c=97 'a', s=1, i=2, l=3\\).*#1.*main.*" "backtrace after alloca"
 }
 
-proc call_after_alloca { } {
+proc_with_prefix call_after_alloca { } {
     global gdb_prompt
     global hex
     global decimal
@@ -907,7 +907,7 @@ proc call_after_alloca { } {
 # and finally stepping into indirect calls.  The point is that on the PA
 # these use a funky `dyncall' mechanism which GDB needs to know about.
 #
-proc localvars_in_indirect_call { } {
+proc_with_prefix localvars_in_indirect_call { } {
     global gdb_prompt
     global hex
     global decimal
@@ -979,7 +979,7 @@ proc localvars_in_indirect_call { } {
 # cascaded) on both the call path and the gdb_suppress_tests; path.
 # to handle trampolines.
 #
-proc test_stepping_over_trampolines { } {
+proc_with_prefix stepping_over_trampolines { } {
     global gdb_prompt
     global hex
     global decimal
@@ -1106,6 +1106,6 @@ recursive_structs_by_value
 localvars_after_alloca
 call_after_alloca
 localvars_in_indirect_call
-test_stepping_over_trampolines
+stepping_over_trampolines
 
 set timeout $prev_timeout
-- 
2.34.0


^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 25/29] gdb/testsuite: Remove duplicates from gdb.base/pointers.exp
  2021-12-10 23:27   ` Pedro Alves
@ 2021-12-16 23:14     ` Lancelot SIX
  2021-12-17 12:18       ` Pedro Alves
  0 siblings, 1 reply; 74+ messages in thread
From: Lancelot SIX @ 2021-12-16 23:14 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches

> 
> Tail parens bad.  :-)
> 

Hi

I have used a comas instead of parens.

Thanks,
Lancelot.

---
From 39203c72a6b7f00975e8b8bc29bcf1b89df0b4b8 Mon Sep 17 00:00:00 2001
From: Lancelot SIX <lsix@lancelotsix.com>
Date: Sun, 21 Nov 2021 01:55:43 +0000
Subject: [PATCH] gdb/testsuite: Remove duplicates from gdb.base/pointers.exp
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

When I run the testsuite, I have :

    Running .../gdb/testsuite/gdb.base/pointers.exp ...
    DUPLICATE: gdb.base/pointers.exp: pointer assignment

Fix by adjusting the test names.

Tested on x86_64-linux.
---
 gdb/testsuite/gdb.base/pointers.exp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gdb/testsuite/gdb.base/pointers.exp b/gdb/testsuite/gdb.base/pointers.exp
index fa7531d0f85..9916df942d0 100644
--- a/gdb/testsuite/gdb.base/pointers.exp
+++ b/gdb/testsuite/gdb.base/pointers.exp
@@ -147,14 +147,14 @@ gdb_test "print v_int_pointer > v_int_pointer2" " = $false" \
 
 gdb_test_no_output "set variable y = *v_int_pointer++" \
     "set y = *v_int_pointer++"
-gdb_test "print y" " = 6" "pointer assignment"
+gdb_test "print y" " = 6" "pointer assignment, after y = *v_int_pointer++"
 gdb_test "print *v_int_pointer" " = 18" "and post-increment"
 
 
 
 gdb_test_no_output "set variable y = *--v_int_pointer2" \
     "set y = *--v_int_pointer2"
-gdb_test "print y" " = 6" "pointer assignment"
+gdb_test "print y" " = 6" "pointer assignment, after y = *--v_int_pointer2"
 gdb_test "print *v_int_pointer2" " = 6" "and pre-decrement"
 
 
-- 
2.34.0


^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 28/29] gdb/testsuite: Remove duplicates from gdb.base/watchpoints.exp
  2021-12-10 23:30   ` Pedro Alves
@ 2021-12-16 23:15     ` Lancelot SIX
  0 siblings, 0 replies; 74+ messages in thread
From: Lancelot SIX @ 2021-12-16 23:15 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches

> > Fix by adjusting the test nanes where appropriate.
> 
> "test names"
> 

Fixed locally.

Thanks,
Lancelot.

^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 21/29] gdb/testsuite: Remove duplicates from gdb.base/shlib-call.exp
  2021-12-16 22:57     ` Lancelot SIX
@ 2021-12-17 11:58       ` Pedro Alves
  0 siblings, 0 replies; 74+ messages in thread
From: Pedro Alves @ 2021-12-17 11:58 UTC (permalink / raw)
  To: Lancelot SIX; +Cc: gdb-patches

On 2021-12-16 22:57, Lancelot SIX wrote:
>> Let's not fix DUPLICATEs with duplication.  :-)  Write instead:
>>
>> with_test_prefix "after restart" {
>>   gdb_test_no_output "set print sevenbit-strings"
>>   gdb_test_no_output "set print address off"
>>   gdb_test_no_output "set width 0"
>> }
>>
>> Actually, I take that back.  We should just delete these 3 "set" commands and the same ones
>> at the bottom too.  Setting width to 0 is already done centrally.  The other two make
>> no difference in this test.  I strongly suspect this is very very old test code.
>>
>> The "Start with a fresh gdb" block could just use clean_restart.
> 
> Hi,
> 
> I did the changes and added some more cleanup (removed trailing
> whitespaces).

You missed removing the 3 set commands after the first clean_restart.

OK with that change.

^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 22/29] gdb/testsuite: Remove duplicates from gdb.base/funcargs.exp
  2021-12-16 23:08     ` Lancelot SIX
@ 2021-12-17 12:00       ` Pedro Alves
  0 siblings, 0 replies; 74+ messages in thread
From: Pedro Alves @ 2021-12-17 12:00 UTC (permalink / raw)
  To: Lancelot SIX; +Cc: gdb-patches

On 2021-12-16 23:08, Lancelot SIX wrote:
> On Fri, Dec 10, 2021 at 11:26:23PM +0000, Pedro Alves wrote:
>> On 2021-11-21 17:56, Lancelot SIX via Gdb-patches wrote:
>>> --- a/gdb/testsuite/gdb.base/funcargs.exp
>>> +++ b/gdb/testsuite/gdb.base/funcargs.exp
>>> @@ -213,7 +213,7 @@ proc complex_args {} {
>>>  
>>>      # Run; should stop at call1a and print actual arguments.
>>>      gdb_run_cmd
>>> -    gdb_test "" " callca \\(f1=1 \\+ 2i, f2=1 \\+ 2i, f3=1 \\+ 2i\\) .*" "run to call2a"
>>> +    gdb_test "" " callca \\(f1=1 \\+ 2i, f2=1 \\+ 2i, f3=1 \\+ 2i\\) .*" "run to call2a (complex_arg)"
>>
>> No tail parens, please.  See:
>>
>> https://sourceware.org/gdb/wiki/GDBTestcaseCookbook#Do_not_use_.22tail_parentheses.22_on_test_messages
> 
> Sorry, I did forget about this.
> 
> I have changed the way I refactor this code.  Mode of the tests are
> already grouped into procs, so I replace plain procs with
> proc_with_prefix.  It also makes it easier to find the problematic
> portion of the file when a FAIL pop up.

I like it, thanks.  This is OK.

^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 25/29] gdb/testsuite: Remove duplicates from gdb.base/pointers.exp
  2021-12-16 23:14     ` Lancelot SIX
@ 2021-12-17 12:18       ` Pedro Alves
  2021-12-17 23:14         ` Lancelot SIX
  0 siblings, 1 reply; 74+ messages in thread
From: Pedro Alves @ 2021-12-17 12:18 UTC (permalink / raw)
  To: Lancelot SIX; +Cc: gdb-patches

On 2021-12-16 23:14, Lancelot SIX wrote:

> diff --git a/gdb/testsuite/gdb.base/pointers.exp b/gdb/testsuite/gdb.base/pointers.exp
> index fa7531d0f85..9916df942d0 100644
> --- a/gdb/testsuite/gdb.base/pointers.exp
> +++ b/gdb/testsuite/gdb.base/pointers.exp
> @@ -147,14 +147,14 @@ gdb_test "print v_int_pointer > v_int_pointer2" " = $false" \
>  
>  gdb_test_no_output "set variable y = *v_int_pointer++" \
>      "set y = *v_int_pointer++"
> -gdb_test "print y" " = 6" "pointer assignment"
> +gdb_test "print y" " = 6" "pointer assignment, after y = *v_int_pointer++"
>  gdb_test "print *v_int_pointer" " = 18" "and post-increment"
>  
>  
>  
>  gdb_test_no_output "set variable y = *--v_int_pointer2" \
>      "set y = *--v_int_pointer2"
> -gdb_test "print y" " = 6" "pointer assignment"
> +gdb_test "print y" " = 6" "pointer assignment, after y = *--v_int_pointer2"
>  gdb_test "print *v_int_pointer2" " = 6" "and pre-decrement"
>  
>  

Hmm, how about this instead?

with_test_prefix "post-increment" {
    gdb_test_no_output "set variable y = *v_int_pointer++" \
	"pointer dereference, set variable"
    gdb_test "print y" " = 6" "pointer assignment"
    gdb_test "print *v_int_pointer" " = 18" "pointer increment"
}

with_test_prefix "pre-decrement" {
    gdb_test_no_output "set variable y = *--v_int_pointer2" \
	"pointer dereference, set variable"
    gdb_test "print y" " = 6" "pointer assignment"
    gdb_test "print *v_int_pointer2" " = 6" "pointer decrement"
}

^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 25/29] gdb/testsuite: Remove duplicates from gdb.base/pointers.exp
  2021-12-17 12:18       ` Pedro Alves
@ 2021-12-17 23:14         ` Lancelot SIX
  2022-01-05 16:05           ` Pedro Alves
  0 siblings, 1 reply; 74+ messages in thread
From: Lancelot SIX @ 2021-12-17 23:14 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches

> 
> Hmm, how about this instead?
> 
> with_test_prefix "post-increment" {
>     gdb_test_no_output "set variable y = *v_int_pointer++" \
> 	"pointer dereference, set variable"
>     gdb_test "print y" " = 6" "pointer assignment"
>     gdb_test "print *v_int_pointer" " = 18" "pointer increment"
> }
> 
> with_test_prefix "pre-decrement" {
>     gdb_test_no_output "set variable y = *--v_int_pointer2" \
> 	"pointer dereference, set variable"
>     gdb_test "print y" " = 6" "pointer assignment"
>     gdb_test "print *v_int_pointer2" " = 6" "pointer decrement"
> }

Done in the wollowing patch.

Lancelot.

---
From 08d05cebf6b40b64834d1d2a140ca6a9a99be8ae Mon Sep 17 00:00:00 2001
From: Lancelot SIX <lsix@lancelotsix.com>
Date: Sun, 21 Nov 2021 01:55:43 +0000
Subject: [PATCH] gdb/testsuite: Remove duplicates from gdb.base/pointers.exp
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

When I run the testsuite, I have :

    Running .../gdb/testsuite/gdb.base/pointers.exp ...
    DUPLICATE: gdb.base/pointers.exp: pointer assignment

Fix by placing the sections with duplication in with_test_prefix blocks.
This removes the duplication and gives a better organization the file.

Tested on x86_64-linux.
---
 gdb/testsuite/gdb.base/pointers.exp | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/gdb/testsuite/gdb.base/pointers.exp b/gdb/testsuite/gdb.base/pointers.exp
index fa7531d0f85..0ac0465072f 100644
--- a/gdb/testsuite/gdb.base/pointers.exp
+++ b/gdb/testsuite/gdb.base/pointers.exp
@@ -145,18 +145,20 @@ gdb_test "print v_int_pointer < v_int_pointer2" " = $true" \
 gdb_test "print v_int_pointer > v_int_pointer2" " = $false" \
     "pointer1>pointer2"
 
-gdb_test_no_output "set variable y = *v_int_pointer++" \
-    "set y = *v_int_pointer++"
-gdb_test "print y" " = 6" "pointer assignment"
-gdb_test "print *v_int_pointer" " = 18" "and post-increment"
-
-
+with_test_prefix "post-increment" {
+    gdb_test_no_output "set variable y = *v_int_pointer++" \
+	"set y = *v_int_pointer++"
+    gdb_test "print y" " = 6" "pointer assignment"
+    gdb_test "print *v_int_pointer" " = 18" "and post-increment"
+}
 
-gdb_test_no_output "set variable y = *--v_int_pointer2" \
-    "set y = *--v_int_pointer2"
-gdb_test "print y" " = 6" "pointer assignment"
-gdb_test "print *v_int_pointer2" " = 6" "and pre-decrement"
 
+with_test_prefix "pre-decrement" {
+    gdb_test_no_output "set variable y = *--v_int_pointer2" \
+	"set y = *--v_int_pointer2"
+    gdb_test "print y" " = 6" "pointer assignment"
+    gdb_test "print *v_int_pointer2" " = 6" "and pre-decrement"
+}
 
 
 gdb_test_no_output "set variable y =v_int_pointer-v_int_pointer2" \
-- 
2.34.0


^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 00/29] Remove DUPLICATEs from testsuite/gdb.base/*.exp
  2021-12-10 23:40 ` [PATCH 00/29] Remove DUPLICATEs from testsuite/gdb.base/*.exp Pedro Alves
@ 2021-12-18  0:39   ` Lancelot SIX
  2022-01-05 16:23     ` Pedro Alves
  0 siblings, 1 reply; 74+ messages in thread
From: Lancelot SIX @ 2021-12-18  0:39 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches

> I reviewed all patches except patch #15 (gdb.base/complete-empty.exp).  I left that for
> last as I think I'll need look a bit in more detail, but I ran out of time for now.
> I sent a few comments.  Patches that I didn't comment on (other than #15) looks
> OK to me.
> 
> Thanks a lot for doing this.
> 

Hi,

I do not know if you have had a chance to look an #15, but I think
I have another approach you might prefer.  Instead of going around the
testing framework in the testcase, it improves the completion testing
framework.

See below the alternative approach.

Let me know what you think.

Best,
Lancelot.

---
From d62890e28d1492248649365946b931886192da76 Mon Sep 17 00:00:00 2001
From: Lancelot SIX <lsix@lancelotsix.com>
Date: Sat, 20 Nov 2021 23:20:23 +0000
Subject: [PATCH] gdb: completion-support.exp: improve leading whitespace
 support
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

There is a expect support library in the source tree designed to help
developers test the auto-completion capabilities of GDB.

One of the functions is test_gdb_complete_unique_re.  It is used
(usually indirectly via test_gdb_complete_unique) to test that a given
input line is completed as a given output line.  The test checks for two
ways to do the completion: using tab-completion, or using the
'complete' command.  To do this, calls to two dedicated functions are
performed.  If we omit few details, we can consider that a call to

    test_gdb_complete_unique $input $expected

is equivalent to the two following calls:

    test_gdb_complete_tab_unique $input $expected
    test_gdb_complete_cmd_unique $input $expected

When using the tab-completion, everything works as expected, but some
care must be taken when using the 'complete' command if the given input
has leading whitespaces.  In such situation, the output of the
'complete' command will drop the leading whitespaces.

The current approach is that in such situation, the input and expected
outputs are right trimmed (i.e. all leading whitespaces are removed)
when performing the command completion check.

This means that the following call:

    test_gdb_complete_unique "   $input" "   $expected"

is almost equivalent to (again, omitting few details and arguments):

    test_gdb_complete_tab_unique "   $input" "   $expected"
    test_gdb_complete_cmd_unique "$input" "$expected"

This approach comes with a problem that we encounter when running the
tests in complete-empty.exp.  When doing so, we have:

    Running .../gdb/testsuite/gdb.base/complete-empty.exp ...
    DUPLICATE: gdb.base/complete-empty.exp: empty-input-line: cmd complete ""

This is because the test file does something like:

    test_gdb_complete_unique "" "!" " " 1
    test_gdb_complete_unique "   " "   !" " " 1¬

which, if we do the substitution introduced above is equivalent to:

    test_gdb_complete_tab_unique "" "!"
    test_gdb_complete_cmd_unique "" "!"
    test_gdb_complete_tab_unique "   " "   !"
    test_gdb_complete_cmd_unique "" "!"

We see that the lines 2 and 4 are now the same, and for this reason the
testing framework complains about DUPLICATE test names.

To fix that, this commit proposes that instead of left trimming both
input and expected outputs, only the expected output is trimmed.

Care must be taken in the case the completion gives more possibilities
than allowed by the max-completions setting.  In this case, the input
will be repeated in the output in its left trimmed version.  This commit
also ensures that this is taken care of.

With this commit, the gdb.base/complete-empty.exp still passes all its
tests but does not report the DUPLICATE anymore.

Tested on x86_64-linux.
---
 gdb/testsuite/lib/completion-support.exp | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/gdb/testsuite/lib/completion-support.exp b/gdb/testsuite/lib/completion-support.exp
index ddd3921977b..706ecdcb923 100644
--- a/gdb/testsuite/lib/completion-support.exp
+++ b/gdb/testsuite/lib/completion-support.exp
@@ -254,10 +254,8 @@ proc test_gdb_complete_unique_re { input_line complete_line_re {append_char " "}
 	}
     }
 
-    # Trim INPUT_LINE and COMPLETE LINE, for the case we're completing
-    # a command with leading whitespace.  Leading command whitespace
-    # is discarded by GDB.
-    set input_line [string trimleft $input_line]
+    # Trim COMPLETE LINE, for the case we're completing a command with leading
+    # whitespace.  Leading command whitespace is discarded by GDB.
     set expected_output_re [string trimleft $complete_line_re]
     if {$append_char_re != " "} {
 	append expected_output_re $append_char_re
@@ -266,7 +264,7 @@ proc test_gdb_complete_unique_re { input_line complete_line_re {append_char " "}
 	set max_completion_reached_msg \
 	    "*** List may be truncated, max-completions reached. ***"
 	set input_line_re \
-	    [string_to_regexp $input_line]
+	    [string_to_regexp [string trimleft $input_line]]
 	set max_completion_reached_msg_re \
 	    [string_to_regexp $max_completion_reached_msg]
 
-- 
2.34.0


^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 01/29] gdb/testsuite: Remove duplicates from gdb.base/stack-checking.exp
  2021-11-21 17:56 ` [PATCH 01/29] gdb/testsuite: Remove duplicates from gdb.base/stack-checking.exp Lancelot SIX
@ 2022-01-04 13:59   ` Andrew Burgess
  0 siblings, 0 replies; 74+ messages in thread
From: Andrew Burgess @ 2022-01-04 13:59 UTC (permalink / raw)
  To: Lancelot SIX; +Cc: gdb-patches

* Lancelot SIX via Gdb-patches <gdb-patches@sourceware.org> [2021-11-21 17:56:08 +0000]:

> When running the testsuite I have:
> 
>     Running .../gdb/testsuite/gdb.base/stack-checking.exp ...
>     DUPLICATE: gdb.base/stack-checking.exp: bt
>     DUPLICATE: gdb.base/stack-checking.exp: bt
> 
> Fix by using with_test_prefix.
> 
> Tested on x86_64-linux.
> ---
>  gdb/testsuite/gdb.base/stack-checking.exp | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/gdb/testsuite/gdb.base/stack-checking.exp b/gdb/testsuite/gdb.base/stack-checking.exp
> index ca66617009f..634e4be2e6b 100644
> --- a/gdb/testsuite/gdb.base/stack-checking.exp
> +++ b/gdb/testsuite/gdb.base/stack-checking.exp
> @@ -31,8 +31,10 @@ if ![runto_main] then {
>  # Test that the debugger is able to unwind to "main" at the next breakpoint
>  # hit. The frame number of "main" should be passed into MAIN_FRAME_NUMBER."
>  proc backtrace_test {name main_frame_number} {
> -    gdb_continue_to_breakpoint "breakpoint for $name"
> -    gdb_test "bt" "#${main_frame_number}.*in main ().*"
> +    with_test_prefix $name {
> +	gdb_continue_to_breakpoint "breakpoint for $name"

This looks good.  I think you should change the test name used in
gdb_continue_to_breakpoint though, as we're now repeating ourselves.
I'd go with something like:

  gdb_continue_to_breakpoint "test location"

or something similar.

This is good to merge with that change.

Thanks,
Andrew

> +	gdb_test "bt" "#${main_frame_number}.*in main ().*"
> +    }
>  }
>  
>  gdb_breakpoint [gdb_get_line_number "set breakpoint here"]
> -- 
> 2.33.1
> 


^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 02/29] gdb/testsuite: Remove duplicates from gdb.base/miscexprs.exp
  2021-11-21 17:56 ` [PATCH 02/29] gdb/testsuite: Remove duplicates from gdb.base/miscexprs.exp Lancelot SIX
  2021-12-10 22:06   ` Pedro Alves
@ 2022-01-04 14:00   ` Andrew Burgess
  1 sibling, 0 replies; 74+ messages in thread
From: Andrew Burgess @ 2022-01-04 14:00 UTC (permalink / raw)
  To: Lancelot SIX; +Cc: gdb-patches

* Lancelot SIX via Gdb-patches <gdb-patches@sourceware.org> [2021-11-21 17:56:09 +0000]:

> When running the testsuite I see:
> 
>     Running .../gdb/testsuite/gdb.base/miscexprs.exp ...
>     DUPLICATE: gdb.base/miscexprs.exp: print value of !ibig.i[100]
>     DUPLICATE: gdb.base/miscexprs.exp: print value of !ibig.i[100]
> 
> Fix the name of some misnamed tests.

LGTM.

Thanks,
Andrew

> 
> Tested on x86_64.
> ---
>  gdb/testsuite/gdb.base/miscexprs.exp | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/gdb/testsuite/gdb.base/miscexprs.exp b/gdb/testsuite/gdb.base/miscexprs.exp
> index 86f41215283..c1fc7420545 100644
> --- a/gdb/testsuite/gdb.base/miscexprs.exp
> +++ b/gdb/testsuite/gdb.base/miscexprs.exp
> @@ -118,10 +118,10 @@ gdb_test "print !sbig.s\[90\]" " = $false" \
>      "print value of !sbig.s\[90\]"
>  
>  gdb_test "print !fbig.f\[100\]" " = $false" \
> -    "print value of !ibig.i\[100\]"
> +    "print value of !fbig.f\[100\]"
>  
>  gdb_test "print !dbig.d\[202\]" " = $false" \
> -    "print value of !ibig.i\[100\]"
> +    "print value of !dbig.d\[202\]"
>  
>  gdb_test "print sbig.s\[90\] * 10" " = 2550" \
>      "print value of !sbig.s\[90\] * 10"
> -- 
> 2.33.1
> 


^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 04/29] gdb/testsuite: Remove duplicates from gdb.base/realname-expand.exp
  2021-11-21 17:56 ` [PATCH 04/29] gdb/testsuite: Remove duplicates from gdb.base/realname-expand.exp Lancelot SIX
@ 2022-01-04 14:06   ` Andrew Burgess
  0 siblings, 0 replies; 74+ messages in thread
From: Andrew Burgess @ 2022-01-04 14:06 UTC (permalink / raw)
  To: Lancelot SIX; +Cc: gdb-patches

* Lancelot SIX via Gdb-patches <gdb-patches@sourceware.org> [2021-11-21 17:56:11 +0000]:

> When running the testsuite, I have:
> 
>     Running .../gdb/testsuite/gdb.base/realname-expand.exp ...
>     DUPLICATE: gdb.base/realname-expand.exp: set basenames-may-differ on
> 
> This is due to the fact that the test restarts GDB twice and each time
> sets the basenames-may-differ setting.  This patch proposes to fix this
> by not restarting GDB so the setting is maintained.  It just clears the
> breakpoints between the two tests and updates the breakpoints number as
> required.
> 
> This patch also perform some minor refactorings to improve
> visibility.

LGTM.

Thanks,
Andrew

> 
> Tested on x86_64-linux.
> ---
>  gdb/testsuite/gdb.base/realname-expand.exp | 12 +++++++-----
>  1 file changed, 7 insertions(+), 5 deletions(-)
> 
> diff --git a/gdb/testsuite/gdb.base/realname-expand.exp b/gdb/testsuite/gdb.base/realname-expand.exp
> index ffe2f85e812..80bc4e0ab22 100644
> --- a/gdb/testsuite/gdb.base/realname-expand.exp
> +++ b/gdb/testsuite/gdb.base/realname-expand.exp
> @@ -40,10 +40,12 @@ clean_restart ${testfile}
>  
>  gdb_test_no_output "set basenames-may-differ on"
>  
> -gdb_test "rbreak realname-expand-real.c:func" "^rbreak realname-expand-real.c:func\r\nBreakpoint 1 at 0x\[0-9a-f\]+: file \[^\r\n\]*/realname-expand-link\\.c, line \[0-9\]+\\.\r\nvoid func\\(void\\);"
> +gdb_test "rbreak realname-expand-real.c:func" \
> +    [multi_line "" \
> +		"Breakpoint 1 at $hex: file \[^\r\n\]*/realname-expand-link\\.c, line $decimal\\." \
> +		"void func\\(void\\);"]
>  
> -clean_restart ${testfile}
> -
> -gdb_test_no_output "set basenames-may-differ on"
> +delete_breakpoints
>  
> -gdb_test "break realname-expand-real.c:func" "^break realname-expand-real.c:func\r\nBreakpoint 1 at 0x\[0-9a-f\]+: file \[^\r\n\]*/realname-expand-link\\.c, line \[0-9\]+\\."
> +gdb_test "break realname-expand-real.c:func" \
> +    "\r\nBreakpoint 2 at $hex: file \[^\r\n\]*/realname-expand-link\\.c, line $decimal\\."
> -- 
> 2.33.1
> 


^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 05/29] gdb/testsuite: Remove duplicates from gdb.base/pie-fork.exp
  2021-11-21 17:56 ` [PATCH 05/29] gdb/testsuite: Remove duplicates from gdb.base/pie-fork.exp Lancelot SIX
@ 2022-01-04 14:07   ` Andrew Burgess
  0 siblings, 0 replies; 74+ messages in thread
From: Andrew Burgess @ 2022-01-04 14:07 UTC (permalink / raw)
  To: Lancelot SIX; +Cc: gdb-patches

* Lancelot SIX via Gdb-patches <gdb-patches@sourceware.org> [2021-11-21 17:56:12 +0000]:

> When running the testsuite, I have:
> 
>     Running .../gdb/testsuite/gdb.base/pie-fork.exp ...
>     DUPLICATE: gdb.base/pie-fork.exp: test_no_detach_on_fork: continue
> 
> Fix by giving explicit names to the 'continue' commands that cause the
> duplicate message.
> 
> Tested on x86_64-linux.

LGTM.

Thanks,
Andrew

> ---
>  gdb/testsuite/gdb.base/pie-fork.exp | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/gdb/testsuite/gdb.base/pie-fork.exp b/gdb/testsuite/gdb.base/pie-fork.exp
> index 2bbdaa48be9..0910da18b42 100644
> --- a/gdb/testsuite/gdb.base/pie-fork.exp
> +++ b/gdb/testsuite/gdb.base/pie-fork.exp
> @@ -54,9 +54,11 @@ proc_with_prefix test_detach_on_fork_follow_child {} {
>  proc_with_prefix test_no_detach_on_fork {} {
>      setup_test "off"
>  
> -    gdb_test "continue" "\r\nThread 1.1 .* hit Breakpoint 2, break_here.*"
> +    gdb_test "continue" "\r\nThread 1.1 .* hit Breakpoint 2, break_here.*" \
> +	     "continue from thread 1.1"
>      gdb_test "thread 2.1"
> -    gdb_test "continue" "\r\nThread 2.1 .* hit Breakpoint 2, break_here.*"
> +    gdb_test "continue" "\r\nThread 2.1 .* hit Breakpoint 2, break_here.*" \
> +	     "continue from thread 2.1"
>  }
>  
>  test_detach_on_fork_follow_parent
> -- 
> 2.33.1
> 


^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 06/29] gdb/testsuite: Remove duplicates from gdb.base/checkpoint.exp
  2021-11-21 17:56 ` [PATCH 06/29] gdb/testsuite: Remove duplicates from gdb.base/checkpoint.exp Lancelot SIX
@ 2022-01-04 14:11   ` Andrew Burgess
  0 siblings, 0 replies; 74+ messages in thread
From: Andrew Burgess @ 2022-01-04 14:11 UTC (permalink / raw)
  To: Lancelot SIX; +Cc: gdb-patches

* Lancelot SIX via Gdb-patches <gdb-patches@sourceware.org> [2021-11-21 17:56:13 +0000]:

> When running the testsuite, I have:
> 
>     Running .../gdb/testsuite/gdb.base/checkpoint.exp ...
>     DUPLICATE: gdb.base/checkpoint.exp: verify lines 5 two
>     DUPLICATE: gdb.base/checkpoint.exp: restart 0 one
> 
> This patch fixes the various erroneous incorrect test names.
> 
> While at it, this patch also remove some trailing white spaces across
> the file.
> 
> Tested on x86_64-linux.

LGTM.

Thanks,
Andrew


> ---
>  gdb/testsuite/gdb.base/checkpoint.exp | 22 +++++++++++-----------
>  1 file changed, 11 insertions(+), 11 deletions(-)
> 
> diff --git a/gdb/testsuite/gdb.base/checkpoint.exp b/gdb/testsuite/gdb.base/checkpoint.exp
> index 46042a9f345..6a1ec22aee3 100644
> --- a/gdb/testsuite/gdb.base/checkpoint.exp
> +++ b/gdb/testsuite/gdb.base/checkpoint.exp
> @@ -65,7 +65,7 @@ gdb_test "checkpoint" ".*" ""
>  gdb_test "continue 10" "breakpoint 1.*" "break1 three"
>  
>  gdb_test "checkpoint" ".*" ""
> -gdb_test "continue 10" "breakpoint 1.*" "break1 four" 
> +gdb_test "continue 10" "breakpoint 1.*" "break1 four"
>  
>  gdb_test "checkpoint" ".*" ""
>  gdb_test "continue 10" "breakpoint 1.*" "break1 five"
> @@ -146,7 +146,7 @@ gdb_test "print i + 1 == lines * 79" " = 1" "verify i 10 one"
>  gdb_test "print lines" " = 91.*" "verify lines 10 one"
>  
>  #
> -# Now let the files be closed by the original process, 
> +# Now let the files be closed by the original process,
>  # and diff them.
>  
>  gdb_test "restart 0" "Switching to .*breakpoint 2.*" "restart 0 one"
> @@ -158,7 +158,7 @@ gdb_test "shell diff -s $pi_txt $copy1_txt" \
>      "diff input and output one"
>  
>  #
> -# And now run from various checkpoints, allowing 
> +# And now run from various checkpoints, allowing
>  # various amounts of input and output.
>  #
>  
> @@ -198,7 +198,7 @@ gdb_test "restart 6" "Switching to .*c == EOF.*" "restart 6 two"
>  gdb_test "continue" ".*" ""
>  gdb_test "continue 1000" "breakpoint 1.*" "breakpoint 1 6 one"
>  gdb_test "step" "if .c == EOF.*" "step in 6 two"
> -gdb_test "print lines" " = 1052.*" "verify lines 5 two"
> +gdb_test "print lines" " = 1052.*" "verify lines 6 two"
>  
>  gdb_test "restart 7" "Switching to .*c == EOF.*" "restart 7 two"
>  gdb_test "continue" ".*" ""
> @@ -210,12 +210,12 @@ gdb_test "shell diff -s $pi_txt $copy1_txt" \
>      "Files .*pi.txt and .*copy1.txt are identical.*" \
>      "diff input and output two"
>  
> -# 
> -# OK, now allow the original program to delete the output file, 
> +#
> +# OK, now allow the original program to delete the output file,
>  # and verify that the checkpoints can still write to it.
> -# 
> +#
>  
> -gdb_test "restart 0" "Switching to .*breakpoint 3.*" "restart 0 one"
> +gdb_test "restart 0" "Switching to .*breakpoint 3.*" "restart 0 two"
>  gdb_breakpoint $break4_loc
>  gdb_test "continue" "breakpoint 4.*" "break4 one"
>  
> @@ -259,7 +259,7 @@ gdb_test "continue" \
>  
>  #
>  # There should be still at least five forks left
> -# 
> +#
>  
>  gdb_test "info checkpoints" " 1 .* 2 .* 3 .* 4 .* 5 .*" \
>      "info checkpoints two"
> @@ -271,7 +271,7 @@ gdb_test "info checkpoints" " 1 .* 2 .* 3 .* 4 .* 5 .*" \
>  gdb_test "kill" "" "kill all one" \
>      "Kill the program being debugged.*y or n. $" "y"
>  
> -# 
> +#
>  # and confirm that all are gone
>  #
>  
> @@ -324,7 +324,7 @@ gdb_test_multiple "info checkpoints" $msg {
>  	    fail $msg
>  	}
>      }
> -}    
> +}
>  
>  #
>  # OK, kill 'em all...
> -- 
> 2.33.1
> 


^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 07/29] gdb/testsuite: Remove duplicates from gdb.base/pending.exp
  2021-11-21 17:56 ` [PATCH 07/29] gdb/testsuite: Remove duplicates from gdb.base/pending.exp Lancelot SIX
@ 2022-01-04 14:12   ` Andrew Burgess
  0 siblings, 0 replies; 74+ messages in thread
From: Andrew Burgess @ 2022-01-04 14:12 UTC (permalink / raw)
  To: Lancelot SIX; +Cc: gdb-patches

* Lancelot SIX via Gdb-patches <gdb-patches@sourceware.org> [2021-11-21 17:56:14 +0000]:

> When running the testsuite, I have:
> 
>     Running .../gdb/testsuite/gdb.base/pending.exp ...
>     DUPLICATE: gdb.base/pending.exp: disable other breakpoints
> 
> Fix by adjusting the test names.
> 
> Tested on x86_64-linux.

LGTM.

Thanks,
Andrew

> ---
>  gdb/testsuite/gdb.base/pending.exp | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/gdb/testsuite/gdb.base/pending.exp b/gdb/testsuite/gdb.base/pending.exp
> index cf3496492f6..8d1c2dce6e3 100644
> --- a/gdb/testsuite/gdb.base/pending.exp
> +++ b/gdb/testsuite/gdb.base/pending.exp
> @@ -244,8 +244,8 @@ gdb_test "continue" \
>  # be 3 then.
>  #
>  
> -gdb_test "disable 7" "" "disable other breakpoints"
> -gdb_test "disable 5" "" "disable other breakpoints"
> +gdb_test "disable 7" "" "disable breakpoint 7"
> +gdb_test "disable 5" "" "disable breakpoint 5"
>  
>  gdb_test "continue" \
>  	 ".*Breakpoint.*pendfunc1.*\\\(x=3\\\) at.*pendshr.c:$bp3_loc.*printf.*;" \
> -- 
> 2.33.1
> 


^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 08/29] gdb/testsuite: Remove duplicates from gdb.base/decl-before-def.exp
  2021-11-21 17:56 ` [PATCH 08/29] gdb/testsuite: Remove duplicates from gdb.base/decl-before-def.exp Lancelot SIX
@ 2022-01-04 14:13   ` Andrew Burgess
  0 siblings, 0 replies; 74+ messages in thread
From: Andrew Burgess @ 2022-01-04 14:13 UTC (permalink / raw)
  To: Lancelot SIX; +Cc: gdb-patches

* Lancelot SIX via Gdb-patches <gdb-patches@sourceware.org> [2021-11-21 17:56:15 +0000]:

> When running the testsuite, I have:
> 
>     Running .../gdb/testsuite/gdb.base/decl-before-def.exp ...
>     DUPLICATE: gdb.base/decl-before-def.exp: p a
> 
> Fix by giving explicit names to the two tests that use the same command.
> 
> Tested on x86_64-linux.

LGTM.

Thanks,
Andrew

> ---
>  gdb/testsuite/gdb.base/decl-before-def.exp | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/gdb/testsuite/gdb.base/decl-before-def.exp b/gdb/testsuite/gdb.base/decl-before-def.exp
> index d907e656e33..0b3f0435b2e 100644
> --- a/gdb/testsuite/gdb.base/decl-before-def.exp
> +++ b/gdb/testsuite/gdb.base/decl-before-def.exp
> @@ -23,10 +23,10 @@ if {[prepare_for_testing "failed to prepare" $testfile $sources]} {
>  # This is required due to PR25764.
>  gdb_test "maint expand-symtabs"
>  
> -gdb_test "p a" { = \{1, 2\}}
> +gdb_test "p a" { = \{1, 2\}} "no running process: p a"
>  
>  if ![runto_main] then {
>      return 0
>  }
>  
> -gdb_test "p a" { = \{1, 2\}}
> +gdb_test "p a" { = \{1, 2\}} "running process: p a"
> -- 
> 2.33.1
> 


^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 09/29] gdb/testsuite: Remove duplicates from gdb.base/solib-display.exp
  2021-11-21 17:56 ` [PATCH 09/29] gdb/testsuite: Remove duplicates from gdb.base/solib-display.exp Lancelot SIX
@ 2022-01-04 14:17   ` Andrew Burgess
  0 siblings, 0 replies; 74+ messages in thread
From: Andrew Burgess @ 2022-01-04 14:17 UTC (permalink / raw)
  To: Lancelot SIX; +Cc: gdb-patches

* Lancelot SIX via Gdb-patches <gdb-patches@sourceware.org> [2021-11-21 17:56:16 +0000]:

> When running the testsuite, I have:
> 
>     Running .../gdb/testsuite/gdb.base/solib-display.exp ...
>     DUPLICATE: gdb.base/solib-display.exp: NO: break 25
>     DUPLICATE: gdb.base/solib-display.exp: NO: continue
>     DUPLICATE: gdb.base/solib-display.exp: IN: break 25
>     DUPLICATE: gdb.base/solib-display.exp: IN: continue
>     DUPLICATE: gdb.base/solib-display.exp: SEP: break 25
>     DUPLICATE: gdb.base/solib-display.exp: SEP: continue
> 
> The 'break 25' appears because the test inserts two breakpoints at the
> same location.  Fix this by only inserting the breakpoint once.
> 
> Fix the 'continue' DUPLICATE by giving a phony name to the second
> continue: 'continue two'.
> 
> While at it, this commit also removes a trailing space.
> 
> Tested on x86_64-linux.

LGTM.

Thanks,
Andrew


> ---
>  gdb/testsuite/gdb.base/solib-display.exp | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/gdb/testsuite/gdb.base/solib-display.exp b/gdb/testsuite/gdb.base/solib-display.exp
> index 54de334357f..f075b295899 100644
> --- a/gdb/testsuite/gdb.base/solib-display.exp
> +++ b/gdb/testsuite/gdb.base/solib-display.exp
> @@ -140,7 +140,7 @@ foreach libsepdebug {NO IN SEP} { with_test_prefix "$libsepdebug" {
>      # are not cleared permaturely.
>  
>      gdb_test "break [gdb_get_line_number "break here" ${testfile}.c]" \
> -	    ".*Breakpoint.* at .*" 
> +	    ".*Breakpoint.* at .*"
>  
>      gdb_test "continue"
>      gdb_test "display main_global" "4: main_global = 44"
> @@ -153,11 +153,9 @@ foreach libsepdebug {NO IN SEP} { with_test_prefix "$libsepdebug" {
>      }
>  
>      gdb_test "" "6: a_static = 46\\r\\n4: main_global = 44\\r\\n.*"
> -    gdb_test "break [gdb_get_line_number "break here" ${testfile}.c]" \
> -	    ".*Breakpoint.* at .*" 
>      gdb_test "continue" [multi_line \
>  			     "4: main_global = 44" \
>  			     "5: a_local = 45" \
>  			     "6: a_static = 46" \
> -			    ]
> +			    ] "continue two"
>  }}
> -- 
> 2.33.1
> 


^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 10/29] gdb/testsuite: Remove duplicates from gdb.base/del.exp
  2021-11-21 17:56 ` [PATCH 10/29] gdb/testsuite: Remove duplicates from gdb.base/del.exp Lancelot SIX
@ 2022-01-04 14:20   ` Andrew Burgess
  0 siblings, 0 replies; 74+ messages in thread
From: Andrew Burgess @ 2022-01-04 14:20 UTC (permalink / raw)
  To: Lancelot SIX; +Cc: gdb-patches

* Lancelot SIX via Gdb-patches <gdb-patches@sourceware.org> [2021-11-21 17:56:17 +0000]:

> When running the testsuite, I have:
> 
>     Running .../gdb/testsuite/gdb.base/del.exp ...
>     DUPLICATE: gdb.base/del.exp: info break after removing break on main
> 
> Refactor slightly this test to run the various configurations under
> foreach_with_prefix so each variant is automatically prefixed, ensuring
> that the forgotten custom test name cannot happen.
> 
> Tested on x86_64-linux.

LGTM.

Thanks,
Andrew

> ---
>  gdb/testsuite/gdb.base/del.exp | 22 +++++++++++-----------
>  1 file changed, 11 insertions(+), 11 deletions(-)
> 
> diff --git a/gdb/testsuite/gdb.base/del.exp b/gdb/testsuite/gdb.base/del.exp
> index 7b1f24b8686..8dc12b7089b 100644
> --- a/gdb/testsuite/gdb.base/del.exp
> +++ b/gdb/testsuite/gdb.base/del.exp
> @@ -32,30 +32,30 @@ proc test_delete_alias { alias } {
>      # First of all, remove all previous breakpoints if there were any,
>      # and then verify that we do not have any breakpoint lying around.
>      gdb_test_no_output "delete" \
> -             "remove all breakpoints ($alias)"
> +             "remove all breakpoints"
>  
>      gdb_test "info break" \
>               "No breakpoints or watchpoints." \
> -             "info break after removing break on main"
> +             "info break after clearing breakpoints"
> +
>  
> -    
>      # Now, insert a breakpoint at an easy location, and then remove it
>      # using $alias. We verified that the removal worked by checking
>      # the list of breakpoints.
>      gdb_test "break -q main" \
>               "Breakpoint.*at.* file .*$srcfile, line.*" \
> -             "breakpoint insertion ($alias)"
> -    
> +             "breakpoint insertion"
> +
>      gdb_test_no_output "$alias \$bpnum" \
> -             "Remove last breakpoint ($alias)"
> -    
> +             "Remove last breakpoint"
> +
>      gdb_test "info break" \
>               "No breakpoints or watchpoints." \
> -             "info break after removing break on main ($alias)"
> +             "info break after removing break on main"
>  }
>  
>  # Test various shortcut forms of the "delete" command.
>  
> -test_delete_alias "del"
> -test_delete_alias "d"
> -
> +foreach_with_prefix alias {"del" "d"} {
> +    test_delete_alias $alias
> +}
> -- 
> 2.33.1
> 


^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 11/29] gdb/testsuite: Remove duplicates from gdb.base/dfp-test.exp
  2021-11-21 17:56 ` [PATCH 11/29] gdb/testsuite: Remove duplicates from gdb.base/dfp-test.exp Lancelot SIX
@ 2022-01-04 14:26   ` Andrew Burgess
  2022-01-05 22:03     ` Lancelot SIX
  0 siblings, 1 reply; 74+ messages in thread
From: Andrew Burgess @ 2022-01-04 14:26 UTC (permalink / raw)
  To: Lancelot SIX; +Cc: gdb-patches

* Lancelot SIX via Gdb-patches <gdb-patches@sourceware.org> [2021-11-21 17:56:18 +0000]:

> When running the testsuite, I have:
> 
>     Running .../gdb/testsuite/gdb.base/dfp-test.exp ...
>     DUPLICATE: gdb.base/dfp-test.exp: 1.23E is an invalid number
>     DUPLICATE: gdb.base/dfp-test.exp: 1.23E45A is an invalid number
>     DUPLICATE: gdb.base/dfp-test.exp: 1.23E is an invalid number
>     DUPLICATE: gdb.base/dfp-test.exp: 1.23E45A is an invalid number
> 
> Fix by adjusting the test names.
> 
> Tested on x86_64-linux.
> ---
>  gdb/testsuite/gdb.base/dfp-test.exp | 20 ++++++++++----------
>  1 file changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git a/gdb/testsuite/gdb.base/dfp-test.exp b/gdb/testsuite/gdb.base/dfp-test.exp
> index 379794a1b31..c2ca7e7f032 100644
> --- a/gdb/testsuite/gdb.base/dfp-test.exp
> +++ b/gdb/testsuite/gdb.base/dfp-test.exp
> @@ -61,10 +61,10 @@ proc d32_set_tests {} {
>      gdb_test "p d32=1.234567E+97df" " = Infinity" "1.234567E+97 is Infinity"
>  
>      # Test that gdb could detect the errors in the string representation of _Decimal32
> -    gdb_test "p d32=12345.df" " = 12345" "12345. is a valid number"
> -    gdb_test "p d32=12345df" ".*Invalid number.*" "12345 is an invalid number"
> -    gdb_test "p d32=1.23Edf" ".*Conversion syntax.*" "1.23E is an invalid number"
> -    gdb_test "p d32=1.23E45Adf" ".*Conversion syntax.*" "1.23E45A is an invalid number"
> +    gdb_test "p d32=12345.df" " = 12345" "12345. is a valid Decimal32 number"
> +    gdb_test "p d32=12345df" ".*Invalid number.*" "12345 is an invalid Decimal32 number"
> +    gdb_test "p d32=1.23Edf" ".*Conversion syntax.*" "1.23E is an invalid Decimal32 number"
> +    gdb_test "p d32=1.23E45Adf" ".*Conversion syntax.*" "1.23E45A is an invalid Decimal32 number"
>  }

Did you consider using proc_with_prefix?  You could change
d32_set_tests and d64_set_tests like this:

  proc_with_prefix d32_set_tests {} {
    ...
  }

  proc_with_prefix d64_set_tests {} {
    ...
  }

And this will cause all of the enclosed tests to be prefixed with
'd32_set_tests' or 'd64_set_tests'.  This seems a slightly neater
solution, what do you think?

Thanks,
Andrew

>  
>  proc d64_set_tests {} {
> @@ -92,9 +92,9 @@ proc d64_set_tests {} {
>      gdb_test "p d64=1.234567890123456E385dd" " = Infinity" "d64=1.234567890123456E385 is Infinity"
>  
>      # Test that gdb could detect the errors in the string representation of _Decimal64
> -    gdb_test "p d64=12345dd" ".*Invalid number.*" "12345dd is an invalid number"
> -    gdb_test "p d64=1.23Edd" ".*Conversion syntax.*" "1.23E is an invalid number"
> -    gdb_test "p d64=1.23E45Add" ".*Conversion syntax.*" "1.23E45A is an invalid number"
> +    gdb_test "p d64=12345dd" ".*Invalid number.*" "12345 is an invalid Decimal64 number"
> +    gdb_test "p d64=1.23Edd" ".*Conversion syntax.*" "1.23E is an invalid Decimal64 number"
> +    gdb_test "p d64=1.23E45Add" ".*Conversion syntax.*" "1.23E45A is an invalid Decimal64 number"
>  }
>  
>  proc d128_set_tests {} {
> @@ -121,9 +121,9 @@ proc d128_set_tests {} {
>      gdb_test "p d128=1.234567890123456E6145dl" "Infinity" "d128=1.234567890123456E6145 is Infinity"
>  
>      # Test that gdb could detect the errors in the string representation of _Decimal128
> -    gdb_test "p d128=12345dl" ".*Invalid number.*" "12345dl is an invalid number"
> -    gdb_test "p d128=1.23Edl" ".*Conversion syntax.*" "1.23E is an invalid number"
> -    gdb_test "p d128=1.23E45Adl" ".*Conversion syntax.*" "1.23E45A is an invalid number"
> +    gdb_test "p d128=12345dl" ".*Invalid number.*" "12345dl is an invalid Decimal128 number"
> +    gdb_test "p d128=1.23Edl" ".*Conversion syntax.*" "1.23E is an invalid Decimal128 number"
> +    gdb_test "p d128=1.23E45Adl" ".*Conversion syntax.*" "1.23E45A is an invalid Decimal128 number"
>  }
>  
>  # Different tests on 32-bits decimal floating point, including the printing
> -- 
> 2.33.1
> 


^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 12/29] gdb/testsuite: Remove duplicates from gdb.base/ptype.exp
  2021-11-21 17:56 ` [PATCH 12/29] gdb/testsuite: Remove duplicates from gdb.base/ptype.exp Lancelot SIX
@ 2022-01-04 15:13   ` Andrew Burgess
  0 siblings, 0 replies; 74+ messages in thread
From: Andrew Burgess @ 2022-01-04 15:13 UTC (permalink / raw)
  To: Lancelot SIX; +Cc: gdb-patches

* Lancelot SIX via Gdb-patches <gdb-patches@sourceware.org> [2021-11-21 17:56:19 +0000]:

> When running the testsuite, I have:
> 
>     Running .../gdb/testsuite/gdb.base/ptype.exp ...
>     DUPLICATE: gdb.base/ptype.exp: ptype the_highest
>     DUPLICATE: gdb.base/ptype.exp: list intfoo
>     DUPLICATE: gdb.base/ptype.exp: list charfoo
> 
> Fix by adjusting the offending test names.
> 
> Tested on x86_64-linux.

LGTM.

Thanks,
Andrew

> ---
>  gdb/testsuite/gdb.base/ptype.exp | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/gdb/testsuite/gdb.base/ptype.exp b/gdb/testsuite/gdb.base/ptype.exp
> index 375a9431aa4..5408abae192 100644
> --- a/gdb/testsuite/gdb.base/ptype.exp
> +++ b/gdb/testsuite/gdb.base/ptype.exp
> @@ -509,7 +509,7 @@ gdb_test "ptype the_highest" \
>  
>  gdb_test "ptype the_highest.anonymous_level_1" \
>           "type = struct \{.*\[\r\n\] *int b;.*\[\r\n\] *struct \{.*\[\r\n\] *int c;.*\[\r\n\] *\} anonymous_level_2;.*\[\r\n\]}.*" \
> -         "ptype the_highest" 
> +         "ptype the_highest.anonymous_level_1"
>  
>  get_debug_format
>  
> @@ -578,9 +578,9 @@ gdb_test "list intfoo" ".*"
>  gdb_test "ptype foo" "type = int" "ptype foo typedef after first list of intfoo"
>  gdb_test "list charfoo" ".*"
>  gdb_test "ptype foo" "type = char" "ptype foo typedef after first list of charfoo"
> -gdb_test "list intfoo" ".*"
> +gdb_test "list intfoo" ".*" "second list intfoo"
>  gdb_test "ptype foo" "type = int" "ptype foo typedef after second list of intfoo"
> -gdb_test "list charfoo" ".*"
> +gdb_test "list charfoo" ".*" "second list charfoo"
>  gdb_test "ptype foo" "type = char" "ptype foo typedef after second list of charfoo"
>  
>  # Test printing type of string constants and array constants, but
> -- 
> 2.33.1
> 


^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 25/29] gdb/testsuite: Remove duplicates from gdb.base/pointers.exp
  2021-12-17 23:14         ` Lancelot SIX
@ 2022-01-05 16:05           ` Pedro Alves
  0 siblings, 0 replies; 74+ messages in thread
From: Pedro Alves @ 2022-01-05 16:05 UTC (permalink / raw)
  To: Lancelot SIX; +Cc: gdb-patches

Hi!

On 2021-12-17 23:14, Lancelot SIX wrote:
>>
>> Hmm, how about this instead?
>>
>> with_test_prefix "post-increment" {
>>     gdb_test_no_output "set variable y = *v_int_pointer++" \
>> 	"pointer dereference, set variable"
>>     gdb_test "print y" " = 6" "pointer assignment"
>>     gdb_test "print *v_int_pointer" " = 18" "pointer increment"
>> }
>>
>> with_test_prefix "pre-decrement" {
>>     gdb_test_no_output "set variable y = *--v_int_pointer2" \
>> 	"pointer dereference, set variable"
>>     gdb_test "print y" " = 6" "pointer assignment"
>>     gdb_test "print *v_int_pointer2" " = 6" "pointer decrement"
>> }
> 
> Done in the wollowing patch.
> 
> Lancelot.
> 

OK.

^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 00/29] Remove DUPLICATEs from testsuite/gdb.base/*.exp
  2021-12-18  0:39   ` Lancelot SIX
@ 2022-01-05 16:23     ` Pedro Alves
  0 siblings, 0 replies; 74+ messages in thread
From: Pedro Alves @ 2022-01-05 16:23 UTC (permalink / raw)
  To: Lancelot SIX; +Cc: gdb-patches

On 2021-12-18 00:39, Lancelot SIX wrote:
>> I reviewed all patches except patch #15 (gdb.base/complete-empty.exp).  I left that for
>> last as I think I'll need look a bit in more detail, but I ran out of time for now.
>> I sent a few comments.  Patches that I didn't comment on (other than #15) looks
>> OK to me.
>>
>> Thanks a lot for doing this.
>>
> 
> Hi,
> 
> I do not know if you have had a chance to look an #15, 

I hadn't, sorry, been mostly traveling / out of office since.

> but I think
> I have another approach you might prefer.  Instead of going around the
> testing framework in the testcase, it improves the completion testing
> framework.
> 
> See below the alternative approach.
> 
> Let me know what you think.

Indeed, I like this much better!  Thanks.  This is OK.

^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 11/29] gdb/testsuite: Remove duplicates from gdb.base/dfp-test.exp
  2022-01-04 14:26   ` Andrew Burgess
@ 2022-01-05 22:03     ` Lancelot SIX
  2022-01-06  9:34       ` Andrew Burgess
  0 siblings, 1 reply; 74+ messages in thread
From: Lancelot SIX @ 2022-01-05 22:03 UTC (permalink / raw)
  To: Andrew Burgess; +Cc: gdb-patches

> 
> Did you consider using proc_with_prefix?  You could change
> d32_set_tests and d64_set_tests like this:
> 
>   proc_with_prefix d32_set_tests {} {
>     ...
>   }
> 
>   proc_with_prefix d64_set_tests {} {
>     ...
>   }
> 
> And this will cause all of the enclosed tests to be prefixed with
> 'd32_set_tests' or 'd64_set_tests'.  This seems a slightly neater
> solution, what do you think?
> 
> Thanks,
> Andrew

Hi,

I like your approach better.

I have implemented it in the attached patch.

Thanks,
Lancelot.

---
From 58a73a850f5b6f12e54d74b27ed3ef7ef96c9579 Mon Sep 17 00:00:00 2001
From: Lancelot SIX <lsix@lancelotsix.com>
Date: Sat, 20 Nov 2021 00:10:07 +0000
Subject: [PATCH] gdb/testsuite: Remove duplicates from gdb.base/dfp-test.exp

When running the testsuite, I have:

    Running .../gdb/testsuite/gdb.base/dfp-test.exp ...
    DUPLICATE: gdb.base/dfp-test.exp: 1.23E is an invalid number
    DUPLICATE: gdb.base/dfp-test.exp: 1.23E45A is an invalid number
    DUPLICATE: gdb.base/dfp-test.exp: 1.23E is an invalid number
    DUPLICATE: gdb.base/dfp-test.exp: 1.23E45A is an invalid number

Fix by using proc_with_prefix where appropriate.

Tested on x86_64-linux.
Co-Author-By: Andrew Burgess <aburgess@redhat.com>
---
 gdb/testsuite/gdb.base/dfp-test.exp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/gdb/testsuite/gdb.base/dfp-test.exp b/gdb/testsuite/gdb.base/dfp-test.exp
index e43ecd0e15e..4866d0ae094 100644
--- a/gdb/testsuite/gdb.base/dfp-test.exp
+++ b/gdb/testsuite/gdb.base/dfp-test.exp
@@ -36,7 +36,7 @@ if ![runto_main] then {
 
 set sizeof_long [get_sizeof "long" 4]
 
-proc d32_set_tests {} {
+proc_with_prefix d32_set_tests {} {
 
     gdb_test "p d32=123.45df" " = 123.45"
     gdb_test "p d32=12345.df" " = 12345"
@@ -67,7 +67,7 @@ proc d32_set_tests {} {
     gdb_test "p d32=1.23E45Adf" ".*Conversion syntax.*" "1.23E45A is an invalid number"
 }
 
-proc d64_set_tests {} {
+proc_with_prefix d64_set_tests {} {
 
     gdb_test "p d64=123.45dd" " = 123.45"
     gdb_test "p d64=12345.dd" " = 12345"
@@ -97,7 +97,7 @@ proc d64_set_tests {} {
     gdb_test "p d64=1.23E45Add" ".*Conversion syntax.*" "1.23E45A is an invalid number"
 }
 
-proc d128_set_tests {} {
+proc_with_prefix d128_set_tests {} {
 
     gdb_test "p d128=123.45dl" " = 123.45"
     gdb_test "p d128=12345.dl" " = 12345"
-- 
2.34.1


^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 11/29] gdb/testsuite: Remove duplicates from gdb.base/dfp-test.exp
  2022-01-05 22:03     ` Lancelot SIX
@ 2022-01-06  9:34       ` Andrew Burgess
  0 siblings, 0 replies; 74+ messages in thread
From: Andrew Burgess @ 2022-01-06  9:34 UTC (permalink / raw)
  To: Lancelot SIX; +Cc: gdb-patches

* Lancelot SIX <lsix@lancelotsix.com> [2022-01-05 22:03:21 +0000]:

> > 
> > Did you consider using proc_with_prefix?  You could change
> > d32_set_tests and d64_set_tests like this:
> > 
> >   proc_with_prefix d32_set_tests {} {
> >     ...
> >   }
> > 
> >   proc_with_prefix d64_set_tests {} {
> >     ...
> >   }
> > 
> > And this will cause all of the enclosed tests to be prefixed with
> > 'd32_set_tests' or 'd64_set_tests'.  This seems a slightly neater
> > solution, what do you think?
> > 
> > Thanks,
> > Andrew
> 
> Hi,
> 
> I like your approach better.
> 
> I have implemented it in the attached patch.
> 
> Thanks,
> Lancelot.
> 
> ---
> From 58a73a850f5b6f12e54d74b27ed3ef7ef96c9579 Mon Sep 17 00:00:00 2001
> From: Lancelot SIX <lsix@lancelotsix.com>
> Date: Sat, 20 Nov 2021 00:10:07 +0000
> Subject: [PATCH] gdb/testsuite: Remove duplicates from gdb.base/dfp-test.exp
> 
> When running the testsuite, I have:
> 
>     Running .../gdb/testsuite/gdb.base/dfp-test.exp ...
>     DUPLICATE: gdb.base/dfp-test.exp: 1.23E is an invalid number
>     DUPLICATE: gdb.base/dfp-test.exp: 1.23E45A is an invalid number
>     DUPLICATE: gdb.base/dfp-test.exp: 1.23E is an invalid number
>     DUPLICATE: gdb.base/dfp-test.exp: 1.23E45A is an invalid number
> 
> Fix by using proc_with_prefix where appropriate.

This LGTM.

Thanks,
Andrew


> 
> Tested on x86_64-linux.
> Co-Author-By: Andrew Burgess <aburgess@redhat.com>
> ---
>  gdb/testsuite/gdb.base/dfp-test.exp | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/gdb/testsuite/gdb.base/dfp-test.exp b/gdb/testsuite/gdb.base/dfp-test.exp
> index e43ecd0e15e..4866d0ae094 100644
> --- a/gdb/testsuite/gdb.base/dfp-test.exp
> +++ b/gdb/testsuite/gdb.base/dfp-test.exp
> @@ -36,7 +36,7 @@ if ![runto_main] then {
>  
>  set sizeof_long [get_sizeof "long" 4]
>  
> -proc d32_set_tests {} {
> +proc_with_prefix d32_set_tests {} {
>  
>      gdb_test "p d32=123.45df" " = 123.45"
>      gdb_test "p d32=12345.df" " = 12345"
> @@ -67,7 +67,7 @@ proc d32_set_tests {} {
>      gdb_test "p d32=1.23E45Adf" ".*Conversion syntax.*" "1.23E45A is an invalid number"
>  }
>  
> -proc d64_set_tests {} {
> +proc_with_prefix d64_set_tests {} {
>  
>      gdb_test "p d64=123.45dd" " = 123.45"
>      gdb_test "p d64=12345.dd" " = 12345"
> @@ -97,7 +97,7 @@ proc d64_set_tests {} {
>      gdb_test "p d64=1.23E45Add" ".*Conversion syntax.*" "1.23E45A is an invalid number"
>  }
>  
> -proc d128_set_tests {} {
> +proc_with_prefix d128_set_tests {} {
>  
>      gdb_test "p d128=123.45dl" " = 123.45"
>      gdb_test "p d128=12345.dl" " = 12345"
> -- 
> 2.34.1
> 


^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 00/29] Remove DUPLICATEs from testsuite/gdb.base/*.exp
  2021-11-21 17:56 [PATCH 00/29] Remove DUPLICATEs from testsuite/gdb.base/*.exp Lancelot SIX
                   ` (29 preceding siblings ...)
  2021-12-10 23:40 ` [PATCH 00/29] Remove DUPLICATEs from testsuite/gdb.base/*.exp Pedro Alves
@ 2022-01-07 22:36 ` Lancelot SIX
  30 siblings, 0 replies; 74+ messages in thread
From: Lancelot SIX @ 2022-01-07 22:36 UTC (permalink / raw)
  To: gdb-patches

Hi,

I’ll shortly be pushing the entire series, with all the changes requested.

Thanks for all the reviews.

Best,
Lancelot.

^ permalink raw reply	[flat|nested] 74+ messages in thread

end of thread, other threads:[~2022-01-07 22:37 UTC | newest]

Thread overview: 74+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-21 17:56 [PATCH 00/29] Remove DUPLICATEs from testsuite/gdb.base/*.exp Lancelot SIX
2021-11-21 17:56 ` [PATCH 01/29] gdb/testsuite: Remove duplicates from gdb.base/stack-checking.exp Lancelot SIX
2022-01-04 13:59   ` Andrew Burgess
2021-11-21 17:56 ` [PATCH 02/29] gdb/testsuite: Remove duplicates from gdb.base/miscexprs.exp Lancelot SIX
2021-12-10 22:06   ` Pedro Alves
2021-12-14 23:28     ` Lancelot SIX
2021-12-15 11:52       ` Pedro Alves
2022-01-04 14:00   ` Andrew Burgess
2021-11-21 17:56 ` [PATCH 03/29] gdb/testsuite: Remove duplicates from gdb.base/interp.exp Lancelot SIX
2021-11-22 14:13   ` Pedro Alves
2021-11-22 17:33     ` Lancelot SIX
2021-12-10 22:01       ` Pedro Alves
2021-11-21 17:56 ` [PATCH 04/29] gdb/testsuite: Remove duplicates from gdb.base/realname-expand.exp Lancelot SIX
2022-01-04 14:06   ` Andrew Burgess
2021-11-21 17:56 ` [PATCH 05/29] gdb/testsuite: Remove duplicates from gdb.base/pie-fork.exp Lancelot SIX
2022-01-04 14:07   ` Andrew Burgess
2021-11-21 17:56 ` [PATCH 06/29] gdb/testsuite: Remove duplicates from gdb.base/checkpoint.exp Lancelot SIX
2022-01-04 14:11   ` Andrew Burgess
2021-11-21 17:56 ` [PATCH 07/29] gdb/testsuite: Remove duplicates from gdb.base/pending.exp Lancelot SIX
2022-01-04 14:12   ` Andrew Burgess
2021-11-21 17:56 ` [PATCH 08/29] gdb/testsuite: Remove duplicates from gdb.base/decl-before-def.exp Lancelot SIX
2022-01-04 14:13   ` Andrew Burgess
2021-11-21 17:56 ` [PATCH 09/29] gdb/testsuite: Remove duplicates from gdb.base/solib-display.exp Lancelot SIX
2022-01-04 14:17   ` Andrew Burgess
2021-11-21 17:56 ` [PATCH 10/29] gdb/testsuite: Remove duplicates from gdb.base/del.exp Lancelot SIX
2022-01-04 14:20   ` Andrew Burgess
2021-11-21 17:56 ` [PATCH 11/29] gdb/testsuite: Remove duplicates from gdb.base/dfp-test.exp Lancelot SIX
2022-01-04 14:26   ` Andrew Burgess
2022-01-05 22:03     ` Lancelot SIX
2022-01-06  9:34       ` Andrew Burgess
2021-11-21 17:56 ` [PATCH 12/29] gdb/testsuite: Remove duplicates from gdb.base/ptype.exp Lancelot SIX
2022-01-04 15:13   ` Andrew Burgess
2021-11-21 17:56 ` [PATCH 13/29] gdb/testsuite: Remove duplicates from gdb.base/dfp-exprs.exp Lancelot SIX
2021-12-10 23:03   ` Pedro Alves
2021-12-15  0:01     ` Lancelot SIX
2021-12-15 11:54       ` Pedro Alves
2021-11-21 17:56 ` [PATCH 14/29] gdb/testsuite: Remove duplicates from gdb.base/subst.exp Lancelot SIX
2021-11-21 17:56 ` [PATCH 15/29] gdb/testsuite: Remove duplicates from gdb.base/complete-empty.exp Lancelot SIX
2021-11-21 17:56 ` [PATCH 16/29] gdb/testsuite: Remove duplicates from gdb.base/ui-redirect.exp Lancelot SIX
2021-12-10 23:15   ` Pedro Alves
2021-12-15  0:26     ` Lancelot SIX
2021-11-21 17:56 ` [PATCH 17/29] gdb/testsuite: Remove duplicates from gdb.base/pretty-array.exp Lancelot SIX
2021-11-21 17:56 ` [PATCH 18/29] gdb/testsuite: Remove duplicates from gdb.base/readline.exp Lancelot SIX
2021-11-21 17:56 ` [PATCH 19/29] gdb/testsuite: Remove duplicates from gdb.base/exprs.exp Lancelot SIX
2021-12-10 23:15   ` Pedro Alves
2021-12-15  0:21     ` Lancelot SIX
2021-11-21 17:56 ` [PATCH 20/29] gdb/testsuite: Remove duplicates from gdb.base/set-cfd.exp Lancelot SIX
2021-11-21 17:56 ` [PATCH 21/29] gdb/testsuite: Remove duplicates from gdb.base/shlib-call.exp Lancelot SIX
2021-12-10 23:24   ` Pedro Alves
2021-12-16 22:57     ` Lancelot SIX
2021-12-17 11:58       ` Pedro Alves
2021-11-21 17:56 ` [PATCH 22/29] gdb/testsuite: Remove duplicates from gdb.base/funcargs.exp Lancelot SIX
2021-12-10 23:26   ` Pedro Alves
2021-12-16 23:08     ` Lancelot SIX
2021-12-17 12:00       ` Pedro Alves
2021-11-21 17:56 ` [PATCH 23/29] gdb/testsuite: Remove duplicates from gdb.base/define-prefix.exp Lancelot SIX
2021-11-21 17:56 ` [PATCH 24/29] gdb/testsuite: Remove duplicates from gdb.base/unload.exp Lancelot SIX
2021-11-21 17:56 ` [PATCH 25/29] gdb/testsuite: Remove duplicates from gdb.base/pointers.exp Lancelot SIX
2021-12-10 23:27   ` Pedro Alves
2021-12-16 23:14     ` Lancelot SIX
2021-12-17 12:18       ` Pedro Alves
2021-12-17 23:14         ` Lancelot SIX
2022-01-05 16:05           ` Pedro Alves
2021-11-21 17:56 ` [PATCH 26/29] gdb/testsuite: Remove duplicates from gdb.base/call-signal-resume.exp Lancelot SIX
2021-11-21 17:56 ` [PATCH 27/29] gdb/testsuite: Remove duplicates from gdb.base/nested-subp2.exp Lancelot SIX
2021-11-21 17:56 ` [PATCH 28/29] gdb/testsuite: Remove duplicates from gdb.base/watchpoints.exp Lancelot SIX
2021-12-10 23:30   ` Pedro Alves
2021-12-16 23:15     ` Lancelot SIX
2021-11-21 17:56 ` [PATCH 29/29] gdb/testsuite: Remove duplicates from gdb.base/corefile-buildid.exp Lancelot SIX
2021-12-10 23:38   ` Pedro Alves
2021-12-10 23:40 ` [PATCH 00/29] Remove DUPLICATEs from testsuite/gdb.base/*.exp Pedro Alves
2021-12-18  0:39   ` Lancelot SIX
2022-01-05 16:23     ` Pedro Alves
2022-01-07 22:36 ` Lancelot SIX

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).