&& 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 single-step breakpoints there, child will
+ hit it, so uninsert single-step breakpoints from parent
(and child). Once vfork child is done, reinsert
them back to parent. */
- uninsert_reinsert_breakpoints (event_thr);
+ uninsert_single_step_breakpoints (event_thr);
}
clone_all_breakpoints (child_thr, event_thr);
event_lwp->status_pending_p = 1;
event_lwp->status_pending = wstat;
- /* If the parent thread is doing step-over with reinsert
- breakpoints, the list of reinsert breakpoints are cloned
+ /* If the parent thread is doing step-over with single-step
+ breakpoints, the list of single-step 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. */
/* 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_single_step_breakpoints (child_thr);
- gdb_assert (has_reinsert_breakpoints (event_thr));
- gdb_assert (!has_reinsert_breakpoints (child_thr));
+ gdb_assert (has_single_step_breakpoints (event_thr));
+ gdb_assert (!has_single_step_breakpoints (child_thr));
}
/* Report the event. */
if (event_lwp->bp_reinsert != 0 && can_software_single_step ())
{
- reinsert_reinsert_breakpoints (event_thr);
+ reinsert_single_step_breakpoints (event_thr);
- gdb_assert (has_reinsert_breakpoints (event_thr));
+ gdb_assert (has_single_step_breakpoints (event_thr));
}
/* Report the event. */
return 1;
else
{
- /* GDBserver must insert reinsert breakpoint for software
+ /* GDBserver must insert single-step breakpoint for software
single step. */
- gdb_assert (has_reinsert_breakpoints (thread));
+ gdb_assert (has_single_step_breakpoints (thread));
return 0;
}
}
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 single_step_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)))
+ || !single_step_breakpoint_inserted_here (event_child->stop_pc)))
{
int increment_pc = 0;
int breakpoint_kind = 0;
/* 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. */
/* Alright, we're going to report a stop. */
- /* Remove reinsert breakpoints. */
+ /* Remove single-step breakpoints. */
if (can_software_single_step ())
{
- /* Remove reinsert breakpoints or not. It it is true, stop all
+ /* Remove single-step 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_single_step_breakpoints_p = 0;
if (non_stop)
{
- remove_reinsert_breakpoints_p
- = has_reinsert_breakpoints (current_thread);
+ remove_single_step_breakpoints_p
+ = has_single_step_breakpoints (current_thread);
}
else
{
/* In all-stop, a stop reply cancels all previous resume
- requests. Delete all reinsert breakpoints. */
+ requests. Delete all single-step 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_single_step_breakpoints (thread))
{
- remove_reinsert_breakpoints_p = 1;
+ remove_single_step_breakpoints_p = 1;
break;
}
}
}
- if (remove_reinsert_breakpoints_p)
+ if (remove_single_step_breakpoints_p)
{
- /* If we remove reinsert breakpoints from memory, stop all lwps,
+ /* If we remove single-step 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_single_step_breakpoints (current_thread));
+ delete_single_step_breakpoints (current_thread);
}
else
{
{
struct thread_info *thread = (struct thread_info *) inf;
- if (has_reinsert_breakpoints (thread))
- delete_reinsert_breakpoints (thread);
+ if (has_single_step_breakpoints (thread))
+ delete_single_step_breakpoints (thread);
}
}
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_single_step_breakpoint (pc, current_ptid);
do_cleanups (old_chain);
}
}
/* Finish a step-over. Reinsert the breakpoint we had uninserted in
- start_step_over, if still there, and delete any reinsert
+ start_step_over, if still there, and delete any single-step
breakpoints we've set, on non hardware single-step targets. */
static int
lwp->bp_reinsert = 0;
- /* Delete any software-single-step reinsert 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. */
+ /* Delete any single-step 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_single_step_breakpoints (current_thread));
+ delete_single_step_breakpoints (current_thread);
}
step_over_bkpt = null_ptid;
debug_printf (" stepping LWP %ld, client wants it stepping\n",
lwpid_of (thread));
- /* If resume_step is requested by GDB, install reinsert
+ /* If resume_step is requested by GDB, install single-step
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 single-step breakpoints weren't removed. */
+ if (can_software_single_step ()
+ && !has_single_step_breakpoints (thread))
install_software_single_step_breakpoints (lwp);
step = maybe_hw_step (thread);
/* A GDB access watchpoint, requested with a Z4 packet. */
gdb_breakpoint_Z4,
- /* A basic-software-single-step breakpoint. */
- reinsert_breakpoint,
+ /* A software single-step breakpoint. */
+ single_step_breakpoint,
/* Any other breakpoint type that doesn't require specific
treatment goes here. E.g., an event breakpoint. */
int (*handler) (CORE_ADDR);
};
-/* Reinsert breakpoint. */
+/* Breakpoint for single step. */
-struct reinsert_breakpoint
+struct single_step_breakpoint
{
struct breakpoint base;
other_bp->handler = handler;
bp = (struct breakpoint *) other_bp;
}
- else if (type == reinsert_breakpoint)
+ else if (type == single_step_breakpoint)
{
- struct reinsert_breakpoint *reinsert_bp
- = XCNEW (struct reinsert_breakpoint);
+ struct single_step_breakpoint *ss_bp
+ = XCNEW (struct single_step_breakpoint);
- bp = (struct breakpoint *) reinsert_bp;
+ bp = (struct breakpoint *) ss_bp;
}
else
gdb_assert_not_reached ("unhandled breakpoint type");
}
void
-set_reinsert_breakpoint (CORE_ADDR stop_at, ptid_t ptid)
+set_single_step_breakpoint (CORE_ADDR stop_at, ptid_t ptid)
{
- struct reinsert_breakpoint *bp;
+ struct single_step_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 single_step_breakpoint *) set_breakpoint_type_at (single_step_breakpoint,
+ stop_at, NULL);
bp->ptid = ptid;
}
void
-delete_reinsert_breakpoints (struct thread_info *thread)
+delete_single_step_breakpoints (struct thread_info *thread)
{
struct process_info *proc = get_thread_process (thread);
struct breakpoint *bp, **bp_link;
while (bp)
{
- if (bp->type == reinsert_breakpoint
- && ptid_equal (((struct reinsert_breakpoint *) bp)->ptid,
+ if (bp->type == single_step_breakpoint
+ && ptid_equal (((struct single_step_breakpoint *) bp)->ptid,
ptid_of (thread)))
{
struct thread_info *saved_thread = current_thread;
}
void
-uninsert_reinsert_breakpoints (struct thread_info *thread)
+uninsert_single_step_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 == single_step_breakpoint
+ && ptid_equal (((struct single_step_breakpoint *) bp)->ptid,
ptid_of (thread)))
{
gdb_assert (bp->raw->inserted > 0);
}
int
-has_reinsert_breakpoints (struct thread_info *thread)
+has_single_step_breakpoints (struct thread_info *thread)
{
struct process_info *proc = get_thread_process (thread);
struct breakpoint *bp, **bp_link;
while (bp)
{
- if (bp->type == reinsert_breakpoint
- && ptid_equal (((struct reinsert_breakpoint *) bp)->ptid,
+ if (bp->type == single_step_breakpoint
+ && ptid_equal (((struct single_step_breakpoint *) bp)->ptid,
ptid_of (thread)))
return 1;
else
}
void
-reinsert_reinsert_breakpoints (struct thread_info *thread)
+reinsert_single_step_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 == single_step_breakpoint
+ && ptid_equal (((struct single_step_breakpoint *) bp)->ptid,
ptid_of (thread)))
{
gdb_assert (bp->raw->inserted > 0);
/* See mem-break.h. */
int
-reinsert_breakpoint_inserted_here (CORE_ADDR addr)
+single_step_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 == single_step_breakpoint
&& bp->raw->pc == addr
&& bp->raw->inserted)
return 1;
next = bp->next;
if (bp->raw->inserted < 0)
{
- /* If reinsert_breakpoints become disabled, that means the
+ /* If single_step_breakpoints become disabled, that means the
manipulations (insertion and removal) of them are wrong. */
- gdb_assert (bp->type != reinsert_breakpoint);
+ gdb_assert (bp->type != single_step_breakpoint);
delete_breakpoint_1 (proc, bp);
}
}
other_dest->handler = ((struct other_breakpoint *) src)->handler;
dest = (struct breakpoint *) other_dest;
}
- else if (src->type == reinsert_breakpoint)
+ else if (src->type == single_step_breakpoint)
{
- struct reinsert_breakpoint *reinsert_dest
- = XCNEW (struct reinsert_breakpoint);
+ struct single_step_breakpoint *ss_dest
+ = XCNEW (struct single_step_breakpoint);
- dest = (struct breakpoint *) reinsert_dest;
- /* Since reinsert breakpoint is thread specific, don't copy
+ dest = (struct breakpoint *) ss_dest;
+ /* Since single-step 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");
int hardware_breakpoint_inserted_here (CORE_ADDR addr);
-/* Returns TRUE if there's any reinsert breakpoint at ADDR. */
+/* Returns TRUE if there's any single-step breakpoint at ADDR. */
-int reinsert_breakpoint_inserted_here (CORE_ADDR addr);
+int single_step_breakpoint_inserted_here (CORE_ADDR addr);
/* Clear all breakpoint conditions and commands associated with a
breakpoint. */
int delete_breakpoint (struct breakpoint *bkpt);
-/* Set a reinsert breakpoint at STOP_AT for thread represented by
+/* Set a single-step breakpoint at STOP_AT for thread represented by
PTID. */
-void set_reinsert_breakpoint (CORE_ADDR stop_at, ptid_t ptid);
+void set_single_step_breakpoint (CORE_ADDR stop_at, ptid_t ptid);
-/* Delete all reinsert breakpoints of THREAD. */
+/* Delete all single-step breakpoints of THREAD. */
-void delete_reinsert_breakpoints (struct thread_info *thread);
+void delete_single_step_breakpoints (struct thread_info *thread);
-/* Reinsert all reinsert breakpoints of THREAD. */
+/* Reinsert all single-step breakpoints of THREAD. */
-void reinsert_reinsert_breakpoints (struct thread_info *thread);
+void reinsert_single_step_breakpoints (struct thread_info *thread);
-/* Uninsert all reinsert breakpoints of THREAD. This still leaves
- the reinsert breakpoints in the table. */
+/* Uninsert all single-step breakpoints of THREAD. This still leaves
+ the single-step breakpoints in the table. */
-void uninsert_reinsert_breakpoints (struct thread_info *thread);
+void uninsert_single_step_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 single-step breakpoints or not. */
-int has_reinsert_breakpoints (struct thread_info *thread);
+int has_single_step_breakpoints (struct thread_info *thread);
/* Uninsert breakpoints at WHERE (and change their status to
uninserted). This still leaves the breakpoints in the table. */