[gdb/testsuite] Introduce allow_dap_tests
authorTom de Vries <tdevries@suse.de>
Sun, 26 Mar 2023 11:44:58 +0000 (13:44 +0200)
committerTom de Vries <tdevries@suse.de>
Sun, 26 Mar 2023 11:44:58 +0000 (13:44 +0200)
commit95e592d9ab1e79272018b8b6b6821bf053cd665b
tree03c325bb6d2f5e1603b6bc333e5347934416eca6
parentbc8b216886e01cf6269b72c12e1a92f43b70efc1
[gdb/testsuite] Introduce allow_dap_tests

Simon pointed out that with gdb.dap/*.exp and target board
native-gdbserver, we run into problems.

I see for each test-case:
...
+++ run
Traceback (most recent call last):
  File "startup.py", line 146, in exec_and_log
    output = gdb.execute(cmd, from_tty=True, to_string=True)
gdb.error: Don't know how to run.  Try "help target".
...

Likewise with target board native-extended-gdbserver.

Fix this by:
- adding a new proc allow_dap_tests,
- using it in all the gdb.dap tests, and
- bailing out if GDBFLAGS/INTERNAL_GDBFLAGS contains
  "set auto-connect-native-target off".

Tested on x86_64-linux.

Reported-By: Simon Marchi <simon.marchi@efficios.com>
Approved-By: Tom Tromey <tom@tromey.com>
gdb/testsuite/gdb.dap/basic-dap.exp
gdb/testsuite/gdb.dap/bt-nodebug.exp
gdb/testsuite/gdb.dap/scopes.exp
gdb/testsuite/lib/gdb.exp