Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
To: Andrew Burgess <aburgess@redhat.com>
Cc: Tom Tromey <tom@tromey.com>,
	 gdb-patches@sourceware.org,  Simon Marchi <simark@simark.ca>
Subject: Re: [PATCH v2] Require async support for DAP tests [PR34548]
Date: Thu, 03 Sep 2026 10:06:28 +0200	[thread overview]
Message-ID: <yddse3q7o8r.fsf@CeBiTec.Uni-Bielefeld.DE> (raw)
In-Reply-To: <871pbdszj4.fsf@redhat.com> (Andrew Burgess's message of "Tue, 01 Sep 2026 17:32:31 +0100")

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

Hi Andrew,

>> +# Return 1 if target supports asynchronous execution, otherwise return 0.
>> +gdb_caching_proc supports_target_async {} {
>> +    global srcdir subdir gdb_prompt
>
> These are not needed and should be removed.

right: they are a remnant of the explicit gdb_reinitialize_dir
$srcdir/$subdir in the first version.

>> +	gdb_test_multiple "continue &" "" {
>> +	    -re "Continuing..*" {
>> +		set res 1
>> +	    }
>> +	    -re ".*Asynchronous execution not supported on this target..*" {
>> +		set res 0
>> +	    }
>
> Both of these would be better written as '-re -wrap "....etc..."' adding
> the -wrap will cause the $gdb_prompt to be matched.  I don't think it
> really matters in this case as you do call gdb_exit immediately after,
> so I think any pending output from GDB is discarded, but it does make
> the gdb.log a little neater, and so easier to grok.

Unfortunately this doesn't work for the same reason I'd removed the
explicit $gdb_prompt anchor

      -re "Continuing\\.\r\n$gdb_prompt $" {

that I'd tried initially: in some cases, you get output like

(gdb) continue &^M
Continuing.^M
(gdb) [Inferior 1 (process 3669382) exited normally]^M
FAIL: gdb.dap/ada-scopes.exp: continue & (timeout)

instead of the expected

(gdb) continue &^M
Continuing.^M
(gdb) gdb_caching_proc supports_target_async caused gdb_exit to be called

causing supports_target_async to incorrectly return 0.

So that's what I'd like to check in.

	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: 1593 bytes --]

# HG changeset patch
# Parent  069fc8428271fcfc95508f3097833f35443e371f
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,35 @@ gdb_caching_proc supports_memtag {} {
     return 0
 }
 
+# Return 1 if target supports asynchronous execution, otherwise return 0.
+gdb_caching_proc supports_target_async {} {
+    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
+
+    set res 0
+    if { [runto_main] } {
+	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-09-03  8:06 UTC|newest]

Thread overview: 15+ 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           ` [PATCH v2] Require async support for DAP tests [PR34548] Rainer Orth
2026-09-01 16:20             ` Tom Tromey
2026-09-01 16:32             ` Andrew Burgess
2026-09-03  8:06               ` Rainer Orth [this message]
2026-09-07  8:34                 ` Andrew Burgess
2026-09-07 10:43                   ` Rainer Orth
2026-08-27 18:59         ` [PATCH] Skip gdb.dap/pauseR.exp on Solaris [PR34548] 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=yddse3q7o8r.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