aboutsummaryrefslogtreecommitdiff
path: root/gdb/event-top.c
diff options
context:
space:
mode:
authorFred Fish <fnf@specifix.com>2007-02-08 16:25:25 +0000
committerFred Fish <fnf@specifix.com>2007-02-08 16:25:25 +0000
commit5f960e007db0868b854c3b796d665d816f89a9b8 (patch)
tree8fca8b39de658c44e41e4e9f1f136bb352ffd2c0 /gdb/event-top.c
parent4998c1dfb80b78923c507abfdd7c824fb74b840d (diff)
downloadgdb-5f960e007db0868b854c3b796d665d816f89a9b8.zip
gdb-5f960e007db0868b854c3b796d665d816f89a9b8.tar.gz
gdb-5f960e007db0868b854c3b796d665d816f89a9b8.tar.bz2
Reviewed by Daniel Jacobowitz <drow@false.org>
2008-02-08 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.
Diffstat (limited to 'gdb/event-top.c')
-rw-r--r--gdb/event-top.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/gdb/event-top.c b/gdb/event-top.c
index 400c812..9a6c2fb 100644
--- a/gdb/event-top.c
+++ b/gdb/event-top.c
@@ -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 ();
}