Work around GCC 6.3.1 bug
[deliverable/binutils-gdb.git] / gdb / break-catch-throw.c
index e71a885c4f20ba1c718e0ab43c13421c9cc20378..faa878e93199705cb02ef97c84072ec6d88aeaa5 100644 (file)
@@ -184,9 +184,7 @@ check_status_exception_catchpoint (struct bpstats *bs)
 static void
 re_set_exception_catchpoint (struct breakpoint *self)
 {
-  struct symtabs_and_lines sals = {0};
-  struct symtabs_and_lines sals_end = {0};
-  struct cleanup *cleanup;
+  std::vector<symtab_and_line> sals;
   enum exception_event_kind kind = classify_exception_breakpoint (self);
   struct program_space *filter_pspace = current_program_space;
 
@@ -209,8 +207,8 @@ re_set_exception_catchpoint (struct breakpoint *self)
          explicit_loc.function_name
            = ASTRDUP (exception_functions[kind].function);
          event_location_up location = new_explicit_location (&explicit_loc);
-         self->ops->decode_location (self, location.get (), filter_pspace,
-                                     &sals);
+         sals = self->ops->decode_location (self, location.get (),
+                                            filter_pspace);
        }
       CATCH (ex, RETURN_MASK_ERROR)
        {
@@ -223,9 +221,7 @@ re_set_exception_catchpoint (struct breakpoint *self)
     }
   END_CATCH
 
-  cleanup = make_cleanup (xfree, sals.sals);
-  update_breakpoint_locations (self, filter_pspace, sals, sals_end);
-  do_cleanups (cleanup);
+  update_breakpoint_locations (self, filter_pspace, sals, {});
 }
 
 static enum print_stop_action
@@ -382,13 +378,12 @@ handle_gnu_v3_exceptions (int tempflag, std::string &&except_rx,
      the right thing.  */
   cp->type = bp_breakpoint;
   cp->kind = ex_event;
-  cp->exception_rx = except_rx;
+  cp->exception_rx = std::move (except_rx);
   cp->pattern = std::move (pattern);
 
   re_set_exception_catchpoint (cp.get ());
 
-  install_breakpoint (0, cp.get (), 1);
-  cp.release ();
+  install_breakpoint (0, std::move (cp), 1);
 }
 
 /* Look for an "if" token in *STRING.  The "if" token must be preceded
@@ -407,7 +402,7 @@ extract_exception_regexp (const char **string)
   const char *start;
   const char *last, *last_space;
 
-  start = skip_spaces_const (*string);
+  start = skip_spaces (*string);
 
   last = start;
   last_space = start;
@@ -421,7 +416,7 @@ extract_exception_regexp (const char **string)
 
       /* No "if" token here.  Skip to the next word start.  */
       last_space = skip_to_space (last);
-      last = skip_spaces_const (last_space);
+      last = skip_spaces (last_space);
     }
 
   *string = last;
@@ -443,7 +438,7 @@ catch_exception_command_1 (enum exception_event_kind ex_event,
 
   if (!arg)
     arg = "";
-  arg = skip_spaces_const (arg);
+  arg = skip_spaces (arg);
 
   std::string except_rx = extract_exception_regexp (&arg);
 
@@ -542,8 +537,6 @@ initialize_throw_catchpoint_ops (void)
   ops->check_status = check_status_exception_catchpoint;
 }
 
-initialize_file_ftype _initialize_break_catch_throw;
-
 void
 _initialize_break_catch_throw (void)
 {
This page took 0.024603 seconds and 4 git commands to generate.