diff mbox series

Adjust gdb.base/sigall.exp for Cygwin

Message ID 20250606191523.1003585-1-pedro@palves.net
State New
Headers show
Series Adjust gdb.base/sigall.exp for Cygwin | expand

Commit Message

Pedro Alves June 6, 2025, 7:15 p.m. UTC
The gdb.base/sigall.exp testcase has many FAILs on Cygwin currently.

From:

 Thread 1 "sigall" received signal SIGPWR, Power fail/restart.
 0x00007ffeac9ed134 in ntdll!ZwWaitForSingleObject () from /cygdrive/c/Windows/SYSTEM32/ntdll.dll
 (gdb) FAIL: gdb.base/sigall.exp: get signal LOST

we see two issues.  The test is expecting "Program received ..." which
only appears if the inferior is single-threaded.  All Cygwin inferiors
are multi-threaded, because both Windows and the Cygwin runtime spawn
a few helper threads.

And then, SIGLOST is the same as SIGPWR on Cygwin.  The testcase
already knows to treat them the same on SPARC64 GNU/Linux.  We just
need to extend the relevant code to treat Cygwin the same.

With this, the test passes cleanly on Cygwin.

Change-Id: Ie3553d043f4aeafafc011347b6cb61ed58501667
---
 gdb/testsuite/gdb.base/sigall.exp | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

Comments

Tom Tromey June 6, 2025, 8:11 p.m. UTC | #1
>>>>> "Pedro" == Pedro Alves <pedro@palves.net> writes:

Pedro> And then, SIGLOST is the same as SIGPWR on Cygwin.  The testcase
Pedro> already knows to treat them the same on SPARC64 GNU/Linux.  We just
Pedro> need to extend the relevant code to treat Cygwin the same.

Pedro> With this, the test passes cleanly on Cygwin.

This looks good to me.
Approved-By: Tom Tromey <tom@tromey.com>

Tom
diff mbox series

Patch

diff --git a/gdb/testsuite/gdb.base/sigall.exp b/gdb/testsuite/gdb.base/sigall.exp
index b23e3c5951f..461a92b57f2 100644
--- a/gdb/testsuite/gdb.base/sigall.exp
+++ b/gdb/testsuite/gdb.base/sigall.exp
@@ -41,13 +41,14 @@  proc test_one_sig {nextsig} {
 	    setup_xfail "i*86-pc-linuxoldld-gnu" "i*86-pc-linuxaout-gnu"
 	}
 	# On Linux SPARC64 systems SIGLOST==SIGPWR and gdb identifies
-	# the raised signal as PWR.
-	if {$thissig == "LOST" && [istarget "sparc64-*-linux*"]} {
+	# the raised signal as PWR.  Same for Cygwin.
+	if {$thissig == "LOST"
+	    && ([istarget "sparc64-*-linux*"] || [istarget "*-*-cygwin*"])} {
 	    set esig "PWR"
 	}
 
 	gdb_test "continue" \
-	    "Continuing.*Program received signal SIG$esig.*" \
+	    "Continuing.* received signal SIG$esig.*" \
 		"get signal $esig"
     }
 
@@ -177,7 +178,7 @@  gdb_test "handle SIGTERM stop print" \
     "SIGTERM\[ \t\]*Yes\[ \t\]*Yes\[ \t\]*Yes.*"
 gdb_test "b handle_TERM" "Breakpoint \[0-9\]+ .*"
 gdb_test "continue" \
-    "Continuing.*Program received signal SIGTERM.*" \
+    "Continuing.* received signal SIGTERM.*" \
     "get signal TERM"
 gdb_test "continue" "Breakpoint.*handle_TERM.*" "send signal TERM"
 gdb_continue_to_end "continue to sigall exit"