aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2023-03-26 13:44:58 +0200
committerTom de Vries <tdevries@suse.de>2023-03-26 13:44:58 +0200
commit95e592d9ab1e79272018b8b6b6821bf053cd665b (patch)
tree03c325bb6d2f5e1603b6bc333e5347934416eca6 /gdb
parentbc8b216886e01cf6269b72c12e1a92f43b70efc1 (diff)
downloadgdb-95e592d9ab1e79272018b8b6b6821bf053cd665b.zip
gdb-95e592d9ab1e79272018b8b6b6821bf053cd665b.tar.gz
gdb-95e592d9ab1e79272018b8b6b6821bf053cd665b.tar.bz2
[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>
Diffstat (limited to 'gdb')
-rw-r--r--gdb/testsuite/gdb.dap/basic-dap.exp2
-rw-r--r--gdb/testsuite/gdb.dap/bt-nodebug.exp2
-rw-r--r--gdb/testsuite/gdb.dap/scopes.exp2
-rw-r--r--gdb/testsuite/lib/gdb.exp15
4 files changed, 19 insertions, 2 deletions
diff --git a/gdb/testsuite/gdb.dap/basic-dap.exp b/gdb/testsuite/gdb.dap/basic-dap.exp
index 5e6e1b5..0026690 100644
--- a/gdb/testsuite/gdb.dap/basic-dap.exp
+++ b/gdb/testsuite/gdb.dap/basic-dap.exp
@@ -15,7 +15,7 @@
# Basic DAP test.
-require allow_python_tests
+require allow_dap_tests
load_lib dap-support.exp
diff --git a/gdb/testsuite/gdb.dap/bt-nodebug.exp b/gdb/testsuite/gdb.dap/bt-nodebug.exp
index e365f08..e4dcef3 100644
--- a/gdb/testsuite/gdb.dap/bt-nodebug.exp
+++ b/gdb/testsuite/gdb.dap/bt-nodebug.exp
@@ -15,6 +15,8 @@
# Test DAP 'bt' through a function without debuginfo.
+require allow_dap_tests
+
load_lib dap-support.exp
standard_testfile bt-main.c bt-inner.c
diff --git a/gdb/testsuite/gdb.dap/scopes.exp b/gdb/testsuite/gdb.dap/scopes.exp
index 0fa9e21..2c4b9ed 100644
--- a/gdb/testsuite/gdb.dap/scopes.exp
+++ b/gdb/testsuite/gdb.dap/scopes.exp
@@ -15,7 +15,7 @@
# Test "scopes" and "variables".
-require allow_python_tests
+require allow_dap_tests
load_lib dap-support.exp
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index dd39247..3cfe22b 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -2488,6 +2488,21 @@ gdb_caching_proc allow_python_tests {} {
return [expr {[string first "--with-python" $output] != -1}]
}
+gdb_caching_proc allow_dap_tests {} {
+ if { ![allow_python_tests] } {
+ return 0
+ }
+
+ # With set auto-connect-native-target off, we run into:
+ # +++ run
+ # Traceback (most recent call last):
+ # File "startup.py", line <n>, 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".
+ set gdb_flags [join $::GDBFLAGS $::INTERNAL_GDBFLAGS]
+ return [expr {[string first "set auto-connect-native-target off" $gdb_flags] == -1}]
+}
+
# Return a 1 if we should run shared library tests.
proc allow_shlib_tests {} {