Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
To: Tom Tromey <tom@tromey.com>
Cc: Andrew Burgess <aburgess@redhat.com>,
	 gdb-patches@sourceware.org, Simon Marchi <simark@simark.ca>
Subject: [PATCH v2] Require async support for DAP tests [PR34548]
Date: Fri, 28 Aug 2026 10:49:34 +0200	[thread overview]
Message-ID: <ydd4iged3z5.fsf_-_@CeBiTec.Uni-Bielefeld.DE> (raw)
In-Reply-To: <87qzjja7ta.fsf@tromey.com> (Tom Tromey's message of "Thu, 27 Aug 2026 09:42:41 -0600")

[-- Attachment #1: Type: text/plain, Size: 2388 bytes --]

Hi Tom,

>>>>>> "Rainer" == Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> writes:
>
> Rainer> Right: some of them already do their own checks for async support:
>
> Rainer>       gdb.base/async.exp
> Rainer>       gdb.base/bg-exec-sigint-bp-cond.exp
> Rainer>       gdb.base/interrupt-noterm.exp
>
> Rainer> but in those cases, async commands are a crucial part of the tests and I
> Rainer> couldn't easily use the new supports_target_async there.
>
> I think it would be fine to stick
>
>     require supports_target_async
>
> At the top of each of these files, and simplify some of the tests to
> just assumes async execution will work.

in some cases, this seems to be the right way forward.  However, I've a
hard time telling which ones should have this treatment.  Others clearly
run tests both in sync and async modes (like
gdb.base/infcall-timeout.exp,
gdb.threads/infcall-from-bp-cond-timeout.exp).  At least in those cases,
we can just skip the async subtests.

> However that can also be comfortably done in a separate patch as well.

I'd rather do it this way, initially concentrating on the cases where
skipping target_async tests can avoid large numbers of timeouts.

> Rainer> +# Return 1 if target supports asynchronous execution, otherwise return 0.
> Rainer> +gdb_caching_proc supports_target_async {} {
> Rainer> +    global srcdir subdir gdb_prompt
> Rainer> +
> Rainer> +    set me "supports_target_async"
> Rainer> +
> Rainer> +    set src { int main() { return 0; } }
> Rainer> +    if {![gdb_simple_compile $me $src executable ""]} {
> Rainer> +	return 0
> Rainer> +    }
> Rainer> +
> Rainer> +    gdb_exit
> Rainer> +    gdb_start
> Rainer> +    gdb_reinitialize_dir $srcdir/$subdir
>
> I think these three lines can be replaced with "clean_restart".

Nice.  So far, I've simply followed existing current practice, although
I've wondered how many tests seem extremely repetetive and
consequentially hard to read.

> Rainer> +    if { ![runto_main] } {
> Rainer> +	return 0
>
> This branch doesn't gdb_exit but falling through does.
> Likewise this return doesn't delete the file.
>
> So maybe reworking this to fall through to the cleanup & final return
> would be better.

Done in the attached revision.

Thanks.
	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: testsuite-dap-async.patch --]
[-- Type: text/x-patch, Size: 1629 bytes --]

# 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 {} {

  reply	other threads:[~2026-08-28  8:50 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-20 14:18 [PATCH] Skip gdb.dap/pause.exp on Solaris [PR34548] Rainer Orth
2026-08-21 14:27 ` Tom Tromey
2026-08-22 20:25   ` Rainer Orth
2026-08-24  9:42     ` Andrew Burgess
2026-08-25  8:19       ` Rainer Orth
2026-08-25  8:22         ` Rainer Orth
2026-08-27 15:42         ` Tom Tromey
2026-08-28  8:49           ` Rainer Orth [this message]
2026-08-27 18:59         ` [PATCH] Skip gdb.dap/pauseR.exp " Andrew Burgess
2026-08-28  8:52           ` Rainer Orth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ydd4iged3z5.fsf_-_@CeBiTec.Uni-Bielefeld.DE \
    --to=ro@cebitec.uni-bielefeld.de \
    --cc=aburgess@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=simark@simark.ca \
    --cc=tom@tromey.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox