Regenerate or1k opcodes file
[deliverable/binutils-gdb.git] / gdb / breakpoint.c
index 7b610ef28de639ad6c227494edbe87b6823bac86..f99a7ab46dd6b7a13e5a2795917e33be71297966 100644 (file)
@@ -2347,12 +2347,6 @@ build_target_condition_list (struct bp_location *bl)
                 need to parse the condition to bytecodes again.  */
              aexpr = parse_cond_to_aexpr (bl->address, loc->cond);
              loc->cond_bytecode = aexpr;
-
-             /* Check if we managed to parse the conditional expression
-                correctly.  If not, we will not send this condition
-                to the target.  */
-             if (aexpr)
-               continue;
            }
 
          /* If we have a NULL bytecode expression, it means something
@@ -2553,9 +2547,6 @@ build_target_command_list (struct bp_location *bl)
              aexpr = parse_cmd_to_aexpr (bl->address,
                                          loc->owner->extra_string);
              loc->cmd_bytecode = aexpr;
-
-             if (!aexpr)
-               continue;
            }
 
          /* If we have a NULL bytecode expression, it means something
@@ -3497,7 +3488,6 @@ create_overlay_event_breakpoint (void)
          overlay_events_enabled = 0;
        }
     }
-  update_global_location_list (UGLL_MAY_INSERT);
 }
 
 static void
@@ -3611,7 +3601,6 @@ create_longjmp_master_breakpoint (void)
        }
     }
   }
-  update_global_location_list (UGLL_MAY_INSERT);
 
   do_cleanups (old_chain);
 }
@@ -3670,8 +3659,6 @@ create_std_terminate_master_breakpoint (void)
     }
   }
 
-  update_global_location_list (UGLL_MAY_INSERT);
-
   do_cleanups (old_chain);
 }
 
@@ -3775,8 +3762,14 @@ create_exception_master_breakpoint (void)
       b->location = new_explicit_location (&explicit_loc);
       b->enable_state = bp_disabled;
     }
+}
 
-  update_global_location_list (UGLL_MAY_INSERT);
+/* Does B have a location spec?  */
+
+static int
+breakpoint_event_location_empty_p (const struct breakpoint *b)
+{
+  return b->location != NULL && event_location_empty_p (b->location);
 }
 
 void
@@ -3893,7 +3886,7 @@ update_breakpoints_after_exec (void)
     /* Without a symbolic address, we have little hope of the
        pre-exec() address meaning the same thing in the post-exec()
        a.out.  */
-    if (event_location_empty_p (b->location))
+    if (breakpoint_event_location_empty_p (b))
       {
        delete_breakpoint (b);
        continue;
@@ -7816,12 +7809,8 @@ struct lang_and_radix
 struct breakpoint *
 create_jit_event_breakpoint (struct gdbarch *gdbarch, CORE_ADDR address)
 {
-  struct breakpoint *b;
-
-  b = create_internal_breakpoint (gdbarch, address, bp_jit_event,
-                                 &internal_breakpoint_ops);
-  update_global_location_list_nothrow (UGLL_MAY_INSERT);
-  return b;
+  return create_internal_breakpoint (gdbarch, address, bp_jit_event,
+                                    &internal_breakpoint_ops);
 }
 
 /* Remove JIT code registration and unregistration breakpoint(s).  */
@@ -13082,7 +13071,7 @@ static void
 bkpt_re_set (struct breakpoint *b)
 {
   /* FIXME: is this still reachable?  */
-  if (event_location_empty_p (b->location))
+  if (breakpoint_event_location_empty_p (b))
     {
       /* Anything without a location can't be re-set.  */
       delete_breakpoint (b);
@@ -14287,7 +14276,6 @@ update_breakpoint_locations (struct breakpoint *b,
       /* Ranged breakpoints have only one start location and one end
         location.  */
       b->enable_state = bp_disabled;
-      update_global_location_list (UGLL_MAY_INSERT);
       printf_unfiltered (_("Could not reset ranged breakpoint %d: "
                           "multiple locations found\n"),
                         b->number);
@@ -14385,8 +14373,6 @@ update_breakpoint_locations (struct breakpoint *b,
 
   if (!locations_are_equal (existing_locations, b->loc))
     observer_notify_breakpoint_modified (b);
-
-  update_global_location_list (UGLL_MAY_INSERT);
 }
 
 /* Find the SaL locations corresponding to the given LOCATION.
@@ -14626,6 +14612,11 @@ breakpoint_re_set (void)
   save_input_radix = input_radix;
   old_chain = save_current_space_and_thread ();
 
+  /* Note: we must not try to insert locations until after all
+     breakpoints have been re-set.  Otherwise, e.g., when re-setting
+     breakpoint 1, we'd insert the locations of breakpoint 2, which
+     hadn't been re-set yet, and thus may have stale locations.  */
+
   ALL_BREAKPOINTS_SAFE (b, b_tmp)
   {
     /* Format possible error msg.  */
@@ -14646,6 +14637,9 @@ breakpoint_re_set (void)
   create_longjmp_master_breakpoint ();
   create_std_terminate_master_breakpoint ();
   create_exception_master_breakpoint ();
+
+  /* Now we can insert.  */
+  update_global_location_list (UGLL_MAY_INSERT);
 }
 \f
 /* Reset the thread number of this breakpoint:
This page took 0.027105 seconds and 4 git commands to generate.