From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 8Zi6L0j+lmpyXBsAWB0awg (envelope-from ) for ; Tue, 01 Sep 2026 12:33:12 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=chOMO8X2; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id BE7FC1E033; Tue, 01 Sep 2026 12:33:12 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=unavailable autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 249271E033 for ; Tue, 01 Sep 2026 12:33:12 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D89354BA79A4 for ; Tue, 1 Sep 2026 16:33:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D89354BA79A4 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=chOMO8X2 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTP id 41D304BA79AB for ; Tue, 1 Sep 2026 16:32:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 41D304BA79AB Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 41D304BA79AB Authentication-Results: sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1788280357; cv=none; b=rIB5gQtVe6hYv+eogqiCIiIP9MhnQ/jq1JYHG+gxcglddVgHtRKNiZvB+jgEaaOXZcbbmKIutodStcbm8lXT8An3sxhSHrCUA837hz6prTezIIUaPC6kvLV2q2ZQ2tTErUb9qHOI9OYAT+Zss0B1kwUm5U14XjOKSlG8HO5sn7o= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1788280357; c=relaxed/simple; bh=01YkcEoP9E3SUcofp/mkt7NH+29MpQp1riL17bD+OLA=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=Bdp5vwj7+0dkwokaYe+S2kQDfrO6pOgKDpWoXNX1SWTJH8sH8aXP/zMB2m+ObaucA+INAmHoxmUNi+q/QHl7+PyS15Ew5g9WvNcovOlT16PdLRZCb1guPozH+E0XpBQbNNijvfQq3E/B4RCFnnmhH3q/D4+luhmQYG/XWDxbGDA= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=chOMO8X2 DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 41D304BA79AB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788280356; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=leX5uYM2HQQzfQXIVqdmAnK7lZt1nCjR/0YzPRlE6lo=; b=chOMO8X2GvmlQSTRAxrARaTmY7UyOTqSfxj+uznbYZYH5KRZQ74WKriqDJb/fy4NHXQ0Gj hbAJ6YmHC+4qGOS3ZkKPg5VsEWQ0xSPdpIsX5LBiVKtmT3hwxVOyK5cZlYP5yqCUOgwCAr 1Aa1eeszn8Atevs/XFm+7pEo5B2HNuQ= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-185-S3Qq3qaUOu-rVzDeIJvE_g-1; Tue, 01 Sept 2026 12:32:34 -0400 X-MC-Unique: S3Qq3qaUOu-rVzDeIJvE_g-1 X-Mimecast-MFC-AGG-ID: S3Qq3qaUOu-rVzDeIJvE_g_1788280354 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-49ccfad90f1so22532115e9.0 for ; Tue, 01 Sep 2026 09:32:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788280353; x=1788885153; h=content-type:mime-version:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to:content-type; bh=leX5uYM2HQQzfQXIVqdmAnK7lZt1nCjR/0YzPRlE6lo=; b=J9LRoqOGifiP0D/rsZ0OEyYp172pFp1gZ0soMyic+fzTHHzW3ake5wpWMYLfLk/zsA 53SpZg0TmxcrmpGwcvcSgeG33q943GE5gMraUhzLY8ph9ip+UdyCMzEHX0KlufHkNCdI /emhxt6SM8wv9YDLNVlaBp+cqM455z2R7uyRu9AGv+UrNzfpyqHlveMjhP9BkgEYbqWd zNu0738ZtUtQbnjNVjReLy1IIckpU18C8uo6Dd5kJIQlfuUxfJb0VDneUTOMQNW+wbZl WierXfoYROn4pB+h49tK3RAly6r3agV8JoyXDWHTEYLUJwLNAEh8ypQg6ndS6kwLkopY evpA== X-Gm-Message-State: AFuF++nrz3Lg1s1mSHFv6aWke95E9jUR/9SSOc+wE7f8QqiCDI9irjZe tn+xTBs0N3kZuYGvppPO2I1QDuAzjDrfX6E9RKvCeKmBOl08jO52ND0OCKKkuwH0wmwdRH1orQ/ fU+SSEv4P7PnXTMvZm8XOrBDsqAKyUQaBVzpKjkiTLYrMDWVVWyXfYQqdgnUYOiGdQljzPBM= X-Gm-Gg: AR+sD12HSNHdRb0B8mf4b58YmqOAgcvPSKPDncOf3P4MVtmTGWYW7PuS4el0ZWmzxvj uBkyUlRFQ3wYXKLXv/GqG6Ea8q7p02U3Fm30OAEbWCn/m77k1hJp7owytnyIHbMSxpvaOHdTl2h agvkmyDSDMbP44sPKzRz3JFVU0LDePSgqaGy8V9Oql9QuF+ujnGesElqFECL94Ed1ZeP0zsqUXp uWfEr9BQd9wrLTbeexagNiY53/0I7QbGrp1X7WHzbly1ijbllS5PE+UUJvFSb3pe0bjAlf77dHy Z4pKjuQR4twvOiyWeLbM063MjwF26sZrTuV1GthaWfadBwgLvL4qix/u+fNeouQrPlmf5bdzfQO jxX+SbUMPfEm70cly2MyAokleoLE= X-Received: by 2002:a05:600c:c4ac:b0:499:a5fc:2087 with SMTP id 5b1f17b1804b1-49b91c20e36mr531537595e9.6.1788280353516; Tue, 01 Sep 2026 09:32:33 -0700 (PDT) X-Received: by 2002:a05:600c:c4ac:b0:499:a5fc:2087 with SMTP id 5b1f17b1804b1-49b91c20e36mr531536475e9.6.1788280353071; Tue, 01 Sep 2026 09:32:33 -0700 (PDT) Received: from localhost (128.223.159.143.dyn.plus.net. [143.159.223.128]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49cdce0b401sm77400265e9.3.2026.09.01.09.32.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Sep 2026 09:32:32 -0700 (PDT) From: Andrew Burgess To: Rainer Orth , Tom Tromey Cc: gdb-patches@sourceware.org, Simon Marchi Subject: Re: [PATCH v2] Require async support for DAP tests [PR34548] In-Reply-To: References: <87fr07tupw.fsf@tromey.com> <874igj26tf.fsf@redhat.com> <87qzjja7ta.fsf@tromey.com> Date: Tue, 01 Sep 2026 17:32:31 +0100 Message-ID: <871pbdszj4.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: M1h6cX7K7WcaUuCsjRS2hJ5RW5H-dJv5LpD7oJK0vF0_1788280354 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org Rainer Orth writes: > Hi Tom, > >>>>>>> "Rainer" == Rainer Orth 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 > > > # 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 These are not needed and should be removed. > + > + 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 If 'runto_main' fails then RES is left unset. Please can you initialise it outside the `if`. > + 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. With these 3 fixes: Approved-By: Andrew Burgess thanks, Andrew > + } > + } > + > + 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 {} {