From: Pedro Alves Date: Tue, 5 Sep 2023 14:06:20 +0000 (+0100) Subject: Adjust gdb.arch/amd64-watchpoint-downgrade.exp for Cygwin X-Git-Tag: binutils-2_45~364 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d29534b21d5bfe0a2964a048fabb345e1ad05b62;p=thirdparty%2Fbinutils-gdb.git Adjust gdb.arch/amd64-watchpoint-downgrade.exp for Cygwin 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 Change-Id: I3aedfec04924ea3fb3bb87ba3251e2b720f8d59c --- diff --git a/gdb/testsuite/gdb.arch/amd64-watchpoint-downgrade.exp b/gdb/testsuite/gdb.arch/amd64-watchpoint-downgrade.exp index dcee0407094..5663b0d5278 100644 --- a/gdb/testsuite/gdb.arch/amd64-watchpoint-downgrade.exp +++ b/gdb/testsuite/gdb.arch/amd64-watchpoint-downgrade.exp @@ -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.