Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] Adjust gdb.base/bp-cond-failure.exp for Cygwin
@ 2025-06-06 16:52 Pedro Alves
  2025-06-06 17:21 ` Kevin Buettner
  0 siblings, 1 reply; 3+ messages in thread
From: Pedro Alves @ 2025-06-06 16:52 UTC (permalink / raw)
  To: gdb-patches

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.

Change-Id: I5ff11d06ac1748d044cef025f1e78b8f84ad3349
---
 gdb/testsuite/gdb.base/bp-cond-failure.exp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gdb/testsuite/gdb.base/bp-cond-failure.exp b/gdb/testsuite/gdb.base/bp-cond-failure.exp
index d6454549b48..4d03e7bc5fe 100644
--- a/gdb/testsuite/gdb.base/bp-cond-failure.exp
+++ b/gdb/testsuite/gdb.base/bp-cond-failure.exp
@@ -75,7 +75,7 @@ proc run_test { cond_eval access_type bpexpr nloc } {
 		 "Error in testing condition for breakpoint ${bp_num}.2:" \
 		 "Cannot access memory at address 0x0" \
 		 "" \
-		 "Breakpoint ${bp_num}.2, foo \\(c=49 ...\\) at \[^\r\n\]+:\[0-9\]+" \
+		 "(Thread \[^\r\n\]+ hit )?Breakpoint ${bp_num}.2, foo \\(c=49 ...\\) at \[^\r\n\]+:\[0-9\]+" \
 		 "${::decimal}\\s+\[^\r\n\]+ breakpoint here\\. \[^\r\n\]+"]
     } else {
 	gdb_test "continue" \
@@ -84,7 +84,7 @@ proc run_test { cond_eval access_type bpexpr nloc } {
 		 "Error in testing condition for breakpoint ${bp_num}:" \
 		 "Cannot access memory at address 0x0" \
 		 "" \
-		 "Breakpoint ${bp_num}, bar \\(\\) at \[^\r\n\]+:\[0-9\]+" \
+		 "(Thread \[^\r\n\]+ hit )?Breakpoint ${bp_num}, bar \\(\\) at \[^\r\n\]+:\[0-9\]+" \
 		 "${::decimal}\\s+\[^\r\n\]+ breakpoint here\\. \[^\r\n\]+"]
     }
 }

base-commit: e9770f7889e72297a179b5596894f4bbdb105224
-- 
2.49.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Adjust gdb.base/bp-cond-failure.exp for Cygwin
  2025-06-06 16:52 [PATCH] Adjust gdb.base/bp-cond-failure.exp for Cygwin Pedro Alves
@ 2025-06-06 17:21 ` Kevin Buettner
  2025-06-09 16:39   ` Pedro Alves
  0 siblings, 1 reply; 3+ messages in thread
From: Kevin Buettner @ 2025-06-06 17:21 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches

On Fri,  6 Jun 2025 17:52:19 +0100
Pedro Alves <pedro@palves.net> wrote:

> 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.

LGTM.

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Adjust gdb.base/bp-cond-failure.exp for Cygwin
  2025-06-06 17:21 ` Kevin Buettner
@ 2025-06-09 16:39   ` Pedro Alves
  0 siblings, 0 replies; 3+ messages in thread
From: Pedro Alves @ 2025-06-09 16:39 UTC (permalink / raw)
  To: Kevin Buettner; +Cc: gdb-patches

Hi!

On 2025-06-06 18:21, Kevin Buettner wrote:

> LGTM.
> 
> Approved-by: Kevin Buettner <kevinb@redhat.com>
> 

Thank you.  Pushed.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-06-09 16:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-06-06 16:52 [PATCH] Adjust gdb.base/bp-cond-failure.exp for Cygwin Pedro Alves
2025-06-06 17:21 ` Kevin Buettner
2025-06-09 16:39   ` Pedro Alves

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox