]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Adjust gdb.base/bp-cond-failure.exp for Cygwin
authorPedro Alves <pedro@palves.net>
Tue, 5 Sep 2023 12:24:17 +0000 (13:24 +0100)
committerPedro Alves <pedro@palves.net>
Mon, 9 Jun 2025 16:27:11 +0000 (17:27 +0100)
commit6fae95d4b72474a30d29c0b0285e3b82b77c624c
tree5f275063f38425905fa32114c7548f778312990c
parent3d6d08beed8eddd3c299523063d87ce6a23d6a3a
Adjust gdb.base/bp-cond-failure.exp for Cygwin

Currently on Cygwin, I get:

 Running /home/alves/gdb/src/gdb/testsuite/gdb.base/bp-cond-failure.exp ...
 FAIL: gdb.base/bp-cond-failure.exp: access_type=char: cond_eval=auto: multi-loc: continue
 FAIL: gdb.base/bp-cond-failure.exp: access_type=char: cond_eval=auto: single-loc: continue
 FAIL: gdb.base/bp-cond-failure.exp: access_type=short: cond_eval=auto: multi-loc: continue
 FAIL: gdb.base/bp-cond-failure.exp: access_type=short: cond_eval=auto: single-loc: continue
 FAIL: gdb.base/bp-cond-failure.exp: access_type=int: cond_eval=auto: multi-loc: continue
 FAIL: gdb.base/bp-cond-failure.exp: access_type=int: cond_eval=auto: single-loc: continue
 FAIL: gdb.base/bp-cond-failure.exp: access_type=long long: cond_eval=auto: multi-loc: continue
 FAIL: gdb.base/bp-cond-failure.exp: access_type=long long: cond_eval=auto: single-loc: continue

On GNU/Linux, we see:

 Breakpoint 2.1, foo () at .../src/gdb/testsuite/gdb.base/bp-cond-failure.c:21
 21        return 0;     /* Multi-location breakpoint here.  */
 (gdb) PASS: gdb.base/bp-cond-failure.exp: access_type=char: cond_eval=auto: multi-loc: continue

While on Cygwin, we see:

 Thread 1 "bp-cond-failure" hit Breakpoint 2.1, foo () at .../src/gdb/testsuite/gdb.base/bp-cond-failure.c:21
 21        return 0;     /* Multi-location breakpoint here.  */
 (gdb) FAIL: gdb.base/bp-cond-failure.exp: access_type=char: cond_eval=auto: multi-loc: continue

The difference is the "Thread 1" part in the beginning of the quoted
output.  It appears on Cygwin, but not on Linux.  That's because on
Cygwin, all inferiors are multi-threaded, because both Windows and the
Cygwin runtime spawn a few helper threads.

Fix this by adjusting the gdb.base/bp-cond-failure.exp testcase to
work with either single- or multi-threaded inferiors.

The testcase passes cleanly for me after this.

Approved-by: Kevin Buettner <kevinb@redhat.com>
Change-Id: I5ff11d06ac1748d044cef025f1e78b8f84ad3349
gdb/testsuite/gdb.base/bp-cond-failure.exp