Trivial patch to remove dependency on host unsigned long type
[deliverable/binutils-gdb.git] / gdb / exceptions.c
index 0dcad71d20b78d954ea4e9c47a0bdba3c12b0e34..c4c1e5716fbb395f7fd0cc2dcd551e42522c8e3e 100644 (file)
@@ -1,6 +1,6 @@
 /* Exception (throw catch) mechanism, for GDB, the GNU debugger.
 
-   Copyright (C) 1986, 1988-2012 Free Software Foundation, Inc.
+   Copyright (C) 1986-2013 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -221,10 +221,10 @@ exceptions_state_mc_action_iter_1 (void)
 void
 throw_exception (struct gdb_exception exception)
 {
-  quit_flag = 0;
+  clear_quit_flag ();
   immediate_quit = 0;
 
-  do_cleanups (ALL_CLEANUPS);
+  do_cleanups (all_cleanups ());
 
   /* Jump to the containing catch_errors() call, communicating REASON
      to that call via setjmp's return value.  Note that REASON can't
@@ -234,28 +234,6 @@ throw_exception (struct gdb_exception exception)
   EXCEPTIONS_SIGLONGJMP (current_catcher->buf, exception.reason);
 }
 
-void
-deprecated_throw_reason (enum return_reason reason)
-{
-  struct gdb_exception exception;
-
-  memset (&exception, 0, sizeof exception);
-
-  exception.reason = reason;
-  switch (reason)
-    {
-    case RETURN_QUIT:
-      break;
-    case RETURN_ERROR:
-      exception.error = GENERIC_ERROR;
-      break;
-    default:
-      internal_error (__FILE__, __LINE__, _("bad switch"));
-    }
-  
-  throw_exception (exception);
-}
-
 static void
 print_flush (void)
 {
@@ -563,7 +541,7 @@ catch_errors (catch_errors_ftype *func, void *func_args, char *errstring,
 }
 
 int
-catch_command_errors (catch_command_errors_ftype * command,
+catch_command_errors (catch_command_errors_ftype *command,
                      char *arg, int from_tty, return_mask mask)
 {
   volatile struct gdb_exception e;
@@ -577,3 +555,19 @@ catch_command_errors (catch_command_errors_ftype * command,
     return 0;
   return 1;
 }
+
+int
+catch_command_errors_const (catch_command_errors_const_ftype *command,
+                           const char *arg, int from_tty, return_mask mask)
+{
+  volatile struct gdb_exception e;
+
+  TRY_CATCH (e, mask)
+    {
+      command (arg, from_tty);
+    }
+  print_any_exception (gdb_stderr, NULL, e);
+  if (e.reason < 0)
+    return 0;
+  return 1;
+}
This page took 0.024409 seconds and 4 git commands to generate.