Support -prompt and -lbl in gdb_test
authorPedro Alves <pedro@palves.net>
Tue, 17 May 2022 10:16:01 +0000 (11:16 +0100)
committerPedro Alves <pedro@palves.net>
Wed, 18 May 2022 10:59:37 +0000 (11:59 +0100)
commitc76d61da4a65eaadca861bf6c77d579a5cc3f422
treee55c7574488123312f0cd7d51178387af0d45a5f
parent44b6e8016087c346dc21270d9097f6294ee1e4f6
Support -prompt and -lbl in gdb_test

This teaches gdb_test to forward the -prompt and -lbl options to
gdb_test_multiple.

The option parsing is done with parse_args.

As a cleanup, instead of using llength and lindex to get at the
positional arguments, use lassign, and check whether the corresponding
variable is empty.

Convert gdb.base/ui-redirect.exp and gdb.xml/tdesc-reload.exp to use
gdb_test -prompt/-lbl instead of gdb_test_multiple as examples.

Change-Id: I243e1296d32c05a421ccef30b63d43a89eaeb4a0
gdb/testsuite/gdb.base/ui-redirect.exp
gdb/testsuite/gdb.xml/tdesc-reload.exp
gdb/testsuite/lib/gdb.exp