From: Nick Roberts <nickrob@snap.net.nz>
To: Pedro Alves <pedro@codesourcery.com>
Cc: gdb-patches@sourceware.org
Subject: Re: linux native async mode support
Date: Fri, 14 Mar 2008 23:10:00 -0000 [thread overview]
Message-ID: <18395.1471.637574.722785@kahikatea.snap.net.nz> (raw)
In-Reply-To: <200803140810.22883.pedro@codesourcery.com>
> This patch adds linux native async mode support.
Wow! This is an awesome patch especially as your previous changes seem to be
for different parts of Gdb. I think my patch only really worked if only one
SIGCHLD signal came in for each round trip in the event loop. I was starting
to see that that the signal handler shouldn't be wrapped around select and that
I would need to queue signals but I never began to understand all the waitpids
in linux_nat_wait or how to get back to the event loop when all the SIGCHLD
signals had been processed.
I have some initial comments but bear in mind it's from a position of lesser
understanding. I can see that I really need to up my game a bit!
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.
(*) I copied this from Apple whose handler was in macosx-nat-inferior.c
but their build is only for one architecture (maybe two now but source
appears to be no longer available from their repository)
---
+ /* SIGCHLD handler for async mode. */
+ async_action.sa_handler = async_sigchld_handler;
+ sigemptyset (&async_action.sa_mask);
+ async_action.sa_flags = SA_RESTART;
+ sigaddset (&async_action.sa_mask, SIGCHLD);
I'm not sure that last line is necessary (I had it in my patch, I know) as the
libc manual says:
When a handler function is invoked on a signal, that signal is
automatically blocked (in addition to any other signals that are already
in the process's signal mask) during the time the handler is running.
---
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.
--
Nick http://www.inet.net.nz/~nickrob
next prev parent reply other threads:[~2008-03-14 23:10 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 [this message]
2008-03-15 1:58 ` Pedro Alves
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=18395.1471.637574.722785@kahikatea.snap.net.nz \
--to=nickrob@snap.net.nz \
--cc=gdb-patches@sourceware.org \
--cc=pedro@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