From: Nick Roberts <nickrob@snap.net.nz>
To: Vladimir Prus <vladimir@codesourcery.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [RFA] Async mode fixes.
Date: Fri, 07 Mar 2008 22:19:00 -0000 [thread overview]
Message-ID: <18385.48967.964309.898509@kahikatea.snap.net.nz> (raw)
In-Reply-To: <200803051027.29575.vladimir@codesourcery.com>
> Presently, gdb's async mode is not very healthy, as follows:
>
> # of expected passes 10129
> # of unexpected failures 537
> # of unexpected successes 2
> # of expected failures 40
> # of known failures 48
> # of unresolved testcases 301
> # of untested testcases 10
> # of unsupported tests 63
>
> The attached patch improves that, bringing the results to:
>
> # of expected passes 10722
> # of unexpected failures 39
> # of unexpected successes 2
> # of expected failures 41
> # of known failures 51
> # of untested testcases 11
> # of unsupported tests 64
>
> where only few failures are actually specific to async mode. There
> are no regressions in non-async mode, on x86.
Like my patch, IMO this one looks a bit like a dog's breakfast. It's got some
good ideas, though, and has certainly increased my understanding of the
asynchronous code. Perhaps a combination of the two patches would create
something useful.
It may reduce the failures, but I suspect that's partly because it's not really
running asynchronously. I don't understand how it really could without adding
another file handler for inferior events. That doesn't mean it can't, just
that I don't understand how it could.
> The patch has comments whenever appropriate, but some points need explicit
> clarification.
>
> To recap, current gdb, when operating with async-enabled target, allows
> two modes for all commands that run target. The fully async mode, requested
> by adding "&" to the command (say, "next &"), makes the target run, gives
> you a prompt and allows you to type further commands. If no "&" is added,
> then a sync execution is simulated -- whereby the prompt is suppressed
> and GDB does not handle any events on stdin. It is my understanding that
> we cannot kill this simulated sync mode because for console GDB,
> simulated sync mode is the only way we can allow the debugged program to
> read from stdin.
I think sync mode is also needed for command files. Also if you look at
top.c, only a few commands, e.g. pwd, can execute while the target is running.
> (I haven't checked if the interaction with debugged program
> indeed works, with Nick's linux async patch). This simulated sync mode
> is implemented by the sync_execution variable, and the
> async_enable_stdin and async_enable_stdout functions.
>
> This issue of simulate sync is not relevant to MI -- for MI, gdb stdin
> is generally a pipe, not a terminal, used only for reading
> commands from frontend and gdb has no way to route input to the application.
Emacs uses a tty for MI when one is available.
> Another important detail of async mode are continuations -- when we resume
> the target, we setup a function to be called when the target eventually
> stops. The relevant functions are add_continuation and do_all_continuations.
There's another continuation in the mi directory:
else if (target_can_async_p ())
{
add_continuation (mi_interpreter_exec_continuation, NULL);
}
You don't appear to have changed that. This is where I have issue with the
current `async' mode: it doesn't appear to use this continuation.
> The important problems with the current code are:
>
> 1. For MI mode, when we call a CLI command, in mi_cmd_interpreter_exec,
> we set sync_execution to 1 and then set it back to 0. This is just bogus --
> setting that variable without also disabling stdin bring the entire
> system in half-consistent state. Further, if the CLI command throws
> an exception, we fail to restore sync_execution. I just removed that code.
I think that _may_ be there because mi_cmd_interpreter_exec can process more
than one CLI command at a time:
-interpreter-exec console pwd dir
~"Working directory /home/nickrob.\n"
~"Source directories searched: $cdir:$cwd\n"
^done
(gdb)
Perhaps that should be changed to just allow one command.
> ...
--
Nick http://www.inet.net.nz/~nickrob
next prev parent reply other threads:[~2008-03-07 22:19 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-05 7:27 Vladimir Prus
2008-03-07 22:19 ` Nick Roberts [this message]
2008-03-07 22:33 ` Daniel Jacobowitz
2008-03-08 8:16 ` Vladimir Prus
2008-03-08 8:59 ` Vladimir Prus
2008-03-08 20:36 ` Nick Roberts
2008-03-08 20:54 ` Daniel Jacobowitz
2008-03-08 23:09 ` Nick Roberts
2008-03-09 0:01 ` Daniel Jacobowitz
2008-03-10 7:58 ` Vladimir Prus
2008-03-10 9:12 ` Nick Roberts
2008-03-10 10:02 ` Vladimir Prus
2008-03-10 22:06 ` Nick Roberts
2008-03-14 18:26 ` Daniel Jacobowitz
2008-03-14 18:58 ` Vladimir Prus
2008-03-17 14:11 ` [commit] Fix compile error (Re: [RFA] Async mode fixes.) Ulrich Weigand
2008-03-17 14:17 ` Daniel Jacobowitz
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=18385.48967.964309.898509@kahikatea.snap.net.nz \
--to=nickrob@snap.net.nz \
--cc=gdb-patches@sources.redhat.com \
--cc=vladimir@codesourcery.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