This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFA] Localize infrun use of remove_breakpoints.


Several calls to remove_breakpoints are to handle
stepping over breakpoints, and it's quite possible
to handle that in a single place -- namely keep_going.
(This patch is on top of my previous patches to
eliminate breakpoints_inserted and rename trap_expected).
OK?

- Volodya

	* infrun.c (handle_inferior_event): Remove
	calls to remove_breakpoints, except where needed to
	communicate change of breakpoint locations to inferior.
	(keep_going): If steppping over breakpoint, remove
	breakpoints.
---
 gdb/infrun.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/gdb/infrun.c b/gdb/infrun.c
index 05b2743..c439ded 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -2154,7 +2154,6 @@ process_event_stop_test:
         if (debug_infrun)
 	  fprintf_unfiltered (gdb_stdlog, "infrun: BPSTAT_WHAT_SET_LONGJMP_RESUME\n");
 	disable_longjmp_breakpoint ();
-	remove_breakpoints ();
 	if (!gdbarch_get_longjmp_target_p (current_gdbarch)
 	    || !gdbarch_get_longjmp_target (current_gdbarch,
 					    get_current_frame (), &jmp_buf_pc))
@@ -2179,7 +2178,6 @@ process_event_stop_test:
       case BPSTAT_WHAT_CLEAR_LONGJMP_RESUME_SINGLE:
         if (debug_infrun)
 	  fprintf_unfiltered (gdb_stdlog, "infrun: BPSTAT_WHAT_CLEAR_LONGJMP_RESUME\n");
-	remove_breakpoints ();
 	disable_longjmp_breakpoint ();
 	ecs->handling_longjmp = 0;	/* FIXME */
 	if (what.main_action == BPSTAT_WHAT_CLEAR_LONGJMP_RESUME)
@@ -2189,7 +2187,6 @@ process_event_stop_test:
       case BPSTAT_WHAT_SINGLE:
         if (debug_infrun)
 	  fprintf_unfiltered (gdb_stdlog, "infrun: BPSTAT_WHAT_SINGLE\n");
-	remove_breakpoints ();
 	ecs->stepping_over_breakpoint = 1;
 	/* Still need to check other stuff, at least the case
 	   where we are stepping and step out of the right range.  */
@@ -2250,7 +2247,6 @@ process_event_stop_test:
 	       were trying to single-step off a breakpoint.  Go back
 	       to doing that.  */
 	    ecs->step_after_step_resume_breakpoint = 0;
-	    remove_breakpoints ();
 	    ecs->stepping_over_breakpoint = 1;
 	    keep_going (ecs);
 	    return;
@@ -2970,7 +2966,11 @@ keep_going (struct execution_control_state *ecs)
 	 already inserted breakpoints.  Therefore, we don't
 	 care if breakpoints were already inserted, or not.  */
       
-      if (!ecs->stepping_over_breakpoint)
+      if (ecs->stepping_over_breakpoint)
+	{
+	  remove_breakpoints ();
+	}
+      else
 	{
 	  /* Stop stepping when inserting breakpoints
 	     has failed.  */
-- 
1.5.3.5


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]