Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Simon Marchi <simon.marchi@polymtl.ca>
Cc: Simon Marchi <simon.marchi@ericsson.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH] Don't send queries to the MI interpreter
Date: Fri, 10 Feb 2017 17:44:00 -0000	[thread overview]
Message-ID: <85ae4ad9-acdc-c9ba-6606-a7ac2abc7e2e@redhat.com> (raw)
In-Reply-To: <bc3b0ad5-992e-5f92-cc8d-9e4591aa2e0a@redhat.com>

On 02/10/2017 05:12 PM, Pedro Alves wrote:

> I've run into these queries deep down in the record layer
> in the past, and wondered about getting rid of them.
> 
> Particularly this one:
> 
> 	  if (!yquery (_("Do you want to auto delete previous execution "
> 			"log entries when record/replay buffer becomes "
> 			"full (record full stop-at-limit)?")))
> 	    error (_("Process record: stopped by user."));
> 
> In order to query, the inferior is already temporarily stopped.
> So why not just unconditionally error, and lets user tweak
> "set record stop-at-limit" and continue if they want.

Let me expand on this a bit.

I have a local unfinished branch somewhere that attempts to address
the "pagination/queries in the primary CLI prevent MI async
notifications (like *stopped) on the secondary MI channel" issue.
I think there's a PR about it, but I can't find it now.  It's the
one that led to Eclipse disabling pagination.

The issue is that pagination is handled by starting a new nested
event loop deep inside the print that triggered the pagination,
and while a secondary event loop is running, no target events
are processed at all (see gdb_readline_wrapper, the
target_async(0) call).  So GDB will only notice that the inferior
stopped for a trap when the pagination/query is unblocked.

So the idea to address this was to continue processing target
events in the background and send them to MI, even while the
CLI is stopped in the pagination.  Meanwhile, if some target event
ends up producing _more_ output _while_ the CLI is already
waiting for the user to request another page of output, we'd need
to buffer the output somewhere temporarily, in order
to later dump it on the screen when whatever we were
outputting that paginated is fully flushed/output.

This suggested actually always buffering asynchronous output
and dumping it on the screen at a safe point.  I.e., output
generated inside handle_inferior_event would always go to
a buffer, and then dumped on the screen after processing the event,
when safe.

And it is at this point that I thought that it is odd to
query and ask for user input deep down inside the record layer,
while handling some asynchronous execution event -- i.e.,
deep down inside handle_inferior_event.  If we're buffering
output, when the user won't see the query anyway.
Hmm, now that I think of it, the "Do you want to auto delete
previous execution" query wouldn't be converted to an error,
but instead to a something like TARGET_WAITKIND_NO_HISTORY,
I suppose.

OK, I found the branch.  Pushed here now:

  https://github.com/palves/gdb/commits/palves/console-pagination

Thanks,
Pedro Alves


  reply	other threads:[~2017-02-10 17:44 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-10 16:37 Simon Marchi
2017-02-10 16:48 ` Pedro Alves
2017-02-10 16:52   ` Simon Marchi
2017-02-10 17:12     ` Pedro Alves
2017-02-10 17:44       ` Pedro Alves [this message]
2017-02-10 18:07         ` Pedro Alves
2017-02-10 18:36           ` Pedro Alves
2017-02-10 19:08             ` Simon Marchi
2017-02-10 19:23               ` Pedro Alves
2017-02-10 19:06           ` Simon Marchi
2017-02-10 19:20             ` Pedro Alves
2017-02-10 19:26               ` Simon Marchi
2017-02-10 19:32                 ` Pedro Alves
2017-02-10 19:30             ` Pedro Alves
2017-02-10 19:03         ` Simon Marchi
2017-02-10 19:08           ` Pedro Alves

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=85ae4ad9-acdc-c9ba-6606-a7ac2abc7e2e@redhat.com \
    --to=palves@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=simon.marchi@ericsson.com \
    --cc=simon.marchi@polymtl.ca \
    /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