[gdb/testsuite] Remove superfluous 3rd argument from gdb_test call (2)
authorTom de Vries <tdevries@suse.de>
Thu, 31 Oct 2019 22:03:25 +0000 (23:03 +0100)
committerTom de Vries <tdevries@suse.de>
Thu, 31 Oct 2019 22:03:25 +0000 (23:03 +0100)
There's a pattern:
...
gdb_test <command> <pattern> <command>
...
that can be written shorter as:
...
gdb_test <command> <pattern>
...

Detect this pattern in proc gdb_test:
...
     global gdb_prompt
     upvar timeout timeout

     if [llength $args]>2 then {
        set message [lindex $args 2]
+       if { $message == [lindex $args 0] && [llength $args] == 3 } {
+           error "HERE"
+       }
     } else {
         set message [lindex $args 0]
     }
...
and fix all occurrences in some gdb testsuite subdirs.

Tested on x86_64-linux.

gdb/testsuite/ChangeLog:

2019-10-31  Tom de Vries  <tdevries@suse.de>

* gdb.arch/amd64-disp-step-avx.exp: Drop superfluous 3rd argument to
gdb_test.
* gdb.arch/amd64-disp-step.exp: Same.
* gdb.asm/asm-source.exp: Same.
* gdb.btrace/buffer-size.exp: Same.
* gdb.btrace/cpu.exp: Same.
* gdb.btrace/enable.exp: Same.
* gdb.dwarf2/count.exp: Same.
* gdb.dwarf2/dw2-ranges-func.exp: Same.
* gdb.dwarf2/dw2-ranges-psym.exp: Same.
* gdb.fortran/vla-datatypes.exp: Same.
* gdb.fortran/vla-history.exp: Same.
* gdb.fortran/vla-ptype.exp: Same.
* gdb.fortran/vla-value.exp: Same.
* gdb.fortran/whatis_type.exp: Same.
* gdb.guile/guile.exp: Same.
* gdb.multi/tids.exp: Same.
* gdb.python/py-finish-breakpoint.exp: Same.
* gdb.python/py-framefilter.exp: Same.
* gdb.python/py-pp-registration.exp: Same.
* gdb.python/py-xmethods.exp: Same.
* gdb.python/python.exp: Same.
* gdb.server/connect-with-no-symbol-file.exp: Same.
* gdb.server/no-thread-db.exp: Same.
* gdb.server/run-without-local-binary.exp: Same.
* gdb.stabs/weird.exp: Same.
* gdb.threads/attach-many-short-lived-threads.exp: Same.
* gdb.threads/thread-find.exp: Same.
* gdb.threads/tls-shared.exp: Same.
* gdb.threads/tls.exp: Same.
* gdb.threads/wp-replication.exp: Same.
* gdb.trace/ax.exp: Same.
* lib/gdb.exp (gdb_test_exact, help_test_raw): Same.

Change-Id: I2fa544c68f8c0099a77e03ff04ddc010eb2b6c7c

33 files changed:
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.arch/amd64-disp-step-avx.exp
gdb/testsuite/gdb.arch/amd64-disp-step.exp
gdb/testsuite/gdb.asm/asm-source.exp
gdb/testsuite/gdb.btrace/buffer-size.exp
gdb/testsuite/gdb.btrace/cpu.exp
gdb/testsuite/gdb.btrace/enable.exp
gdb/testsuite/gdb.dwarf2/count.exp
gdb/testsuite/gdb.dwarf2/dw2-ranges-func.exp
gdb/testsuite/gdb.dwarf2/dw2-ranges-psym.exp
gdb/testsuite/gdb.fortran/vla-datatypes.exp
gdb/testsuite/gdb.fortran/vla-history.exp
gdb/testsuite/gdb.fortran/vla-ptype.exp
gdb/testsuite/gdb.fortran/vla-value.exp
gdb/testsuite/gdb.fortran/whatis_type.exp
gdb/testsuite/gdb.guile/guile.exp
gdb/testsuite/gdb.multi/tids.exp
gdb/testsuite/gdb.python/py-finish-breakpoint.exp
gdb/testsuite/gdb.python/py-framefilter.exp
gdb/testsuite/gdb.python/py-pp-registration.exp
gdb/testsuite/gdb.python/py-xmethods.exp
gdb/testsuite/gdb.python/python.exp
gdb/testsuite/gdb.server/connect-with-no-symbol-file.exp
gdb/testsuite/gdb.server/no-thread-db.exp
gdb/testsuite/gdb.server/run-without-local-binary.exp
gdb/testsuite/gdb.stabs/weird.exp
gdb/testsuite/gdb.threads/attach-many-short-lived-threads.exp
gdb/testsuite/gdb.threads/thread-find.exp
gdb/testsuite/gdb.threads/tls-shared.exp
gdb/testsuite/gdb.threads/tls.exp
gdb/testsuite/gdb.threads/wp-replication.exp
gdb/testsuite/gdb.trace/ax.exp
gdb/testsuite/lib/gdb.exp

index c1fe2d05c2c42fc1a78d4d8ce882f71a0b36937b..a5decfd99a9add8effa7de80c4e33c7f4f177c3a 100644 (file)
@@ -1,3 +1,39 @@
+2019-10-31  Tom de Vries  <tdevries@suse.de>
+
+       * gdb.arch/amd64-disp-step-avx.exp: Drop superfluous 3rd argument to
+       gdb_test.
+       * gdb.arch/amd64-disp-step.exp: Same.
+       * gdb.asm/asm-source.exp: Same.
+       * gdb.btrace/buffer-size.exp: Same.
+       * gdb.btrace/cpu.exp: Same.
+       * gdb.btrace/enable.exp: Same.
+       * gdb.dwarf2/count.exp: Same.
+       * gdb.dwarf2/dw2-ranges-func.exp: Same.
+       * gdb.dwarf2/dw2-ranges-psym.exp: Same.
+       * gdb.fortran/vla-datatypes.exp: Same.
+       * gdb.fortran/vla-history.exp: Same.
+       * gdb.fortran/vla-ptype.exp: Same.
+       * gdb.fortran/vla-value.exp: Same.
+       * gdb.fortran/whatis_type.exp: Same.
+       * gdb.guile/guile.exp: Same.
+       * gdb.multi/tids.exp: Same.
+       * gdb.python/py-finish-breakpoint.exp: Same.
+       * gdb.python/py-framefilter.exp: Same.
+       * gdb.python/py-pp-registration.exp: Same.
+       * gdb.python/py-xmethods.exp: Same.
+       * gdb.python/python.exp: Same.
+       * gdb.server/connect-with-no-symbol-file.exp: Same.
+       * gdb.server/no-thread-db.exp: Same.
+       * gdb.server/run-without-local-binary.exp: Same.
+       * gdb.stabs/weird.exp: Same.
+       * gdb.threads/attach-many-short-lived-threads.exp: Same.
+       * gdb.threads/thread-find.exp: Same.
+       * gdb.threads/tls-shared.exp: Same.
+       * gdb.threads/tls.exp: Same.
+       * gdb.threads/wp-replication.exp: Same.
+       * gdb.trace/ax.exp: Same.
+       * lib/gdb.exp (gdb_test_exact, help_test_raw): Same.
+
 2019-10-31  Tom de Vries  <tdevries@suse.de>
 
        * gdb.ada/array_bounds.exp: Drop superfluous 3rd argument to gdb_test.
