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:
Pedro Alves
2013-10-28 16:39:06 +00:00
parent 94c57d6a62
commit cdaa5b7326
2 changed files with 224 additions and 225 deletions

View File

@ -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> 2013-10-28 Pedro Alves <palves@redhat.com>
* infrun.c (process_event_stop_test): New function, factored out * infrun.c (process_event_stop_test): New function, factored out

View File

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