From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id wZpYAcTl+WmlvhYAWB0awg (envelope-from ) for ; Tue, 05 May 2026 08:42:44 -0400 Received: by simark.ca (Postfix, from userid 112) id 01DF81E067; Tue, 05 May 2026 08:42:43 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham 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 2D1EA1E0B1 for ; Tue, 05 May 2026 08:42:42 -0400 (EDT) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id 863374B9DB40 for ; Tue, 5 May 2026 12:42:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 863374B9DB40 Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) by sourceware.org (Postfix) with ESMTPS id 08C804BA23E7 for ; Tue, 5 May 2026 12:42:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 08C804BA23E7 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 08C804BA23E7 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=209.85.221.41 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1777984939; cv=none; b=AYSmJUI5Rks9V4SnsT17WuyzxOmicwRB5U4lScrrmft8M3sH8703l+tAEtP1rgnvNtZAsAK/RB0+Isnl4LcxrcAjTcjwAdMbWZFYEzI5I/goXCi8haW4SZKPWKNJNwg4oTXv+UviiQ3CHENIrLyS+T4C2oLv4Zjw6Hl2ze/BUfY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1777984939; c=relaxed/simple; bh=GvK8/1OVgzV25i1byD9kp7YNjOyt1X4hO1wd8BQP/u0=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=eFAp6rPNakndmYwIw7GjEewkuU6FVE2XNhHZlVljz2Gw4a1RtJW7UKFUeEJgldDEcJl0flPwaVEQbfQKF3HExef3Ty5OU7kBg+uIM2wFLMa1k93wk2ElocTJp84FN0VQ8C/wK+2Hq5QdIO0F1uE/diIZJnK8TqXwdxzrduz7QLg= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 08C804BA23E7 Received: by mail-wr1-f41.google.com with SMTP id ffacd0b85a97d-43d77f6092eso3217419f8f.2 for ; Tue, 05 May 2026 05:42:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777984938; x=1778589738; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=fH3N0GqVJcU/vvnnkXI4zc6n9olWFH2xjgNdo/tmAYw=; b=s9Z9ZB0HpCyScN+PQpfX5tH9IrXtGjFF6zgNW+n7xT1KLwEdtBS0DF731pZM6AVW0I Jxc+hsKrnlQ9Ohqs75n0qepHsXdfzJwg3o81j7JLudtofznnOfnSqeelpenBwn91CAMg H8hHUyXzJJFSsSjxU77Agdx9qa011qKOZ7M007zvYXXDm6Ytra1CtuIhtNmbtrqh+oPj QEYqaZkHd/zuPr0WqadDiZX684sEG1VR8iLF8tLzh2kIsX0yAFk+SLACKLqqdy4h+NIl XD3Q1KUKGhu/7a/oFm7QwUgomC2PI89W61M1Q+jFYXCLP0Z0bLplqtvbsn72ISW5RYXH V5wA== X-Gm-Message-State: AOJu0YzLdwPz1wyiC7BOLMm+jKh2hJPhah6q+EaWhG/rV9UavrUh9xPW gUN/vAoU1HxwxPjYnLF6c9kqD9VsZNKsDXBuMTJG5AY9hKdI5qUgEti6pim9tw== X-Gm-Gg: AeBDiet9Dd4/McGiXBbZ0k6bR1nC+jCQfEEHVxQP0BN/Z02yxhyps0fZy2IMhW91YZm KmDJlEKOylk/SfYncVTcts9F+BteyP0/73DDXnoa47+a99tI0VERLifX6FyDMagNRNsVwgjHg+2 2VsTWkFQwKFXu1RmYOKE1XExSEb6g1f7vel+fwTmiQ7w3ZIks6/OLbkEKjja0+waGZ0vkrSMBtt 2wil0R3c4T8/sfuYKzAHghoEhLXtBv+xiFpcV+/pHEWCaswVuswTQYzrNL4WrxmrzA9IN38KeAa 6+EXUjhAPVYsm1CYyE18255SfgKuwWv7SnRonXrb2X7RXSq92vd51LBVy8mkXNf+IjbbdMq4gTj Cdt14M8HqXdstSh1tPJzufGafKAfVa+6SfdhgP6iIk6S6oj4FciLWH+eplte63ZLNNWe6A4j5O3 lxvA5R6sCzZ4GYT2y0/5/sFH6ezl0qE/a5zfoGCtwiu6U= X-Received: by 2002:a05:6000:4287:b0:43d:77a8:3baf with SMTP id ffacd0b85a97d-45006240e52mr5483562f8f.32.1777984937459; Tue, 05 May 2026 05:42:17 -0700 (PDT) Received: from localhost ([2001:8a0:facb:a800:d362:b803:ffc5:8f78]) by smtp.gmail.com with UTF8SMTPSA id ffacd0b85a97d-45052953383sm4129927f8f.13.2026.05.05.05.42.16 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 05 May 2026 05:42:17 -0700 (PDT) From: Pedro Alves To: gdb-patches@sourceware.org Subject: [PATCH 1/3] Adjust gdb.threads/schedlock.exp for Cygwin Date: Tue, 5 May 2026 13:42:08 +0100 Message-ID: <20260505124210.1450101-2-pedro@palves.net> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260505124210.1450101-1-pedro@palves.net> References: <20260505124210.1450101-1-pedro@palves.net> 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 This commit adjusts gdb.threads/schedlock.exp to work on Cygwin too. The main difference to other systems is that on Windows, a Ctrl-C in the terminal results in Windows injecting a new thread in the inferior to report a EXCEPTION_DEBUG_EVENT/DBG_CONTROL_C event. That means that even with schedlock on, Ctrl-C always switches focus to a different thread. With this, gdb.threads/schedlock.exp passes cleanly on Cygwin. Change-Id: I574c702d370da6eaf92e82ce81efe1a44660b24f commit-id: f96fcdea --- gdb/testsuite/gdb.threads/schedlock.exp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/gdb/testsuite/gdb.threads/schedlock.exp b/gdb/testsuite/gdb.threads/schedlock.exp index eeca3f8fd0f..169f6876b62 100644 --- a/gdb/testsuite/gdb.threads/schedlock.exp +++ b/gdb/testsuite/gdb.threads/schedlock.exp @@ -105,6 +105,17 @@ proc goto_loop { msg } { } proc my_continue { msg } { + + # On Cygwin, a Ctrl-C in the terminal results in Windows injecting + # a new thread in the inferior to report a + # EXCEPTION_DEBUG_EVENT/DBG_CONTROL_C event. That means that even + # with schedlock on, Ctrl-C always switches focus to a different + # thread. Hide that fact here by saving/restoring the current + # thread. + if {[istarget *-*-cygwin*]} { + set gdb_thr [get_valueof "" "\$_thread" 0 "save current gdb thread"] + } + set test "continue ($msg)" gdb_test_multiple "continue" $test { -re "Continuing" { @@ -114,6 +125,13 @@ proc my_continue { msg } { stop_process "stop all threads ($msg)" + # See above. This must be done before goto_loop, otherwise with + # schedlock on, we'd be resuming the injected Ctrl-C thread. + if {[istarget *-*-cygwin*]} { + gdb_test "thread $gdb_thr" "Switching to thread .*" \ + "restore current gdb thread" + } + goto_loop $msg } @@ -201,6 +219,9 @@ if { $bad == 0 } { # before the command was run. BEFORE_ARGS is the value of the # thread's args before the command was run. LOCKED indicates whether # we expect threads other than the selected thread remained locked. +# +# Note, on Cygwin, the "we didn't switch threads" test is pointless, +# see my_continue. proc check_result { cmd before_thread before_args locked } { global NUM -- 2.53.0