From: Pedro Alves <pedro@palves.net>
To: gdb-patches@sourceware.org
Subject: [PATCH 3/3] Adjust gdb.threads/step-over-trips-on-watchpoint.exp for Cygwin
Date: Tue, 5 May 2026 13:42:10 +0100 [thread overview]
Message-ID: <20260505124210.1450101-4-pedro@palves.net> (raw)
In-Reply-To: <20260505124210.1450101-1-pedro@palves.net>
gdb.threads/step-over-trips-on-watchpoint.exp fails on Cygwin with
many casding timeouts:
Running /home/alves/rocm/gdb/src/gdb/testsuite/gdb.threads/step-over-trips-on-watchpoint.exp ...
FAIL: gdb.threads/step-over-trips-on-watchpoint.exp: displaced=off: no thread-specific bp: step: continue to breakpoint: run to breakpoint in thread 2 (timeout)
FAIL: gdb.threads/step-over-trips-on-watchpoint.exp: displaced=off: no thread-specific bp: step: find addresses: clear watch_me (timeout)
FAIL: gdb.threads/step-over-trips-on-watchpoint.exp: displaced=off: no thread-specific bp: step: find addresses: watch watch_me (timeout)
FAIL: gdb.threads/step-over-trips-on-watchpoint.exp: displaced=off: no thread-specific bp: step: find addresses: continue to watchpoint (timeout)
FAIL: gdb.threads/step-over-trips-on-watchpoint.exp: displaced=off: no thread-specific bp: step: find addresses: find addresses (timeout)
FAIL: gdb.threads/step-over-trips-on-watchpoint.exp: displaced=off: no thread-specific bp: step: find addresses: delete all breakpoints, watchpoints, tracepoints, and catchpoints in delete_breakpoints (timeout)
... many more ...
The problem is that the testcase assumes that the program's child
thread is GDB thread ID 2. This commit removes that assumption. It
now passes cleanly on Cygwin.
Change-Id: Ief28e6ebf47abdcd2e71c5f2c70caf2d8753ef5e
commit-id: 7207e3c2
---
.../step-over-trips-on-watchpoint.exp | 22 ++++++++++++++++---
1 file changed, 19 insertions(+), 3 deletions(-)
diff --git a/gdb/testsuite/gdb.threads/step-over-trips-on-watchpoint.exp b/gdb/testsuite/gdb.threads/step-over-trips-on-watchpoint.exp
index 0a0c5edb97a..cb87f039c78 100644
--- a/gdb/testsuite/gdb.threads/step-over-trips-on-watchpoint.exp
+++ b/gdb/testsuite/gdb.threads/step-over-trips-on-watchpoint.exp
@@ -53,6 +53,20 @@ proc do_test { displaced with_bp } {
continue
}
+ gdb_breakpoint "child_function"
+
+ # Don't assume the testcase's child thread has GDB
+ # thread id 2. On some systems, like e.g.,
+ # Cygwin/Windows the OS/runtime spawns helper threads
+ # before the child thread is spawned.
+ set thr_child "unknown"
+ gdb_test_multiple "c" "run to child thread" {
+ -re -wrap "Thread ($::decimal) .*hit Breakpoint .*, child_function.*" {
+ set thr_child $expect_out(1,string)
+ pass $gdb_test_name
+ }
+ }
+
gdb_test_no_output "set displaced-stepping $displaced"
set line [gdb_get_line_number "set wait-thread breakpoint here"]
@@ -60,15 +74,17 @@ proc do_test { displaced with_bp } {
return
}
gdb_continue_to_breakpoint "run to wait-thread breakpoint"
- gdb_test "info threads" "\\\* 1 .* 2 .*" "info threads shows all threads"
+ gdb_test "info threads" "\\\* 1 .* $thr_child .*" \
+ "info threads shows all threads"
gdb_test_no_output "set scheduler-locking on"
delete_breakpoints
gdb_breakpoint [gdb_get_line_number "set breakpoint child here"]
- gdb_test "thread 2" "Switching to .*"
- gdb_continue_to_breakpoint "run to breakpoint in thread 2"
+ gdb_test "thread $thr_child" "Switching to .*" \
+ "switch to child thread"
+ gdb_continue_to_breakpoint "run to breakpoint in child thread"
set address_triggers_watch "<invalid>"
set after_address_triggers_watch "<invalid>"
--
2.53.0
prev parent reply other threads:[~2026-05-05 12:42 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-05 12:42 [PATCH 0/3] Adjust a few gdb.threads/ testcases " Pedro Alves
2026-05-05 12:42 ` [PATCH 1/3] Adjust gdb.threads/schedlock.exp " Pedro Alves
2026-05-05 12:42 ` [PATCH 2/3] Adjust gdb.threads/multiple-successive-infcall.exp " Pedro Alves
2026-05-05 12:42 ` Pedro Alves [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260505124210.1450101-4-pedro@palves.net \
--to=pedro@palves.net \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox