Uniquefy gdb.threads/attach-into-signal.exp
[deliverable/binutils-gdb.git] / gdb / exceptions.c
index 64a653afa02c431dc1a326fc6dcb98315e5f2982..623e8e0e647ff0751dcd3d4b7c9c2016571d6f0d 100644 (file)
@@ -174,7 +174,6 @@ catch_exceptions_with_msg (struct ui_out *func_uiout,
                           char **gdberrmsg,
                           return_mask mask)
 {
-  volatile struct gdb_exception ex;
   struct gdb_exception exception = exception_none;
   volatile int val = 0;
   struct ui_out *saved_uiout;
@@ -183,14 +182,15 @@ catch_exceptions_with_msg (struct ui_out *func_uiout,
   saved_uiout = current_uiout;
   current_uiout = func_uiout;
 
-  TRY_CATCH (ex, RETURN_MASK_ALL)
+  TRY
     {
       val = (*func) (current_uiout, func_args);
     }
-  if (ex.reason < 0)
+  CATCH (ex, RETURN_MASK_ALL)
     {
       exception = ex;
     }
+  END_CATCH
 
   /* Restore the global builder.  */
   current_uiout = saved_uiout;
@@ -228,17 +228,22 @@ int
 catch_errors (catch_errors_ftype *func, void *func_args, char *errstring,
              return_mask mask)
 {
+  struct gdb_exception exception = exception_none;
   volatile int val = 0;
-  volatile struct gdb_exception exception;
   struct ui_out *saved_uiout;
 
   /* Save the global ``struct ui_out'' builder.  */
   saved_uiout = current_uiout;
 
-  TRY_CATCH (exception, RETURN_MASK_ALL)
+  TRY
     {
       val = func (func_args);
     }
+  CATCH (ex, RETURN_MASK_ALL)
+    {
+      exception = ex;
+    }
+  END_CATCH
 
   /* Restore the global builder.  */
   current_uiout = saved_uiout;
This page took 0.037443 seconds and 4 git commands to generate.