From: Fred Fish <fnf@specifix.com>
To: Mark Kettenis <mark.kettenis@xs4all.nl>
Cc: drow@false.org, gdb-patches@sources.redhat.com
Subject: Re: [RFC] Patch for QUIT macro support
Date: Mon, 22 Jan 2007 14:41:00 -0000 [thread overview]
Message-ID: <200701220740.53051.fnf@specifix.com> (raw)
In-Reply-To: <200610151800.k9FI0fDS016688@elgar.sibelius.xs4all.nl>
[-- Attachment #1: Type: text/plain, Size: 328 bytes --]
On Sunday 15 October 2006 11:00, Mark Kettenis wrote:
> We really should not put history in our comments.
Good point. Here is a patch with updated comments.
It would be good if someone could independently review, test, and
approve this, particularly anyone using an interface other than the
normal command line one.
-Fred
[-- Attachment #2: quit.diff --]
[-- Type: text/x-diff, Size: 1484 bytes --]
2007-01-22 Fred Fish <fnf@specifix.com>
* event-top.c (handle_sigint): Set quit_flag.
(async_request_quit): Don't set quit_flag. Avoid calling quit()
if quit_flag has already been reset.
Index: event-top.c
===================================================================
RCS file: /cvs/src/src/gdb/event-top.c,v
retrieving revision 1.48
diff -u -p -r1.48 event-top.c
--- event-top.c 9 Jan 2007 17:58:50 -0000 1.48
+++ event-top.c 22 Jan 2007 14:35:14 -0000
@@ -961,6 +961,13 @@ handle_sigint (int sig)
{
signal (sig, handle_sigint);
+ /* We could be running in a loop reading in symfiles or something so
+ it may be quite a while before we get back to the event loop. So
+ set quit_flag to 1 here. Then if QUIT is called before we get to
+ the event loop, we will unwind as expected. */
+
+ quit_flag = 1;
+
/* If immediate_quit is set, we go ahead and process the SIGINT right
away, even if we usually would defer this to the event loop. The
assumption here is that it is safe to process ^C immediately if
@@ -989,7 +996,14 @@ handle_sigterm (int sig)
void
async_request_quit (gdb_client_data arg)
{
- quit_flag = 1;
+ /* If the quit_flag has gotten reset back to 0 by the time we get
+ back here, that means that an exception was thrown to unwind
+ the current command before we got back to the event loop. So
+ there is no reason to call quit again here. */
+
+ if (quit_flag == 0)
+ return;
+
quit ();
}
next prev parent reply other threads:[~2007-01-22 14:41 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-13 12:43 Fred Fish
2006-10-13 13:22 ` Fred Fish
2006-10-13 13:30 ` Daniel Jacobowitz
2006-10-13 13:49 ` Fred Fish
2007-01-21 17:44 ` Daniel Jacobowitz
2007-01-21 19:23 ` Fred Fish
[not found] ` <200610151800.k9FI0fDS016688@elgar.sibelius.xs4all.nl>
2007-01-22 14:41 ` Fred Fish [this message]
2007-02-08 14:34 ` Daniel Jacobowitz
2007-02-08 20:49 ` Nick Roberts
2007-02-08 21:17 ` Fred Fish
2007-02-08 21:51 ` Nick Roberts
2006-10-13 14:58 ` Fred Fish
2007-02-08 14:34 ` Daniel Jacobowitz
2006-10-16 0:08 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=200701220740.53051.fnf@specifix.com \
--to=fnf@specifix.com \
--cc=drow@false.org \
--cc=gdb-patches@sources.redhat.com \
--cc=mark.kettenis@xs4all.nl \
/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