infrun.c:process_event_stop_test: Reindent.
gdb/ 2013-10-28 Pedro Alves <palves@redhat.com> * infrun.c (process_event_stop_test): Remove unnecessary scoping level and reindent.
This commit is contained in:
parent
94c57d6a62
commit
cdaa5b7326
@ -1,3 +1,8 @@
|
||||
2013-10-28 Pedro Alves <palves@redhat.com>
|
||||
|
||||
* infrun.c (process_event_stop_test): Remove unnecessary scoping
|
||||
level and reindent.
|
||||
|
||||
2013-10-28 Pedro Alves <palves@redhat.com>
|
||||
|
||||
* infrun.c (process_event_stop_test): New function, factored out
|
||||
|
78
gdb/infrun.c
78
gdb/infrun.c
@ -4422,13 +4422,11 @@ process_event_stop_test (struct execution_control_state *ecs)
|
||||
struct symtab_and_line stop_pc_sal;
|
||||
struct frame_info *frame;
|
||||
struct gdbarch *gdbarch;
|
||||
|
||||
{
|
||||
/* Handle cases caused by hitting a breakpoint. */
|
||||
|
||||
CORE_ADDR jmp_buf_pc;
|
||||
struct bpstat_what what;
|
||||
|
||||
/* Handle cases caused by hitting a breakpoint. */
|
||||
|
||||
frame = get_current_frame ();
|
||||
gdbarch = get_frame_arch (frame);
|
||||
|
||||
@ -4440,8 +4438,8 @@ process_event_stop_test (struct execution_control_state *ecs)
|
||||
}
|
||||
|
||||
/* If we hit an internal event that triggers symbol changes, the
|
||||
current frame will be invalidated within bpstat_what (e.g.,
|
||||
if we hit an internal solib event). Re-fetch it. */
|
||||
current frame will be invalidated within bpstat_what (e.g., if we
|
||||
hit an internal solib event). Re-fetch it. */
|
||||
frame = get_current_frame ();
|
||||
gdbarch = get_frame_arch (frame);
|
||||
|
||||
@ -4462,10 +4460,9 @@ process_event_stop_test (struct execution_control_state *ecs)
|
||||
{
|
||||
struct value *arg_value;
|
||||
|
||||
/* If we set the longjmp breakpoint via a SystemTap
|
||||
probe, then use it to extract the arguments. The
|
||||
destination PC is the third argument to the
|
||||
probe. */
|
||||
/* If we set the longjmp breakpoint via a SystemTap probe,
|
||||
then use it to extract the arguments. The destination PC
|
||||
is the third argument to the probe. */
|
||||
arg_value = probe_safe_evaluate_at_pc (frame, 2);
|
||||
if (arg_value)
|
||||
jmp_buf_pc = value_as_address (arg_value);
|
||||
@ -4495,22 +4492,21 @@ process_event_stop_test (struct execution_control_state *ecs)
|
||||
|
||||
/* There are several cases to consider.
|
||||
|
||||
1. The initiating frame no longer exists. In this case
|
||||
we must stop, because the exception or longjmp has gone
|
||||
too far.
|
||||
1. The initiating frame no longer exists. In this case we
|
||||
must stop, because the exception or longjmp has gone too
|
||||
far.
|
||||
|
||||
2. The initiating frame exists, and is the same as the
|
||||
current frame. We stop, because the exception or
|
||||
longjmp has been caught.
|
||||
current frame. We stop, because the exception or longjmp
|
||||
has been caught.
|
||||
|
||||
3. The initiating frame exists and is different from
|
||||
the current frame. This means the exception or longjmp
|
||||
has been caught beneath the initiating frame, so keep
|
||||
going.
|
||||
3. The initiating frame exists and is different from the
|
||||
current frame. This means the exception or longjmp has
|
||||
been caught beneath the initiating frame, so keep going.
|
||||
|
||||
4. longjmp breakpoint has been placed just to protect
|
||||
against stale dummy frames and user is not interested
|
||||
in stopping around longjmps. */
|
||||
against stale dummy frames and user is not interested in
|
||||
stopping around longjmps. */
|
||||
|
||||
if (debug_infrun)
|
||||
fprintf_unfiltered (gdb_stdlog,
|
||||
@ -4551,8 +4547,8 @@ process_event_stop_test (struct execution_control_state *ecs)
|
||||
}
|
||||
}
|
||||
|
||||
/* For Cases 1 and 2, remove the step-resume breakpoint,
|
||||
if it exists. */
|
||||
/* For Cases 1 and 2, remove the step-resume breakpoint, if it
|
||||
exists. */
|
||||
delete_step_resume_breakpoint (ecs->event_thread);
|
||||
|
||||
ecs->event_thread->control.stop_step = 1;
|
||||
@ -4565,8 +4561,8 @@ process_event_stop_test (struct execution_control_state *ecs)
|
||||
if (debug_infrun)
|
||||
fprintf_unfiltered (gdb_stdlog, "infrun: BPSTAT_WHAT_SINGLE\n");
|
||||
ecs->event_thread->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. */
|
||||
/* Still need to check other stuff, at least the case where we
|
||||
are stepping and step out of the right range. */
|
||||
break;
|
||||
|
||||
case BPSTAT_WHAT_STEP_RESUME:
|
||||
@ -4579,11 +4575,11 @@ process_event_stop_test (struct execution_control_state *ecs)
|
||||
{
|
||||
struct thread_info *tp = ecs->event_thread;
|
||||
|
||||
/* We are finishing a function in reverse, and just hit
|
||||
the step-resume breakpoint at the start address of
|
||||
the function, and we're almost there -- just need to
|
||||
back up by one more single-step, which should take us
|
||||
back to the function call. */
|
||||
/* We are finishing a function in reverse, and just hit the
|
||||
step-resume breakpoint at the start address of the
|
||||
function, and we're almost there -- just need to back up
|
||||
by one more single-step, which should take us back to the
|
||||
function call. */
|
||||
tp->control.step_range_start = tp->control.step_range_end = 1;
|
||||
keep_going (ecs);
|
||||
return;
|
||||
@ -4592,10 +4588,10 @@ process_event_stop_test (struct execution_control_state *ecs)
|
||||
if (stop_pc == ecs->stop_func_start
|
||||
&& execution_direction == EXEC_REVERSE)
|
||||
{
|
||||
/* We are stepping over a function call in reverse, and
|
||||
just hit the step-resume breakpoint at the start
|
||||
address of the function. Go back to single-stepping,
|
||||
which should take us back to the function call. */
|
||||
/* We are stepping over a function call in reverse, and just
|
||||
hit the step-resume breakpoint at the start address of
|
||||
the function. Go back to single-stepping, which should
|
||||
take us back to the function call. */
|
||||
ecs->event_thread->stepping_over_breakpoint = 1;
|
||||
keep_going (ecs);
|
||||
return;
|
||||
@ -4632,8 +4628,8 @@ process_event_stop_test (struct execution_control_state *ecs)
|
||||
if (ecs->event_thread->step_after_step_resume_breakpoint)
|
||||
{
|
||||
/* Back when the step-resume breakpoint was inserted, we
|
||||
were trying to single-step off a breakpoint. Go back
|
||||
to doing that. */
|
||||
were trying to single-step off a breakpoint. Go back to
|
||||
doing that. */
|
||||
ecs->event_thread->step_after_step_resume_breakpoint = 0;
|
||||
ecs->event_thread->stepping_over_breakpoint = 1;
|
||||
keep_going (ecs);
|
||||
@ -4644,13 +4640,11 @@ process_event_stop_test (struct execution_control_state *ecs)
|
||||
case BPSTAT_WHAT_KEEP_CHECKING:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* We come here if we hit a breakpoint but should not
|
||||
stop for it. Possibly we also were stepping
|
||||
and should stop for that. So fall through and
|
||||
test for stepping. But, if not stepping,
|
||||
do not stop. */
|
||||
/* We come here if we hit a breakpoint but should not stop for it.
|
||||
Possibly we also were stepping and should stop for that. So fall
|
||||
through and test for stepping. But, if not stepping, do not
|
||||
stop. */
|
||||
|
||||
/* In all-stop mode, if we're currently stepping but have stopped in
|
||||
some other thread, we need to switch back to the stepped thread. */
|
||||
|
Loading…
Reference in New Issue
Block a user