]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb: add program_space parameter to mark_breakpoints_out
authorSimon Marchi <simon.marchi@efficios.com>
Wed, 7 Feb 2024 16:53:19 +0000 (11:53 -0500)
committerSimon Marchi <simon.marchi@polymtl.ca>
Fri, 9 Feb 2024 16:09:55 +0000 (11:09 -0500)
Make the current_program_space reference bubble up one level.

Change-Id: Idc8ed78d23bf3bb2969f6963d8cc049f26901c29
Approved-By: Andrew Burgess <aburgess@redhat.com>
gdb/breakpoint.c
gdb/breakpoint.h
gdb/infrun.c
gdb/target.c

index 7d1171ec35eb2091902721b5535c75f588a5f7dc..d844ef7baf258a255caed1dd67c5eb4d6761e249 100644 (file)
@@ -4216,13 +4216,13 @@ remove_breakpoint (struct bp_location *bl)
   return remove_breakpoint_1 (bl, REMOVE_BREAKPOINT);
 }
 
-/* Clear the "inserted" flag in all breakpoints.  */
+/* See breakpoint.h.  */
 
 void
-mark_breakpoints_out (void)
+mark_breakpoints_out (program_space *pspace)
 {
   for (bp_location *bl : all_bp_locations ())
-    if (bl->pspace == current_program_space)
+    if (bl->pspace == pspace)
       bl->inserted = 0;
 }
 
@@ -4248,7 +4248,7 @@ breakpoint_init_inferior (enum inf_context context)
   if (gdbarch_has_global_breakpoints (current_inferior ()->arch ()))
     return;
 
-  mark_breakpoints_out ();
+  mark_breakpoints_out (pspace);
 
   for (breakpoint &b : all_breakpoints_safe ())
     {
index 93c49520e8ced845cc5e408f63c9cdfb2d0ebff3..e7bebed2725d34d5cd6c50dbacf44b5b0d6d5ad1 100644 (file)
@@ -1764,8 +1764,9 @@ extern void breakpoint_set_inferior (struct breakpoint *b, int inferior);
 
 extern void breakpoint_set_task (struct breakpoint *b, int task);
 
-/* Clear the "inserted" flag in all breakpoints.  */
-extern void mark_breakpoints_out (void);
+/* Clear the "inserted" flag in all breakpoints locations in PSPACE.  */
+
+extern void mark_breakpoints_out (program_space *pspace);
 
 extern struct breakpoint *create_jit_event_breakpoint (struct gdbarch *,
                                                       CORE_ADDR);
index 87965fb12742a0f03ca9e9a47635cf6acb60bdd5..d00a98906d71d890e08e7226a7c73c57315b0226 100644 (file)
@@ -1247,7 +1247,7 @@ follow_exec (ptid_t ptid, const char *exec_file_target)
      value that was overwritten with a TRAP instruction).  Since
      we now have a new a.out, those shadow contents aren't valid.  */
 
-  mark_breakpoints_out ();
+  mark_breakpoints_out (current_program_space);
 
   /* The target reports the exec event to the main thread, even if
      some other thread does the exec, and even if the main thread was
index ec75f952ea2072c912b301912abb668d1f675c4d..e72e22da69a3bae0c336b480016b3dedde47a343 100644 (file)
@@ -3628,7 +3628,7 @@ generic_mourn_inferior (void)
   /* Mark breakpoints uninserted in case something tries to delete a
      breakpoint while we delete the inferior's threads (which would
      fail, since the inferior is long gone).  */
-  mark_breakpoints_out ();
+  mark_breakpoints_out (inf->pspace);
 
   if (inf->pid != 0)
     exit_inferior (inf);