From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id Vg4PKJgXQ2iycAMAWB0awg (envelope-from ) for ; Fri, 06 Jun 2025 12:30:16 -0400 Received: by simark.ca (Postfix, from userid 112) id 8F4E71E11C; Fri, 6 Jun 2025 12:30:16 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-9.0 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED, RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE autolearn=ham autolearn_force=no version=4.0.1 Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (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 D392E1E0C2 for ; Fri, 6 Jun 2025 12:30:15 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4288E3857354 for ; Fri, 6 Jun 2025 16:30:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4288E3857354 Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) by sourceware.org (Postfix) with ESMTPS id 2DE773858C50 for ; Fri, 6 Jun 2025 16:29:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2DE773858C50 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 2DE773858C50 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=209.85.128.50 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1749227380; cv=none; b=CsVsz2XYG9tBrX7eoNs0urJDgu9XVWEC6ny5pxKscDmArmZj/WEhzFPGY0fMJvMQr/Jniih46431lMEmV/MBRVGTyfbTyqVFz8TvmuXa+t9obOeigpnbORdL/OMU/25WmhODVKKXaY1QOqBVKv8qFN/ZoVP45asbQaY9TLSU064= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1749227380; c=relaxed/simple; bh=FT7Dt8qJwE0wLlJLpO012YV6Uxd3wAuZX0NhBWKuQfc=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=u6/tE4/eSfLSj5HUDVQMSk6tvZKZXIg5b+ZITLmn48bkooe0qhafQrF6T/zxzFPtd43KmevttkORnZEemq6l+Bw/PvRRNtQ0XPztR2kl5E8N39DmaDSGVFCUXo1xNwKgTABGl0ACeRUNsYlahvcK6JwMaFfpcYrRmshQUOcc3jk= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2DE773858C50 Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-450cfb6a794so16036725e9.1 for ; Fri, 06 Jun 2025 09:29:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749227379; x=1749832179; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=CITp5o0LioL4gH+iXO3ymPShiAR1OU9SdjCVPDOpWO0=; b=PMsqkey7tvdsyLIUcT9c244qkkWPHkKnBGMvfQ0DKQggNzJExwKuROUYCbftdZaBK+ 87HMjmJkX7h5yNNvB8+EVp8yFGXBhOG6lYiOjriqfaJMYVbibYQ63gFREqSBbUlltYjt 4SeXTE+80lQR7NDE1tcbO2MmKHyeZCPvXA8XnVvz9nVEgKhVOqLI0tldk9GnPwbjreJh 14x5ozOySdRo93BlRyZR6DIy+EgwClpC/wEcSUOhxNjF/Tc4vxxFyiCLq0g16gEGN8Ch 8Gnqx1XaiQPewm5di+DMkZY5DHp7qyKOSCAmQDTb//T1Hc7DW8OWWG/6zfWkwsSe7m2b /pbg== X-Gm-Message-State: AOJu0YyVCq1WV0ETyrb4Rg/qSFv3xV0/R5RnTc5/d3A5kTMquHboo3FW fQcuvTnltgVjfXRyqKEA3vgsjSob8ZWmkK6nJUSNfxs/6+RQDKt2og7EhcRSgivu X-Gm-Gg: ASbGncuoHhbfffuRI+r0qddPI6j39Adx9yZwGkZunH4GxLVkCVTC6eb1ItHAiJKkMeK 3hpHsnG9AF+pY9B+84p/Af/Zkp+tlXxMBRPdG4zBQOKYnn3xWKxWUZpwhLVOhjqQSxHpaRekJEu P5603IRWMsE1c+K8NoCuVUEkY8zkxAh31mHtc3PcwSmkzfeFyvEAcjpPNDxze1lgTZjZPSOytmT oKdUu9GEhrb46xfwJmWgcO834WU9kPLgMCM8tuu9gnCz7GChLMmmmiDKMqsRr9OYze9ALkBq7sN FqAu47di8ADomv/XttbQwENzXqv2Ka9+6IWtVtXwmydC9UTMjQ== X-Google-Smtp-Source: AGHT+IHvahz+gq7xRtbwBR6IMU7SJR8GA4hiKUsCV2LRZ4LWKsRdHEyzZM2Bf1NsqgJS/waGz6fF8w== X-Received: by 2002:a05:600c:1e02:b0:442:f482:c421 with SMTP id 5b1f17b1804b1-452013d1ab6mr38801675e9.22.1749227378360; Fri, 06 Jun 2025 09:29:38 -0700 (PDT) Received: from localhost ([2001:8a0:facf:2b00:77f6:647:8d2f:f905]) by smtp.gmail.com with UTF8SMTPSA id 5b1f17b1804b1-45213709670sm29452725e9.25.2025.06.06.09.29.37 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 06 Jun 2025 09:29:37 -0700 (PDT) From: Pedro Alves To: gdb-patches@sourceware.org Subject: [PATCH] gdb.multi/attach-no-multi-process.exp: Detect no remote non-stop Date: Fri, 6 Jun 2025 17:29:31 +0100 Message-ID: <20250606162932.960463-1-pedro@palves.net> X-Mailer: git-send-email 2.49.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Running gdb.multi/attach-no-multi-process.exp on Cygwin, where GDBserver does not support non-stop mode, I see: FAIL: gdb.multi/attach-no-multi-process.exp: target_non_stop=off: info threads FAIL: gdb.multi/attach-no-multi-process.exp: target_non_stop=on: attach to the program via remote (timeout) FAIL: gdb.multi/attach-no-multi-process.exp: target_non_stop=on: info threads (timeout) Let's ignore the first "info threads" fail. The timeouts look like this: builtin_spawn /home/alves/gdb-cache-cygwin/gdb/../gdbserver/gdbserver --once --multi localhost:2346 Listening on port 2346 target extended-remote localhost:2346 Remote debugging using localhost:2346 Non-stop mode requested, but remote does not support non-stop (gdb) gdb_do_cache: can_spawn_for_attach ( ) builtin_spawn /home/alves/gdb/build-cygwin-testsuite/outputs/gdb.multi/attach-no-multi-process/attach-no-multi-process attach 14540 FAIL: gdb.multi/attach-no-multi-process.exp: target_non_stop=on: attach to the program via remote (timeout) info threads FAIL: gdb.multi/attach-no-multi-process.exp: target_non_stop=on: info threads (timeout) Note the "Non-stop mode requested, but remote does not support non-stop" line. The intro to gdb_target_cmd_ext says: # gdb_target_cmd_ext # Send gdb the "target" command. Returns 0 on success, 1 on failure, 2 on # unsupported. That's perfect here, we can just use gdb_target_cmd_ext instead of gdb_target_cmd, and check for 2 (unsupported). That's what this patch does. However gdb_target_cmd_ext incorrectly returns 1 instead of 2 for the case where the remote target says it does not support non-stop. That is also fixed by this patch. With this, we no longer get those timeout fails. We get instead: target extended-remote localhost:2346 Remote debugging using localhost:2346 Non-stop mode requested, but remote does not support non-stop (gdb) UNSUPPORTED: gdb.multi/attach-no-multi-process.exp: target_non_stop=on: non-stop RSP Change-Id: I1ab3162f74200c6c02a17a0600b102d2d12db236 --- gdb/testsuite/gdb.multi/attach-no-multi-process.exp | 5 ++++- gdb/testsuite/lib/gdbserver-support.exp | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/gdb/testsuite/gdb.multi/attach-no-multi-process.exp b/gdb/testsuite/gdb.multi/attach-no-multi-process.exp index 28aabaf9edf..502f30940cc 100644 --- a/gdb/testsuite/gdb.multi/attach-no-multi-process.exp +++ b/gdb/testsuite/gdb.multi/attach-no-multi-process.exp @@ -59,7 +59,10 @@ proc test {target_non_stop} { "switch to inferior 2" set res [gdbserver_start "--multi" ""] set gdbserver_gdbport [lindex $res 1] - gdb_target_cmd "extended-remote" $gdbserver_gdbport + if { [gdb_target_cmd_ext "extended-remote" $gdbserver_gdbport] == 2 } { + unsupported "non-stop RSP" + return + } # Start a program, then attach to it. set spawn_id_list [spawn_wait_for_attach [list $binfile]] diff --git a/gdb/testsuite/lib/gdbserver-support.exp b/gdb/testsuite/lib/gdbserver-support.exp index c2850724c52..23892068c97 100644 --- a/gdb/testsuite/lib/gdbserver-support.exp +++ b/gdb/testsuite/lib/gdbserver-support.exp @@ -69,7 +69,7 @@ proc gdb_target_cmd_ext { targetname serialport {additional_text ""} } { } -re "Non-stop mode requested, but remote does not support non-stop.*$gdb_prompt $" { verbose "remote does not support non-stop" - return 1 + return 2 } -re "Remote MIPS debugging.*$additional_text.*$gdb_prompt" { verbose "Set target to $targetname" base-commit: e9770f7889e72297a179b5596894f4bbdb105224 -- 2.49.0