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]

[PATCH] [GDBserver] Replace "reinsert_breakpoint" with "singlestep_breakpoint"


reinsert_breakpoint is used for software single step, so it is more
clear to rename it to singleste_breakpoint.  This was pointed out in
the review https://sourceware.org/ml/gdb-patches/2016-05/msg00429.html
I don't rename "other_breakpoint" in this patch.

gdb/gdbserver:

2016-09-01  Yao Qi  <yao.qi@linaro.org>

	* linux-low.c: Replace "reinsert_breakpoints" with
	"singlestep_breakpoints".  Replace "reinsert breakpoints"
	with "singlestep breakpoints".
	* mem-break.c: Likewise.
	* mem-break.h: Likewise.
---
 gdb/gdbserver/linux-low.c | 68 +++++++++++++++++++++++------------------------
 gdb/gdbserver/mem-break.c | 66 ++++++++++++++++++++++-----------------------
 gdb/gdbserver/mem-break.h | 26 +++++++++---------
 3 files changed, 80 insertions(+), 80 deletions(-)

diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c
index 45061ac..b152922 100644
--- a/gdb/gdbserver/linux-low.c
+++ b/gdb/gdbserver/linux-low.c
@@ -550,11 +550,11 @@ handle_extended_wait (struct lwp_info **orig_event_lwp, int wstat)
 	      && can_software_single_step ()
 	      && event == PTRACE_EVENT_VFORK)
 	    {
-	      /* If we leave reinsert breakpoints there, child will
-		 hit it, so uninsert reinsert breakpoints from parent
+	      /* If we leave singlestep breakpoints there, child will
+		 hit it, so uninsert singlestep breakpoints from parent
 		 (and child).  Once vfork child is done, reinsert
 		 them back to parent.  */
-	      uninsert_reinsert_breakpoints (event_thr);
+	      uninsert_singlestep_breakpoints (event_thr);
 	    }
 
 	  clone_all_breakpoints (child_thr, event_thr);
@@ -582,7 +582,7 @@ handle_extended_wait (struct lwp_info **orig_event_lwp, int wstat)
 	  event_lwp->status_pending = wstat;
 
 	  /* If the parent thread is doing step-over with reinsert
-	     breakpoints, the list of reinsert breakpoints are cloned
+	     breakpoints, the list of singlestep breakpoints are cloned
 	     from the parent's.  Remove them from the child process.
 	     In case of vfork, we'll reinsert them back once vforked
 	     child is done.  */
@@ -592,10 +592,10 @@ handle_extended_wait (struct lwp_info **orig_event_lwp, int wstat)
 	      /* The child process is forked and stopped, so it is safe
 		 to access its memory without stopping all other threads
 		 from other processes.  */
-	      delete_reinsert_breakpoints (child_thr);
+	      delete_singlestep_breakpoints (child_thr);
 
-	      gdb_assert (has_reinsert_breakpoints (event_thr));
-	      gdb_assert (!has_reinsert_breakpoints (child_thr));
+	      gdb_assert (has_singlestep_breakpoints (event_thr));
+	      gdb_assert (!has_singlestep_breakpoints (child_thr));
 	    }
 
 	  /* Report the event.  */
@@ -649,9 +649,9 @@ handle_extended_wait (struct lwp_info **orig_event_lwp, int wstat)
 
       if (event_lwp->bp_reinsert != 0 && can_software_single_step ())
 	{
-	  reinsert_reinsert_breakpoints (event_thr);
+	  reinsert_singlestep_breakpoints (event_thr);
 
-	  gdb_assert (has_reinsert_breakpoints (event_thr));
+	  gdb_assert (has_singlestep_breakpoints (event_thr));
 	}
 
       /* Report the event.  */
@@ -2624,7 +2624,7 @@ maybe_hw_step (struct thread_info *thread)
     {
       /* GDBserver must insert reinsert breakpoint for software
 	 single step.  */
-      gdb_assert (has_reinsert_breakpoints (thread));
+      gdb_assert (has_singlestep_breakpoints (thread));
       return 0;
     }
 }
