Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Franco de Carvalho <pedromfc@linux.ibm.com>
To: Pedro Alves <palves@redhat.com>,
	Joel Brobecker <brobecker@adacore.com>,
	       gdb-patches@sourceware.org
Subject: Re: [PATCH] Fix testsuite hangs when gdb_test_multiple body errors out (Re: GDB 8.2.90 available for testing)
Date: Mon, 25 Mar 2019 19:43:00 -0000	[thread overview]
Message-ID: <8736napwo9.fsf@linux.vnet.ibm.com> (raw)
In-Reply-To: <a2c7a981-4b23-45c2-74f0-64f16bcc5981@redhat.com>

Pedro Alves <palves@redhat.com> writes:

> On 03/22/2019 08:44 PM, Pedro Franco de Carvalho wrote:
>> Pedro Alves <palves@redhat.com> writes:
>> 
>> Hello,
>> 
>>> I spent a while trying to fix this, and I came up with the patch below.
>>>
>>> WDYT?
>> 
>> Makes sense to me.
>> 
>>> So this commit solves this by appending an "eof" with an empty
>>> spawn_id list, so that it won't ever match.
>> 
>> This is a clever solution, but just to be sure, can we actually rely on
>> this behavior when the list is empty?  This did work when I tested it,
>> but could some Expect version conceivably do something else like
>> returning an error when parsing a body with a "-i" that uses an empty
>> list?
>
> I'd think not, but I can't predict the future so I can't be sure,
> of course.
>
> I looked at expect's source code a little and (in my untrained eyes)
> it didn't seem like there would be a reason for it not to work,
> since -i's argument is just read as a list.  I think a reasonable use
> case would be to allow an empty variable as spawn id, so that
> some patterns would be disabled depending on the variable being
> empty or not (e.g., "-i $my_spawn_id_if_any").
>
> When I thought of this trick, I was going to use an indirect
> spawn id:
>
>  The -i flag may also name a global variable in which case the variable
>  is read for a list of spawn ids. The variable is reread whenever it changes.
>  This provides a way of changing the I/O source while the command is in
>  execution. Spawn ids provided this way are called "indirect" spawn ids. 
>
> and having that global variable be an empty list.  That came to mind
> since I had experience with using indirect spawn ids in another case
> when I needed an empty spawn id list:
>
>     # Use an indirect spawn id list, and remove the inferior spawn id
>     # from the expected output as soon as it matches, in case
>     # $inferior_pattern happens to be a prefix of the resulting full
>     # gdb pattern below (e.g., "\r\n").
>     global gdb_test_stdio_spawn_id_list
>     set gdb_test_stdio_spawn_id_list "$inferior_spawn_id"
>
> And then I realized the to-the-point '-i ""' would work just as well.
>
> I think that if this stops working, likely either empty variable or
> indirect spawn id pointing at an empty list would still keep working,
> so we would likely be able to switch to one of those.

Ok! Makes sense to me, thanks for the explanation.

> Maybe meanwhile, we could ask on the dejagnu list what's the purpose
> of this picking one of eof/timeout/default as an error block, see if
> that could be removed.  I'd guess that dejagnu would change faster
> than expect here, or maybe I should say, less slowly.  :-)

I can do that if you want, and let them know about the comment tokens
affecting the error block selection too.

>
> Thanks,
> Pedro Alves

Thanks for fixing this!

--
Pedro Franco de Carvalho


  reply	other threads:[~2019-03-25 19:43 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-27  5:51 GDB 8.2.90 available for testing Joel Brobecker
2019-02-27 22:05 ` Jim Wilson
2019-03-04 11:15   ` Andrew Burgess
2019-03-04 13:57     ` Alan Hayward
2019-03-04 20:00     ` Jim Wilson
2019-02-28 18:31 ` MinGW build of GDB 8.2.90 (was: GDB 8.2.90 available for testing) Eli Zaretskii
2019-02-28 18:55   ` MinGW build of GDB 8.2.90 Sergio Durigan Junior
2019-02-28 19:06     ` LRN
2019-02-28 19:45     ` Eli Zaretskii
2019-02-28 20:17       ` Sergio Durigan Junior
2019-02-28 20:29         ` Eli Zaretskii
2019-02-28 20:37           ` Sergio Durigan Junior
2019-02-28 18:34 ` GDB 8.2.90 available for testing Eli Zaretskii
2019-03-01 16:35   ` Pedro Alves
2019-03-01 18:50     ` Tom Tromey
2019-03-07 22:44     ` Tom Tromey
2019-03-08  7:46       ` Eli Zaretskii
2019-03-08 20:57         ` Tom Tromey
2019-03-09  6:13           ` Eli Zaretskii
2019-03-14 17:32             ` Tom Tromey
2019-03-14 19:49               ` Eli Zaretskii
2019-03-15 12:55                 ` Tom Tromey
2019-03-17 15:56               ` Eli Zaretskii
2019-03-17 17:31                 ` Tom Tromey
2019-03-17 18:36                   ` Eli Zaretskii
2019-03-18 14:13                     ` Tom Tromey
2019-03-18 18:08                       ` Eli Zaretskii
2019-03-07 17:42 ` Pedro Franco de Carvalho
     [not found]   ` <4d855905-32ce-ba4b-72f5-037f1796b37e@redhat.com>
2019-03-22 14:42     ` [PATCH] Fix testsuite hangs when gdb_test_multiple body errors out (Re: GDB 8.2.90 available for testing) Simon Marchi
2019-03-25 13:23       ` Pedro Alves
2019-03-22 20:44     ` Pedro Franco de Carvalho
2019-03-25 13:21       ` Pedro Alves
2019-03-25 19:43         ` Pedro Franco de Carvalho [this message]
2019-03-26 18:58           ` Pedro Alves
2019-03-26 21:01             ` Pedro Franco de Carvalho
2019-03-28 17:36               ` Joel Brobecker

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=8736napwo9.fsf@linux.vnet.ibm.com \
    --to=pedromfc@linux.ibm.com \
    --cc=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@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