This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[patch] Fix racy FAILs #2 due to "read1" [Re: [PATCH] add -s option to make -break-insert support dprintf]
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: Hui Zhu <teawater at gmail dot com>
- Cc: Eli Zaretskii <eliz at gnu dot org>, tromey at redhat dot com, palves at redhat dot com, hui_zhu at mentor dot com, gdb-patches at sourceware dot org, marc dot khouzam at ericsson dot com
- Date: Thu, 23 May 2013 16:03:32 +0200
- Subject: [patch] Fix racy FAILs #2 due to "read1" [Re: [PATCH] add -s option to make -break-insert support dprintf]
- References: <CANFwon3meTbHqy-kfibR6XiJpkZdS3348am2wP6i9Dbz_sowLg at mail dot gmail dot com> <87ehdehnc9 dot fsf at fleche dot redhat dot com> <CANFwon0NgSTcX+iuPsSPWU_t6O1UebETRrGvG7ghcAwC-MXTRA at mail dot gmail dot com> <838v3masbd dot fsf at gnu dot org> <CANFwon0cXTz+X2A_3Fz1kuc40H64siGYGtO6CRKyGeMw88ca2Q at mail dot gmail dot com> <834ne6an8h dot fsf at gnu dot org> <CANFwon0fMc6efT!tEVn_WLQ+8EaCzQ6f2AJH22jPg1RHyhnM2eg at mail dot gmail dot com> <CANFwon2V92hrOOvum+g5o+AFKLwNn+PsrKtskjdWJBoq95H_vg at mail dot gmail dot com> <83bo85wt9u dot fsf at gnu dot org> <CANFwon0zgYPbBdj4U-x_OqVUtjg35WAmMp1Gmyy6b=i6Ne-9qg at mail dot gmail dot com>
On Tue, 21 May 2013 06:24:16 +0200, Hui Zhu wrote:
> Checked in http://sourceware.org/ml/gdb-cvs/2013-05/msg00193.html
I got another racy FAIL today:
FAIL: gdb.mi/mi-dprintf.exp: mi info dprintf second time
I found I forgot to run the "read1" reproducer with gdbserver yesterday, which
revealed more races.
I will check it in today.
Regards,
Jan
gdb/testsuite/
2013-05-23 Jan Kratochvil <jan.kratochvil@redhat.com>
PR testsuite/12649
* gdb.mi/mi-dprintf.exp (mi_continue_dprintf) (mi 2nd dprintf): Replace
$mi_gdb_prompt expectation by mi_expect_stop.
(mi 1st dprintf, agent, mi 2nd dprintf, agent)
(mi info dprintf second time): Replace them by mi_send_resuming_command
and mi_expect_stop.
diff --git a/gdb/testsuite/gdb.mi/mi-dprintf.exp b/gdb/testsuite/gdb.mi/mi-dprintf.exp
index ea8b3a8..3509963 100644
--- a/gdb/testsuite/gdb.mi/mi-dprintf.exp
+++ b/gdb/testsuite/gdb.mi/mi-dprintf.exp
@@ -83,7 +83,7 @@ proc mi_continue_dprintf {args} {
set msg "mi 2nd dprintf"
mi_send_resuming_command "exec-continue" "$msg continue"
gdb_expect {
- -re ".*At foo entry.*arg=1235, g=2222.*$mi_gdb_prompt$" {
+ -re ".*At foo entry.*arg=1235, g=2222" {
pass $msg
}
-re ".*$mi_gdb_prompt$" {
@@ -93,6 +93,7 @@ proc mi_continue_dprintf {args} {
fail $msg
}
}
+ mi_expect_stop ".*" ".*" ".*" ".*" ".*" "" "$msg 2nd stop"
}
}
@@ -135,11 +136,28 @@ gdb_expect {
if $target_can_dprintf {
mi_run_cmd
- mi_gdb_test "continue" ".*breakpoint-hit.*func=\"foo\".*" "mi 1st dprintf, agent"
+ mi_expect_stop ".*" ".*" ".*" ".*" ".*" "" "mi expect stop"
- mi_gdb_test "continue" ".*breakpoint-hit.*func=\"foo\".*" "mi 2nd dprintf, agent"
+ mi_send_resuming_command "exec-continue" "mi 1st dprintf continue, agent"
+ mi_expect_stop ".*" "foo" ".*" ".*" ".*" "" "mi 1st dprintf, agent"
- mi_gdb_test "6-break-info" ".*modified.*" "mi info dprintf second time"
+ mi_send_resuming_command "exec-continue" "mi 2nd dprintf continue, agent"
+
+ # The =breakpoint-modified text is a part of the "-exec-continue" output.
+ set msg "mi info dprintf second time"
+ gdb_expect {
+ -re "=breakpoint-modified," {
+ pass $msg
+ }
+ -re ".*$mi_gdb_prompt$" {
+ fail "$msg"
+ }
+ timeout {
+ fail "$msg"
+ }
+ }
+
+ mi_expect_stop ".*" "foo" ".*" ".*" ".*" "" "mi 2nd dprintf, agent"
}
mi_gdb_test "set dprintf-style foobar" ".*error.*" "mi set dprintf style to an unrecognized type"