Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Subject: [committed][gdb/testsuite] Update infrun regexp in gdb.base/watch_thread_num.exp
Date: Tue, 11 May 2021 14:23:08 +0200	[thread overview]
Message-ID: <20210511122306.GA27946@delia> (raw)

Hi,

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.

Committed to trunk.

Thanks,
- Tom

[gdb/testsuite] Update infrun regexp in gdb.base/watch_thread_num.exp

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.

---
 gdb/testsuite/gdb.base/watch_thread_num.exp | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/gdb/testsuite/gdb.base/watch_thread_num.exp b/gdb/testsuite/gdb.base/watch_thread_num.exp
index 5e2a8ab3235..cbfc9560c2b 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

                 reply	other threads:[~2021-05-11 12:23 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20210511122306.GA27946@delia \
    --to=tdevries@suse.de \
    --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