[gdb/testsuite] Remove superfluous 3rd argument from gdb_test call (4)
authorTom de Vries <tdevries@suse.de>
Sat, 2 Nov 2019 05:55:10 +0000 (06:55 +0100)
committerTom de Vries <tdevries@suse.de>
Sat, 2 Nov 2019 05:55:10 +0000 (06:55 +0100)
commit11af934b5cdba71d14f8ea7905b484c8a6ba0561
tree8f3f9303975c94a58bd00685f6025cf12e6b8eba
parente96ec2bab75a943e1666497b1389e297775af5a8
[gdb/testsuite] Remove superfluous 3rd argument from gdb_test call (4)

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 the testsuite/gdb.base subdir.

Tested on x86_64-linux.

gdb/testsuite/ChangeLog:

2019-11-02  Tom de Vries  <tdevries@suse.de>

* gdb.base/advance.exp: Drop superfluous 3rd argument to gdb_test.
* gdb.base/anon.exp: Same.
* gdb.base/auto-connect-native-target.exp: Same.
* gdb.base/call-ar-st.exp: Same.
* gdb.base/catch-syscall.exp: Same.
* gdb.base/commands.exp: Same.
* gdb.base/default.exp: Same.
* gdb.base/display.exp: Same.
* gdb.base/float.exp: Same.
* gdb.base/foll-fork.exp: Same.
* gdb.base/help.exp: Same.
* gdb.base/info-macros.exp: Same.
* gdb.base/info-proc.exp: Same.
* gdb.base/info-target.exp: Same.
* gdb.base/long_long.exp: Same.
* gdb.base/macscp.exp: Same.
* gdb.base/memattr.exp: Same.
* gdb.base/nofield.exp: Same.
* gdb.base/pointers.exp: Same.
* gdb.base/printcmds.exp: Same.
* gdb.base/ptype.exp: Same.
* gdb.base/restore.exp: Same.
* gdb.base/return.exp: Same.
* gdb.base/scope.exp: Same.
* gdb.base/set-noassign.exp: Same.
* gdb.base/setshow.exp: Same.
* gdb.base/shlib-call.exp: Same.
* gdb.base/signals.exp: Same.
* gdb.base/sigstep.exp: Same.
* gdb.base/skip.exp: Same.
* gdb.base/solib-symbol.exp: Same.
* gdb.base/stap-probe.exp: Same.
* gdb.base/step-line.exp: Same.
* gdb.base/step-test.exp: Same.
* gdb.base/style.exp: Same.
* gdb.base/varargs.exp: Same.
* gdb.base/vla-datatypes.exp: Same.
* gdb.base/vla-ptr.exp: Same.
* gdb.base/vla-sideeffect.exp: Same.
* gdb.base/volatile.exp: Same.
* gdb.base/watch-cond-infcall.exp: Same.
* gdb.base/watchpoint.exp: Same.

Change-Id: Ifd24dc13d552e7dd03f9049db419b08c6adc4112
43 files changed:
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/advance.exp
gdb/testsuite/gdb.base/anon.exp
gdb/testsuite/gdb.base/auto-connect-native-target.exp
gdb/testsuite/gdb.base/call-ar-st.exp
gdb/testsuite/gdb.base/catch-syscall.exp
gdb/testsuite/gdb.base/commands.exp
gdb/testsuite/gdb.base/default.exp
gdb/testsuite/gdb.base/display.exp
gdb/testsuite/gdb.base/float.exp
gdb/testsuite/gdb.base/foll-fork.exp
gdb/testsuite/gdb.base/help.exp
gdb/testsuite/gdb.base/info-macros.exp
gdb/testsuite/gdb.base/info-proc.exp
gdb/testsuite/gdb.base/info-target.exp
gdb/testsuite/gdb.base/long_long.exp
gdb/testsuite/gdb.base/macscp.exp
gdb/testsuite/gdb.base/memattr.exp
gdb/testsuite/gdb.base/nofield.exp
gdb/testsuite/gdb.base/pointers.exp
gdb/testsuite/gdb.base/printcmds.exp
gdb/testsuite/gdb.base/ptype.exp
gdb/testsuite/gdb.base/restore.exp
gdb/testsuite/gdb.base/return.exp
gdb/testsuite/gdb.base/scope.exp
gdb/testsuite/gdb.base/set-noassign.exp
gdb/testsuite/gdb.base/setshow.exp
gdb/testsuite/gdb.base/shlib-call.exp
gdb/testsuite/gdb.base/signals.exp
gdb/testsuite/gdb.base/sigstep.exp
gdb/testsuite/gdb.base/skip.exp
gdb/testsuite/gdb.base/solib-symbol.exp
gdb/testsuite/gdb.base/stap-probe.exp
gdb/testsuite/gdb.base/step-line.exp
gdb/testsuite/gdb.base/step-test.exp
gdb/testsuite/gdb.base/style.exp
gdb/testsuite/gdb.base/varargs.exp
gdb/testsuite/gdb.base/vla-datatypes.exp
gdb/testsuite/gdb.base/vla-ptr.exp
gdb/testsuite/gdb.base/vla-sideeffect.exp
gdb/testsuite/gdb.base/volatile.exp
gdb/testsuite/gdb.base/watch-cond-infcall.exp
gdb/testsuite/gdb.base/watchpoint.exp