index 27e4bc0604496a8be715b146ba6feab78b48c070..f652fd834e649db12515c9ad9fc6294110710ec9 100644 (file)
@@ -78,11 +78,9 @@ proc disp_step_func { func } {
     set test_end_label "${func}_end"
 
     gdb_test "break ${test_start_label}" \
-       "Breakpoint.*at.* file .*$srcfile, line.*" \
-       "break ${test_start_label}"
+       "Breakpoint.*at.* file .*$srcfile, line.*"
     gdb_test "break ${test_end_label}" \
-       "Breakpoint.*at.* file .*$srcfile, line.*" \
-       "break ${test_end_label}"
+       "Breakpoint.*at.* file .*$srcfile, line.*"
 
     gdb_test "continue" \
        "Continuing.*Breakpoint.*, ${test_start_label} ().*" \
index 75e8bf6d6de2c5f58ad86c943367852e74c1feb6..6f493923b0deb77f6d775d1ac3e0d72db5185794 100644 (file)
@@ -45,18 +45,14 @@ if ![runto_main] then {
 # Test call/ret.
 
 gdb_test "break test_call" \
-    "Breakpoint.*at.* file .*$srcfile, line.*" \
-    "break test_call"
+    "Breakpoint.*at.* file .*$srcfile, line.*"
 gdb_test "break test_call_end" \
-    "Breakpoint.*at.* file .*$srcfile, line.*" \
-    "break test_call_end"
+    "Breakpoint.*at.* file .*$srcfile, line.*"
 
 gdb_test "break test_ret" \
-    "Breakpoint.*at.* file .*$srcfile, line.*" \
-    "break test_ret"
+    "Breakpoint.*at.* file .*$srcfile, line.*"
 gdb_test "break test_ret_end" \
-    "Breakpoint.*at.* file .*$srcfile, line.*" \
-    "break test_ret_end"
+    "Breakpoint.*at.* file .*$srcfile, line.*"
 
 gdb_test "continue" \
     "Continuing.*Breakpoint.*, test_call ().*" \
@@ -77,18 +73,14 @@ gdb_test "continue" \
 # Test abs-jmp/rep-ret.
 
 gdb_test "break test_abs_jmp" \
-    "Breakpoint.*at.* file .*$srcfile, line.*" \
-    "break test_abs_jmp"
+    "Breakpoint.*at.* file .*$srcfile, line.*"
 gdb_test "break test_abs_jmp_end" \
-    "Breakpoint.*at.* file .*$srcfile, line.*" \
-    "break test_abs_jmp_end"
+    "Breakpoint.*at.* file .*$srcfile, line.*"
 
 gdb_test "break test_rep_ret" \
-    "Breakpoint.*at.* file .*$srcfile, line.*" \
-    "break test_rep_ret"
+    "Breakpoint.*at.* file .*$srcfile, line.*"
 gdb_test "break test_rep_ret_end" \
-    "Breakpoint.*at.* file .*$srcfile, line.*" \
-    "break test_rep_ret_end"
+    "Breakpoint.*at.* file .*$srcfile, line.*"
 
 gdb_test "continue" \
     "Continuing.*Breakpoint.*, test_abs_jmp ().*" \
@@ -109,11 +101,9 @@ gdb_test "continue" \
 # Test syscall.
 
 gdb_test "break test_syscall" \
-    "Breakpoint.*at.* file .*$srcfile, line.*" \
-    "break test_syscall"
+    "Breakpoint.*at.* file .*$srcfile, line.*"
 gdb_test "break test_syscall_end" \
-    "Breakpoint.*at.* file .*$srcfile, line.*" \
-    "break test_syscall_end"
+    "Breakpoint.*at.* file .*$srcfile, line.*"
 
 gdb_test "continue" \
     "Continuing.*Breakpoint.*, test_syscall ().*" \
@@ -128,11 +118,9 @@ gdb_test "continue" \
 # These don't occur in normal code, but gdb should still DTRT.
 
 gdb_test "break test_int3" \
-    "Breakpoint.*at.* file .*$srcfile, line.*" \
-    "break test_int3"
+    "Breakpoint.*at.* file .*$srcfile, line.*"
 gdb_test "break test_int3_end" \
-    "Breakpoint.*at.* file .*$srcfile, line.*" \
-    "break test_int3_end"
+    "Breakpoint.*at.* file .*$srcfile, line.*"
 
 gdb_test "continue" \
     "Continuing.*Breakpoint.*, test_int3 ().*" \
@@ -192,11 +180,9 @@ proc rip_test { reg } {
     set test_end_label "test_rip_${reg}_end"
 
     gdb_test "break ${test_start_label}" \
-       "Breakpoint.*at.* file .*$srcfile, line.*" \
-       "break ${test_start_label}"
+       "Breakpoint.*at.* file .*$srcfile, line.*"
     gdb_test "break ${test_end_label}" \
-       "Breakpoint.*at.* file .*$srcfile, line.*" \
-       "break ${test_end_label}"
+       "Breakpoint.*at.* file .*$srcfile, line.*"
 
     gdb_test "continue" \
        "Continuing.*Breakpoint.*, ${test_start_label} ().*" \
index b10ee1702fcf5c7ca43c2a4746f2b67310515d5d..5904cb18bcb933730c9525b1b595a35890e9ebe0 100644 (file)
@@ -421,8 +421,7 @@ gdb_test_multiple "info sources" "info sources" {
 
 # Try 'info line'
 gdb_test "info line" \
-       "Line $line_call_foo3_again of.*asmsrc2.s.*starts at.*<\\.?foo2+.*> and ends at.*<\\.?foo2+.*>." \
-       "info line"
+       "Line $line_call_foo3_again of.*asmsrc2.s.*starts at.*<\\.?foo2+.*> and ends at.*<\\.?foo2+.*>."
 
 # Try 'nexting' over next call to foo3
 gdb_test "next" "$line_foo2_leave\[ \t\]+gdbasm_leave" "next over foo3"
index b46e0775d229f11cd5787a40914ff8656a4d617c..a52458b132535e0e656bfd940619d9ae913073d4 100644 (file)
@@ -43,4 +43,4 @@ gdb_test "info record" [multi_line \
   "Recording format: \[^\\\r\\\n\]*" \
   "Buffer size: 4kB\." \
   "Recorded 0 instructions in 0 functions \\\(0 gaps\\\) for \[^\\\r\\\n\]*" \
-  ] "info record"
+  ]
index 28f8c687701f609714455db10047eb593eed54d6..93ed0c623033a3ebfcdea6354ba40e463db3f569 100644 (file)
@@ -42,11 +42,9 @@ proc test_junk { arg junk current } {
 gdb_test "show record btrace cpu" "btrace cpu is 'auto'\." "default cpu"
 
 gdb_test "set record" \
-    "\"set record\" must be followed by an appropriate subcommand.*" \
-    "set record"
+    "\"set record\" must be followed by an appropriate subcommand.*"
 gdb_test "set record btrace" \
-    "\"set record btrace\" must be followed by an appropriate subcommand.*" \
-    "set record btrace"
+    "\"set record btrace\" must be followed by an appropriate subcommand.*"
 test_bad "" "auto"
 
 test_good "intel: 0/0"
index 4bc034cb3b212ad670d694df319d5bd923180bcf..6b74d1d6bf24548c58372f52735ac79f31eddc25 100644 (file)
@@ -64,7 +64,7 @@ gdb_test "info record" "Active record target: record-btrace\r
 Recorded 0 instructions in 0 functions \\\(0 gaps\\\) for thread 1.*\\." "info record without trace"
 
 # stop btrace record
-gdb_test "record stop" "Process record is stopped and all execution logs are deleted\\." "record stop"
+gdb_test "record stop" "Process record is stopped and all execution logs are deleted\\."
 gdb_test "record stop" "No record target is currently active\\..*" "record stop the second time"
 
 # enable btrace again
index d2bde31e7d915572cf3a83254b56dee5d44bbc85..5c8f0f10846fdaf5d5fc74b1d26967fb8f30351c 100644 (file)
@@ -109,17 +109,17 @@ if ![runto_main] {
     return -1
 }
 
-gdb_test "ptype array" "type = char \\\[5\\\]" "ptype array"
-gdb_test "whatis array" "type = char \\\[5\\\]" "whatis array"
-gdb_test "print array" " = \"hello\"" "print array"
-gdb_test "print sizeof array" " = 5" "print sizeof array"
-
-gdb_test "ptype array2" "type = char \\\[1\\\]" "ptype array"
-gdb_test "whatis array2" "type = char \\\[1\\\]" "whatis array"
-gdb_test "print array2" " = \"A\"" "print array"
-gdb_test "print sizeof array2" " = 1" "print sizeof array"
-
-gdb_test "ptype static_array" "type = char \\\[5\\\]" "ptype static_array"
-gdb_test "whatis static_array" "type = char \\\[5\\\]" "whatis static_array"
-gdb_test "print static_array" " = \"world\"" "print static_array"
-gdb_test "print sizeof static_array" " = 5" "print sizeof static_array"
+gdb_test "ptype array" "type = char \\\[5\\\]"
+gdb_test "whatis array" "type = char \\\[5\\\]"
+gdb_test "print array" " = \"hello\""
+gdb_test "print sizeof array" " = 5"
+
+gdb_test "ptype array2" "type = char \\\[1\\\]"
+gdb_test "whatis array2" "type = char \\\[1\\\]"
+gdb_test "print array2" " = \"A\""
+gdb_test "print sizeof array2" " = 1"
+
+gdb_test "ptype static_array" "type = char \\\[5\\\]"
+gdb_test "whatis static_array" "type = char \\\[5\\\]"
+gdb_test "print static_array" " = \"world\""
+gdb_test "print sizeof static_array" " = 5"
index bd0564f18864bcab5a2d0f06cc31a3818fe02d3d..214dcdf379f47a67db4a22efbe5f54edb4df1677 100644 (file)
@@ -257,8 +257,7 @@ proc do_test {suffix} {
        # This is intentional since that behavior is one of the bugs that
        # this test case tests for.
        gdb_test "break foo" \
-           "Breakpoint.*at.* file .*$srcfile, line \\d+\\." \
-           "break foo"
+           "Breakpoint.*at.* file .*$srcfile, line \\d+\\."
 
        # Continue to foo.  Allow execution to stop either on the prologue
        # or on the call to bar since either behavior is acceptable though
@@ -323,8 +322,7 @@ proc do_test {suffix} {
     # This more permissive RE for "break foo" will allow a breakpoint on
     # multiple locations to PASS.  */
     gdb_test "break foo" \
-       "Breakpoint.*at.*" \
-       "break foo"
+       "Breakpoint.*at.*"
 
     gdb_test "break baz" \
        "Breakpoint.*at.* file .*$srcfile, line \\d+\\."
index 0e9acbfad52dd2b709adb30e756691c0756149b1..333577eb5e7063107f7f1f1d0871d83cfbfdc654 100644 (file)
@@ -134,5 +134,4 @@ if ![runto_main] {
 # Note we use a name that is very different from the linkage name, in
 # order to not set the breakpoint via minsyms.
 gdb_test "break someothername" \
-    "Breakpoint.*at.*" \
-    "break someothername"
+    "Breakpoint.*at.*"
index bb5ed276c22609f2eb46caf3c956d8ccc4b30de6..c8025c7698f303460e27cd4259316cedfa927e6a 100644 (file)
@@ -55,16 +55,11 @@ gdb_test "print l" " = \\.TRUE\\." "charactervla allocated"
 
 gdb_breakpoint [gdb_get_line_number "vlas-initialized"]
 gdb_continue_to_breakpoint "vlas-initialized"
-gdb_test "ptype intvla" "type = $int, allocatable \\\(11,22,33\\\)" \
-  "ptype intvla"
-gdb_test "ptype realvla" "type = $real, allocatable \\\(11,22,33\\\)" \
-  "ptype realvla"
-gdb_test "ptype complexvla" "type = $complex, allocatable \\\(11,22,33\\\)" \
-  "ptype complexvla"
-gdb_test "ptype logicalvla" "type = $logical, allocatable \\\(11,22,33\\\)" \
-  "ptype logicalvla"
-gdb_test "ptype charactervla" "type = character\\\*1, allocatable \\\(11,22,33\\\)" \
-  "ptype charactervla"
+gdb_test "ptype intvla" "type = $int, allocatable \\\(11,22,33\\\)"
+gdb_test "ptype realvla" "type = $real, allocatable \\\(11,22,33\\\)"
+gdb_test "ptype complexvla" "type = $complex, allocatable \\\(11,22,33\\\)"
+gdb_test "ptype logicalvla" "type = $logical, allocatable \\\(11,22,33\\\)"
+gdb_test "ptype charactervla" "type = character\\\*1, allocatable \\\(11,22,33\\\)"
 
 gdb_test "print intvla(5,5,5)" " = 1" "print intvla(5,5,5) (1st)"
 gdb_test "print realvla(5,5,5)" " = 3.14\\d+" \
index 8737beb42180edc4c0f9877da313eddf50de6357..b7ce366e7978cefe5ec6f3603a05a30a9e85df2b 100644 (file)
@@ -39,7 +39,7 @@ with_timeout_factor 2 {
 }
 
 # Try to access history values for full vla prints.
-gdb_test "print \$1" " = <not allocated>" "print \$1"
+gdb_test "print \$1" " = <not allocated>"
 with_timeout_factor 2 {
     gdb_test "print \$2" \
       " = \\( *\\( *\\( *1311, *1311, *1311,\[()1311, .\]*\\)" "print \$4"
@@ -47,9 +47,9 @@ with_timeout_factor 2 {
 
 gdb_breakpoint [gdb_get_line_number "vla2-filled"]
 gdb_continue_to_breakpoint "vla2-filled"
-gdb_test "print vla2(1,43,20)" " = 1311" "print vla2(1,43,20)"
-gdb_test "print vla1(1,3,8)" " = 1001" "print vla2(1,3,8)"
+gdb_test "print vla2(1,43,20)" " = 1311"
+gdb_test "print vla1(1,3,8)" " = 1001"
 
 # Try to access history values for vla values.
-gdb_test "print \$5" " = 1311" "print \$5"
-gdb_test "print \$6" " = 1001" "print \$6"
+gdb_test "print \$5" " = 1311"
+gdb_test "print \$6" " = 1001"
index 7f8268bd335b329858f4ca21e3d689bd30d9af22..918ed072b9e0783cbadb1895a122fd658129e155 100644 (file)
@@ -55,8 +55,7 @@ gdb_breakpoint [gdb_get_line_number "vla1-filled"]
 gdb_continue_to_breakpoint "vla1-filled"
 gdb_test "ptype vla1" "type = $real, allocatable \\\(10,10,10\\\)" \
   "ptype vla1 filled"
-gdb_test "ptype vla1(3, 6, 9)" "type = $real" \
-  "ptype vla1(3, 6, 9)"
+gdb_test "ptype vla1(3, 6, 9)" "type = $real"
 
 gdb_breakpoint [gdb_get_line_number "vla2-filled"]
 gdb_continue_to_breakpoint "vla2-filled"
@@ -69,8 +68,7 @@ gdb_breakpoint [gdb_get_line_number "pvla-associated"]
 gdb_continue_to_breakpoint "pvla-associated"
 gdb_test "ptype pvla" "type = $real \\\(10,10,10\\\)" \
   "ptype pvla associated"
-gdb_test "ptype pvla(3, 6, 9)" "type = $real" \
-  "ptype pvla(3, 6, 9)"
+gdb_test "ptype pvla(3, 6, 9)" "type = $real"
 
 gdb_breakpoint [gdb_get_line_number "pvla-re-associated"]
 gdb_continue_to_breakpoint "pvla-re-associated"
index ed0cace9f48846e48f434234a742ce09abfe305f..5b6ad5df72c82f55696d2cd853f8adc578faf880 100644 (file)
@@ -148,12 +148,12 @@ gdb_test "print \$myvar" \
   "print \$myvar set to vla1"
 
 gdb_test "next" "\\d+.*vla1\\(1, 3, 8\\) = 1001" "next (2)"
-gdb_test "print \$myvar(3,6,9)" " = 1311" "print \$myvar(3,6,9)"
+gdb_test "print \$myvar(3,6,9)" " = 1311"
 
 gdb_breakpoint [gdb_get_line_number "pvla-associated"]
 gdb_continue_to_breakpoint "pvla-associated, second time"
 gdb_test_no_output "set \$mypvar = pvla" "set \$mypvar = pvla"
-gdb_test "print \$mypvar(1,3,8)" " = 1001" "print \$mypvar(1,3,8)"
+gdb_test "print \$mypvar(1,3,8)" " = 1001"
 
 # deallocate pointer and make sure user defined variable still has the
 # right value.
index e2ce63a62a062e52b1d1fd819dfc59d4ae5c3018..15306d7920f675ffe1dcc8a12f7a43cbdd45adf4 100644 (file)
@@ -50,14 +50,12 @@ gdb_test "ptype t1" \
   [multi_line "type = Type t1" \
                  "    $t1_i" \
                  "    $t1_r" \
-                 "End Type t1"] \
-  "ptype t1"
+                 "End Type t1"]
 gdb_test "ptype t1v" \
   [multi_line "type = Type t1" \
                  "    $t1_i" \
                  "    $t1_r" \
-                 "End Type t1"] \
-  "ptype t1v"
+                 "End Type t1"]
 
 gdb_test "ptype t2v" \
   [multi_line "type = Type t2" \
index 61e82aec31bf29dc881f477e087ec8f898d3ed24..0d37514de5a5d9ea823bb93ba97c901641a646cc 100644 (file)
@@ -68,7 +68,7 @@ gdb_test_multiline "show guile command" \
 
 gdb_test "source $srcdir/$subdir/source2.scm" "yes" "source source2.scm"
 
-gdb_test "source -s source2.scm" "yes" "source -s source2.scm"
+gdb_test "source -s source2.scm" "yes"
 
 gdb_test "guile (print (current-objfile))" "= #f"
 gdb_test "guile (print (objfiles))" "= \\(\\)"
index 477806bdadd6845e744fbb4017b96c5f45a624b9..e5113f1d0ebc3a4d9114b05244c8f60b1ad4ff9f 100644 (file)
@@ -52,10 +52,12 @@ proc thread_apply {tid_list exp_tid_list {message ""}} {
     }
 
     set cmd "thread apply $tid_list"
-    if {$message == ""} {
-       set message $cmd
+    if {$message != ""} {
+       gdb_test "$cmd p 1234" $r $message
+       return
     }
-    gdb_test "$cmd p 1234" $r $message
+
+    gdb_test "$cmd p 1234" $r
 }
 
 # Issue "info threads TID_LIST" and expect EXP_TID_LIST (a list of
@@ -66,10 +68,11 @@ proc info_threads {tid_list exp_tid_list {message ""}} {
     set r [join $expected " ${any}\r\n${any} "]
     set r "${any} $r ${any}"
     set cmd "info threads $tid_list"
-    if {$message == ""} {
-       set message $cmd
+    if {$message != ""} {
+       gdb_test $cmd $r $message
+       return
     }
-    gdb_test $cmd $r $message
+    gdb_test $cmd $r
 }
 
 # Issue "info threads TID_LIST" and expect INFO_THR output.  Then
@@ -96,8 +99,7 @@ proc thr_apply_info_thr_error {tid_list exp_error_apply {exp_error_info ""}} {
        $exp_error_info
 
     gdb_test "thread apply $tid_list" \
-       $exp_error_apply \
-       "thread apply $tid_list"
+       $exp_error_apply
 }
 
 # Issue both "info threads TID_LIST" and "thread apply TID_LIST" and
index 6ffa17a357700a9a95441a0ee86835e91ba7c943..fda32a2358911bb6c7e79532ad8a6544fbbc571e 100644 (file)
@@ -255,5 +255,5 @@ if ![runto "test_exec_exit"] then {
 }     
 
 gdb_test "python SimpleFinishBreakpoint(gdb.newest_frame())" "SimpleFinishBreakpoint init" "set FinishBP after the exec"
-gdb_test "catch exec" "Catchpoint.*\(exec\).*" "catch exec"
+gdb_test "catch exec" "Catchpoint.*\(exec\).*"
 gdb_test "continue" "SimpleFinishBreakpoint out of scope.*" "catch out of scope after exec"
index 336c88597a9c19e9a8d4ec0665ea937618220b11..e04080621bdd2e8851ef5222756c25a9da95b811 100644 (file)
@@ -85,8 +85,7 @@ gdb_continue_to_breakpoint "Inner test breakpoint"
 
 # Test multiple local blocks.
 gdb_test "bt full no-filters" \
-    ".*#0.*end_func.*h = 9.*f = 42.*g = 19.*bar = $hex \"Inside block x2\".*d = 15.*e = 14.*foo = $hex \"Inside block\".*str = $hex \"The End\".*st2 = $hex \"Is Near\".*b = 12.*c = 5.*" \
-    "bt full no-filters"
+    ".*#0.*end_func.*h = 9.*f = 42.*g = 19.*bar = $hex \"Inside block x2\".*d = 15.*e = 14.*foo = $hex \"Inside block\".*str = $hex \"The End\".*st2 = $hex \"Is Near\".*b = 12.*c = 5.*"
 gdb_test "bt full" \
     ".*#0.*cnuf_dne.*h = 9.*f = 42.*g = 19.*bar = $hex \"Inside block x2\".*d = 15.*e = 14.*foo = $hex \"Inside block\".*str = $hex \"The End\".*st2 = $hex \"Is Near\".*b = 12.*c = 5.*" \
     "bt full with filters"
@@ -145,8 +144,7 @@ gdb_test "disable frame-filter global NoSuchFilter" \
 
 # Test no-filters
 gdb_test "bt no-filters" \
-    ".*#0.*end_func.*#22.*in func1.*#27.*in main \\(\\).*" \
-    "bt no-filters"
+    ".*#0.*end_func.*#22.*in func1.*#27.*in main \\(\\).*"
 
 # Test reverse
 gdb_test "bt" \
index fa9458fa2411cc302ede96ffc41ff1573567929a..0eb7f8b2bf52c1ebd211a604f45d569bb1ba586f 100644 (file)
@@ -58,10 +58,8 @@ proc prepare_test { } {
 proc test_printers { s_prefix } {
     global hex
 
-    gdb_test "print flt" " = x=<42> y=<43>" \
-       "print flt"
-    gdb_test "print s" " = ${s_prefix} a=<1> b=<$hex>" \
-       "print s"
+    gdb_test "print flt" " = x=<42> y=<43>"
+    gdb_test "print s" " = ${s_prefix} a=<1> b=<$hex>"
 }
 
 # Test registration with verbose off.
index d7ba8f2dc9b8be73bf197423152f8b27724303c8..0b4096747f029581a0d1921030c48ff0fb0cc075 100644 (file)
@@ -159,8 +159,7 @@ gdb_test_no_output "disable xmethod progspace E_methods;method_int" \
 gdb_test "info xmethod progspace E_methods;method_int" ".* \\\[disabled\\\]" \
   "info xmethod xmethods E_methods;method_int"
 gdb_test_no_output "disable xmethod progspace G_methods" "disable G_methods 2"
-gdb_test "info xmethod progspace" ".*G_methods \\\[disabled\\\].*" \
-  "info xmethod progspace"
+gdb_test "info xmethod progspace" ".*G_methods \\\[disabled\\\].*"
 
 # PR 18285
 # First make sure both are enabled.
index c795814a658edd4ee65e2dc53cae689937968ea0..bbcec850e41a5a84fc0415b6a5b6b3d06b2ee7df 100644 (file)
@@ -94,7 +94,7 @@ gdb_py_test_multiple "indented multi-line python command" \
 
 gdb_test "source $remote_source2_py" "yes" "source source2.py"
 
-gdb_test "source -s source2.py" "yes" "source -s source2.py"
+gdb_test "source -s source2.py" "yes"
 
 set remote_source2_symlink_notpy \
     [gdb_remote_download host ${srcdir}/${subdir}/source2.py \
index 4a3b59f6321feee0fe6d49b225441a2921afe2bb..79a24a5fe4d312681ac7592449a6167b2581ccb9 100644 (file)
@@ -50,7 +50,7 @@ proc connect_no_symbol_file { sysroot action } {
 
        # Make sure we're disconnected, in case we're testing with an
        # extended-remote board, therefore already connected.
-       gdb_test "disconnect" ".*" "disconnect"
+       gdb_test "disconnect" ".*"
 
        # Discard any symbol files that we have opened.
        gdb_test "file" ".*" "discard symbol table" \
index 34dc22973fe58dba7165ed575cbefad5ee8f1c75..501cb2a79ca322366e09c92496d527b99d85901c 100644 (file)
@@ -52,5 +52,4 @@ gdb_continue_to_breakpoint "after tls assignment"
 
 # Printing a tls variable should fail gracefully without a libthread_db.
 gdb_test "print foo" \
-    "Cannot find thread-local storage for Thread \[^,\]+, executable file ${binfile}:\[\r\n\]+Remote target failed to process qGetTLSAddr request" \
-    "print foo"
+    "Cannot find thread-local storage for Thread \[^,\]+, executable file ${binfile}:\[\r\n\]+Remote target failed to process qGetTLSAddr request"
index 6ec0d1e03b145cedcb27411cac993e140066fbc2..b4d5fda7a692708ad1df817a39cb0b5b92eb2442 100644 (file)
@@ -39,7 +39,7 @@ save_vars { GDBFLAGS } {
 
     # Make sure we're disconnected, in case we're testing with an
     # extended-remote board, therefore already connected.
-    gdb_test "disconnect" ".*" "disconnect"
+    gdb_test "disconnect" ".*"
 
     # Let's start gdbserver in extended-remote mode now.  We cannot
     # use gdbserver_start_extended here because it starts gdbserver,
index 001f97bdee72f8fd5015875fc958cc944c0f7ac2..56a26bb0e1b4f9bd4e97420dc3b294c463884aa2 100644 (file)
@@ -137,7 +137,7 @@ proc do_tests {} {
        print_weird_var attr126
 
        gdb_test "p const69" " = 69" "'e' constant on non-enum type"
-       gdb_test "whatis const69" "type = (unsigned int|inttype)" "whatis const69"
+       gdb_test "whatis const69" "type = (unsigned int|inttype)"
 
        gdb_test "p sizeof (const70)" " = 2" "'e' constant with embedded type"
 
@@ -147,7 +147,7 @@ proc do_tests {} {
 
         gdb_test "p constString3" " = \"String3 with embedded quote ' in the middle\"" "string constant 3"
         gdb_test "p constString4" { = "String4 with embedded quote \\" in the middle"} "string constant 4"
-       gdb_test "p bad_neg0" " = \{field0 = 42, field2 =.*field3 = 45\}" "p bad_neg0"
+       gdb_test "p bad_neg0" " = \{field0 = 42, field2 =.*field3 = 45\}"
 
        gdb_test "ptype inttype" "type = (unsigned int|inttype)" "ptype on inttype"
        gdb_test "p sizeof (float72type)" " = 9" "unrecognized floating point type"
@@ -155,8 +155,8 @@ proc do_tests {} {
        # This big number needs to be kept as one piece
        gdb_test "p/x int256var" " = 0x0*2a0000002b0000002c0000002d0000002d0000002c0000002b0000002a" "print very big integer"
 
-       gdb_test "whatis consth" "type = inttype" "whatis consth"
-       gdb_test "whatis consth2" "type = inttype" "whatis consth2"
+       gdb_test "whatis consth" "type = inttype"
+       gdb_test "whatis consth2" "type = inttype"
 
        # GDB does not yet understand S constants
        setup_xfail "*-*-*"
index 41d65094b2ac974e0f36eee940cf74f94ea16b92..06d8a295b7652444a26d59bda0fb90c48f809a17 100644 (file)
@@ -128,7 +128,7 @@ proc test {} {
            # detaching from the program and reattaching, we check that
            # the program doesn't die due to gdb leaving a pending
            # breakpoint hit on a new thread unprocessed.
-           gdb_test "break break_fn" "Breakpoint.*" "break break_fn"
+           gdb_test "break break_fn" "Breakpoint.*"
 
            # Wait a bit, to give time for most threads to hit the
            # breakpoint, including threads we might have failed to
index 6f58674450fc5aa2b31d8ebca061f9773ade5de3..97d7637d7a3dee4c533858d2f1816bf96e8230de 100644 (file)
@@ -276,9 +276,7 @@ gdb_test_multiple "info threads 3-3" "info threads 3-3" {
 # Test bad input
 
 gdb_test "info thread foo" \
-    "Invalid thread ID: foo" \
-    "info thread foo"
+    "Invalid thread ID: foo"
 
 gdb_test "info thread foo -1" \
-    "Invalid thread ID: foo -1" \
-    "info thread foo -1"
+    "Invalid thread ID: foo -1"
index 5a4b9b6f8d867b8e46cd99648578c92906ea37ca..9d46a70df0b7a3d4806d75bf603a2a4795bcfbe3 100644 (file)
@@ -61,6 +61,4 @@ gdb_test "continue" \
         "continue to break"
 # This is more of a gcc/glibc test, really. 
 #
-gdb_test "print result" "3" "print result"
-
-
+gdb_test "print result" "3"
index eb571dc12ed82ad295a16eb38442864e7d0775b9..eaa8391f9f600c08a53b8390869d1d954688ccfc 100644 (file)
@@ -290,10 +290,9 @@ gdb_expect {
 runto spin
 
 gdb_test "info address a_global" \
-       ".*a_global.*static storage at address.*" "info address a_global"
+       ".*a_global.*static storage at address.*"
 
-gdb_test "info address me" ".*me.*is a (complex DWARF expression:|variable).*" \
-    "info address me"
+gdb_test "info address me" ".*me.*is a (complex DWARF expression:|variable).*"
 
 
 # Test LOC_UNRESOLVED references resolving for `extern' TLS variables.
index 390d37f9e16678fe9f40bfdabfdf893d3e7236c6..35a351ce8f49d04d1a3509a4c9cf074bb0a24f8d 100644 (file)
@@ -114,8 +114,7 @@ for { set i 0 } { $i < $NR_THREADS } { incr i } {
     # in the background for a specific thread.
     if {$i < $hwatch_count} {
       gdb_test "watch watched_data\[$i\]" \
-       "Hardware watchpoint .*" \
-       "watch watched_data\[$i\]"
+       "Hardware watchpoint .*"
     } else {
       verbose -log "Not setting watchpoint for watched_data\[$i\]\n"
     }
index f05689f169ed544c4cb11603681e20c475d421aa..f0ff1f1c91392fdb70f85ac4ccbc56456673beb8 100644 (file)
@@ -40,99 +40,99 @@ gdb_load $binfile
 runto_main
 gdb_reinitialize_dir $srcdir/$subdir
 
-gdb_test "maint agent 12" ".*const8 12.*pop.*end.*" "maint agent 12"
+gdb_test "maint agent 12" ".*const8 12.*pop.*end.*"
 
-gdb_test "maint agent gdb_char_test" "" "maint agent gdb_char_test"
+gdb_test "maint agent gdb_char_test" ""
 
-gdb_test "maint agent gdb_arr_test\[12\]" "" "maint agent gdb_arr_test\[12\]"
+gdb_test "maint agent gdb_arr_test\[12\]" ""
 
-gdb_test "maint agent gdb_arr_test\[gdb_short_test\]" "" "maint agent gdb_arr_test\[gdb_short_test\]"
+gdb_test "maint agent gdb_arr_test\[gdb_short_test\]" ""
 
-gdb_test "maint agent gdb_struct1_test" "" "maint agent gdb_struct1_test"
+gdb_test "maint agent gdb_struct1_test" ""
 
-gdb_test "maint agent gdb_struct1_test.s" "" "maint agent gdb_struct1_test.s"
+gdb_test "maint agent gdb_struct1_test.s" ""
 
-gdb_test "maint agent gdb_struct1_test.arr\[gdb_struct1_test.c\]" "" "maint agent gdb_struct1_test.arr\[gdb_struct1_test.c\]"
+gdb_test "maint agent gdb_struct1_test.arr\[gdb_struct1_test.c\]" ""
 
-gdb_test "maint agent gdb_structp_test" "" "maint agent gdb_structp_test"
+gdb_test "maint agent gdb_structp_test" ""
 
-gdb_test "maint agent gdb_structp_test->l" "" "maint agent gdb_structp_test->l"
+gdb_test "maint agent gdb_structp_test->l" ""
 
-gdb_test "maint agent gdb_structp_test->bfield" "" "maint agent gdb_structp_test->bfield"
+gdb_test "maint agent gdb_structp_test->bfield" ""
 
-gdb_test "maint agent gdb_long_test + gdb_short_test" "" "maint agent gdb_long_test + gdb_short_test"
+gdb_test "maint agent gdb_long_test + gdb_short_test" ""
 
-gdb_test "maint agent gdb_long_test - gdb_short_test" "" "maint agent gdb_long_test - gdb_short_test"
+gdb_test "maint agent gdb_long_test - gdb_short_test" ""
 
-gdb_test "maint agent gdb_long_test * gdb_short_test" "" "maint agent gdb_long_test * gdb_short_test"
+gdb_test "maint agent gdb_long_test * gdb_short_test" ""
 
-gdb_test "maint agent gdb_long_test / gdb_short_test" "" "maint agent gdb_long_test / gdb_short_test"
+gdb_test "maint agent gdb_long_test / gdb_short_test" ""
 
-gdb_test "maint agent gdb_structp_test + 1" "" "maint agent gdb_structp_test + 1"
+gdb_test "maint agent gdb_structp_test + 1" ""
 
-gdb_test "maint agent gdb_long_test == gdb_short_test" "" "maint agent gdb_long_test == gdb_short_test"
+gdb_test "maint agent gdb_long_test == gdb_short_test" ""
 
-gdb_test "maint agent gdb_long_test != gdb_short_test" "" "maint agent gdb_long_test != gdb_short_test"
+gdb_test "maint agent gdb_long_test != gdb_short_test" ""
 
-gdb_test "maint agent gdb_long_test < gdb_short_test" "" "maint agent gdb_long_test < gdb_short_test"
+gdb_test "maint agent gdb_long_test < gdb_short_test" ""
 
-gdb_test "maint agent gdb_long_test <= gdb_short_test" "" "maint agent gdb_long_test <= gdb_short_test"
+gdb_test "maint agent gdb_long_test <= gdb_short_test" ""
 
-gdb_test "maint agent gdb_long_test > gdb_short_test" "" "maint agent gdb_long_test > gdb_short_test"
+gdb_test "maint agent gdb_long_test > gdb_short_test" ""
 
-gdb_test "maint agent gdb_long_test >= gdb_short_test" "" "maint agent gdb_long_test >= gdb_short_test"
+gdb_test "maint agent gdb_long_test >= gdb_short_test" ""
 
-gdb_test "maint agent &gdb_long_test == &gdb_short_test" "" "maint agent &gdb_long_test == &gdb_short_test"
+gdb_test "maint agent &gdb_long_test == &gdb_short_test" ""
 
-gdb_test "maint agent &gdb_long_test < &gdb_short_test" "" "maint agent &gdb_long_test < &gdb_short_test"
+gdb_test "maint agent &gdb_long_test < &gdb_short_test" ""
 
-gdb_test "maint agent (unsigned char)1L" ".*ext 8.*" "maint agent (unsigned char)1L"
+gdb_test "maint agent (unsigned char)1L" ".*ext 8.*"
 
 # Now test eval version of agent expressions.
 
-gdb_test "maint agent-eval 12" ".*const8 12.*end.*" "maint agent-eval 12"
+gdb_test "maint agent-eval 12" ".*const8 12.*end.*"
 
-gdb_test "maint agent-eval gdb_char_test" "" "maint agent-eval gdb_char_test"
+gdb_test "maint agent-eval gdb_char_test" ""
 
-gdb_test "maint agent-eval gdb_arr_test\[12\]" "" "maint agent-eval gdb_arr_test\[12\]"
+gdb_test "maint agent-eval gdb_arr_test\[12\]" ""
 
-gdb_test "maint agent-eval gdb_arr_test\[gdb_short_test\]" "" "maint agent-eval gdb_arr_test\[gdb_short_test\]"
+gdb_test "maint agent-eval gdb_arr_test\[gdb_short_test\]" ""
 
-gdb_test "maint agent-eval gdb_struct1_test" "" "maint agent-eval gdb_struct1_test"
+gdb_test "maint agent-eval gdb_struct1_test" ""
 
-gdb_test "maint agent-eval gdb_struct1_test.s" "" "maint agent-eval gdb_struct1_test.s"
+gdb_test "maint agent-eval gdb_struct1_test.s" ""
 
-gdb_test "maint agent-eval gdb_struct1_test.arr\[gdb_struct1_test.c\]" "" "maint agent-eval gdb_struct1_test.arr\[gdb_struct1_test.c\]"
+gdb_test "maint agent-eval gdb_struct1_test.arr\[gdb_struct1_test.c\]" ""
 
-gdb_test "maint agent-eval gdb_structp_test" "" "maint agent-eval gdb_structp_test"
+gdb_test "maint agent-eval gdb_structp_test" ""
 
-gdb_test "maint agent-eval gdb_structp_test->l" "" "maint agent-eval gdb_structp_test->l"
+gdb_test "maint agent-eval gdb_structp_test->l" ""
 
-gdb_test "maint agent-eval gdb_structp_test->bfield" "" "maint agent-eval gdb_structp_test->bfield"
+gdb_test "maint agent-eval gdb_structp_test->bfield" ""
 
-gdb_test "maint agent-eval gdb_long_test + gdb_short_test" "" "maint agent-eval gdb_long_test + gdb_short_test"
+gdb_test "maint agent-eval gdb_long_test + gdb_short_test" ""
 
-gdb_test "maint agent-eval gdb_long_test - gdb_short_test" "" "maint agent-eval gdb_long_test - gdb_short_test"
+gdb_test "maint agent-eval gdb_long_test - gdb_short_test" ""
 
-gdb_test "maint agent-eval gdb_long_test * gdb_short_test" "" "maint agent-eval gdb_long_test * gdb_short_test"
+gdb_test "maint agent-eval gdb_long_test * gdb_short_test" ""
 
-gdb_test "maint agent-eval gdb_long_test / gdb_short_test" "" "maint agent-eval gdb_long_test / gdb_short_test"
+gdb_test "maint agent-eval gdb_long_test / gdb_short_test" ""
 
-gdb_test "maint agent-eval gdb_structp_test + 1" "" "maint agent-eval gdb_structp_test + 1"
+gdb_test "maint agent-eval gdb_structp_test + 1" ""
 
-gdb_test "maint agent-eval gdb_long_test == gdb_short_test" "" "maint agent-eval gdb_long_test == gdb_short_test"
+gdb_test "maint agent-eval gdb_long_test == gdb_short_test" ""
 
-gdb_test "maint agent-eval gdb_long_test != gdb_short_test" "" "maint agent-eval gdb_long_test != gdb_short_test"
+gdb_test "maint agent-eval gdb_long_test != gdb_short_test" ""
 
-gdb_test "maint agent-eval gdb_long_test < gdb_short_test" "" "maint agent-eval gdb_long_test < gdb_short_test"
+gdb_test "maint agent-eval gdb_long_test < gdb_short_test" ""
 
-gdb_test "maint agent-eval gdb_long_test <= gdb_short_test" "" "maint agent-eval gdb_long_test <= gdb_short_test"
+gdb_test "maint agent-eval gdb_long_test <= gdb_short_test" ""
 
-gdb_test "maint agent-eval gdb_long_test > gdb_short_test" "" "maint agent-eval gdb_long_test > gdb_short_test"
+gdb_test "maint agent-eval gdb_long_test > gdb_short_test" ""
 
-gdb_test "maint agent-eval gdb_long_test >= gdb_short_test" "" "maint agent-eval gdb_long_test >= gdb_short_test"
+gdb_test "maint agent-eval gdb_long_test >= gdb_short_test" ""
 
-gdb_test "maint agent-eval &gdb_long_test == &gdb_short_test" ".*equal.*end.*" "maint agent-eval &gdb_long_test == &gdb_short_test"
+gdb_test "maint agent-eval &gdb_long_test == &gdb_short_test" ".*equal.*end.*"
 
-gdb_test "maint agent-eval &gdb_long_test < &gdb_short_test" "" "maint agent-eval &gdb_long_test < &gdb_short_test"
+gdb_test "maint agent-eval &gdb_long_test < &gdb_short_test" ""
 
index 599bf0f0c3cb13817abb29ea5618a1e250186872..2d395efb5656cad7225a093962d93c55c0115ae7 100644 (file)
@@ -1401,11 +1401,10 @@ proc gdb_test_exact { args } {
     regsub -all "\n" $pattern "\r\n" pattern
     if [llength $args]==3 then {
        set message [lindex $args 2]
-    } else {
-       set message $command
+       return [gdb_test $command $pattern $message]
     }
 
-    return [gdb_test $command $pattern $message]
+    return [gdb_test $command $pattern]
 }
 
 # Wrapper around gdb_test_multiple that looks for a list of expected
@@ -5783,13 +5782,13 @@ proc gdb_gnu_strip_debug { dest args } {
 # If third argument TESTNAME is not empty, it's used as the name of the
 # test to be printed on pass/fail.
 proc help_test_raw { gdb_command expected_lines {testname {}} } {
-    if {$testname == {}} {
-       set message $gdb_command
-    } else {
-       set message $testname
-    }
     set expected_output [join $expected_lines ""]
-    gdb_test "${gdb_command}" "${expected_output}" $message
+    if {$testname != {}} {
+       gdb_test "${gdb_command}" "${expected_output}" $testname
+       return
+    }
+
+    gdb_test "${gdb_command}" "${expected_output}"
 }
 
 # A regexp that matches the end of help CLASS|PREFIX_COMMAND
This page took 0.049053 seconds and 4 git commands to generate.