From: Daniel Jacobowitz <dan@codesourcery.com>
To: Frederic Riss <frederic.riss@gmail.com>
Cc: Michael Snyder <msnyder@vmware.com>,
"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: [resubmit] gdb.base, r*.exp thru w*.exp
Date: Tue, 15 Jun 2010 16:19:00 -0000 [thread overview]
Message-ID: <20100615161912.GA7975@caradoc.them.org> (raw)
In-Reply-To: <AANLkTimG38HTcyRN2hr5If0lcUCHY_84j3V_JmEne-Ha@mail.gmail.com>
On Tue, Jun 15, 2010 at 05:55:48PM +0200, Frederic Riss wrote:
> On 20 May 2010 22:29, Michael Snyder <msnyder@vmware.com> wrote:
> > Index: setshow.exp
> > --- setshow.exp 5 May 2010 18:06:58 -0000 ? ? ? 1.14
> > +++ setshow.exp 20 May 2010 20:24:11 -0000
> > @@ -54,27 +54,25 @@ if { ![runto_main] } {
> > ?#test set annotate 2
> > -send_gdb "set annotate 2\n"
> > -gdb_expect {
> > - ? ? ? -re ".*\032\032pre-prompt.*$gdb_prompt .*\032\032prompt.*$" \
> > - ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? { pass "set annotate 2" }
> > - ? ? ? timeout ? ? ? ? ? ? ? ? { fail "(timeout) set annotate 2" }
> > +
> > +gdb_test_multiple "set annotate 2" "set annotate 2" {
> > + ? ?-re ".*\032\032pre-prompt.*$gdb_prompt .*\032\032prompt.*$" {
> > + ? ?pass "set annotate 2"
> > ? ? }
> > +}
>
> Before that commit, the test seemed 100% reliable.
This hunk unfortunately exhibits a common subtle pitfall :-(
You can use bare gdb_expect with a string that contains gdb_prompt not
at the end, or contains more than one gdb_prompt, although it's a bit
tricky. You can't do the same with gdb_test_multiple, because it has
patterns like ".*$gdb_prompt $" -> FAIL. If the output comes out
buffered in such a way that the prompt is written separately from the
post-prompt text, this will match before GDB is done printing output.
--
Daniel Jacobowitz
CodeSourcery
next prev parent reply other threads:[~2010-06-15 16:19 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-20 21:01 Michael Snyder
2010-05-20 21:07 ` Joel Brobecker
2010-05-20 21:14 ` Michael Snyder
2010-05-20 21:28 ` Jan Kratochvil
2010-05-20 21:46 ` Michael Snyder
2010-05-20 21:47 ` Jan Kratochvil
2010-05-20 21:57 ` Michael Snyder
2010-05-20 22:02 ` Jan Kratochvil
2010-05-20 22:07 ` Michael Snyder
2010-05-20 22:07 ` Joel Brobecker
2010-05-20 22:21 ` Michael Snyder
2010-06-15 15:56 ` Frederic Riss
2010-06-15 16:19 ` Daniel Jacobowitz [this message]
2010-06-16 8:12 ` Frederic Riss
2010-06-18 0:23 ` Michael Snyder
2010-06-18 7:30 ` Frederic Riss
2010-06-15 17:44 ` Michael Snyder
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=20100615161912.GA7975@caradoc.them.org \
--to=dan@codesourcery.com \
--cc=frederic.riss@gmail.com \
--cc=gdb-patches@sourceware.org \
--cc=msnyder@vmware.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