From: Pedro Alves <pedro@codesourcery.com>
To: gdb-patches@sourceware.org
Cc: Daniel Jacobowitz <drow@false.org>,
Pierre Muller <muller@ics.u-strasbg.fr>
Subject: Re: continuations and breakpoint commands
Date: Sun, 04 May 2008 22:49:00 -0000 [thread overview]
Message-ID: <200805042234.29099.pedro@codesourcery.com> (raw)
In-Reply-To: <20080502153655.GO29202@caradoc.them.org>
Sorry, I seem to have missed this,
A Friday 02 May 2008 16:36:55, Daniel Jacobowitz wrote:
> On Wed, Apr 30, 2008 at 03:59:34PM +0100, Pedro Alves wrote:
> > > What happens to the already typed chars in the
> > > case of a prompt switch?
> >
> > No sure I understood that. When the inferior is running in
> > sync execution, any typed character goes to the inferior, while
> > in async execution the terminal stays with GDB and GDB interprets
> > any command you pass to it.
>
> I think he's asking what happens when the program hits a breakpoint
> while you're mid-typing. I assume we print some output and readline
> redraws the prompt line?
There's no prompt switch in async mode. The code comment in question
has to do with sync_execution on top of async mode, where anything
the user typed while the inferior was executing went to the inferior.
In async, if some breakpoint is hit mid-typing we just print some
output, and don't mess with the prompt, so whatever the user was
mid-typing is unaffected. The command line does gets a bit
garbled, because there's no distintion between the command line,
and other output, though.
With a source that looks like (line/code):
8 sleep (10); << stopped here.
9 sleep (10); << breakpoint here.
(gdb) c&
Continuing.
(gdb) help << "enter" not pressed yet.
(wait for breakpoint hit)
(gdb) c&
Continuing.
(gdb) helpBreakpoint 3, thread1_really () at thread.cpp:9
9 in thread.cpp
<< press "enter" now.
List of classes of commands:
aliases -- Aliases of other commands
breakpoints -- Making program stop at certain points
data -- Examining data
files -- Specifying and examining files
internals -- Maintenance commands
obscure -- Obscure features
running -- Running the program
...
Clearly, an improvement would be for the output to be:
(gdb) c&
Continuing.
(gdb) help << "enter" not pressed yet.
(wait for breakpoint hit)
(gdb) c&
Continuing.
Breakpoint 3, thread1_really () at thread.cpp:9
9 in thread.cpp
(gdb) help
I suppose it may be possible to add some smartness to printf_*filtered
and friends to do some dance with readline for this.
There's one case where prompting may get in the way
of what the user was typing. That's when due to *_filtered,
pagination kicks in. We use a prompt for the query.
Hey, nobody's been claiming CLI is perfect in async mode yet :-)
--
Pedro Alves
next prev parent reply other threads:[~2008-05-04 21:34 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-30 5:59 Pedro Alves
2008-04-30 14:03 ` Luis Machado
2008-04-30 14:21 ` Pedro Alves
2008-04-30 17:00 ` Pierre Muller
2008-04-30 18:25 ` Pedro Alves
2008-05-02 15:38 ` Daniel Jacobowitz
2008-05-04 22:49 ` Pedro Alves [this message]
2008-05-02 15:44 ` Daniel Jacobowitz
2008-05-07 4:33 ` 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=200805042234.29099.pedro@codesourcery.com \
--to=pedro@codesourcery.com \
--cc=drow@false.org \
--cc=gdb-patches@sourceware.org \
--cc=muller@ics.u-strasbg.fr \
/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