@@ -3330,13 +3330,13 @@ linux_wait_1 (ptid_t ptid,
      the breakpoint address.
      So in the case of the hardware single step advance the PC manually
      past the breakpoint and in the case of software single step advance only
-     if it's not the reinsert_breakpoint we are hitting.
+     if it's not the singlestep_breakpoint we are hitting.
      This avoids that a program would keep trapping a permanent breakpoint
      forever.  */
   if (!ptid_equal (step_over_bkpt, null_ptid)
       && event_child->stop_reason == TARGET_STOPPED_BY_SW_BREAKPOINT
       && (event_child->stepping
-	  || !reinsert_breakpoint_inserted_here (event_child->stop_pc)))
+	  || !singlestep_breakpoint_inserted_here (event_child->stop_pc)))
     {
       int increment_pc = 0;
       int breakpoint_kind = 0;
@@ -3390,8 +3390,8 @@ linux_wait_1 (ptid_t ptid,
 
       /* We have a SIGTRAP, possibly a step-over dance has just
 	 finished.  If so, tweak the state machine accordingly,
-	 reinsert breakpoints and delete any reinsert (software
-	 single-step) breakpoints.  */
+	 reinsert breakpoints and delete any single-step
+	 breakpoints.  */
       step_over_finished = finish_step_over (event_child);
 
       /* Now invoke the callbacks of any internal breakpoints there.  */
@@ -3705,48 +3705,48 @@ linux_wait_1 (ptid_t ptid,
 
   /* Alright, we're going to report a stop.  */
 
-  /* Remove reinsert breakpoints.  */
+  /* Remove singlestep breakpoints.  */
   if (can_software_single_step ())
     {
-      /* Remove reinsert breakpoints or not.  It it is true, stop all
+      /* Remove singlestep breakpoints or not.  It it is true, stop all
 	 lwps, so that other threads won't hit the breakpoint in the
 	 staled memory.  */
-      int remove_reinsert_breakpoints_p = 0;
+      int remove_singlestep_breakpoints_p = 0;
 
       if (non_stop)
 	{
-	  remove_reinsert_breakpoints_p
-	    = has_reinsert_breakpoints (current_thread);
+	  remove_singlestep_breakpoints_p
+	    = has_singlestep_breakpoints (current_thread);
 	}
       else
 	{
 	  /* In all-stop, a stop reply cancels all previous resume
-	     requests.  Delete all reinsert breakpoints.  */
+	     requests.  Delete all singlestep breakpoints.  */
 	  struct inferior_list_entry *inf, *tmp;
 
 	  ALL_INFERIORS (&all_threads, inf, tmp)
 	    {
 	      struct thread_info *thread = (struct thread_info *) inf;
 
-	      if (has_reinsert_breakpoints (thread))
+	      if (has_singlestep_breakpoints (thread))
 		{
-		  remove_reinsert_breakpoints_p = 1;
+		  remove_singlestep_breakpoints_p = 1;
 		  break;
 		}
 	    }
 	}
 
-      if (remove_reinsert_breakpoints_p)
+      if (remove_singlestep_breakpoints_p)
 	{
-	  /* If we remove reinsert breakpoints from memory, stop all lwps,
+	  /* If we remove singlestep breakpoints from memory, stop all lwps,
 	     so that other threads won't hit the breakpoint in the staled
 	     memory.  */
 	  stop_all_lwps (0, event_child);
 
 	  if (non_stop)
 	    {
-	      gdb_assert (has_reinsert_breakpoints (current_thread));
-	      delete_reinsert_breakpoints (current_thread);
+	      gdb_assert (has_singlestep_breakpoints (current_thread));
+	      delete_singlestep_breakpoints (current_thread);
 	    }
 	  else
 	    {
@@ -3756,8 +3756,8 @@ linux_wait_1 (ptid_t ptid,
 		{
 		  struct thread_info *thread = (struct thread_info *) inf;
 
-		  if (has_reinsert_breakpoints (thread))
-		    delete_reinsert_breakpoints (thread);
+		  if (has_singlestep_breakpoints (thread))
+		    delete_singlestep_breakpoints (thread);
 		}
 	    }
 
@@ -4279,7 +4279,7 @@ install_software_single_step_breakpoints (struct lwp_info *lwp)
   next_pcs = (*the_low_target.get_next_pcs) (regcache);
 
   for (i = 0; VEC_iterate (CORE_ADDR, next_pcs, i, pc); ++i)
-    set_reinsert_breakpoint (pc, current_ptid);
+    set_singlestep_breakpoint (pc, current_ptid);
 
   do_cleanups (old_chain);
 }
@@ -4902,15 +4902,15 @@ finish_step_over (struct lwp_info *lwp)
 
       lwp->bp_reinsert = 0;
 
-      /* Delete any software-single-step reinsert breakpoints.  No
+      /* Delete any software-single-step singlestep breakpoints.  No
 	 longer needed.  We don't have to worry about other threads
 	 hitting this trap, and later not being able to explain it,
 	 because we were stepping over a breakpoint, and we hold all
 	 threads but LWP stopped while doing that.  */
       if (!can_hardware_single_step ())
 	{
-	  gdb_assert (has_reinsert_breakpoints (current_thread));
-	  delete_reinsert_breakpoints (current_thread);
+	  gdb_assert (has_singlestep_breakpoints (current_thread));
+	  delete_singlestep_breakpoints (current_thread);
 	}
 
       step_over_bkpt = null_ptid;
@@ -5228,8 +5228,8 @@ proceed_one_lwp (struct inferior_list_entry *entry, void *except)
 
       /* If resume_step is requested by GDB, install reinsert
 	 breakpoints when the thread is about to be actually resumed if
-	 the reinsert breakpoints weren't removed.  */
-      if (can_software_single_step () && !has_reinsert_breakpoints (thread))
+	 the singlestep breakpoints weren't removed.  */
+      if (can_software_single_step () && !has_singlestep_breakpoints (thread))
 	install_software_single_step_breakpoints (lwp);
 
       step = maybe_hw_step (thread);
diff --git a/gdb/gdbserver/mem-break.c b/gdb/gdbserver/mem-break.c
index 7cd037f..2e06242 100644
--- a/gdb/gdbserver/mem-break.c
+++ b/gdb/gdbserver/mem-break.c
@@ -134,7 +134,7 @@ enum bkpt_type
     gdb_breakpoint_Z4,
 
     /* A basic-software-single-step breakpoint.  */
-    reinsert_breakpoint,
+    singlestep_breakpoint,
 
     /* Any other breakpoint type that doesn't require specific
        treatment goes here.  E.g., an event breakpoint.  */
@@ -206,9 +206,9 @@ struct other_breakpoint
   int (*handler) (CORE_ADDR);
 };
 
-/* Reinsert breakpoint.  */
+/* Breakpoint for single step.  */
 
-struct reinsert_breakpoint
+struct singlestep_breakpoint
 {
   struct breakpoint base;
 
@@ -828,12 +828,12 @@ set_breakpoint (enum bkpt_type type, enum raw_bkpt_type raw_type,
       other_bp->handler = handler;
       bp = (struct breakpoint *) other_bp;
     }
-  else if (type == reinsert_breakpoint)
+  else if (type == singlestep_breakpoint)
     {
-      struct reinsert_breakpoint *reinsert_bp
-	= XCNEW (struct reinsert_breakpoint);
+      struct singlestep_breakpoint *ss_bp
+	= XCNEW (struct singlestep_breakpoint);
 
-      bp = (struct breakpoint *) reinsert_bp;
+      bp = (struct breakpoint *) ss_bp;
     }
   else
     gdb_assert_not_reached ("unhandled breakpoint type");
@@ -1479,19 +1479,19 @@ gdb_breakpoint_here (CORE_ADDR where)
 }
 
 void
-set_reinsert_breakpoint (CORE_ADDR stop_at, ptid_t ptid)
+set_singlestep_breakpoint (CORE_ADDR stop_at, ptid_t ptid)
 {
-  struct reinsert_breakpoint *bp;
+  struct singlestep_breakpoint *bp;
 
   gdb_assert (ptid_get_pid (current_ptid) == ptid_get_pid (ptid));
 
-  bp = (struct reinsert_breakpoint *) set_breakpoint_type_at (reinsert_breakpoint,
-							      stop_at, NULL);
+  bp = (struct singlestep_breakpoint *) set_breakpoint_type_at (singlestep_breakpoint,
+								stop_at, NULL);
   bp->ptid = ptid;
 }
 
 void
-delete_reinsert_breakpoints (struct thread_info *thread)
+delete_singlestep_breakpoints (struct thread_info *thread)
 {
   struct process_info *proc = get_thread_process (thread);
   struct breakpoint *bp, **bp_link;
@@ -1501,8 +1501,8 @@ delete_reinsert_breakpoints (struct thread_info *thread)
 
   while (bp)
     {
-      if (bp->type == reinsert_breakpoint
-	  && ptid_equal (((struct reinsert_breakpoint *) bp)->ptid,
+      if (bp->type == singlestep_breakpoint
+	  && ptid_equal (((struct singlestep_breakpoint *) bp)->ptid,
 			 ptid_of (thread)))
 	{
 	  struct thread_info *saved_thread = current_thread;
@@ -1591,15 +1591,15 @@ uninsert_all_breakpoints (void)
 }
 
 void
-uninsert_reinsert_breakpoints (struct thread_info *thread)
+uninsert_singlestep_breakpoints (struct thread_info *thread)
 {
   struct process_info *proc = get_thread_process (thread);
   struct breakpoint *bp;
 
   for (bp = proc->breakpoints; bp != NULL; bp = bp->next)
     {
-    if (bp->type == reinsert_breakpoint
-	&& ptid_equal (((struct reinsert_breakpoint *) bp)->ptid,
+    if (bp->type == singlestep_breakpoint
+	&& ptid_equal (((struct singlestep_breakpoint *) bp)->ptid,
 		       ptid_of (thread)))
       {
 	gdb_assert (bp->raw->inserted > 0);
@@ -1663,7 +1663,7 @@ reinsert_breakpoints_at (CORE_ADDR pc)
 }
 
 int
-has_reinsert_breakpoints (struct thread_info *thread)
+has_singlestep_breakpoints (struct thread_info *thread)
 {
   struct process_info *proc = get_thread_process (thread);
   struct breakpoint *bp, **bp_link;
@@ -1673,8 +1673,8 @@ has_reinsert_breakpoints (struct thread_info *thread)
 
   while (bp)
     {
-      if (bp->type == reinsert_breakpoint
-	  && ptid_equal (((struct reinsert_breakpoint *) bp)->ptid,
+      if (bp->type == singlestep_breakpoint
+	  && ptid_equal (((struct singlestep_breakpoint *) bp)->ptid,
 			 ptid_of (thread)))
 	return 1;
       else
@@ -1701,15 +1701,15 @@ reinsert_all_breakpoints (void)
 }
 
 void
-reinsert_reinsert_breakpoints (struct thread_info *thread)
+reinsert_singlestep_breakpoints (struct thread_info *thread)
 {
   struct process_info *proc = get_thread_process (thread);
   struct breakpoint *bp;
 
   for (bp = proc->breakpoints; bp != NULL; bp = bp->next)
     {
-      if (bp->type == reinsert_breakpoint
-	  && ptid_equal (((struct reinsert_breakpoint *) bp)->ptid,
+      if (bp->type == singlestep_breakpoint
+	  && ptid_equal (((struct singlestep_breakpoint *) bp)->ptid,
 			 ptid_of (thread)))
 	{
 	  gdb_assert (bp->raw->inserted > 0);
@@ -1839,13 +1839,13 @@ hardware_breakpoint_inserted_here (CORE_ADDR addr)
 /* See mem-break.h.  */
 
 int
-reinsert_breakpoint_inserted_here (CORE_ADDR addr)
+singlestep_breakpoint_inserted_here (CORE_ADDR addr)
 {
   struct process_info *proc = current_process ();
   struct breakpoint *bp;
 
   for (bp = proc->breakpoints; bp != NULL; bp = bp->next)
-    if (bp->type == reinsert_breakpoint
+    if (bp->type == singlestep_breakpoint
 	&& bp->raw->pc == addr
 	&& bp->raw->inserted)
       return 1;
@@ -1885,9 +1885,9 @@ delete_disabled_breakpoints (void)
       next = bp->next;
       if (bp->raw->inserted < 0)
 	{
-	  /* If reinsert_breakpoints become disabled, that means the
+	  /* If singlestep_breakpoints become disabled, that means the
 	     manipulations (insertion and removal) of them are wrong.  */
-	  gdb_assert (bp->type != reinsert_breakpoint);
+	  gdb_assert (bp->type != singlestep_breakpoint);
 	  delete_breakpoint_1 (proc, bp);
 	}
     }
@@ -2200,15 +2200,15 @@ clone_one_breakpoint (const struct breakpoint *src, ptid_t ptid)
       other_dest->handler = ((struct other_breakpoint *) src)->handler;
       dest = (struct breakpoint *) other_dest;
     }
-  else if (src->type == reinsert_breakpoint)
+  else if (src->type == singlestep_breakpoint)
     {
-      struct reinsert_breakpoint *reinsert_dest
-	= XCNEW (struct reinsert_breakpoint);
+      struct singlestep_breakpoint *ss_dest
+	= XCNEW (struct singlestep_breakpoint);
 
-      dest = (struct breakpoint *) reinsert_dest;
-      /* Since reinsert breakpoint is thread specific, don't copy
+      dest = (struct breakpoint *) ss_dest;
+      /* Since singlestep breakpoint is thread specific, don't copy
 	 thread id from SRC, use ID instead.  */
-      reinsert_dest->ptid = ptid;
+      ss_dest->ptid = ptid;
     }
   else
     gdb_assert_not_reached ("unhandled breakpoint type");
diff --git a/gdb/gdbserver/mem-break.h b/gdb/gdbserver/mem-break.h
index 3322ec5..94eefad 100644
--- a/gdb/gdbserver/mem-break.h
+++ b/gdb/gdbserver/mem-break.h
@@ -101,9 +101,9 @@ int software_breakpoint_inserted_here (CORE_ADDR addr);
 
 int hardware_breakpoint_inserted_here (CORE_ADDR addr);
 
-/* Returns TRUE if there's any reinsert breakpoint at ADDR.  */
+/* Returns TRUE if there's any singlestep breakpoint at ADDR.  */
 
-int reinsert_breakpoint_inserted_here (CORE_ADDR addr);
+int singlestep_breakpoint_inserted_here (CORE_ADDR addr);
 
 /* Clear all breakpoint conditions and commands associated with a
    breakpoint.  */
@@ -152,32 +152,32 @@ struct breakpoint *set_breakpoint_at (CORE_ADDR where,
 
 int delete_breakpoint (struct breakpoint *bkpt);
 
-/* Set a reinsert breakpoint at STOP_AT for thread represented by
+/* Set a singlestep breakpoint at STOP_AT for thread represented by
    PTID.  */
 
-void set_reinsert_breakpoint (CORE_ADDR stop_at, ptid_t ptid);
+void set_singlestep_breakpoint (CORE_ADDR stop_at, ptid_t ptid);
 
-/* Delete all reinsert breakpoints of THREAD.  */
+/* Delete all singlestep breakpoints of THREAD.  */
 
-void delete_reinsert_breakpoints (struct thread_info *thread);
+void delete_singlestep_breakpoints (struct thread_info *thread);
 
-/* Reinsert all reinsert breakpoints of THREAD.  */
+/* Reinsert all singlestep breakpoints of THREAD.  */
 
-void reinsert_reinsert_breakpoints (struct thread_info *thread);
+void reinsert_singlestep_breakpoints (struct thread_info *thread);
 
-/* Uninsert all reinsert breakpoints of THREAD.  This still leaves
-   the reinsert breakpoints in the table.  */
+/* Uninsert all singlestep breakpoints of THREAD.  This still leaves
+   the singlestep breakpoints in the table.  */
 
-void uninsert_reinsert_breakpoints (struct thread_info *thread);
+void uninsert_singlestep_breakpoints (struct thread_info *thread);
 
 /* Reinsert breakpoints at WHERE (and change their status to
    inserted).  */
 
 void reinsert_breakpoints_at (CORE_ADDR where);
 
-/* The THREAD has reinsert breakpoints or not.  */
+/* The THREAD has singlestep breakpoints or not.  */
 
-int has_reinsert_breakpoints (struct thread_info *thread);
+int has_singlestep_breakpoints (struct thread_info *thread);
 
 /* Uninsert breakpoints at WHERE (and change their status to
    uninserted).  This still leaves the breakpoints in the table.  */
-- 
1.9.1


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