[gdb/testsuite] Disallow single argument in multi_line
authorTom de Vries <tdevries@suse.de>
Tue, 8 Jun 2021 15:39:05 +0000 (17:39 +0200)
committerTom de Vries <tdevries@suse.de>
Tue, 8 Jun 2021 15:39:05 +0000 (17:39 +0200)
commitfdae5c22cedfb5948f2ccfbafc57ab53587129d5
tree491342222ff749c4705f96a571e4658d6465d8f4
parent956ea65cd707707c0f725930214cbc781367a831
[gdb/testsuite] Disallow single argument in multi_line

It's a common mistake of mine to do:
...
set l [list "foo" "bar"]
set re [multi_line $l]
...
and to get "foo bar" while I was expecting "foo\r\nbar", which I get after
doing instead:
...
set re [multi_line {*}$l]
...

Detect this type of mistake by erroring out in multi_line when only one
argument is passed.

Tested on x86_64-linux.

gdb/testsuite/ChangeLog:

2021-06-08  Tom de Vries  <tdevries@suse.de>

* lib/gdb.exp (multi_line): Require more than one argument.
* gdb.base/gdbinit-history.exp: Update multi_line call.
* gdb.base/jit-reader.exp: Remove multi_line call.
* gdb.fortran/dynamic-ptype-whatis.exp: Same.
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/gdbinit-history.exp
gdb/testsuite/gdb.base/jit-reader.exp
gdb/testsuite/gdb.fortran/dynamic-ptype-whatis.exp
gdb/testsuite/lib/gdb.exp