# HG changeset patch # Parent 3fcec728f85b5d0cfef637d13368c88dad2e7bbc Require async support for DAP tests [PR34548] diff --git a/gdb/testsuite/gdb.dap/pause.exp b/gdb/testsuite/gdb.dap/pause.exp --- a/gdb/testsuite/gdb.dap/pause.exp +++ b/gdb/testsuite/gdb.dap/pause.exp @@ -15,9 +15,6 @@ # Test "pause" in DAP. -# PR dap/34548 -require {!istarget "*-*-solaris2*"} - require allow_dap_tests load_lib dap-support.exp diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -3070,6 +3070,10 @@ gdb_caching_proc with_system_readline {} } gdb_caching_proc allow_dap_tests {} { + if { ![supports_target_async] } { + return 0 + } + if { ![allow_python_tests] } { return 0 } @@ -3908,6 +3912,37 @@ gdb_caching_proc supports_memtag {} { return 0 } +# Return 1 if target supports asynchronous execution, otherwise return 0. +gdb_caching_proc supports_target_async {} { + global srcdir subdir gdb_prompt + + set me "supports_target_async" + + set src { int main() { return 0; } } + if {![gdb_simple_compile $me $src executable ""]} { + return 0 + } + + clean_restart + gdb_load $obj + + if { [runto_main] } { + set res 0 + gdb_test_multiple "continue &" "" { + -re "Continuing..*" { + set res 1 + } + -re ".*Asynchronous execution not supported on this target..*" { + set res 0 + } + } + } + + gdb_exit + remote_file build delete $obj + return $res +} + # Return 1 if catch syscall is supported, otherwise return 0. gdb_caching_proc supports_catch_syscall {} {