Fix probe-related internal error on AIX
[deliverable/binutils-gdb.git] / gdb / break-catch-throw.c
index 72834902f0ca6a0d827223cf7b7297a0995f0a84..9831d96f4154bdf14dfbef287658010ec4a60419 100644 (file)
@@ -207,29 +207,32 @@ re_set_exception_catchpoint (struct breakpoint *self)
   volatile struct gdb_exception e;
   struct cleanup *cleanup;
   enum exception_event_kind kind = classify_exception_breakpoint (self);
-  int pass;
 
-  for (pass = 0; sals.sals == NULL && pass < 2; ++pass)
+  /* We first try to use the probe interface.  */
+  TRY_CATCH (e, RETURN_MASK_ERROR)
     {
-      TRY_CATCH (e, RETURN_MASK_ERROR)
+      char *spec = ASTRDUP (exception_functions[kind].probe);
+
+      sals = parse_probes (&spec, NULL);
+    }
+
+  if (e.reason < 0)
+    {
+      volatile struct gdb_exception ex;
+
+      /* Using the probe interface failed.  Let's fallback to the normal
+        catchpoint mode.  */
+      TRY_CATCH (ex, RETURN_MASK_ERROR)
        {
-         char *spec;
-
-         if (pass == 0)
-           {
-             spec = ASTRDUP (exception_functions[kind].probe);
-             sals = parse_probes (&spec, NULL);
-           }
-         else
-           {
-             spec = ASTRDUP (exception_functions[kind].function);
-             self->ops->decode_linespec (self, &spec, &sals);
-           }
+         char *spec = ASTRDUP (exception_functions[kind].function);
+
+         self->ops->decode_linespec (self, &spec, &sals);
        }
+
       /* NOT_FOUND_ERROR just means the breakpoint will be pending, so
         let it through.  */
-      if (e.reason < 0 && e.error != NOT_FOUND_ERROR)
-       throw_exception (e);
+      if (ex.reason < 0 && ex.error != NOT_FOUND_ERROR)
+       throw_exception (ex);
     }
 
   cleanup = make_cleanup (xfree, sals.sals);
This page took 0.024283 seconds and 4 git commands to generate.