2004-08-25 Andrew Cagney <cagney@gnu.org>
* infrun.c: Re-indent. Move expression operators to the beginning of the line. Remove long disabled #if 0 code.
This commit is contained in:
parent
f855931bbd
commit
8fb3e588da
2 changed files with 194 additions and 230 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2004-08-25 Andrew Cagney <cagney@gnu.org>
|
||||||
|
|
||||||
|
* infrun.c: Re-indent. Move expression operators to the beginning
|
||||||
|
of the line. Remove long disabled #if 0 code.
|
||||||
|
|
||||||
2004-08-24 Andrew Cagney <cagney@gnu.org>
|
2004-08-24 Andrew Cagney <cagney@gnu.org>
|
||||||
|
|
||||||
* doublest.h (floatformat_ieee_quad): Rename
|
* doublest.h (floatformat_ieee_quad): Rename
|
||||||
|
|
95
gdb/infrun.c
95
gdb/infrun.c
|
@ -580,8 +580,8 @@ resume (int step, enum target_signal sig)
|
||||||
|
|
||||||
resume_ptid = RESUME_ALL; /* Default */
|
resume_ptid = RESUME_ALL; /* Default */
|
||||||
|
|
||||||
if ((step || singlestep_breakpoints_inserted_p) &&
|
if ((step || singlestep_breakpoints_inserted_p)
|
||||||
(stepping_past_singlestep_breakpoint
|
&& (stepping_past_singlestep_breakpoint
|
||||||
|| (!breakpoints_inserted && breakpoint_here_p (read_pc ()))))
|
|| (!breakpoints_inserted && breakpoint_here_p (read_pc ()))))
|
||||||
{
|
{
|
||||||
/* Stepping past a breakpoint without inserting breakpoints.
|
/* Stepping past a breakpoint without inserting breakpoints.
|
||||||
|
@ -592,9 +592,9 @@ resume (int step, enum target_signal sig)
|
||||||
resume_ptid = inferior_ptid;
|
resume_ptid = inferior_ptid;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((scheduler_mode == schedlock_on) ||
|
if ((scheduler_mode == schedlock_on)
|
||||||
(scheduler_mode == schedlock_step &&
|
|| (scheduler_mode == schedlock_step
|
||||||
(step || singlestep_breakpoints_inserted_p)))
|
&& (step || singlestep_breakpoints_inserted_p)))
|
||||||
{
|
{
|
||||||
/* User-settable 'scheduler' mode requires solo thread resume. */
|
/* User-settable 'scheduler' mode requires solo thread resume. */
|
||||||
resume_ptid = inferior_ptid;
|
resume_ptid = inferior_ptid;
|
||||||
|
@ -649,8 +649,8 @@ prepare_to_proceed (void)
|
||||||
/* Make sure we were stopped either at a breakpoint, or because
|
/* Make sure we were stopped either at a breakpoint, or because
|
||||||
of a Ctrl-C. */
|
of a Ctrl-C. */
|
||||||
if (wait_status.kind != TARGET_WAITKIND_STOPPED
|
if (wait_status.kind != TARGET_WAITKIND_STOPPED
|
||||||
|| (wait_status.value.sig != TARGET_SIGNAL_TRAP &&
|
|| (wait_status.value.sig != TARGET_SIGNAL_TRAP
|
||||||
wait_status.value.sig != TARGET_SIGNAL_INT))
|
&& wait_status.value.sig != TARGET_SIGNAL_INT))
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -937,7 +937,8 @@ void handle_inferior_event (struct execution_control_state *ecs);
|
||||||
|
|
||||||
static void step_into_function (struct execution_control_state *ecs);
|
static void step_into_function (struct execution_control_state *ecs);
|
||||||
static void insert_step_resume_breakpoint (struct frame_info *step_frame,
|
static void insert_step_resume_breakpoint (struct frame_info *step_frame,
|
||||||
struct execution_control_state *ecs);
|
struct execution_control_state
|
||||||
|
*ecs);
|
||||||
static void stop_stepping (struct execution_control_state *ecs);
|
static void stop_stepping (struct execution_control_state *ecs);
|
||||||
static void prepare_to_wait (struct execution_control_state *ecs);
|
static void prepare_to_wait (struct execution_control_state *ecs);
|
||||||
static void keep_going (struct execution_control_state *ecs);
|
static void keep_going (struct execution_control_state *ecs);
|
||||||
|
@ -1313,31 +1314,6 @@ handle_inferior_event (struct execution_control_state *ecs)
|
||||||
ui_out_text (uiout, "[New ");
|
ui_out_text (uiout, "[New ");
|
||||||
ui_out_text (uiout, target_pid_or_tid_to_str (ecs->ptid));
|
ui_out_text (uiout, target_pid_or_tid_to_str (ecs->ptid));
|
||||||
ui_out_text (uiout, "]\n");
|
ui_out_text (uiout, "]\n");
|
||||||
|
|
||||||
#if 0
|
|
||||||
/* NOTE: This block is ONLY meant to be invoked in case of a
|
|
||||||
"thread creation event"! If it is invoked for any other
|
|
||||||
sort of event (such as a new thread landing on a breakpoint),
|
|
||||||
the event will be discarded, which is almost certainly
|
|
||||||
a bad thing!
|
|
||||||
|
|
||||||
To avoid this, the low-level module (eg. target_wait)
|
|
||||||
should call in_thread_list and add_thread, so that the
|
|
||||||
new thread is known by the time we get here. */
|
|
||||||
|
|
||||||
/* We may want to consider not doing a resume here in order
|
|
||||||
to give the user a chance to play with the new thread.
|
|
||||||
It might be good to make that a user-settable option. */
|
|
||||||
|
|
||||||
/* At this point, all threads are stopped (happens
|
|
||||||
automatically in either the OS or the native code).
|
|
||||||
Therefore we need to continue all threads in order to
|
|
||||||
make progress. */
|
|
||||||
|
|
||||||
target_resume (RESUME_ALL, 0, TARGET_SIGNAL_0);
|
|
||||||
prepare_to_wait (ecs);
|
|
||||||
return;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (ecs->ws.kind)
|
switch (ecs->ws.kind)
|
||||||
|
@ -1588,7 +1564,8 @@ handle_inferior_event (struct execution_control_state *ecs)
|
||||||
|
|
||||||
if (stepping_past_singlestep_breakpoint)
|
if (stepping_past_singlestep_breakpoint)
|
||||||
{
|
{
|
||||||
gdb_assert (SOFTWARE_SINGLE_STEP_P () && singlestep_breakpoints_inserted_p);
|
gdb_assert (SOFTWARE_SINGLE_STEP_P ()
|
||||||
|
&& singlestep_breakpoints_inserted_p);
|
||||||
gdb_assert (ptid_equal (singlestep_ptid, ecs->ptid));
|
gdb_assert (ptid_equal (singlestep_ptid, ecs->ptid));
|
||||||
gdb_assert (!ptid_equal (singlestep_ptid, saved_singlestep_ptid));
|
gdb_assert (!ptid_equal (singlestep_ptid, saved_singlestep_ptid));
|
||||||
|
|
||||||
|
@ -1840,12 +1817,11 @@ handle_inferior_event (struct execution_control_state *ecs)
|
||||||
stack. */
|
stack. */
|
||||||
|
|
||||||
if (stop_signal == TARGET_SIGNAL_TRAP
|
if (stop_signal == TARGET_SIGNAL_TRAP
|
||||||
|| (breakpoints_inserted &&
|
|| (breakpoints_inserted
|
||||||
(stop_signal == TARGET_SIGNAL_ILL
|
&& (stop_signal == TARGET_SIGNAL_ILL
|
||||||
|| stop_signal == TARGET_SIGNAL_SEGV
|
|| stop_signal == TARGET_SIGNAL_SEGV
|
||||||
|| stop_signal == TARGET_SIGNAL_EMT))
|
|| stop_signal == TARGET_SIGNAL_EMT))
|
||||||
|| stop_soon == STOP_QUIETLY
|
|| stop_soon == STOP_QUIETLY || stop_soon == STOP_QUIETLY_NO_SIGSTOP)
|
||||||
|| stop_soon == STOP_QUIETLY_NO_SIGSTOP)
|
|
||||||
{
|
{
|
||||||
if (stop_signal == TARGET_SIGNAL_TRAP && stop_after_trap)
|
if (stop_signal == TARGET_SIGNAL_TRAP && stop_after_trap)
|
||||||
{
|
{
|
||||||
|
@ -2014,12 +1990,6 @@ process_event_stop_test:
|
||||||
delete_step_resume_breakpoint (&step_resume_breakpoint);
|
delete_step_resume_breakpoint (&step_resume_breakpoint);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
|
||||||
/* FIXME - Need to implement nested temporary breakpoints */
|
|
||||||
if (step_over_calls > 0)
|
|
||||||
set_longjmp_resume_breakpoint (jmp_buf_pc, get_current_frame ());
|
|
||||||
else
|
|
||||||
#endif /* 0 */
|
|
||||||
set_longjmp_resume_breakpoint (jmp_buf_pc, null_frame_id);
|
set_longjmp_resume_breakpoint (jmp_buf_pc, null_frame_id);
|
||||||
ecs->handling_longjmp = 1; /* FIXME */
|
ecs->handling_longjmp = 1; /* FIXME */
|
||||||
keep_going (ecs);
|
keep_going (ecs);
|
||||||
|
@ -2029,17 +1999,6 @@ process_event_stop_test:
|
||||||
case BPSTAT_WHAT_CLEAR_LONGJMP_RESUME_SINGLE:
|
case BPSTAT_WHAT_CLEAR_LONGJMP_RESUME_SINGLE:
|
||||||
remove_breakpoints ();
|
remove_breakpoints ();
|
||||||
breakpoints_inserted = 0;
|
breakpoints_inserted = 0;
|
||||||
#if 0
|
|
||||||
/* FIXME - Need to implement nested temporary breakpoints */
|
|
||||||
if (step_over_calls
|
|
||||||
&& (frame_id_inner (get_frame_id (get_current_frame ()),
|
|
||||||
step_frame_id)))
|
|
||||||
{
|
|
||||||
ecs->another_trap = 1;
|
|
||||||
keep_going (ecs);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#endif /* 0 */
|
|
||||||
disable_longjmp_breakpoint ();
|
disable_longjmp_breakpoint ();
|
||||||
ecs->handling_longjmp = 0; /* FIXME */
|
ecs->handling_longjmp = 0; /* FIXME */
|
||||||
if (what.main_action == BPSTAT_WHAT_CLEAR_LONGJMP_RESUME)
|
if (what.main_action == BPSTAT_WHAT_CLEAR_LONGJMP_RESUME)
|
||||||
|
@ -2166,8 +2125,8 @@ process_event_stop_test:
|
||||||
the call that caused this catchpoint to trigger. That
|
the call that caused this catchpoint to trigger. That
|
||||||
gives the user a more useful vantage from which to
|
gives the user a more useful vantage from which to
|
||||||
examine their program's state. */
|
examine their program's state. */
|
||||||
else if (what.main_action ==
|
else if (what.main_action
|
||||||
BPSTAT_WHAT_CHECK_SHLIBS_RESUME_FROM_HOOK)
|
== BPSTAT_WHAT_CHECK_SHLIBS_RESUME_FROM_HOOK)
|
||||||
{
|
{
|
||||||
/* ??rehrauer: If I could figure out how to get the
|
/* ??rehrauer: If I could figure out how to get the
|
||||||
right return PC from here, we could just set a temp
|
right return PC from here, we could just set a temp
|
||||||
|
@ -2312,8 +2271,7 @@ process_event_stop_test:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (frame_id_eq (frame_unwind_id (get_current_frame ()),
|
if (frame_id_eq (frame_unwind_id (get_current_frame ()), step_frame_id))
|
||||||
step_frame_id))
|
|
||||||
{
|
{
|
||||||
/* It's a subroutine call. */
|
/* It's a subroutine call. */
|
||||||
CORE_ADDR real_stop_pc;
|
CORE_ADDR real_stop_pc;
|
||||||
|
@ -2350,8 +2308,8 @@ process_event_stop_test:
|
||||||
/* We're doing a "next", set a breakpoint at callee's return
|
/* We're doing a "next", set a breakpoint at callee's return
|
||||||
address (the address at which the caller will
|
address (the address at which the caller will
|
||||||
resume). */
|
resume). */
|
||||||
insert_step_resume_breakpoint (get_prev_frame (get_current_frame ()),
|
insert_step_resume_breakpoint (get_prev_frame
|
||||||
ecs);
|
(get_current_frame ()), ecs);
|
||||||
keep_going (ecs);
|
keep_going (ecs);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -2361,8 +2319,8 @@ process_event_stop_test:
|
||||||
/* We're doing a "next", set a breakpoint at callee's return
|
/* We're doing a "next", set a breakpoint at callee's return
|
||||||
address (the address at which the caller will
|
address (the address at which the caller will
|
||||||
resume). */
|
resume). */
|
||||||
insert_step_resume_breakpoint (get_prev_frame (get_current_frame ()),
|
insert_step_resume_breakpoint (get_prev_frame
|
||||||
ecs);
|
(get_current_frame ()), ecs);
|
||||||
keep_going (ecs);
|
keep_going (ecs);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -2424,7 +2382,8 @@ process_event_stop_test:
|
||||||
|
|
||||||
/* Set a breakpoint at callee's return address (the address at
|
/* Set a breakpoint at callee's return address (the address at
|
||||||
which the caller will resume). */
|
which the caller will resume). */
|
||||||
insert_step_resume_breakpoint (get_prev_frame (get_current_frame ()), ecs);
|
insert_step_resume_breakpoint (get_prev_frame (get_current_frame ()),
|
||||||
|
ecs);
|
||||||
keep_going (ecs);
|
keep_going (ecs);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -2487,8 +2446,8 @@ process_event_stop_test:
|
||||||
{
|
{
|
||||||
/* Set a breakpoint at callee's return address (the address
|
/* Set a breakpoint at callee's return address (the address
|
||||||
at which the caller will resume). */
|
at which the caller will resume). */
|
||||||
insert_step_resume_breakpoint (get_prev_frame (get_current_frame ()),
|
insert_step_resume_breakpoint (get_prev_frame
|
||||||
ecs);
|
(get_current_frame ()), ecs);
|
||||||
keep_going (ecs);
|
keep_going (ecs);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -2566,9 +2525,9 @@ process_event_stop_test:
|
||||||
stackless leaf function. I think the logic should instead look
|
stackless leaf function. I think the logic should instead look
|
||||||
at the unwound frame ID has that should give a more robust
|
at the unwound frame ID has that should give a more robust
|
||||||
indication of what happened. */
|
indication of what happened. */
|
||||||
if (step-ID == current-ID)
|
if (step - ID == current - ID)
|
||||||
still stepping in same function;
|
still stepping in same function;
|
||||||
else if (step-ID == unwind (current-ID))
|
else if (step - ID == unwind (current - ID))
|
||||||
stepped into a function;
|
stepped into a function;
|
||||||
else
|
else
|
||||||
stepped out of a function;
|
stepped out of a function;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue