aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2021-05-11 14:22:11 +0200
committerTom de Vries <tdevries@suse.de>2021-05-11 14:22:11 +0200
commit5048549af94ccac1ac76de35120c2e85c44d3391 (patch)
tree66eca0804d5e04f283beea3831b85178d3a1a2cb
parent2302f963547cd43c2d3b97491d5ef16be6b783a5 (diff)
downloadgdb-5048549af94ccac1ac76de35120c2e85c44d3391.zip
gdb-5048549af94ccac1ac76de35120c2e85c44d3391.tar.gz
gdb-5048549af94ccac1ac76de35120c2e85c44d3391.tar.bz2
[gdb/testsuite] Update infrun regexp in gdb.base/watch_thread_num.exp
The test-case gdb.base/watch_thread_num.exp contains an infrun regexp: ... -re "infrun:" { ... which doesn't trigger because: - the test-case doesn't contain "set debug infrun 1", and - if we hack the test-case to add this, the regexp doesn't match because "[infrun] " is printed instead. Make the test pass with "set debug infrun 1" and add the setting commented out. Tested on x86_64-linux. gdb/testsuite/ChangeLog: 2021-05-11 Tom de Vries <tdevries@suse.de> * gdb.base/watch_thread_num.exp: Fix "set debug infrun 1" FAILs. Add "set debug infrun 1" commented out.
-rw-r--r--gdb/testsuite/ChangeLog5
-rw-r--r--gdb/testsuite/gdb.base/watch_thread_num.exp20
2 files changed, 21 insertions, 4 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index beee49b..a1cd485 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,10 @@
2021-05-11 Tom de Vries <tdevries@suse.de>
+ * gdb.base/watch_thread_num.exp: Fix "set debug infrun 1" FAILs.
+ Add "set debug infrun 1" commented out.
+
+2021-05-11 Tom de Vries <tdevries@suse.de>
+
* gdb.base/gdb-sigterm.exp: Fix exp_continue regexp.
2021-05-11 Bhuvanendra Kumar <Bhuvanendra.KumarN@amd.com>
diff --git a/gdb/testsuite/gdb.base/watch_thread_num.exp b/gdb/testsuite/gdb.base/watch_thread_num.exp
index 5e2a8ab..cbfc956 100644
--- a/gdb/testsuite/gdb.base/watch_thread_num.exp
+++ b/gdb/testsuite/gdb.base/watch_thread_num.exp
@@ -81,18 +81,30 @@ gdb_test "info breakpoint \$bpnum" \
"stop only in thread $thread_num" \
"info breakpoint shows watchpoint is thread-specific"
+# Uncomment to see additional information.
+#gdb_test "set debug infrun 1"
+
for {set i 1} {$i <= 5} {incr i} {
set watchpoint "Watchpoint triggered iteration $i"
set check "Check thread that triggered iteration $i"
set test $watchpoint
+ set seen_watchpoint 0
gdb_test_multiple "continue" $test {
- -re "infrun:" {
- # Avoid timeouts when debugging GDB.
+ -re "Hardware access \\(read/write\\) watchpoint .*: shared_var" {
+ set seen_watchpoint 1
exp_continue
}
- -re "Hardware access \\(read/write\\) watchpoint .*: shared_var.*$gdb_prompt $" {
- pass $test
+ -re "$gdb_prompt " {
+ if { $seen_watchpoint } {
+ pass $test
+ } else {
+ fail $test
+ }
+ }
+ -re "\\\[infrun\\\] " {
+ # Avoid timeouts when debugging GDB.
+ exp_continue
}
}
gdb_test "thread" ".*Current thread is $thread_num .*" $check