Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Michael Snyder <msnyder@vmware.com>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: [resubmit] gdb.base, r*.exp thru w*.exp
Date: Thu, 20 May 2010 21:57:00 -0000	[thread overview]
Message-ID: <4BF5AE60.1080500@vmware.com> (raw)
In-Reply-To: <20100520214614.GA11229@host0.dyn.jankratochvil.net>

Jan Kratochvil wrote:
> On Thu, 20 May 2010 23:37:49 +0200, Michael Snyder wrote:
>> Jan Kratochvil wrote:
>>> On Thu, 20 May 2010 22:29:47 +0200, Michael Snyder wrote:
>>>> +	-re ".*in main after func1.*$gdb_prompt $" {
>>> Sorry for not a complete review but for this case there should be:
>>>
>>> 	-re ".*in main after func1.*\r\n$gdb_prompt $" {
>>>
>>> or lib/gdb.exp proc gdb_test is using:
>>>
>>> 	-re ".*in main after func1.*[\r\n]+$gdb_prompt $" {
>>>
>>> as just "$gdb_prompt $" is needlessly  weak in practical cases causing false
>>> positives.
>> Thanks for the review -- but I don't follow you.
>>
>> What is it about this particular case that you think requires
>> disambiguating?  Or are you saying this in general?
> 
> It was said in general.
> 
> There could be for example output
> 
> (gdb) return
> Make func1 return now? (y or n) y
> #0  main () at ./gdb.base/return.c:31
> 31        printf("in debugger (gdb) after func1\n");
> (gdb) 
> 
> and if expect would read(2) just the part 
> 
> (gdb) return
> Make func1 return now? (y or n) y
> #0  main () at ./gdb.base/return.c:31
> 31        printf("in debugger (gdb) 
> 
> before the next part of input arrives it can have a false termination of
> waiting on the prompt.
> 
> That can happens for example for "info set" where the output contains text:
> prompt:  Gdb's prompt is "(gdb) ".
> 
> (In this specific testcase there is no "(gdb) " contained in the output so it
> cannot have a false positive.  But examining all the testcases would be
> difficult.  Also I understand even "\r\n(gdb) " can have a false positive on
> some random output.)

Well, this is a very common and ancient idiom that is used
everywhere throughout the test suite.

You have to assume that we don't care about anything between
the ".*" and the "$gdb_prompt $".  If we do, the test is wrong,
but if it consumes more output than it was meant to, the
following tests will fail.


  reply	other threads:[~2010-05-20 21:49 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 [this message]
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
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=4BF5AE60.1080500@vmware.com \
    --to=msnyder@vmware.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jan.kratochvil@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