&& thread->state == THREAD_RUNNING
&& !thread->executing
&& !thread->stop_requested
- && thread->suspend.stop_signal == GDB_SIGNAL_0)
+ && thread->stop_signal () == GDB_SIGNAL_0)
{
infrun_debug_printf ("resuming vfork parent thread %s",
target_pid_to_str (thread->ptid).c_str ());
/* Avoid confusing the next resume, if the next stop/resume
happens to apply to another thread. */
- tp->suspend.stop_signal = GDB_SIGNAL_0;
+ tp->set_stop_signal (GDB_SIGNAL_0);
/* Advise target which signals may be handled silently.
gdb_assert (!tp->stop_requested);
gdb_assert (!thread_is_in_step_over_chain (tp));
- if (tp->suspend.waitstatus_pending_p)
+ if (tp->has_pending_waitstatus ())
{
infrun_debug_printf
("thread %s has pending wait "
"status %s (currently_stepping=%d).",
target_pid_to_str (tp->ptid).c_str (),
- target_waitstatus_to_string (&tp->suspend.waitstatus).c_str (),
+ target_waitstatus_to_string (&tp->pending_waitstatus ()).c_str (),
currently_stepping (tp));
tp->inf->process_target ()->threads_executing = true;
target_pid_to_str (tp->ptid).c_str ());
}
- tp->suspend.stop_signal = GDB_SIGNAL_0;
+ tp->set_stop_signal (GDB_SIGNAL_0);
if (target_can_async_p ())
{
/* If we're starting a new sequence, then the previous finished
single-step is no longer relevant. */
- if (tp->suspend.waitstatus_pending_p)
+ if (tp->has_pending_waitstatus ())
{
- if (tp->suspend.stop_reason == TARGET_STOPPED_BY_SINGLE_STEP)
+ if (tp->stop_reason () == TARGET_STOPPED_BY_SINGLE_STEP)
{
infrun_debug_printf ("pending event of %s was a finished step. "
"Discarding.",
target_pid_to_str (tp->ptid).c_str ());
- tp->suspend.waitstatus_pending_p = 0;
- tp->suspend.stop_reason = TARGET_STOPPED_BY_NO_REASON;
+ tp->clear_pending_waitstatus ();
+ tp->set_stop_reason (TARGET_STOPPED_BY_NO_REASON);
}
else
{
infrun_debug_printf
("thread %s has pending wait status %s (currently_stepping=%d).",
target_pid_to_str (tp->ptid).c_str (),
- target_waitstatus_to_string (&tp->suspend.waitstatus).c_str (),
+ target_waitstatus_to_string (&tp->pending_waitstatus ()).c_str (),
currently_stepping (tp));
}
}
/* If this signal should not be seen by program, give it zero.
Used for debugging signals. */
- if (!signal_pass_state (tp->suspend.stop_signal))
- tp->suspend.stop_signal = GDB_SIGNAL_0;
+ if (!signal_pass_state (tp->stop_signal ()))
+ tp->set_stop_signal (GDB_SIGNAL_0);
delete tp->thread_fsm;
tp->thread_fsm = NULL;
resuming more threads. */
bool has_thread_with_pending_status = false;
for (thread_info *thread : all_non_exited_threads (proc_target))
- if (thread->resumed () && thread->suspend.waitstatus_pending_p)
+ if (thread->resumed () && thread->has_pending_waitstatus ())
{
has_thread_with_pending_status = true;
break;
if (addr == (CORE_ADDR) -1)
{
- if (pc == cur_thr->suspend.stop_pc
+ if (pc == cur_thr->stop_pc ()
&& breakpoint_here_p (aspace, pc) == ordinary_breakpoint_here
&& execution_direction != EXEC_REVERSE)
/* There is a breakpoint at the address we will resume at,
}
if (siggnal != GDB_SIGNAL_DEFAULT)
- cur_thr->suspend.stop_signal = siggnal;
+ cur_thr->set_stop_signal (siggnal);
/* If an exception is thrown from this point on, make sure to
propagate GDB's knowledge of the executing state to the
{
infrun_debug_printf ("[%s] resumed",
target_pid_to_str (tp->ptid).c_str ());
- gdb_assert (tp->executing || tp->suspend.waitstatus_pending_p);
+ gdb_assert (tp->executing || tp->has_pending_waitstatus ());
continue;
}
know about that yet, queue a pending event, as if the
thread had just stopped now. Unless the thread already had
a pending event. */
- if (!tp->suspend.waitstatus_pending_p)
+ if (!tp->has_pending_waitstatus ())
{
- tp->suspend.waitstatus_pending_p = 1;
- tp->suspend.waitstatus.kind = TARGET_WAITKIND_STOPPED;
- tp->suspend.waitstatus.value.sig = GDB_SIGNAL_0;
+ target_waitstatus ws;
+ ws.kind = TARGET_WAITKIND_STOPPED;
+ ws.value.sig = GDB_SIGNAL_0;
+ tp->set_pending_waitstatus (ws);
}
/* Clear the inline-frame state, since we're re-processing the
{
return (tp->ptid.matches (waiton_ptid)
&& tp->resumed ()
- && tp->suspend.waitstatus_pending_p);
+ && tp->has_pending_waitstatus ());
};
/* First see how many events we have. Count only resumed threads
/* We have a specific thread to check. */
tp = find_thread_ptid (inf, ptid);
gdb_assert (tp != NULL);
- if (!tp->suspend.waitstatus_pending_p)
+ if (!tp->has_pending_waitstatus ())
tp = NULL;
}
if (tp != NULL
- && (tp->suspend.stop_reason == TARGET_STOPPED_BY_SW_BREAKPOINT
- || tp->suspend.stop_reason == TARGET_STOPPED_BY_HW_BREAKPOINT))
+ && (tp->stop_reason () == TARGET_STOPPED_BY_SW_BREAKPOINT
+ || tp->stop_reason () == TARGET_STOPPED_BY_HW_BREAKPOINT))
{
struct regcache *regcache = get_thread_regcache (tp);
struct gdbarch *gdbarch = regcache->arch ();
pc = regcache_read_pc (regcache);
- if (pc != tp->suspend.stop_pc)
+ if (pc != tp->stop_pc ())
{
infrun_debug_printf ("PC of %s changed. was=%s, now=%s",
target_pid_to_str (tp->ptid).c_str (),
- paddress (gdbarch, tp->suspend.stop_pc),
+ paddress (gdbarch, tp->stop_pc ()),
paddress (gdbarch, pc));
discard = 1;
}
infrun_debug_printf ("pending event of %s cancelled.",
target_pid_to_str (tp->ptid).c_str ());
- tp->suspend.waitstatus.kind = TARGET_WAITKIND_SPURIOUS;
- tp->suspend.stop_reason = TARGET_STOPPED_BY_NO_REASON;
+ tp->clear_pending_waitstatus ();
+ target_waitstatus ws;
+ ws.kind = TARGET_WAITKIND_SPURIOUS;
+ tp->set_pending_waitstatus (ws);
+ tp->set_stop_reason (TARGET_STOPPED_BY_NO_REASON);
}
}
{
infrun_debug_printf ("Using pending wait status %s for %s.",
target_waitstatus_to_string
- (&tp->suspend.waitstatus).c_str (),
+ (&tp->pending_waitstatus ()).c_str (),
target_pid_to_str (tp->ptid).c_str ());
/* Now that we've selected our final event LWP, un-adjust its PC
if it was a software breakpoint (and the target doesn't
always adjust the PC itself). */
- if (tp->suspend.stop_reason == TARGET_STOPPED_BY_SW_BREAKPOINT
+ if (tp->stop_reason () == TARGET_STOPPED_BY_SW_BREAKPOINT
&& !target_supports_stopped_by_sw_breakpoint ())
{
struct regcache *regcache;
}
}
- tp->suspend.stop_reason = TARGET_STOPPED_BY_NO_REASON;
- *status = tp->suspend.waitstatus;
- tp->suspend.waitstatus_pending_p = 0;
+ tp->set_stop_reason (TARGET_STOPPED_BY_NO_REASON);
+ *status = tp->pending_waitstatus ();
+ tp->clear_pending_waitstatus ();
/* Wake up the event loop again, until all pending events are
processed. */
static void
adjust_pc_after_break (struct thread_info *thread,
- struct target_waitstatus *ws)
+ const target_waitstatus *ws)
{
struct regcache *regcache;
struct gdbarch *gdbarch;
regcache = get_thread_regcache (ecs->event_thread);
syscall_number = ecs->ws.value.syscall_number;
- ecs->event_thread->suspend.stop_pc = regcache_read_pc (regcache);
+ ecs->event_thread->set_stop_pc (regcache_read_pc (regcache));
if (catch_syscall_enabled () > 0
&& catching_syscall_number (syscall_number) > 0)
ecs->event_thread->control.stop_bpstat
= bpstat_stop_status (regcache->aspace (),
- ecs->event_thread->suspend.stop_pc,
+ ecs->event_thread->stop_pc (),
ecs->event_thread, &ecs->ws);
if (handle_stop_requested (ecs))
/* Don't care about return value; stop_func_start and stop_func_name
will both be 0 if it doesn't work. */
- find_pc_partial_function_sym (ecs->event_thread->suspend.stop_pc,
+ find_pc_partial_function_sym (ecs->event_thread->stop_pc (),
&gsi,
&ecs->stop_func_start,
&ecs->stop_func_end,
tp->ptid.tid ());
/* Record for later. */
- tp->suspend.waitstatus = *ws;
- tp->suspend.waitstatus_pending_p = 1;
+ tp->set_pending_waitstatus (*ws);
if (ws->kind == TARGET_WAITKIND_STOPPED
&& ws->value.sig == GDB_SIGNAL_TRAP)
const address_space *aspace = regcache->aspace ();
CORE_ADDR pc = regcache_read_pc (regcache);
- adjust_pc_after_break (tp, &tp->suspend.waitstatus);
+ adjust_pc_after_break (tp, &tp->pending_waitstatus ());
scoped_restore_current_thread restore_thread;
switch_to_thread (tp);
if (target_stopped_by_watchpoint ())
- {
- tp->suspend.stop_reason
- = TARGET_STOPPED_BY_WATCHPOINT;
- }
+ tp->set_stop_reason (TARGET_STOPPED_BY_WATCHPOINT);
else if (target_supports_stopped_by_sw_breakpoint ()
&& target_stopped_by_sw_breakpoint ())
- {
- tp->suspend.stop_reason
- = TARGET_STOPPED_BY_SW_BREAKPOINT;
- }
+ tp->set_stop_reason (TARGET_STOPPED_BY_SW_BREAKPOINT);
else if (target_supports_stopped_by_hw_breakpoint ()
&& target_stopped_by_hw_breakpoint ())
- {
- tp->suspend.stop_reason
- = TARGET_STOPPED_BY_HW_BREAKPOINT;
- }
+ tp->set_stop_reason (TARGET_STOPPED_BY_HW_BREAKPOINT);
else if (!target_supports_stopped_by_hw_breakpoint ()
- && hardware_breakpoint_inserted_here_p (aspace,
- pc))
- {
- tp->suspend.stop_reason
- = TARGET_STOPPED_BY_HW_BREAKPOINT;
- }
+ && hardware_breakpoint_inserted_here_p (aspace, pc))
+ tp->set_stop_reason (TARGET_STOPPED_BY_HW_BREAKPOINT);
else if (!target_supports_stopped_by_sw_breakpoint ()
- && software_breakpoint_inserted_here_p (aspace,
- pc))
- {
- tp->suspend.stop_reason
- = TARGET_STOPPED_BY_SW_BREAKPOINT;
- }
+ && software_breakpoint_inserted_here_p (aspace, pc))
+ tp->set_stop_reason (TARGET_STOPPED_BY_SW_BREAKPOINT);
else if (!thread_has_single_step_breakpoints_set (tp)
&& currently_stepping (tp))
- {
- tp->suspend.stop_reason
- = TARGET_STOPPED_BY_SINGLE_STEP;
- }
+ tp->set_stop_reason (TARGET_STOPPED_BY_SINGLE_STEP);
}
}
&& event.ws.value.sig == GDB_SIGNAL_0)
{
/* We caught the event that we intended to catch, so
- there's no event pending. */
- t->suspend.waitstatus.kind = TARGET_WAITKIND_IGNORE;
- t->suspend.waitstatus_pending_p = 0;
+ there's no event to save as pending. */
if (displaced_step_finish (t, GDB_SIGNAL_0)
== DISPLACED_STEP_FINISH_STATUS_NOT_EXECUTED)
}
regcache = get_thread_regcache (t);
- t->suspend.stop_pc = regcache_read_pc (regcache);
+ t->set_stop_pc (regcache_read_pc (regcache));
infrun_debug_printf ("saved stop_pc=%s for %s "
"(currently_stepping=%d)",
- paddress (target_gdbarch (),
- t->suspend.stop_pc),
+ paddress (target_gdbarch (), t->stop_pc ()),
target_pid_to_str (t->ptid).c_str (),
currently_stepping (t));
}
}
if (!ignore_event
- && (thread->executing
- || thread->suspend.waitstatus_pending_p))
+ && (thread->executing || thread->has_pending_waitstatus ()))
{
/* Either there were no unwaited-for children left in the
target at some point, but there are now, or some target
ecs->event_thread->control.stop_bpstat
= bpstat_stop_status (regcache->aspace (),
- ecs->event_thread->suspend.stop_pc,
+ ecs->event_thread->stop_pc (),
ecs->event_thread, &ecs->ws);
if (handle_stop_requested (ecs))
gdb of events. This allows the user to get control
and place breakpoints in initializer routines for
dynamically loaded objects (among other things). */
- ecs->event_thread->suspend.stop_signal = GDB_SIGNAL_0;
+ ecs->event_thread->set_stop_signal (GDB_SIGNAL_0);
if (stop_on_solib_events)
{
/* Make sure we print "Stopped due to solib-event" in
and not immediately. */
ecs->event_thread->pending_follow = ecs->ws;
- ecs->event_thread->suspend.stop_pc
- = regcache_read_pc (get_thread_regcache (ecs->event_thread));
+ ecs->event_thread->set_stop_pc
+ (regcache_read_pc (get_thread_regcache (ecs->event_thread)));
ecs->event_thread->control.stop_bpstat
= bpstat_stop_status (get_current_regcache ()->aspace (),
- ecs->event_thread->suspend.stop_pc,
+ ecs->event_thread->stop_pc (),
ecs->event_thread, &ecs->ws);
if (handle_stop_requested (ecs))
bool follow_child
= (follow_fork_mode_string == follow_fork_mode_child);
- ecs->event_thread->suspend.stop_signal = GDB_SIGNAL_0;
+ ecs->event_thread->set_stop_signal (GDB_SIGNAL_0);
process_stratum_target *targ
= ecs->event_thread->inf->process_target ();
execd thread for that case (this is a nop otherwise). */
ecs->event_thread = inferior_thread ();
- ecs->event_thread->suspend.stop_pc
- = regcache_read_pc (get_thread_regcache (ecs->event_thread));
+ ecs->event_thread->set_stop_pc
+ (regcache_read_pc (get_thread_regcache (ecs->event_thread)));
ecs->event_thread->control.stop_bpstat
= bpstat_stop_status (get_current_regcache ()->aspace (),
- ecs->event_thread->suspend.stop_pc,
+ ecs->event_thread->stop_pc (),
ecs->event_thread, &ecs->ws);
/* Note that this may be referenced from inside
/* If no catchpoint triggered for this, then keep going. */
if (!bpstat_causes_stop (ecs->event_thread->control.stop_bpstat))
{
- ecs->event_thread->suspend.stop_signal = GDB_SIGNAL_0;
+ ecs->event_thread->set_stop_signal (GDB_SIGNAL_0);
keep_going (ecs);
return;
}
infrun_debug_printf ("stopped");
delete_just_stopped_threads_single_step_breakpoints ();
- ecs->event_thread->suspend.stop_pc
- = regcache_read_pc (get_thread_regcache (inferior_thread ()));
+ ecs->event_thread->set_stop_pc
+ (regcache_read_pc (get_thread_regcache (inferior_thread ())));
if (handle_stop_requested (ecs))
return;
{
infrun_debug_printf ("restart threads: [%s] resumed",
target_pid_to_str (tp->ptid).c_str ());
- gdb_assert (tp->executing || tp->suspend.waitstatus_pending_p);
+ gdb_assert (tp->executing || tp->has_pending_waitstatus ());
continue;
}
}
- if (tp->suspend.waitstatus_pending_p)
+ if (tp->has_pending_waitstatus ())
{
infrun_debug_printf ("restart threads: [%s] has pending status",
target_pid_to_str (tp->ptid).c_str ());
resumed_thread_with_pending_status (struct thread_info *tp,
void *arg)
{
- return (tp->resumed ()
- && tp->suspend.waitstatus_pending_p);
+ return tp->resumed () && tp->has_pending_waitstatus ();
}
/* Called when we get an event that may finish an in-line or
static int
finish_step_over (struct execution_control_state *ecs)
{
- displaced_step_finish (ecs->event_thread,
- ecs->event_thread->suspend.stop_signal);
+ displaced_step_finish (ecs->event_thread, ecs->event_thread->stop_signal ());
bool had_step_over_info = step_over_info_valid_p ();
gdb_assert (!tp->executing);
regcache = get_thread_regcache (tp);
- tp->suspend.stop_pc = regcache_read_pc (regcache);
+ tp->set_stop_pc (regcache_read_pc (regcache));
infrun_debug_printf ("saved stop_pc=%s for %s "
"(currently_stepping=%d)",
- paddress (target_gdbarch (),
- tp->suspend.stop_pc),
+ paddress (target_gdbarch (), tp->stop_pc ()),
target_pid_to_str (tp->ptid).c_str (),
currently_stepping (tp));
gdb_assert (ecs->ws.kind == TARGET_WAITKIND_STOPPED);
- ecs->event_thread->suspend.stop_signal = ecs->ws.value.sig;
+ ecs->event_thread->set_stop_signal (ecs->ws.value.sig);
/* Do we need to clean up the state of a thread that has
completed a displaced single-step? (Doing so usually affects
the user wanted this thread to be stopped, pretend we got a
SIG0 (generic unsignaled stop). */
if (ecs->event_thread->stop_requested
- && ecs->event_thread->suspend.stop_signal == GDB_SIGNAL_TRAP)
- ecs->event_thread->suspend.stop_signal = GDB_SIGNAL_0;
+ && ecs->event_thread->stop_signal () == GDB_SIGNAL_TRAP)
+ ecs->event_thread->set_stop_signal (GDB_SIGNAL_0);
- ecs->event_thread->suspend.stop_pc
- = regcache_read_pc (get_thread_regcache (ecs->event_thread));
+ ecs->event_thread->set_stop_pc
+ (regcache_read_pc (get_thread_regcache (ecs->event_thread)));
context_switch (ecs);
struct regcache *regcache = get_thread_regcache (ecs->event_thread);
struct gdbarch *reg_gdbarch = regcache->arch ();
- infrun_debug_printf ("stop_pc=%s",
- paddress (reg_gdbarch,
- ecs->event_thread->suspend.stop_pc));
+ infrun_debug_printf
+ ("stop_pc=%s", paddress (reg_gdbarch, ecs->event_thread->stop_pc ()));
if (target_stopped_by_watchpoint ())
{
CORE_ADDR addr;
GDB_SIGNAL_0, meaning: stopped for no particular reason
other than GDB's request. */
if (stop_soon == STOP_QUIETLY_NO_SIGSTOP
- && (ecs->event_thread->suspend.stop_signal == GDB_SIGNAL_STOP
- || ecs->event_thread->suspend.stop_signal == GDB_SIGNAL_TRAP
- || ecs->event_thread->suspend.stop_signal == GDB_SIGNAL_0))
+ && (ecs->event_thread->stop_signal () == GDB_SIGNAL_STOP
+ || ecs->event_thread->stop_signal () == GDB_SIGNAL_TRAP
+ || ecs->event_thread->stop_signal () == GDB_SIGNAL_0))
{
stop_print_frame = true;
stop_waiting (ecs);
- ecs->event_thread->suspend.stop_signal = GDB_SIGNAL_0;
+ ecs->event_thread->set_stop_signal (GDB_SIGNAL_0);
return;
}
gdbarch = get_frame_arch (frame);
/* Pull the single step breakpoints out of the target. */
- if (ecs->event_thread->suspend.stop_signal == GDB_SIGNAL_TRAP)
+ if (ecs->event_thread->stop_signal () == GDB_SIGNAL_TRAP)
{
struct regcache *regcache;
CORE_ADDR pc;
}
delete_just_stopped_threads_single_step_breakpoints ();
- if (ecs->event_thread->suspend.stop_signal == GDB_SIGNAL_TRAP
+ if (ecs->event_thread->stop_signal () == GDB_SIGNAL_TRAP
&& ecs->event_thread->control.trap_expected
&& ecs->event_thread->stepping_over_watchpoint)
stopped_by_watchpoint = 0;
skip_inline_frames call would break things. Fortunately
that's an extremely unlikely scenario. */
if (!pc_at_non_inline_function (aspace,
- ecs->event_thread->suspend.stop_pc,
+ ecs->event_thread->stop_pc (),
&ecs->ws)
- && !(ecs->event_thread->suspend.stop_signal == GDB_SIGNAL_TRAP
+ && !(ecs->event_thread->stop_signal () == GDB_SIGNAL_TRAP
&& ecs->event_thread->control.trap_expected
&& pc_at_non_inline_function (aspace,
ecs->event_thread->prev_pc,
&ecs->ws)))
{
stop_chain = build_bpstat_chain (aspace,
- ecs->event_thread->suspend.stop_pc,
+ ecs->event_thread->stop_pc (),
&ecs->ws);
skip_inline_frames (ecs->event_thread, stop_chain);
}
}
- if (ecs->event_thread->suspend.stop_signal == GDB_SIGNAL_TRAP
+ if (ecs->event_thread->stop_signal () == GDB_SIGNAL_TRAP
&& ecs->event_thread->control.trap_expected
&& gdbarch_single_step_through_delay_p (gdbarch)
&& currently_stepping (ecs->event_thread))
handles this event. */
ecs->event_thread->control.stop_bpstat
= bpstat_stop_status (get_current_regcache ()->aspace (),
- ecs->event_thread->suspend.stop_pc,
+ ecs->event_thread->stop_pc (),
ecs->event_thread, &ecs->ws, stop_chain);
/* Following in case break condition called a
simply make sure to ignore it if `stopped_by_watchpoint' is
set. */
- if (ecs->event_thread->suspend.stop_signal == GDB_SIGNAL_TRAP
+ if (ecs->event_thread->stop_signal () == GDB_SIGNAL_TRAP
&& !bpstat_explains_signal (ecs->event_thread->control.stop_bpstat,
GDB_SIGNAL_TRAP)
&& stopped_by_watchpoint)
/* See if the breakpoints module can explain the signal. */
random_signal
= !bpstat_explains_signal (ecs->event_thread->control.stop_bpstat,
- ecs->event_thread->suspend.stop_signal);
+ ecs->event_thread->stop_signal ());
/* Maybe this was a trap for a software breakpoint that has since
been removed. */
if (random_signal && target_stopped_by_sw_breakpoint ())
{
if (gdbarch_program_breakpoint_here_p (gdbarch,
- ecs->event_thread->suspend.stop_pc))
+ ecs->event_thread->stop_pc ()))
{
struct regcache *regcache;
int decr_pc;
(record_full_gdb_operation_disable_set ());
regcache_write_pc (regcache,
- ecs->event_thread->suspend.stop_pc + decr_pc);
+ ecs->event_thread->stop_pc () + decr_pc);
}
}
else
/* If not, perhaps stepping/nexting can. */
if (random_signal)
- random_signal = !(ecs->event_thread->suspend.stop_signal == GDB_SIGNAL_TRAP
+ random_signal = !(ecs->event_thread->stop_signal () == GDB_SIGNAL_TRAP
&& currently_stepping (ecs->event_thread));
/* Perhaps the thread hit a single-step breakpoint of _another_
if (random_signal)
{
/* Signal not for debugging purposes. */
- enum gdb_signal stop_signal = ecs->event_thread->suspend.stop_signal;
+ enum gdb_signal stop_signal = ecs->event_thread->stop_signal ();
infrun_debug_printf ("random signal (%s)",
gdb_signal_to_symbol_string (stop_signal));
to remain stopped. */
if (stop_soon != NO_STOP_QUIETLY
|| ecs->event_thread->stop_requested
- || signal_stop_state (ecs->event_thread->suspend.stop_signal))
+ || signal_stop_state (ecs->event_thread->stop_signal ()))
{
stop_waiting (ecs);
return;
/* Notify observers the signal has "handle print" set. Note we
returned early above if stopping; normal_stop handles the
printing in that case. */
- if (signal_print[ecs->event_thread->suspend.stop_signal])
+ if (signal_print[ecs->event_thread->stop_signal ()])
{
/* The signal table tells us to print about this signal. */
target_terminal::ours_for_output ();
- gdb::observers::signal_received.notify (ecs->event_thread->suspend.stop_signal);
+ gdb::observers::signal_received.notify (ecs->event_thread->stop_signal ());
target_terminal::inferior ();
}
/* Clear the signal if it should not be passed. */
- if (signal_program[ecs->event_thread->suspend.stop_signal] == 0)
- ecs->event_thread->suspend.stop_signal = GDB_SIGNAL_0;
+ if (signal_program[ecs->event_thread->stop_signal ()] == 0)
+ ecs->event_thread->set_stop_signal (GDB_SIGNAL_0);
- if (ecs->event_thread->prev_pc == ecs->event_thread->suspend.stop_pc
+ if (ecs->event_thread->prev_pc == ecs->event_thread->stop_pc ()
&& ecs->event_thread->control.trap_expected
&& ecs->event_thread->control.step_resume_breakpoint == NULL)
{
return;
}
- if (ecs->event_thread->suspend.stop_signal != GDB_SIGNAL_0
- && (pc_in_thread_step_range (ecs->event_thread->suspend.stop_pc,
+ if (ecs->event_thread->stop_signal () != GDB_SIGNAL_0
+ && (pc_in_thread_step_range (ecs->event_thread->stop_pc (),
ecs->event_thread)
|| ecs->event_thread->control.step_range_end == 1)
&& frame_id_eq (get_stack_frame_id (frame),
return;
}
fill_in_stop_func (gdbarch, ecs);
- if (ecs->event_thread->suspend.stop_pc == ecs->stop_func_start
+ if (ecs->event_thread->stop_pc () == ecs->stop_func_start
&& execution_direction == EXEC_REVERSE)
{
/* We are stepping over a function call in reverse, and just
through a function epilogue and therefore must detect when
the current-frame changes in the middle of a line. */
- if (pc_in_thread_step_range (ecs->event_thread->suspend.stop_pc,
+ if (pc_in_thread_step_range (ecs->event_thread->stop_pc (),
ecs->event_thread)
&& (execution_direction != EXEC_REVERSE
|| frame_id_eq (get_frame_id (frame),
/* When stepping backward, stop at beginning of line range
(unless it's the function entry point, in which case
keep going back to the call point). */
- CORE_ADDR stop_pc = ecs->event_thread->suspend.stop_pc;
+ CORE_ADDR stop_pc = ecs->event_thread->stop_pc ();
if (stop_pc == ecs->event_thread->control.step_range_start
&& stop_pc != ecs->stop_func_start
&& execution_direction == EXEC_REVERSE)
if (execution_direction != EXEC_REVERSE
&& ecs->event_thread->control.step_over_calls == STEP_OVER_UNDEBUGGABLE
- && in_solib_dynsym_resolve_code (ecs->event_thread->suspend.stop_pc))
+ && in_solib_dynsym_resolve_code (ecs->event_thread->stop_pc ()))
{
CORE_ADDR pc_after_resolver =
- gdbarch_skip_solib_resolver (gdbarch,
- ecs->event_thread->suspend.stop_pc);
+ gdbarch_skip_solib_resolver (gdbarch, ecs->event_thread->stop_pc ());
infrun_debug_printf ("stepped into dynsym resolve code");
/* Step through an indirect branch thunk. */
if (ecs->event_thread->control.step_over_calls != STEP_OVER_NONE
&& gdbarch_in_indirect_branch_thunk (gdbarch,
- ecs->event_thread->suspend.stop_pc))
+ ecs->event_thread->stop_pc ()))
{
infrun_debug_printf ("stepped into indirect branch thunk");
keep_going (ecs);
call check below as on some targets return trampolines look
like subroutine calls (MIPS16 return thunks). */
if (gdbarch_in_solib_return_trampoline (gdbarch,
- ecs->event_thread->suspend.stop_pc,
+ ecs->event_thread->stop_pc (),
ecs->stop_func_name)
&& ecs->event_thread->control.step_over_calls != STEP_OVER_NONE)
{
/* Determine where this trampoline returns. */
- CORE_ADDR stop_pc = ecs->event_thread->suspend.stop_pc;
+ CORE_ADDR stop_pc = ecs->event_thread->stop_pc ();
CORE_ADDR real_stop_pc
= gdbarch_skip_trampoline_code (gdbarch, frame, stop_pc);
&& (!frame_id_eq (ecs->event_thread->control.step_stack_frame_id,
outer_frame_id)
|| (ecs->event_thread->control.step_start_function
- != find_pc_function (ecs->event_thread->suspend.stop_pc)))))
+ != find_pc_function (ecs->event_thread->stop_pc ())))))
{
- CORE_ADDR stop_pc = ecs->event_thread->suspend.stop_pc;
+ CORE_ADDR stop_pc = ecs->event_thread->stop_pc ();
CORE_ADDR real_stop_pc;
infrun_debug_printf ("stepped into subroutine");
if (execution_direction == EXEC_REVERSE
&& ecs->event_thread->control.step_over_calls != STEP_OVER_NONE)
{
- CORE_ADDR stop_pc = ecs->event_thread->suspend.stop_pc;
+ CORE_ADDR stop_pc = ecs->event_thread->stop_pc ();
if (gdbarch_skip_trampoline_code (gdbarch, frame, stop_pc)
|| (ecs->stop_func_start == 0
stack of inlined frames, even if GDB actually believes that it is in a
more outer frame. This is checked for below by calls to
inline_skipped_frames. */
- stop_pc_sal = find_pc_line (ecs->event_thread->suspend.stop_pc, 0);
+ stop_pc_sal = find_pc_line (ecs->event_thread->stop_pc (), 0);
/* NOTE: tausq/2004-05-24: This if block used to be done before all
the trampoline processing logic, however, there are some trampolines
}
bool refresh_step_info = true;
- if ((ecs->event_thread->suspend.stop_pc == stop_pc_sal.pc)
+ if ((ecs->event_thread->stop_pc () == stop_pc_sal.pc)
&& (ecs->event_thread->current_line != stop_pc_sal.line
|| ecs->event_thread->current_symtab != stop_pc_sal.symtab))
{
/* Check if the current thread is blocked on an incomplete
step-over, interrupted by a random signal. */
if (ecs->event_thread->control.trap_expected
- && ecs->event_thread->suspend.stop_signal != GDB_SIGNAL_TRAP)
+ && ecs->event_thread->stop_signal () != GDB_SIGNAL_TRAP)
{
infrun_debug_printf
("need to finish step-over of [%s]",
ecs->event_thread->control.trap_expected = 0;
/* Likewise, clear the signal if it should not be passed. */
- if (!signal_program[ecs->event_thread->suspend.stop_signal])
- ecs->event_thread->suspend.stop_signal = GDB_SIGNAL_0;
+ if (!signal_program[ecs->event_thread->stop_signal ()])
+ ecs->event_thread->set_stop_signal (GDB_SIGNAL_0);
if (restart_stepped_thread (ecs->target, ecs->ptid))
{
if (tp->state == THREAD_EXITED)
continue;
- if (tp->suspend.waitstatus_pending_p)
+ if (tp->has_pending_waitstatus ())
continue;
/* Ignore threads of processes the caller is not
if (tp->state == THREAD_EXITED)
continue;
- if (tp->suspend.waitstatus_pending_p)
+ if (tp->has_pending_waitstatus ())
continue;
/* Ignore threads of processes the caller is not
/* If we have a pending event to process, skip resuming the
target and go straight to processing it. */
- if (thr->resumed () && thr->suspend.waitstatus_pending_p)
+ if (thr->resumed () && thr->has_pending_waitstatus ())
return;
}
reset_ecs (ecs, tp);
switch_to_thread (tp);
- tp->suspend.stop_pc = regcache_read_pc (get_thread_regcache (tp));
+ tp->set_stop_pc (regcache_read_pc (get_thread_regcache (tp)));
frame = get_current_frame ();
/* If the PC of the thread we were trying to single-step has
This prevents us continuously moving the single-step breakpoint
forward, one instruction at a time, overstepping. */
- if (tp->suspend.stop_pc != tp->prev_pc)
+ if (tp->stop_pc () != tp->prev_pc)
{
ptid_t resume_ptid;
infrun_debug_printf ("expected thread advanced also (%s -> %s)",
paddress (target_gdbarch (), tp->prev_pc),
- paddress (target_gdbarch (), tp->suspend.stop_pc));
+ paddress (target_gdbarch (), tp->stop_pc ()));
/* Clear the info of the previous step-over, as it's no longer
valid (if the thread was trying to step over a breakpoint, it
insert_single_step_breakpoint (get_frame_arch (frame),
get_frame_address_space (frame),
- tp->suspend.stop_pc);
+ tp->stop_pc ());
tp->set_resumed (true);
resume_ptid = internal_resume_ptid (tp->control.stepping_command);
fill_in_stop_func (gdbarch, ecs);
compunit_symtab *cust
- = find_pc_compunit_symtab (ecs->event_thread->suspend.stop_pc);
+ = find_pc_compunit_symtab (ecs->event_thread->stop_pc ());
if (cust != NULL && compunit_language (cust) != language_asm)
ecs->stop_func_start
= gdbarch_skip_prologue_noexcept (gdbarch, ecs->stop_func_start);
ecs->stop_func_start);
}
- if (ecs->stop_func_start == ecs->event_thread->suspend.stop_pc)
+ if (ecs->stop_func_start == ecs->event_thread->stop_pc ())
{
/* We are already there: stop now. */
end_stepping_range (ecs);
fill_in_stop_func (gdbarch, ecs);
- cust = find_pc_compunit_symtab (ecs->event_thread->suspend.stop_pc);
+ cust = find_pc_compunit_symtab (ecs->event_thread->stop_pc ());
if (cust != NULL && compunit_language (cust) != language_asm)
ecs->stop_func_start
= gdbarch_skip_prologue_noexcept (gdbarch, ecs->stop_func_start);
- stop_func_sal = find_pc_line (ecs->event_thread->suspend.stop_pc, 0);
+ stop_func_sal = find_pc_line (ecs->event_thread->stop_pc (), 0);
/* OK, we're just going to keep stepping here. */
- if (stop_func_sal.pc == ecs->event_thread->suspend.stop_pc)
+ if (stop_func_sal.pc == ecs->event_thread->stop_pc ())
{
/* We're there already. Just stop stepping now. */
end_stepping_range (ecs);
non-signal event (e.g., a fork); or took a signal which we
are supposed to pass through to the inferior. Simply
continue. */
- resume (ecs->event_thread->suspend.stop_signal);
+ resume (ecs->event_thread->stop_signal ());
}
else if (step_over_info_valid_p ())
{
ecs->event_thread->control.trap_expected = (remove_bp || remove_wps);
- resume (ecs->event_thread->suspend.stop_signal);
+ resume (ecs->event_thread->stop_signal ());
}
prepare_to_wait (ecs);
keep_going (struct execution_control_state *ecs)
{
if (ecs->event_thread->control.trap_expected
- && ecs->event_thread->suspend.stop_signal == GDB_SIGNAL_TRAP)
+ && ecs->event_thread->stop_signal () == GDB_SIGNAL_TRAP)
ecs->event_thread->control.trap_expected = 0;
- if (!signal_program[ecs->event_thread->suspend.stop_signal])
- ecs->event_thread->suspend.stop_signal = GDB_SIGNAL_0;
+ if (!signal_program[ecs->event_thread->stop_signal ()])
+ ecs->event_thread->set_stop_signal (GDB_SIGNAL_0);
keep_going_pass_signal (ecs);
}
&& frame_id_eq (tp->control.step_frame_id,
get_frame_id (get_current_frame ()))
&& (tp->control.step_start_function
- == find_pc_function (tp->suspend.stop_pc)))
+ == find_pc_function (tp->stop_pc ())))
{
/* Finished step, just print source line. */
source_flag = SRC_LINE;
update_thread_list ();
if (last.kind == TARGET_WAITKIND_STOPPED && stopped_by_random_signal)
- gdb::observers::signal_received.notify (inferior_thread ()->suspend.stop_signal);
+ gdb::observers::signal_received.notify (inferior_thread ()->stop_signal ());
/* As with the notification of thread events, we want to delay
notifying the user that we've switched thread context until
infcall_suspend_state (struct gdbarch *gdbarch,
const struct thread_info *tp,
struct regcache *regcache)
- : m_thread_suspend (tp->suspend),
- m_registers (new readonly_detached_regcache (*regcache))
+ : m_registers (new readonly_detached_regcache (*regcache))
{
+ tp->save_suspend_to (m_thread_suspend);
+
gdb::unique_xmalloc_ptr<gdb_byte> siginfo_data;
if (gdbarch_get_siginfo_type_p (gdbarch))
struct thread_info *tp,
struct regcache *regcache) const
{
- tp->suspend = m_thread_suspend;
+ tp->restore_suspend_from (m_thread_suspend);
if (m_siginfo_gdbarch == gdbarch)
{
any stop signal information. The stop signal is not useful when
starting an inferior function call, and run_inferior_call will not use
the signal due to its `proceed' call with GDB_SIGNAL_0. */
- tp->suspend.stop_signal = GDB_SIGNAL_0;
+ tp->set_stop_signal (GDB_SIGNAL_0);
return inf_state;
}