Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Tom Tromey <tromey@redhat.com>
Cc: gdb-patches@sourceware.org, Marek Polacek <mpolacek@redhat.com>
Subject: [patch] testsuite: MI: racy results in async mode #2
Date: Sat, 29 Oct 2011 10:36:00 -0000	[thread overview]
Message-ID: <20111029100900.GA5767@host1.jankratochvil.net> (raw)
In-Reply-To: <20111028083256.GA8281@host1.jankratochvil.net>

On Fri, 28 Oct 2011 10:32:56 +0200, Jan Kratochvil wrote:
> > Jan> 2011-10-27  Jan Kratochvil  <jan.kratochvil@redhat.com>
> > Jan> 	* lib/mi-support.exp (breakpoint_re): Suppress match reporting.
> > Jan> 	(mi_gdb_test): Import globals thread_selected_re
> > Jan> 	and breakpoint_re.  Expect them optionally at the regex start.
[...]
> Checked in:
> 	http://sourceware.org/ml/gdb-cvs/2011-10/msg00202.html

Unfortunately it still does not work (but it is no longer reproducible by the
testsuite/12649 "read1" way).

-*stopped,reason="breakpoint-hit",disp="del",bkptno="1",frame={addr="0x080485fd",func="main",args=[{name="argc",value="1"},{name="argv",value="0xffffd1e4"}],file="gdb/testsuite/gdb.mi/non-stop.c",fullname="gdb/testsuite/gdb.mi/non-stop.c",line="86"},thread-id="1",stopped-threads=["1"],core="5"^M
+*stopped,reason="breakpoint-hit",disp="del",bkptno="1",frame={addr="0x080485fd",func="main",args=[{name="argc",value="1"},{name="argv",value="0xffffd1c4"}],file="gdb/testsuite/gdb.mi/non-stop.c",fullname="gdb/testsuite/gdb.mi/non-stop.c",line="86"},thread-id="1",stopped-threads=["1"],core="0"^M
+=breakpoint-deleted,id="1"^M
 PASS: gdb.mi/mi-nonstop.exp: mi runto main
 Expecting: 222\^done,bkpt={number="2",type="breakpoint",disp="keep",enabled="y",addr=".*",func="break_at_me",file=".*",fullname=".*",line=".*",times="0",original-location=".*"}
 Expecting: ^(222-break-insert break_at_me[^M
 ]+)?(222\^done,bkpt={number="2",type="breakpoint",disp="keep",enabled="y",addr=".*",func="break_at_me",file=".*",fullname=".*",line=".*",times="0",original-location=".*"}[^M
 ]+[(]gdb[)] ^M
 [ ]*)
 222-break-insert break_at_me^M
-=breakpoint-deleted,id="1"^M
 222^done,bkpt={number="2",type="breakpoint",disp="keep",enabled="y",addr="0x08048537",func="break_at_me",file="gdb/testsuite/gdb.mi/non-stop.c",fullname="gdb/testsuite/gdb.mi/non-stop.c",line="41",times="0",original-location="break_at_me"}^M
 (gdb) ^M
-FAIL: gdb.mi/mi-nonstop.exp: breakpoint at marker
+PASS: gdb.mi/mi-nonstop.exp: breakpoint at marker

Therefore proposing the attached way.

No regressions on {x86_64,x86_64-m32,i686}-fedora16pre-linux-gnu and with gdbserver.


Thanks,
Jan


gdb/testsuite/
2011-10-29  Jan Kratochvil  <jan.kratochvil@redhat.com>

	Fix racy FAILs.
	* lib/mi-support.exp (mi_gdb_test): Replace thread_selected_re and
	breakpoint_re globals import by async.  Set string_regex to .* for
	async.  Remove the optional thread_selected_re and breakpoint_re
	globals expectations.

--- a/gdb/testsuite/lib/mi-support.exp
+++ b/gdb/testsuite/lib/mi-support.exp
@@ -576,7 +576,7 @@ proc mi_gdb_test { args } {
     global verbose
     global mi_gdb_prompt
     global GDB expect_out
-    global inferior_exited_re thread_selected_re breakpoint_re
+    global inferior_exited_re async
     upvar timeout timeout
 
     set command [lindex $args 0]
@@ -651,6 +651,11 @@ proc mi_gdb_test { args } {
 	    set tmt 60;
 	}
     }
+    if {$async} {
+	# With $prompt_re "" there may come arbitrary asynchronous response
+	# from the previous command, before or after $string_regex.
+	set string_regex ".*"
+    }
     verbose -log "Expecting: ^($string_regex\[\r\n\]+)?($pattern\[\r\n\]+$mi_gdb_prompt\[ \]*)"
     gdb_expect $tmt {
 	 -re "\\*\\*\\* DOSEXIT code.*" {
@@ -668,7 +673,7 @@ proc mi_gdb_test { args } {
 	    gdb_start
 	    set result -1
 	}
-	 -re "^(?:$thread_selected_re|$breakpoint_re)*($string_regex\[\r\n\]+)?($pattern\[\r\n\]+$mi_gdb_prompt\[ \]*)" {
+	 -re "^($string_regex\[\r\n\]+)?($pattern\[\r\n\]+$mi_gdb_prompt\[ \]*)" {
 	    # At this point, $expect_out(1,string) is the MI input command.
 	    # and $expect_out(2,string) is the MI output command.
 	    # If $expect_out(1,string) is "", then there was no MI input command here.


  reply	other threads:[~2011-10-29 10:09 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-27 10:16 [patch] testsuite: MI: racy results in async mode (PR testsuite/12649) Jan Kratochvil
2011-10-27 16:49 ` Tom Tromey
2011-10-28  8:51   ` [commit] " Jan Kratochvil
2011-10-29 10:36     ` Jan Kratochvil [this message]
2011-10-29 12:10       ` [patch] testsuite: MI: racy results in async mode #2 Marek Polacek
2011-10-29 12:15         ` Marek Polacek
2011-10-29 15:09           ` Jan Kratochvil
2011-10-29 16:01             ` Marek Polacek
2011-11-01 16:20       ` Tom Tromey
2011-11-01 20:01         ` [commit] " Jan Kratochvil
2011-11-01 16:26       ` Marek Polacek
2011-11-01 15:40 ` [patch] testsuite: MI: racy results in async mode (PR testsuite/12649) Doug Evans
2011-11-01 16:26   ` Jan Kratochvil
2011-11-01 18:55   ` Tom Tromey
2011-11-01 22:46     ` Doug Evans
2011-11-02 17:31       ` Tom Tromey

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=20111029100900.GA5767@host1.jankratochvil.net \
    --to=jan.kratochvil@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=mpolacek@redhat.com \
    --cc=tromey@redhat.com \
    /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