This is the mail archive of the gdb-cvs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] Fix racy test in gdb.threads/thread-specific-bp.exp


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

commit 55a98976756cb2df83ac8f8e9799331fbcc4f669
Author: Yao Qi <yao.qi@linaro.org>
Date:   Wed Apr 5 14:46:13 2017 +0100

    Fix racy test in gdb.threads/thread-specific-bp.exp
    
    I see the following test fail from time to time, due to the racy test
    in gdb.threads/thread-specific-bp.exp.
    
    continue -a^M
    Continuing.^M
    ^M
    Thread 1 "thread-specific" hit Breakpoint 4, end () at binutils-gdb/gdb/testsuite/gdb.threads/thread-specific-bp.c:29^M
    29      }^M
    (gdb) [Thread 0x40322460 (LWP 12950) exited]^M
    Thread-specific breakpoint 3 deleted - thread 2 no longer in the thread list.^M
    FAIL: gdb.threads/thread-specific-bp.exp: non-stop: continue to end (timeout)
    
    This patch changes gdb_test to gdb_test_multiple to match prompt only
    instead of both prompt and anchor.
    
    gdb/testsuite:
    
    2017-04-05  Yao Qi  <yao.qi@linaro.org>
    
    	* gdb.threads/thread-specific-bp.exp (check_thread_specific_breakpoint):
    	Use gdb_test_multiple, and don't match anchor.

Diff:
---
 gdb/ChangeLog                                    | 5 +++++
 gdb/testsuite/gdb.threads/thread-specific-bp.exp | 9 ++++++---
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index abd6dd9..92f5b22 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2017-04-05  Yao Qi  <yao.qi@linaro.org>
+
+	* gdb.threads/thread-specific-bp.exp (check_thread_specific_breakpoint):
+	Use gdb_test_multiple, and don't match anchor.
+
 2017-04-05  Pedro Alves  <palves@redhat.com>
 
 	* MAINTAINERS (Global Maintainers): Add Simon Marchi.
diff --git a/gdb/testsuite/gdb.threads/thread-specific-bp.exp b/gdb/testsuite/gdb.threads/thread-specific-bp.exp
index bdf12f8..0c7e9fd 100644
--- a/gdb/testsuite/gdb.threads/thread-specific-bp.exp
+++ b/gdb/testsuite/gdb.threads/thread-specific-bp.exp
@@ -87,9 +87,12 @@ proc check_thread_specific_breakpoint {mode} {
 	} else {
 	    set cmd "continue"
 	}
-	gdb_test "$cmd" \
-	    "Breakpoint .* end .* at .*" \
-	    "continue to end"
+	set test "continue to end"
+	gdb_test_multiple "$cmd" $test {
+	    -re "Breakpoint .* end .* at .*\r\n$gdb_prompt " {
+		pass $test
+	    }
+	}
 
 	set test "thread-specific breakpoint was deleted"
 	gdb_test_multiple "info breakpoint" $test {


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]