Multi-target support
[deliverable/binutils-gdb.git] / gdb / breakpoint.c
index 055a8c9ee29a3793eac3c13ad02c81b03c33ec6d..5b734abf1c161b41001b428782a0f27d19f13edb 100644 (file)
@@ -389,7 +389,7 @@ breakpoints_should_be_inserted_now (void)
         no threads under GDB's control yet.  */
       return 1;
     }
-  else if (target_has_execution)
+  else
     {
       if (always_inserted_mode)
        {
@@ -398,8 +398,10 @@ breakpoints_should_be_inserted_now (void)
          return 1;
        }
 
-      if (threads_are_executing ())
-       return 1;
+      for (inferior *inf : all_inferiors ())
+       if (inf->has_execution ()
+           && threads_are_executing (inf->process_target ()))
+         return 1;
 
       /* Don't remove breakpoints yet if, even though all threads are
         stopped, we still have events to process.  */
@@ -2887,7 +2889,7 @@ update_inserted_breakpoint_locations (void)
         if we aren't attached to any process yet, we should still
         insert breakpoints.  */
       if (!gdbarch_has_global_breakpoints (target_gdbarch ())
-         && inferior_ptid == null_ptid)
+         && (inferior_ptid == null_ptid || !target_has_execution))
        continue;
 
       val = insert_bp_location (bl, &tmp_error_stream, &disabled_breaks,
@@ -2943,7 +2945,7 @@ insert_breakpoint_locations (void)
         if we aren't attached to any process yet, we should still
         insert breakpoints.  */
       if (!gdbarch_has_global_breakpoints (target_gdbarch ())
-         && inferior_ptid == null_ptid)
+         && (inferior_ptid == null_ptid || !target_has_execution))
        continue;
 
       val = insert_bp_location (bl, &tmp_error_stream, &disabled_breaks,
@@ -11903,7 +11905,18 @@ update_global_location_list (enum ugll_insert_mode insert_mode)
                 around.  We simply always ignore hardware watchpoint
                 traps we can no longer explain.  */
 
-             old_loc->events_till_retirement = 3 * (thread_count () + 1);
+             process_stratum_target *proc_target = nullptr;
+             for (inferior *inf : all_inferiors ())
+               if (inf->pspace == old_loc->pspace)
+                 {
+                   proc_target = inf->process_target ();
+                   break;
+                 }
+             if (proc_target != nullptr)
+               old_loc->events_till_retirement
+                 = 3 * (thread_count (proc_target) + 1);
+             else
+               old_loc->events_till_retirement = 1;
              old_loc->owner = NULL;
 
              moribund_locations.push_back (old_loc);
This page took 0.025916 seconds and 4 git commands to generate.