From: Pedro Alves <pedro@codesourcery.com>
To: Nick Roberts <nickrob@snap.net.nz>
Cc: gdb-patches@sourceware.org
Subject: Re: linux native async mode support
Date: Sat, 15 Mar 2008 01:58:00 -0000 [thread overview]
Message-ID: <200803150157.47855.pedro@codesourcery.com> (raw)
In-Reply-To: <18395.1471.637574.722785@kahikatea.snap.net.nz>
A Friday 14 March 2008 23:09:51, Nick wrote:
> Wow!
:-)
> It seems unfortunate that you had to move async_file_handler into
> linux_nat.c as much of this seems generic and will presumably make it
> harder to port the async mode to other platforms. I put it in inf-ptrace.c
> (*) which creates problems if the target doesn't actually support async
> mode. More recently I thought maybe not setting t->to_async_mask_value to
> 1 in inf_ptrace_target might solve that.
>
On the contraire. Not assuming abstractions upfront allows us to
enhance and test the linux port, without worrying about the other
inf-ptrace.c clients breaking. We'll add the non-stop support soon, and
that will need further tweaking. We can worry about abstractions and
common code when someone wants to add async support to another target.
I'd advise to hold on a bit until we stabilize this port a bit more.
> Daniel talks about async mode being the default but I don't really
> understand this. In order for Gdb to be able to accept input while the
> inferior is running and possibly accepting it's own input, seems to require
> separate terminals. This isn't a problem for a front end but, in general,
> will be when Gdb is run from the command line.
This is a confusion of terms. The async mode he was refering to, is
the event loop code path, in which we (ideally) never block in
wait_for_inferior.
I'm sure you know most of this already, but let me repeat it for
clarity.
If the target supports async event loop mode, the user can still run
the inferior in synchronous mode, with the usual commands, and
gdb can put the inferior in the foreground. That's currently
controlled by the sync_execution global variable. The sync_execution
mode is implemented on top of the async/event loop code path, and can
(ideally) be ignored by the target code (as long as it supports
async/event loop mode). It is up to gdb common code to disable
stdin to simulate synchronous execution, which enables passing
the terminal to the inferior. From a users perpective, target
in event loop mode with sync_execution set is the same as
what we have had until now.
In addition to that mode, by having the target in async/event loop
mode, the user/frontend can use the background execution commands
(run&, continue&, step&, etc.), which makes gdb accept input
from the user/frontend while the inferior is running. This is
essential for non-stop mode, which we'll be adding soon.
In a nutshell, having the target in "async mode" has no
drawbacks, only advantages. It's only that it isn't perfect yet. When
we get to the point where the non-async code path is not needed anymore,
we can drop a bunch of support code. That's doesn't seem likelly to
happen anytime soon in the common code, but it can be done target by
target. Linux native and target (extended-)remote are the first
candidates.
(I'll address the patch comments later)
Thanks!
--
Pedro Alves
next prev parent reply other threads:[~2008-03-15 1:58 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-14 8:11 Pedro Alves
2008-03-14 21:17 ` Daniel Jacobowitz
2008-03-17 16:05 ` Pedro Alves
2008-03-17 22:05 ` Daniel Jacobowitz
2008-03-18 23:27 ` Pedro Alves
2008-03-18 23:58 ` Daniel Jacobowitz
2008-03-21 15:55 ` Daniel Jacobowitz
2008-03-21 17:19 ` Pedro Alves
2008-03-28 14:48 ` Maciej W. Rozycki
2008-03-28 16:07 ` Pedro Alves
2008-03-28 16:13 ` Daniel Jacobowitz
2008-03-28 16:40 ` Pedro Alves
2008-03-18 0:06 ` Nick Roberts
2008-03-18 23:28 ` Pedro Alves
2008-03-19 3:59 ` Nick Roberts
2008-03-19 16:25 ` Luis Machado
2008-03-19 23:19 ` Pedro Alves
2008-03-19 23:26 ` Pedro Alves
2008-03-20 1:58 ` Nick Roberts
2008-03-21 15:47 ` Daniel Jacobowitz
2008-03-21 15:49 ` Daniel Jacobowitz
2008-03-21 23:02 ` Nick Roberts
2008-03-22 1:25 ` Daniel Jacobowitz
2008-03-22 22:06 ` Nick Roberts
2008-04-01 14:00 ` Daniel Jacobowitz
2008-04-01 15:17 ` Vladimir Prus
2008-04-01 20:09 ` Nick Roberts
2008-04-04 12:34 ` Vladimir Prus
2008-04-05 17:20 ` Nick Roberts
2008-04-05 22:07 ` Vladimir Prus
2008-04-07 0:06 ` Nick Roberts
2008-04-07 2:33 ` Nick Roberts
2008-03-18 2:47 ` Nick Roberts
2008-03-14 23:10 ` Nick Roberts
2008-03-15 1:58 ` Pedro Alves [this message]
2008-03-15 3:11 ` Daniel Jacobowitz
2008-03-17 23:41 ` Nick Roberts
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=200803150157.47855.pedro@codesourcery.com \
--to=pedro@codesourcery.com \
--cc=gdb-patches@sourceware.org \
--cc=nickrob@snap.net.nz \
/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