From: Pedro Alves <pedro@codesourcery.com>
To: gdb-patches@sourceware.org
Cc: Marek Polacek <mpolacek@redhat.com>
Subject: Re: [PATCH] gdb.base/pr10179.exp: fix racy tests (PR testsuite/12649)
Date: Tue, 03 May 2011 17:50:00 -0000 [thread overview]
Message-ID: <201105031850.46894.pedro@codesourcery.com> (raw)
In-Reply-To: <4DC032F1.3030705@redhat.com>
On Tuesday 03 May 2011 17:53:05, Marek Polacek wrote:
> > For instance, break.exp doesn't appear to
> > need to match the whole question.
>
> In break.exp, there are no `gdb_test "delete breakpoints"'.
Right, I was refering its first test: "delete breakpoints".
It doesn't use gdb_test, but I didn't know what was doing
on within gdb_test itself that was causing the race you were
seeing.
> > Not sure the original PR 10179 had something to do with
> > deleting breakpoints, otherwise, there's a delete_breakpoints
> > procedure tests can use to do this.
>
> I think the best thing here is to make use of the `delete_breakpoints', since
> pr10179.exp addresses to test the `rbreak', not deleting the breakpoints.
> Replacing `gdb_test "delete breakpoints"' with delete_breakpoints also
> cures the races. IIUC, the race was caused by this part:
>
> "Delete all breakpoints.*" "y"
>
> Thus, when using read1(), we match the question "Delete all breakpoints?
> (y or n)" right after the "breakpoints" word. This will leave in the buffer
> "? (y or n)". The "(y or n)" matches and causes the "interactive prompt" fail.
You're assuming I already knew the fail was of "interactive prompt"
kind. :-) I didn't, but I now ran the test and see the failure. Seeing
this also helps review:
FAIL: gdb.base/pr10179.exp: delete breakpoints (got interactive prompt)
FAIL: gdb.base/pr10179.exp: rbreak pr10179-a.c:foo.*
FAIL: gdb.base/pr10179.exp: rbreak pr10179-a.c : .* (got interactive prompt)
Knowing all this, your original patch was indeed trivial.
>
> Here is a better patch. Tested with both read{,1}. OK now? Thanks,
>
> 2011-05-03 Marek Polacek <mpolacek@redhat.com>
>
> * gdb.base/pr10179.exp: Get rid of races using `delete_breakpoints'
> in place of `gdb_test "delete breakpoints"'. This eliminates two
> testcases.
Okay, thanks, this is even better.
--
Pedro Alves
next prev parent reply other threads:[~2011-05-03 17:50 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-02 17:18 Marek Polacek
2011-05-02 19:24 ` Pedro Alves
2011-05-03 16:53 ` Marek Polacek
2011-05-03 17:50 ` Pedro Alves [this message]
2011-05-03 18:05 ` Marek Polacek
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=201105031850.46894.pedro@codesourcery.com \
--to=pedro@codesourcery.com \
--cc=gdb-patches@sourceware.org \
--cc=mpolacek@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