* event-top.c (async_disconnect): If an exception is thrown from
authorJoseph Myers <joseph@codesourcery.com>
Wed, 21 Sep 2011 15:21:28 +0000 (15:21 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Wed, 21 Sep 2011 15:21:28 +0000 (15:21 +0000)
quit_cover, call pop_all_targets.  Use TRY_CATCH instead of
catch_errors.
* top.c (quit_cover): Return void and take no arguments.
* top.h (quit_cover): Update prototype.

gdb/ChangeLog
gdb/event-top.c
gdb/top.c
gdb/top.h

index f15e616..49687c9 100644 (file)
@@ -1,3 +1,11 @@
+2011-09-21  Joseph Myers  <joseph@codesourcery.com>
+
+       * event-top.c (async_disconnect): If an exception is thrown from
+       quit_cover, call pop_all_targets.  Use TRY_CATCH instead of
+       catch_errors.
+       * top.c (quit_cover): Return void and take no arguments.
+       * top.h (quit_cover): Update prototype.
+
 2011-09-20  Joseph Myers  <joseph@codesourcery.com>
 
        * mi/mi-main.c (mi_load_progress): Restore saved_uiout value to
index ff2aefb..a276690 100644 (file)
@@ -870,9 +870,25 @@ handle_sighup (int sig)
 static void
 async_disconnect (gdb_client_data arg)
 {
-  catch_errors (quit_cover, NULL,
-               "Could not kill the program being debugged",
-               RETURN_MASK_ALL);
+  volatile struct gdb_exception exception;
+
+  TRY_CATCH (exception, RETURN_MASK_ALL)
+    {
+      quit_cover ();
+    }
+
+  if (exception.reason < 0)
+    {
+      fputs_filtered ("Could not kill the program being debugged",
+                     gdb_stderr);
+      exception_print (gdb_stderr, exception);
+    }
+
+  TRY_CATCH (exception, RETURN_MASK_ALL)
+    {
+      pop_all_targets (1);
+    }
+
   signal (SIGHUP, SIG_DFL);    /*FIXME: ???????????  */
   raise (SIGHUP);
 }
index 22178b7..ec475a8 100644 (file)
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -288,14 +288,13 @@ void (*deprecated_context_hook) (int id);
 /* NOTE 1999-04-29: This function will be static again, once we modify
    gdb to use the event loop as the default command loop and we merge
    event-top.c into this file, top.c.  */
-/* static */ int
-quit_cover (void *s)
+/* static */ void
+quit_cover (void)
 {
   caution = 0;                 /* Throw caution to the wind -- we're exiting.
                                   This prevents asking the user dumb 
                                   questions.  */
   quit_command ((char *) 0, 0);
-  return 0;
 }
 #endif /* defined SIGHUP */
 \f
index e36201c..3e6679c 100644 (file)
--- a/gdb/top.h
+++ b/gdb/top.h
@@ -41,7 +41,7 @@ extern void command_loop (void);
 extern int quit_confirm (void);
 extern void quit_force (char *, int);
 extern void quit_command (char *, int);
-extern int quit_cover (void *);
+extern void quit_cover (void);
 extern void execute_command (char *, int);
 
 /* Prepare for execution of a command.