aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/lib
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2023-08-02 23:14:58 +0200
committerTom de Vries <tdevries@suse.de>2023-08-02 23:14:58 +0200
commit3c3e54d7b5f7da003292710fe810e670d45832d8 (patch)
treeb2315895e9f8e9e9d82f830766126f71f60438bb /gdb/testsuite/lib
parent86bb2d76c901a558e5b2dd29df95874ce6e78dae (diff)
downloadgdb-3c3e54d7b5f7da003292710fe810e670d45832d8.zip
gdb-3c3e54d7b5f7da003292710fe810e670d45832d8.tar.gz
gdb-3c3e54d7b5f7da003292710fe810e670d45832d8.tar.bz2
[gdb/dap] Disable DAP for python <= 3.5
DAP requires python module typing, which is supported starting python 3.5. Make this formal by: - disabling the dap interpreter for python version < 3.5 - returning 0 in allow_dap_tests for python version < 3.5 Approved-By: Tom Tromey <tom@tromey.com> PR dap/30708 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30708
Diffstat (limited to 'gdb/testsuite/lib')
-rw-r--r--gdb/testsuite/lib/gdb.exp25
1 files changed, 25 insertions, 0 deletions
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 87d6895..36bf738 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -1533,6 +1533,26 @@ proc gdb_test { args } {
return [gdb_test_multiple $command $message {*}$opts $user_code]
}
+# Return 1 if python version used is at least MAJOR.MINOR
+proc python_version_at_least { major minor } {
+ set python_script {print (sys.version_info\[0\], sys.version_info\[1\])}
+
+ set res [remote_exec host $::GDB \
+ "$::INTERNAL_GDBFLAGS -batch -ex \"python $python_script\""]
+ if { [lindex $res 0] != 0 } {
+ error "Couldn't get python version"
+ }
+
+ set python_version [lindex $res 1]
+ set python_version [string trim $python_version]
+
+ regexp {^([0-9]+) ([0-9]+)$} $python_version \
+ dummy python_version_major python_version_minor
+
+ return [version_compare [list $major $minor] \
+ <= [list $python_version_major $python_version_minor]]
+}
+
# Return 1 if tcl version used is at least MAJOR.MINOR
proc tcl_version_at_least { major minor } {
global tcl_version
@@ -2586,6 +2606,11 @@ gdb_caching_proc allow_dap_tests {} {
return 0
}
+ # The dap code uses module typing, available starting python 3.5.
+ if { ![python_version_at_least 3 5] } {
+ return 0
+ }
+
# ton.tcl uses "string is entier", supported starting tcl 8.6.
if { ![tcl_version_at_least 8 6] } {
return 0