* breakpoint.c, breakpoint.h (breakpoint_init_inferior): New function
[deliverable/binutils-gdb.git] / gdb / breakpoint.c
index ee5cf541d693859163b692d0502d5050f9fc5220..2db375340eb137dba18c07a92fc53ee9d945bace 100644 (file)
@@ -505,8 +505,7 @@ remove_breakpoints ()
   return 0;
 }
 
-/* Clear the "inserted" flag in all breakpoints.
-   This is done when the inferior is loaded.  */
+/* Clear the "inserted" flag in all breakpoints.  */
 
 void
 mark_breakpoints_out ()
@@ -517,6 +516,26 @@ mark_breakpoints_out ()
     b->inserted = 0;
 }
 
+/* Clear the "inserted" flag in all breakpoints and delete any breakpoints
+   which should go away between runs of the program.  */
+
+void
+breakpoint_init_inferior ()
+{
+  register struct breakpoint *b, *temp;
+
+  ALL_BREAKPOINTS_SAFE (b, temp)
+    {
+      b->inserted = 0;
+
+      /* If the call dummy breakpoint is at the entry point it will
+        cause problems when the inferior is rerun, so we better
+        get rid of it.  */
+      if (b->type == bp_call_dummy)
+       delete_breakpoint (b);
+    }
+}
+
 /* breakpoint_here_p (PC) returns 1 if an enabled breakpoint exists at PC.
    When continuing from a location with a breakpoint,
    we actually single step once before calling insert_breakpoints.  */
@@ -2709,6 +2728,7 @@ breakpoint_re_set_one (bint)
     case bp_finish:
     case bp_longjmp:
     case bp_longjmp_resume:
+    case bp_call_dummy:
       delete_breakpoint (b);
       break;
     }
This page took 0.023702 seconds and 4 git commands to generate.