[gdb/testsuite] Add proc require in lib/gdb.exp
authorTom de Vries <tdevries@suse.de>
Mon, 11 Oct 2021 10:21:00 +0000 (12:21 +0200)
committerTom de Vries <tdevries@suse.de>
Mon, 11 Oct 2021 10:21:00 +0000 (12:21 +0200)
commit4f69f0a21ef0a22e5e7d82ba271d6a7330469fb1
tree0fccf8501275ae33c084e503c3ff97315a020b7a
parentb6fca8a3d501a4dca0726fe8b89d18d9ba5780c6
[gdb/testsuite] Add proc require in lib/gdb.exp

Add a new proc require in lib/gdb.exp, and use it to shorten:
...
if { [gdb_skip_xml_test] } {
    # Valgrind gdbserver requires gdb with xml support.
    untested "missing xml support"
    return 0
}
...
into:
...
require gdb_skip_xml_test 0
...

Tested on x86_64-linux, both with and without a trigger patch that forces
gdb_skip_xml_test to return 1.
gdb/testsuite/gdb.base/valgrind-bt.exp
gdb/testsuite/gdb.base/valgrind-disp-step.exp
gdb/testsuite/gdb.base/valgrind-infcall-2.exp
gdb/testsuite/gdb.base/valgrind-infcall.exp
gdb/testsuite/lib/gdb.exp