From: Andrew Cagney <cagney@gnu.org>
To: Elena Zannoni <ezannoni@redhat.com>, Joel Brobecker <brobecker@gnat.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [RFA/RFC] QUIT doesn't seem to be working !?
Date: Fri, 20 Feb 2004 16:14:00 -0000 [thread overview]
Message-ID: <40363249.4090607@gnu.org> (raw)
In-Reply-To: <16435.52781.747628.886278@localhost.redhat.com>
Some related history:
non-blocking reads/writes and event loops
http://sources.redhat.com/ml/gdb/2000-06/msg00088.html
remote.c's "async", "extended-async" back ends
http://sources.redhat.com/ml/gdb/2001-02/msg00016.html
remote.c and a re-entrant event-loop
http://sources.redhat.com/ml/gdb/2000-06/msg00144.html
> I think your observations are correct. quit_flag is not set when we
> hit the QUITs, if we use the event loop. I remember testing the
> behavior of ^-C several times, when I wrote that stuff, but I focused
> more on interrupting a running target (launched with run&, etc) for
> the async remote case. There is even a mechanism in gdb to handle a
> ^-C hit twice.
>
> Unfortunately I think that your patch is not completely correct. You
> set up *both* the QUIT machinery and the event-loop to process *one*
> SIGINT the next time through. Whatever one you reach first, it will
> leave a non-existant event set for the other.
>
> Probably for the event-loop case we should forget quit_flag and just
> rely on the markers being set in the event-loop machinery. Which means
> that QUIT (or equivalent) will have to figure out if there are any
> high priority events to be processed. Which, if you think about it, is
> like saying that there will be a 'lower-level/inner-level/secondary'
> event loop. In this sigint case, for QUIT to be able to pull out the
> interrupt related markers from the event loop, it means that those
> markers now need to identify themselves somehow. The event loop is
> currently completely agnostic about the kind of events to be
> processed. It only knows that they are generated by a signal (any
> signal), while we want to pull out only the sigint ones.
Based on the above links. So this means that QUIT:
#define QUIT { \
if (quit_flag) quit (); \
if (interactive_hook) interactive_hook (); \
}
should be replaced by something like:
#define QUIT keep_event_loop_alive ();
> Actually the event loop knows only about 2 kinds (well, 3) kinds of
> events: signals and file-descriptors related events (and timers). We
> are talking here about subverting that categorization by introducing a
> urgent/high priority kind of event that needs to be processed
> right now, w/o waiting until you get back to the event loop proper.
>
> So, since 6.1 is approaching, I would mark this as a known problem,
> and try to solve it in mainline, after the branch is cut.
Yes. I did a quick user poll over lunch and everyone indicated that
contrl-c "works for me" (the sample included heavy java and C++ users!).
Andrew
next prev parent reply other threads:[~2004-02-20 16:14 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-08-12 22:22 Joel Brobecker
2003-08-28 14:41 ` Daniel Jacobowitz
2003-11-17 1:00 ` Daniel Jacobowitz
2004-01-19 16:24 ` Daniel Jacobowitz
2004-02-18 20:46 ` Elena Zannoni
2004-02-20 16:14 ` Andrew Cagney [this message]
2004-02-20 17:09 ` Joel Brobecker
2004-02-20 17:51 ` Andrew Cagney
2004-02-26 17:04 ` Daniel Jacobowitz
2004-02-26 17:32 ` Joel Brobecker
2004-02-20 17:06 ` Joel Brobecker
2004-02-23 15:15 ` Elena Zannoni
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=40363249.4090607@gnu.org \
--to=cagney@gnu.org \
--cc=brobecker@gnat.com \
--cc=ezannoni@redhat.com \
--cc=gdb-patches@sources.redhat.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