* [PATCH] Fix racy test in gdb.threads/thread-specific-bp.exp
@ 2017-04-03 21:06 Yao Qi
2017-04-04 1:49 ` Simon Marchi
0 siblings, 1 reply; 4+ messages in thread
From: Yao Qi @ 2017-04-03 21:06 UTC (permalink / raw)
To: gdb-patches
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-03 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.
---
gdb/testsuite/gdb.threads/thread-specific-bp.exp | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/gdb/testsuite/gdb.threads/thread-specific-bp.exp b/gdb/testsuite/gdb.threads/thread-specific-bp.exp
index bdf12f8..a652e9c 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\]*)\r\n$gdb_prompt " {
+ pass $test
+ }
+ }
set test "thread-specific breakpoint was deleted"
gdb_test_multiple "info breakpoint" $test {
--
1.9.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Fix racy test in gdb.threads/thread-specific-bp.exp
2017-04-03 21:06 [PATCH] Fix racy test in gdb.threads/thread-specific-bp.exp Yao Qi
@ 2017-04-04 1:49 ` Simon Marchi
2017-04-04 8:08 ` Yao Qi
0 siblings, 1 reply; 4+ messages in thread
From: Simon Marchi @ 2017-04-04 1:49 UTC (permalink / raw)
To: Yao Qi; +Cc: gdb-patches
On 2017-04-03 17:06, Yao Qi wrote:
> diff --git a/gdb/testsuite/gdb.threads/thread-specific-bp.exp
> b/gdb/testsuite/gdb.threads/thread-specific-bp.exp
> index bdf12f8..a652e9c 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\]*)\r\n$gdb_prompt " {
I am not sure I understand what this is supposed to match. First are
the parenthesis useful, since we're not using any capture group? Then,
.* followed with [^\r\n]* doesn't seem useful, since the .* can just
match anything the [^\r\n]* doesn't match.
What about just this?
set test "continue to end"
gdb_test_multiple "$cmd" $test {
-re "hit Breakpoint $decimal, end \\(\\) at.*$gdb_prompt " {
pass $test
}
}
Simon
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Fix racy test in gdb.threads/thread-specific-bp.exp
2017-04-04 1:49 ` Simon Marchi
@ 2017-04-04 8:08 ` Yao Qi
2017-04-04 13:37 ` Simon Marchi
0 siblings, 1 reply; 4+ messages in thread
From: Yao Qi @ 2017-04-04 8:08 UTC (permalink / raw)
To: Simon Marchi; +Cc: gdb-patches
Simon Marchi <simon.marchi@polymtl.ca> writes:
> I am not sure I understand what this is supposed to match. First are
> the parenthesis useful, since we're not using any capture group?
I don't capture anything.
> Then, .* followed with [^\r\n]* doesn't seem useful, since the .* can
> just match anything the [^\r\n]* doesn't match.
>
> What about just this?
>
> set test "continue to end"
> gdb_test_multiple "$cmd" $test {
> -re "hit Breakpoint $decimal, end \\(\\) at.*$gdb_prompt " {
We should still keep \r\n before $gdb_prompt.
> pass $test
> }
> }
The original pattern is "end .* at", so I want to leave it there, and
change it to
set test "continue to end"
gdb_test_multiple "$cmd" $test {
-re "Breakpoint .* end .* at .*\r\n$gdb_prompt " {
pass $test
}
}
--
Yao (齐尧)
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Fix racy test in gdb.threads/thread-specific-bp.exp
2017-04-04 8:08 ` Yao Qi
@ 2017-04-04 13:37 ` Simon Marchi
0 siblings, 0 replies; 4+ messages in thread
From: Simon Marchi @ 2017-04-04 13:37 UTC (permalink / raw)
To: Yao Qi; +Cc: gdb-patches
On 2017-04-04 04:08, Yao Qi wrote:
>> Then, .* followed with [^\r\n]* doesn't seem useful, since the .* can
>> just match anything the [^\r\n]* doesn't match.
>>
>> What about just this?
>>
>> set test "continue to end"
>> gdb_test_multiple "$cmd" $test {
>> -re "hit Breakpoint $decimal, end \\(\\) at.*$gdb_prompt " {
>
> We should still keep \r\n before $gdb_prompt.
>
>> pass $test
>> }
>> }
>
> The original pattern is "end .* at", so I want to leave it there, and
> change it to
>
> set test "continue to end"
> gdb_test_multiple "$cmd" $test {
> -re "Breakpoint .* end .* at .*\r\n$gdb_prompt " {
> pass $test
> }
> }
LGTM.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-04-04 13:37 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-03 21:06 [PATCH] Fix racy test in gdb.threads/thread-specific-bp.exp Yao Qi
2017-04-04 1:49 ` Simon Marchi
2017-04-04 8:08 ` Yao Qi
2017-04-04 13:37 ` Simon Marchi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox