]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Adjust gdb.arch/amd64-watchpoint-downgrade.exp for Cygwin
authorPedro Alves <pedro@palves.net>
Tue, 5 Sep 2023 14:06:20 +0000 (15:06 +0100)
committerPedro Alves <pedro@palves.net>
Mon, 9 Jun 2025 16:42:03 +0000 (17:42 +0100)
The gdb.arch/amd64-watchpoint-downgrade.exp testcase is assuming the
output of debugging a single-thread program, like so, on e.g.,
GNU/Linux:

 starti
 Starting program: .../gdb.arch/amd64-watchpoint-downgrade/amd64-watchpoint-downgrade
 warning: watchpoint 1 downgraded to software watchpoint

 Program stopped.
 0x00007ffff7fe32b0 in _start () from /lib64/ld-linux-x86-64.so.2

However, on Cygwin, where all inferiors are multi-threaded (because
both Windows and the Cygwin runtime spawn a few helper threads), we
get:

 starti
 Starting program: .../gdb.arch/amd64-watchpoint-downgrade/amd64-watchpoint-downgrade
 [New Thread 4652.0x17e4]
 warning: watchpoint 1 downgraded to software watchpoint

 Thread 1 stopped.
 0x00007ffbfc1c0911 in ntdll!LdrInitShimEngineDynamic () from C:/Windows/SYSTEM32/ntdll.dll

This commit adjusts the testcase to work with either output.

(Note GDB may print a thread name after the thread number.)

Approved-by: Kevin Buettner <kevinb@redhat.com>
Change-Id: I3aedfec04924ea3fb3bb87ba3251e2b720f8d59c

gdb/testsuite/gdb.arch/amd64-watchpoint-downgrade.exp

index dcee04070943368c1da50a55042b5e5363251478..5663b0d5278130d7b45adfa851c30a330b8e1992 100644 (file)
@@ -58,7 +58,7 @@ gdb_test "starti" \
     [multi_line \
         "warning: watchpoint $num downgraded to software watchpoint" \
         "" \
-        "Program stopped\\." \
+        "(Program|Thread \[^\r\n\]) stopped\\." \
         ".*"]
 
 # Watchpoint should now have downgraded to a s/w watchpoint.