public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] [gdb/testsuite] Fix gdb.threads/thread-specific-bp.exp on native-gdbserver
@ 2023-03-09 11:31 Tom de Vries
  0 siblings, 0 replies; only message in thread
From: Tom de Vries @ 2023-03-09 11:31 UTC (permalink / raw)
  To: gdb-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=89702edd933a5595557bcd9cc4a0dcc3262226d4

commit 89702edd933a5595557bcd9cc4a0dcc3262226d4
Author: Tom de Vries <tdevries@suse.de>
Date:   Thu Mar 9 12:31:26 2023 +0100

    [gdb/testsuite] Fix gdb.threads/thread-specific-bp.exp on native-gdbserver
    
    With test-case gdb.threads/thread-specific-bp.exp and target board
    native-gdbserver I run into:
    ...
    (gdb) PASS: gdb.threads/thread-specific-bp.exp: non_stop=off: thread 1 selected
    continue^M
    Continuing.^M
    Thread-specific breakpoint 3 deleted - thread 2 no longer in the thread list.^M
    ^M
    Thread 1 "thread-specific" hit Breakpoint 4, end () at \
      thread-specific-bp.c:29^M
    29      }^M
    (gdb) FAIL: gdb.threads/thread-specific-bp.exp: non_stop=off: \
      continue to end (timeout)
    ...
    
    The problem is that the test-case tries to match the "[Thread ... exited]"
    message which we do see with native testing:
    ...
    Continuing.^M
    [Thread 0x7ffff746e700 (LWP 7047) exited]^M
    Thread-specific breakpoint 3 deleted - thread 2 no longer in the thread list.^M
    ...
    
    The fact that the message is missing was reported as PR remote/30129.
    
    We could add a KFAIL for this, but the functionality the test-case is trying
    to test has nothing to do with the message, so it should pass.  I only added
    matching of the message in commit 2e5843d87c4 ("[gdb/testsuite] Fix
    gdb.threads/thread-specific-bp.exp") to handle a race, not realizing doing so
    broke testing on native-gdbserver.
    
    Fix this by matching the "Thread-specific breakpoint $decimal deleted" message
    instead.
    
    Tested on x86_64-linux.

Diff:
---
 gdb/testsuite/gdb.threads/thread-specific-bp.exp | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/gdb/testsuite/gdb.threads/thread-specific-bp.exp b/gdb/testsuite/gdb.threads/thread-specific-bp.exp
index cecf946f5c4..2d1c71a68e3 100644
--- a/gdb/testsuite/gdb.threads/thread-specific-bp.exp
+++ b/gdb/testsuite/gdb.threads/thread-specific-bp.exp
@@ -90,8 +90,14 @@ proc check_thread_specific_breakpoint {non_stop} {
     set test "continue to end"
     set thread_exited 0
     set prompt 0
+    set msg_re \
+	[join \
+	     [list \
+		  "Thread-specific breakpoint 3 deleted" \
+		  "-" \
+		  "thread 2 no longer in the thread list\\."]]
     gdb_test_multiple "$cmd" $test -lbl {
-	-re "(^|\r\n)\\\[Thread \[^\r\n\]* exited](?=\r\n)" {
+	-re "(^|\r\n)${msg_re}(?=\r\n)" {
 	    if { $prompt } {
 		pass $gdb_test_name
 	    } else {

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-03-09 11:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-09 11:31 [binutils-gdb] [gdb/testsuite] Fix gdb.threads/thread-specific-bp.exp on native-gdbserver Tom de Vries

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).