From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 2cHDKXygD2q1sQ0AWB0awg (envelope-from ) for ; Thu, 21 May 2026 20:17:00 -0400 Received: by simark.ca (Postfix, from userid 112) id A799E1E091; Thu, 21 May 2026 20:17:00 -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,WEIRD_PORT 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 C590C1E024 for ; Thu, 21 May 2026 20:16:59 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5EB3648F52CE for ; Fri, 22 May 2026 00:16:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5EB3648F52CE Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) by sourceware.org (Postfix) with ESMTPS id 792A848F665B for ; Fri, 22 May 2026 00:16:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 792A848F665B 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 792A848F665B Authentication-Results: sourceware.org; arc=none smtp.remote-ip=209.85.128.53 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1779408995; cv=none; b=MSpBphix3Quutk4mYFhyPskMrcl+qBY9rU9CfHZKs1TEfwaxOAKRDyf2u/S7krSNyumh3j0MvbQ6FEeNQArc/X8UASW1pHufBxTqbyvCbQ0mKN1NdtanVD3wrvvpFFXCWvLo5YbHA8Ey5XSNizmj/3kim71csq+tF0fu56wCnq0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1779408995; c=relaxed/simple; bh=QHg5OeNep0/AYM7Qk/xXIzWz1LG2oH03NPQJOC9mRt8=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=VdofuFceOdc0QC9cKuLa+6LtV6tTeYdxdXElf3/Z2/Ik3YaAd1Oqft9sBwyU76NsYjqRWCoJ+ZRnLJaasqjW2fHnBffHsgV/57OFA+1TITKnofMirP6aQipk4DTrrgsGNJD5t4uEnBGJ9vPQsBP1FHd5M1Py6PqtxKwUy2fy93M= ARC-Authentication-Results: i=1; sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 792A848F665B Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-4903d5c67bfso4848585e9.1 for ; Thu, 21 May 2026 17:16:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779408994; x=1780013794; 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=GnDPWNM1q5J6fU6MDnAfdMuutyrofVXOmfDNcR2JGbE=; b=FHLzIxXdDsUCCXHGm2pCV3H1aVLdCtnWRnKZPFYKuvu3X31t2ICQooXK+S41w0/DtI hdhB/KE9jrGRqmNhoLEZVnJl2tCCa7XJpQeka2noniMYQ5OncPDaZUx7myRzJodpaXgr 1a8Y7sIpoxWuEQjtsifpauB26wHSBrc0XMlSi6q3xYVY4XIS2OaYqvR3iqIOwKHoHUqh rcYQ8t4dvmhb/KBdBOUI4+SUUA4gUjT2qeYxIqKFeYR4Si7opzzSIX3BS9oGQpdoFytg 1uY83Cf98gIVRdUV4MgrgqR4s71nsRvoyQGPw/Q+xVN8vwqRUDRe5Da9qQ/lix80qWwy oeSQ== X-Gm-Message-State: AOJu0Yy2ICvhZ9KwK4g6aTfJPQlQQqbbCr7W8NqUYfUZ4xLxqkfSVyYq jYZUGeTGZbx5vo45bbBDj+zdOtwmo/vNzElynwYcZYUsvgbF2VP+9nWjvsfaxA== X-Gm-Gg: Acq92OEY1m7SIMgyOfsbgn1yLfr9oesCVdLgXU7oB93Nk1WFwsxip5Zey3xrPLVh623 /sgiAUfinsoYmHknCUTbBV07v1JkrEiP+P+N4fdSZtCDcWCL0xve9TTq6RigLGPu6hkZZNbnXAG ZtPJtR3P/wqb7/5KUaYZOCW14pqk+n5d+qAcwSYHkAZ9lkiVnvS+TwnL8tPcvrS85lKGTLvsSEA BQ0sPdW/w30SBn3efVUxMz2oqqQbJt5T+pv+VjHyPNGMZgOrx9IEZkA0TMDo/2D2H9wSp9L1YJ0 icCHktlJ0uEYkAR2a5VbUEjvgebORdqLH1Yd3erCDeFuwevhw9IRsEkKrShGlScxTbIQC82ejOy CUCqhXQtgHcXZYsRUcH/CQZOH2e5r69zN4SwYFkjDqwUCAq2ZO7zm4YxlWANTOsHprbI3eRzvLE DN4Ni/dC6Kqs9eCOMLzoXhpQ== X-Received: by 2002:a05:600c:4fc9:b0:48a:93d2:60d2 with SMTP id 5b1f17b1804b1-4904225331amr11975115e9.0.1779408994261; Thu, 21 May 2026 17:16:34 -0700 (PDT) Received: from localhost ([2001:8a0:fae3:2600:cb04:347e:aaad:ca08]) by smtp.gmail.com with UTF8SMTPSA id ffacd0b85a97d-45eb4ae8fb5sm797211f8f.36.2026.05.21.17.16.33 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 21 May 2026 17:16:33 -0700 (PDT) From: Pedro Alves To: gdb-patches@sourceware.org Subject: [PATCH 3/5] Adjust gdb.base/exitsignal.exp for Cygwin Date: Fri, 22 May 2026 01:16:24 +0100 Message-ID: <20260522001626.393908-4-pedro@palves.net> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260522001626.393908-1-pedro@palves.net> References: <20260522001626.393908-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 Cygwin has this feature where if the program is about to die with a signal, and there's a debugger attached, it raises a SIGTRAP via DebugBreak. So if you try to pass a terminating signal to the inferior, you see that SIGTRAP first, before the process exits with the signal. E.g.: Thread 1 "segfault" received signal SIGSEGV, Segmentation fault. 0x0000000100401092 in main () at segfault.cc:5 5 *(volatile int *)0; (gdb) c Continuing. Thread 1 "segfault" received signal SIGTRAP, Trace/breakpoint trap. 0x00007ffe99d35a13 in KERNELBASE!DebugBreak () from C:/WINDOWS/System32/KERNELBASE.dll (gdb) bt #0 0x00007ffe99d35a13 in KERNELBASE!DebugBreak () from C:/WINDOWS/System32/KERNELBASE.dll #1 0x00007ffe896163b7 in break_here () at /usr/src/debug/cygwin-3.6.9-1/winsup/cygwin/dcrt0.cc:473 #2 0x00007ffe8962fe13 in try_to_debug () at /usr/src/debug/cygwin-3.6.9-1/winsup/cygwin/exceptions.cc:599 #3 exception::handle (e=0x7ffffc9b0, frame=, in=0x7ffffc4c0, dispatch=) at /usr/src/debug/cygwin-3.6.9-1/winsup/cygwin/exceptions.cc:812 #4 0x00007ffe9c5e63df in ntdll!.chkstk () from C:/WINDOWS/SYSTEM32/ntdll.dll #5 0x00007ffe9c499497 in ntdll!RtlLocateExtendedFeature () from C:/WINDOWS/SYSTEM32/ntdll.dll #6 0x00007ffe9c5e5d1e in ntdll!KiUserExceptionDispatcher () from C:/WINDOWS/SYSTEM32/ntdll.dll #7 0x0000000100401092 in main () at segfault.cc:5 (gdb) c Continuing. ... [Inferior 1 (process 8032) exited with code 05400] (gdb) gdb.base/exitsignal.exp fails on Cygwin partly because it doesn't take that into account. This commit fixes it. In addition, the typical adjustement for the fact that all programs are multi-threaded on Cygwin is also necessary. gdb.base/exitsignal.exp still won't pass cleanly yet. That'll be finally fixed in the next patch. Change-Id: I2d18e2604afe3a4f80987848e2c1cd307ed43401 commit-id: 013964ce --- gdb/testsuite/gdb.base/exitsignal.exp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/gdb.base/exitsignal.exp b/gdb/testsuite/gdb.base/exitsignal.exp index aa2710450b5..f1effcd8cea 100644 --- a/gdb/testsuite/gdb.base/exitsignal.exp +++ b/gdb/testsuite/gdb.base/exitsignal.exp @@ -50,7 +50,13 @@ gdb_test "print \$_exitcode" " = void" \ "\$_exitcode is void before running" # Trigger SIGSEGV. -gdb_test "continue" "Program received signal SIGSEGV.*" "trigger SIGSEGV" +gdb_test "continue" "(Thread .*|Program) received signal SIGSEGV.*" "trigger SIGSEGV" + +if {[istarget "*-*-cygwin*"]} { + # Cygwin calls DebugBreak before it lets the process exit. + gdb_test "continue" "Thread .* received signal SIGTRAP.*" \ + "trigger try_to_debug SIGTRAP" +} # Continue until the end. gdb_test "continue" "Program terminated with signal SIGSEGV.*" \ -- 2.53.0