signal_catchpoint_breakpoint_hit (const struct bp_location *bl,
const address_space *aspace,
CORE_ADDR bp_addr,
- const struct target_waitstatus *ws)
+ const target_waitstatus &ws)
{
const struct signal_catchpoint *c
= (const struct signal_catchpoint *) bl->owner;
gdb_signal signal_number;
- if (ws->kind () != TARGET_WAITKIND_STOPPED)
+ if (ws.kind () != TARGET_WAITKIND_STOPPED)
return 0;
- signal_number = ws->sig ();
+ signal_number = ws.sig ();
/* If we are catching specific signals in this breakpoint, then we
must guarantee that the called signal is the same signal we are
static int
breakpoint_hit_catch_syscall (const struct bp_location *bl,
const address_space *aspace, CORE_ADDR bp_addr,
- const struct target_waitstatus *ws)
+ const target_waitstatus &ws)
{
/* We must check if we are catching specific syscalls in this
breakpoint. If we are, then we must guarantee that the called
const struct syscall_catchpoint *c
= (const struct syscall_catchpoint *) bl->owner;
- if (ws->kind () != TARGET_WAITKIND_SYSCALL_ENTRY
- && ws->kind () != TARGET_WAITKIND_SYSCALL_RETURN)
+ if (ws.kind () != TARGET_WAITKIND_SYSCALL_ENTRY
+ && ws.kind () != TARGET_WAITKIND_SYSCALL_RETURN)
return 0;
- syscall_number = ws->syscall_number ();
+ syscall_number = ws.syscall_number ();
/* Now, checking if the syscall is the same. */
if (!c->syscalls_to_be_caught.empty ())
watchpoints have triggered, according to the target. */
int
-watchpoints_triggered (struct target_waitstatus *ws)
+watchpoints_triggered (const target_waitstatus &ws)
{
bool stopped_by_watchpoint = target_stopped_by_watchpoint ();
CORE_ADDR addr;
static int
bpstat_check_location (const struct bp_location *bl,
const address_space *aspace, CORE_ADDR bp_addr,
- const struct target_waitstatus *ws)
+ const target_waitstatus &ws)
{
struct breakpoint *b = bl->owner;
bpstat *
build_bpstat_chain (const address_space *aspace, CORE_ADDR bp_addr,
- const struct target_waitstatus *ws)
+ const target_waitstatus &ws)
{
bpstat *bs_head = nullptr, **bs_link = &bs_head;
bpstat *
bpstat_stop_status (const address_space *aspace,
CORE_ADDR bp_addr, thread_info *thread,
- const struct target_waitstatus *ws,
+ const target_waitstatus &ws,
bpstat *stop_chain)
{
struct breakpoint *b = NULL;
static int
breakpoint_hit_catch_fork (const struct bp_location *bl,
const address_space *aspace, CORE_ADDR bp_addr,
- const struct target_waitstatus *ws)
+ const target_waitstatus &ws)
{
struct fork_catchpoint *c = (struct fork_catchpoint *) bl->owner;
- if (ws->kind () != TARGET_WAITKIND_FORKED)
+ if (ws.kind () != TARGET_WAITKIND_FORKED)
return 0;
- c->forked_inferior_pid = ws->child_ptid ();
+ c->forked_inferior_pid = ws.child_ptid ();
return 1;
}
static int
breakpoint_hit_catch_vfork (const struct bp_location *bl,
const address_space *aspace, CORE_ADDR bp_addr,
- const struct target_waitstatus *ws)
+ const target_waitstatus &ws)
{
struct fork_catchpoint *c = (struct fork_catchpoint *) bl->owner;
- if (ws->kind () != TARGET_WAITKIND_VFORKED)
+ if (ws.kind () != TARGET_WAITKIND_VFORKED)
return 0;
- c->forked_inferior_pid = ws->child_ptid ();
+ c->forked_inferior_pid = ws.child_ptid ();
return 1;
}
breakpoint_hit_catch_solib (const struct bp_location *bl,
const address_space *aspace,
CORE_ADDR bp_addr,
- const struct target_waitstatus *ws)
+ const target_waitstatus &ws)
{
struct solib_catchpoint *self = (struct solib_catchpoint *) bl->owner;
- if (ws->kind () == TARGET_WAITKIND_LOADED)
+ if (ws.kind () == TARGET_WAITKIND_LOADED)
return 1;
for (breakpoint *other : all_breakpoints ())
static int
breakpoint_hit_catch_exec (const struct bp_location *bl,
const address_space *aspace, CORE_ADDR bp_addr,
- const struct target_waitstatus *ws)
+ const target_waitstatus &ws)
{
struct exec_catchpoint *c = (struct exec_catchpoint *) bl->owner;
- if (ws->kind () != TARGET_WAITKIND_EXECD)
+ if (ws.kind () != TARGET_WAITKIND_EXECD)
return 0;
- c->exec_pathname = make_unique_xstrdup (ws->execd_pathname ());
+ c->exec_pathname = make_unique_xstrdup (ws.execd_pathname ());
return 1;
}
breakpoint_hit_ranged_breakpoint (const struct bp_location *bl,
const address_space *aspace,
CORE_ADDR bp_addr,
- const struct target_waitstatus *ws)
+ const target_waitstatus &ws)
{
- if (ws->kind () != TARGET_WAITKIND_STOPPED
- || ws->sig () != GDB_SIGNAL_TRAP)
+ if (ws.kind () != TARGET_WAITKIND_STOPPED
+ || ws.sig () != GDB_SIGNAL_TRAP)
return 0;
return breakpoint_address_match_range (bl->pspace->aspace, bl->address,
static int
breakpoint_hit_watchpoint (const struct bp_location *bl,
const address_space *aspace, CORE_ADDR bp_addr,
- const struct target_waitstatus *ws)
+ const target_waitstatus &ws)
{
struct breakpoint *b = bl->owner;
struct watchpoint *w = (struct watchpoint *) b;
base_breakpoint_breakpoint_hit (const struct bp_location *bl,
const address_space *aspace,
CORE_ADDR bp_addr,
- const struct target_waitstatus *ws)
+ const target_waitstatus &ws)
{
internal_error_pure_virtual_called ();
}
static int
bkpt_breakpoint_hit (const struct bp_location *bl,
const address_space *aspace, CORE_ADDR bp_addr,
- const struct target_waitstatus *ws)
+ const target_waitstatus &ws)
{
- if (ws->kind () != TARGET_WAITKIND_STOPPED
- || ws->sig () != GDB_SIGNAL_TRAP)
+ if (ws.kind () != TARGET_WAITKIND_STOPPED
+ || ws.sig () != GDB_SIGNAL_TRAP)
return 0;
if (!breakpoint_address_match (bl->pspace->aspace, bl->address,
static int
dprintf_breakpoint_hit (const struct bp_location *bl,
const address_space *aspace, CORE_ADDR bp_addr,
- const struct target_waitstatus *ws)
+ const target_waitstatus &ws)
{
if (dprintf_style == dprintf_style_agent
&& target_can_run_breakpoint_commands ())
static int
tracepoint_breakpoint_hit (const struct bp_location *bl,
const address_space *aspace, CORE_ADDR bp_addr,
- const struct target_waitstatus *ws)
+ const target_waitstatus &ws)
{
/* By definition, the inferior does not report stops at
tracepoints. */
int
pc_at_non_inline_function (const address_space *aspace, CORE_ADDR pc,
- const struct target_waitstatus *ws)
+ const target_waitstatus &ws)
{
for (breakpoint *b : all_breakpoints ())
{
int (*breakpoint_hit) (const struct bp_location *bl,
const address_space *aspace,
CORE_ADDR bp_addr,
- const struct target_waitstatus *ws);
+ const target_waitstatus &ws);
/* Check internal conditions of the breakpoint referred to by BS.
If we should not stop for this breakpoint, set BS->stop to 0. */
extern bpstat *build_bpstat_chain (const address_space *aspace,
CORE_ADDR bp_addr,
- const struct target_waitstatus *ws);
+ const target_waitstatus &ws);
/* Get a bpstat associated with having just stopped at address
BP_ADDR in thread PTID. STOP_CHAIN may be supplied as a previously
extern bpstat *bpstat_stop_status (const address_space *aspace,
CORE_ADDR pc, thread_info *thread,
- const struct target_waitstatus *ws,
+ const target_waitstatus &ws,
bpstat *stop_chain = nullptr);
\f
/* This bpstat_what stuff tells wait_for_inferior what to do with a
/* Check if any hardware watchpoints have triggered, according to the
target. */
-int watchpoints_triggered (struct target_waitstatus *);
+int watchpoints_triggered (const target_waitstatus &);
/* Helper for transparent breakpoint hiding for memory read and write
routines.
extern int pc_at_non_inline_function (const address_space *aspace,
CORE_ADDR pc,
- const struct target_waitstatus *ws);
+ const target_waitstatus &ws);
extern int user_breakpoint_p (struct breakpoint *);
void
print_target_wait_results (ptid_t waiton_ptid, ptid_t result_ptid,
- const struct target_waitstatus *ws)
+ const struct target_waitstatus &ws)
{
infrun_debug_printf ("target_wait (%s [%s], status) =",
waiton_ptid.to_string ().c_str (),
infrun_debug_printf (" %s [%s],",
result_ptid.to_string ().c_str (),
target_pid_to_str (result_ptid).c_str ());
- infrun_debug_printf (" %s", ws->to_string ().c_str ());
+ infrun_debug_printf (" %s", ws.to_string ().c_str ());
}
/* Select a thread at random, out of those which are resumed and have
event.ptid = do_target_wait_1 (inf, pid_ptid, &event.ws, 0);
if (debug_infrun)
- print_target_wait_results (pid_ptid, event.ptid, &event.ws);
+ print_target_wait_results (pid_ptid, event.ptid, event.ws);
handle_one (event);
}
ecs->target = inf->process_target ();
if (debug_infrun)
- print_target_wait_results (minus_one_ptid, ecs->ptid, &ecs->ws);
+ print_target_wait_results (minus_one_ptid, ecs->ptid, ecs->ws);
/* Now figure out what to do with the result of the result. */
handle_inferior_event (ecs);
switch_to_target_no_thread (ecs->target);
if (debug_infrun)
- print_target_wait_results (minus_one_ptid, ecs->ptid, &ecs->ws);
+ print_target_wait_results (minus_one_ptid, ecs->ptid, ecs->ws);
/* If an error happens while handling the event, propagate GDB's
knowledge of the executing state to the frontend/user running
static void
adjust_pc_after_break (struct thread_info *thread,
- const target_waitstatus *ws)
+ const target_waitstatus &ws)
{
struct regcache *regcache;
struct gdbarch *gdbarch;
target with both of these set in GDB history, and it seems unlikely to be
correct, so gdbarch_have_nonsteppable_watchpoint is not checked here. */
- if (ws->kind () != TARGET_WAITKIND_STOPPED)
+ if (ws.kind () != TARGET_WAITKIND_STOPPED)
return;
- if (ws->sig () != GDB_SIGNAL_TRAP)
+ if (ws.sig () != GDB_SIGNAL_TRAP)
return;
/* In reverse execution, when a breakpoint is hit, the instruction
ecs->event_thread->control.stop_bpstat
= bpstat_stop_status (regcache->aspace (),
ecs->event_thread->stop_pc (),
- ecs->event_thread, &ecs->ws);
+ ecs->event_thread, ecs->ws);
if (handle_stop_requested (ecs))
return false;
event_ptid = target_wait (minus_one_ptid, ws, TARGET_WNOHANG);
if (debug_infrun)
- print_target_wait_results (minus_one_ptid, event_ptid, ws);
+ print_target_wait_results (minus_one_ptid, event_ptid, *ws);
return event_ptid;
}
/* Save the thread's event and stop reason to process it later. */
static void
-save_waitstatus (struct thread_info *tp, const target_waitstatus *ws)
+save_waitstatus (struct thread_info *tp, const target_waitstatus &ws)
{
infrun_debug_printf ("saving status %s for %s",
- ws->to_string ().c_str (),
+ ws.to_string ().c_str (),
tp->ptid.to_string ().c_str ());
/* Record for later. */
- tp->set_pending_waitstatus (*ws);
+ tp->set_pending_waitstatus (ws);
- if (ws->kind () == TARGET_WAITKIND_STOPPED
- && ws->sig () == GDB_SIGNAL_TRAP)
+ if (ws.kind () == TARGET_WAITKIND_STOPPED
+ && ws.sig () == GDB_SIGNAL_TRAP)
{
struct regcache *regcache = get_thread_regcache (tp);
const address_space *aspace = regcache->aspace ();
CORE_ADDR pc = regcache_read_pc (regcache);
- adjust_pc_after_break (tp, &tp->pending_waitstatus ());
+ adjust_pc_after_break (tp, tp->pending_waitstatus ());
scoped_restore_current_thread restore_thread;
switch_to_thread (tp);
switch_to_thread_no_regs (t);
mark_non_executing_threads (event.target, event.ptid,
event.ws);
- save_waitstatus (t, &event.ws);
+ save_waitstatus (t, event.ws);
t->stop_requested = false;
}
}
t->ptid.to_string ().c_str ());
/* Record for later. */
- save_waitstatus (t, &event.ws);
+ save_waitstatus (t, event.ws);
sig = (event.ws.kind () == TARGET_WAITKIND_STOPPED
? event.ws.sig () : GDB_SIGNAL_0);
}
/* Dependent on valid ECS->EVENT_THREAD. */
- adjust_pc_after_break (ecs->event_thread, &ecs->ws);
+ adjust_pc_after_break (ecs->event_thread, ecs->ws);
/* Dependent on the current PC value modified by adjust_pc_after_break. */
reinit_frame_cache ();
ecs->event_thread->control.stop_bpstat
= bpstat_stop_status (regcache->aspace (),
ecs->event_thread->stop_pc (),
- ecs->event_thread, &ecs->ws);
+ ecs->event_thread, ecs->ws);
if (handle_stop_requested (ecs))
return;
ecs->event_thread->control.stop_bpstat
= bpstat_stop_status (get_current_regcache ()->aspace (),
ecs->event_thread->stop_pc (),
- ecs->event_thread, &ecs->ws);
+ ecs->event_thread, ecs->ws);
if (handle_stop_requested (ecs))
return;
ecs->event_thread->control.stop_bpstat
= bpstat_stop_status (get_current_regcache ()->aspace (),
ecs->event_thread->stop_pc (),
- ecs->event_thread, &ecs->ws);
+ ecs->event_thread, ecs->ws);
if (handle_stop_requested (ecs))
return;
gdb_assert (pending != tp);
/* Record the event thread's event for later. */
- save_waitstatus (tp, &ecs->ws);
+ save_waitstatus (tp, ecs->ws);
/* This was cleared early, by handle_inferior_event. Set it
so this pending event is considered by
do_target_wait. */
&& ecs->event_thread->stepping_over_watchpoint)
stopped_by_watchpoint = 0;
else
- stopped_by_watchpoint = watchpoints_triggered (&ecs->ws);
+ stopped_by_watchpoint = watchpoints_triggered (ecs->ws);
/* If necessary, step over this watchpoint. We'll be back to display
it in a moment. */
that's an extremely unlikely scenario. */
if (!pc_at_non_inline_function (aspace,
ecs->event_thread->stop_pc (),
- &ecs->ws)
+ ecs->ws)
&& !(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)))
+ ecs->ws)))
{
stop_chain = build_bpstat_chain (aspace,
ecs->event_thread->stop_pc (),
- &ecs->ws);
+ ecs->ws);
skip_inline_frames (ecs->event_thread, stop_chain);
/* Re-fetch current thread's frame in case that invalidated
ecs->event_thread->control.stop_bpstat
= bpstat_stop_status (get_current_regcache ()->aspace (),
ecs->event_thread->stop_pc (),
- ecs->event_thread, &ecs->ws, stop_chain);
+ ecs->event_thread, ecs->ws, stop_chain);
/* Following in case break condition called a
function. */
based on the event(s) that just occurred. */
static void
-print_stop_location (struct target_waitstatus *ws)
+print_stop_location (const target_waitstatus &ws)
{
int bpstat_ret;
enum print_what source_flag;
int do_frame_printing = 1;
struct thread_info *tp = inferior_thread ();
- bpstat_ret = bpstat_print (tp->control.stop_bpstat, ws->kind ());
+ bpstat_ret = bpstat_print (tp->control.stop_bpstat, ws.kind ());
switch (bpstat_ret)
{
case PRINT_UNKNOWN:
{
scoped_restore save_uiout = make_scoped_restore (¤t_uiout, uiout);
- print_stop_location (&last);
+ print_stop_location (last);
/* Display the auto-display expressions. */
if (displays)
/* Pretty print the results of target_wait, for debugging purposes. */
extern void print_target_wait_results (ptid_t waiton_ptid, ptid_t result_ptid,
- const struct target_waitstatus *ws);
+ const struct target_waitstatus &ws);
extern int signal_stop_state (int);
target_waitstatus *status);
ptid_t select_thread_for_ambiguous_stop_reply
- (const struct target_waitstatus *status);
+ (const struct target_waitstatus &status);
void remote_notice_new_inferior (ptid_t currthread, bool executing);
event_ptid = target_wait (waiton_ptid, &ws, TARGET_WNOHANG);
if (remote_debug)
- print_target_wait_results (waiton_ptid, event_ptid, &ws);
+ print_target_wait_results (waiton_ptid, event_ptid, ws);
switch (ws.kind ())
{
-1 if we want to check all threads. */
static int
-is_pending_fork_parent (const target_waitstatus *ws, int event_pid,
+is_pending_fork_parent (const target_waitstatus &ws, int event_pid,
ptid_t thread_ptid)
{
- if (ws->kind () == TARGET_WAITKIND_FORKED
- || ws->kind () == TARGET_WAITKIND_VFORKED)
+ if (ws.kind () == TARGET_WAITKIND_FORKED
+ || ws.kind () == TARGET_WAITKIND_VFORKED)
{
if (event_pid == -1 || event_pid == thread_ptid.pid ())
return 1;
/* Return the thread's pending status used to determine whether the
thread is a fork parent stopped at a fork event. */
-static const target_waitstatus *
+static const target_waitstatus &
thread_pending_fork_status (struct thread_info *thread)
{
if (thread->has_pending_waitstatus ())
- return &thread->pending_waitstatus ();
+ return thread->pending_waitstatus ();
else
- return &thread->pending_follow;
+ return thread->pending_follow;
}
/* Determine if THREAD is a pending fork parent thread. */
static int
is_pending_fork_parent_thread (struct thread_info *thread)
{
- const target_waitstatus *ws = thread_pending_fork_status (thread);
+ const target_waitstatus &ws = thread_pending_fork_status (thread);
int pid = -1;
return is_pending_fork_parent (ws, pid, thread->ptid);
fork child threads from the CONTEXT list. */
for (thread_info *thread : all_non_exited_threads (this))
{
- const target_waitstatus *ws = thread_pending_fork_status (thread);
+ const target_waitstatus &ws = thread_pending_fork_status (thread);
if (is_pending_fork_parent (ws, pid, thread->ptid))
- context->remove_thread (ws->child_ptid ());
+ context->remove_thread (ws.child_ptid ());
}
/* Check for any pending fork events (not reported or processed yet)
ptid_t
remote_target::select_thread_for_ambiguous_stop_reply
- (const struct target_waitstatus *status)
+ (const target_waitstatus &status)
{
REMOTE_SCOPED_DEBUG_ENTER_EXIT;
/* Some stop events apply to all threads in an inferior, while others
only apply to a single thread. */
bool process_wide_stop
- = (status->kind () == TARGET_WAITKIND_EXITED
- || status->kind () == TARGET_WAITKIND_SIGNALLED);
+ = (status.kind () == TARGET_WAITKIND_EXITED
+ || status.kind () == TARGET_WAITKIND_SIGNALLED);
remote_debug_printf ("process_wide_stop = %d", process_wide_stop);
/* If no thread/process was reported by the stub then select a suitable
thread/process. */
if (ptid == null_ptid)
- ptid = select_thread_for_ambiguous_stop_reply (status);
+ ptid = select_thread_for_ambiguous_stop_reply (*status);
gdb_assert (ptid != null_ptid);
if (status->kind () != TARGET_WAITKIND_EXITED
that are stopped at a fork event. */
for (thread_info *thread : all_non_exited_threads (this))
{
- struct target_waitstatus *ws = &thread->pending_follow;
+ const target_waitstatus &ws = thread->pending_follow;
if (is_pending_fork_parent (ws, pid, thread->ptid))
{
- int child_pid = ws->child_ptid ().pid ();
+ int child_pid = ws.child_ptid ().pid ();
int res;
res = remote_vkill (child_pid);
in process PID and kill those fork child threads as well. */
remote_notif_get_pending_events (notif);
for (auto &event : rs->stop_reply_queue)
- if (is_pending_fork_parent (&event->ws, pid, event->ptid))
+ if (is_pending_fork_parent (event->ws, pid, event->ptid))
{
int child_pid = event->ws.child_ptid ().pid ();
int res;
}
void
-prepare_resume_reply (char *buf, ptid_t ptid,
- struct target_waitstatus *status)
+prepare_resume_reply (char *buf, ptid_t ptid, const target_waitstatus &status)
{
client_state &cs = get_client_state ();
if (debug_threads)
debug_printf ("Writing resume reply for %s:%d\n",
- target_pid_to_str (ptid).c_str (), status->kind ());
+ target_pid_to_str (ptid).c_str (), status.kind ());
- switch (status->kind ())
+ switch (status.kind ())
{
case TARGET_WAITKIND_STOPPED:
case TARGET_WAITKIND_FORKED:
const char **regp;
struct regcache *regcache;
- if ((status->kind () == TARGET_WAITKIND_FORKED && cs.report_fork_events)
- || (status->kind () == TARGET_WAITKIND_VFORKED
+ if ((status.kind () == TARGET_WAITKIND_FORKED && cs.report_fork_events)
+ || (status.kind () == TARGET_WAITKIND_VFORKED
&& cs.report_vfork_events))
{
enum gdb_signal signal = GDB_SIGNAL_TRAP;
- const char *event = (status->kind () == TARGET_WAITKIND_FORKED
+ const char *event = (status.kind () == TARGET_WAITKIND_FORKED
? "fork" : "vfork");
sprintf (buf, "T%02x%s:", signal, event);
buf += strlen (buf);
- buf = write_ptid (buf, status->child_ptid ());
+ buf = write_ptid (buf, status.child_ptid ());
strcat (buf, ";");
}
- else if (status->kind () == TARGET_WAITKIND_VFORK_DONE
+ else if (status.kind () == TARGET_WAITKIND_VFORK_DONE
&& cs.report_vfork_events)
{
enum gdb_signal signal = GDB_SIGNAL_TRAP;
sprintf (buf, "T%02xvforkdone:;", signal);
}
- else if (status->kind () == TARGET_WAITKIND_EXECD && cs.report_exec_events)
+ else if (status.kind () == TARGET_WAITKIND_EXECD && cs.report_exec_events)
{
enum gdb_signal signal = GDB_SIGNAL_TRAP;
const char *event = "exec";
buf += strlen (buf);
/* Encode pathname to hexified format. */
- bin2hex ((const gdb_byte *) status->execd_pathname (),
+ bin2hex ((const gdb_byte *) status.execd_pathname (),
hexified_pathname,
- strlen (status->execd_pathname ()));
+ strlen (status.execd_pathname ()));
sprintf (buf, "%s;", hexified_pathname);
buf += strlen (buf);
}
- else if (status->kind () == TARGET_WAITKIND_THREAD_CREATED
+ else if (status.kind () == TARGET_WAITKIND_THREAD_CREATED
&& cs.report_thread_events)
{
enum gdb_signal signal = GDB_SIGNAL_TRAP;
sprintf (buf, "T%02xcreate:;", signal);
}
- else if (status->kind () == TARGET_WAITKIND_SYSCALL_ENTRY
- || status->kind () == TARGET_WAITKIND_SYSCALL_RETURN)
+ else if (status.kind () == TARGET_WAITKIND_SYSCALL_ENTRY
+ || status.kind () == TARGET_WAITKIND_SYSCALL_RETURN)
{
enum gdb_signal signal = GDB_SIGNAL_TRAP;
- const char *event = (status->kind () == TARGET_WAITKIND_SYSCALL_ENTRY
+ const char *event = (status.kind () == TARGET_WAITKIND_SYSCALL_ENTRY
? "syscall_entry" : "syscall_return");
sprintf (buf, "T%02x%s:%x;", signal, event,
- status->syscall_number ());
+ status.syscall_number ());
}
else
- sprintf (buf, "T%02x", status->sig ());
+ sprintf (buf, "T%02x", status.sig ());
if (disable_packet_T)
{
case TARGET_WAITKIND_EXITED:
if (cs.multi_process)
sprintf (buf, "W%x;process:%x",
- status->exit_status (), ptid.pid ());
+ status.exit_status (), ptid.pid ());
else
- sprintf (buf, "W%02x", status->exit_status ());
+ sprintf (buf, "W%02x", status.exit_status ());
break;
case TARGET_WAITKIND_SIGNALLED:
if (cs.multi_process)
sprintf (buf, "X%x;process:%x",
- status->sig (), ptid.pid ());
+ status.sig (), ptid.pid ());
else
- sprintf (buf, "X%02x", status->sig ());
+ sprintf (buf, "X%02x", status.sig ());
break;
case TARGET_WAITKIND_THREAD_EXITED:
- sprintf (buf, "w%x;", status->exit_status ());
+ sprintf (buf, "w%x;", status.exit_status ());
buf += strlen (buf);
buf = write_ptid (buf, ptid);
break;
void disable_async_io (void);
void check_remote_input_interrupt_request (void);
void prepare_resume_reply (char *buf, ptid_t ptid,
- struct target_waitstatus *status);
+ const target_waitstatus &status);
const char *decode_address_to_semicolon (CORE_ADDR *addrp, const char *start);
void decode_address (CORE_ADDR *addrp, const char *start, int len);
/* Put a stop reply to the stop reply queue. */
static void
-queue_stop_reply (ptid_t ptid, struct target_waitstatus *status)
+queue_stop_reply (ptid_t ptid, const target_waitstatus &status)
{
struct vstop_notif *new_notif = new struct vstop_notif;
new_notif->ptid = ptid;
- new_notif->status = *status;
+ new_notif->status = status;
notif_event_enque (¬if_stop, new_notif);
}
{
struct vstop_notif *vstop = (struct vstop_notif *) event;
- prepare_resume_reply (own_buf, vstop->ptid, &vstop->status);
+ prepare_resume_reply (own_buf, vstop->ptid, vstop->status);
}
/* Helper for in_queued_stop_replies. */
cs.last_status = thread->last_status;
cs.last_ptid = thread->id;
- prepare_resume_reply (cs.own_buf, cs.last_ptid, &cs.last_status);
+ prepare_resume_reply (cs.own_buf, cs.last_ptid, cs.last_status);
return 1;
}
return 0;
so by now). Tag all threads as "want-stopped", so we don't
resume them implicitly without the client telling us to. */
gdb_wants_all_threads_stopped ();
- prepare_resume_reply (cs.own_buf, cs.last_ptid, &cs.last_status);
+ prepare_resume_reply (cs.own_buf, cs.last_ptid, cs.last_status);
disable_async_io ();
if (cs.last_status.kind () == TARGET_WAITKIND_EXITED
write_ok (own_buf);
}
else
- prepare_resume_reply (own_buf, cs.last_ptid, &cs.last_status);
+ prepare_resume_reply (own_buf, cs.last_ptid, cs.last_status);
}
else
write_enn (own_buf);
if (cs.last_status.kind () == TARGET_WAITKIND_STOPPED)
{
- prepare_resume_reply (own_buf, cs.last_ptid, &cs.last_status);
+ prepare_resume_reply (own_buf, cs.last_ptid, cs.last_status);
/* In non-stop, sending a resume reply doesn't set the general
thread, but GDB assumes a vRun sets it (this is so GDB can
/* Pass the last stop reply back to GDB, but don't notify
yet. */
- queue_stop_reply (thread->id, &thread->last_status);
+ queue_stop_reply (thread->id, thread->last_status);
}
}
}
set_desired_thread ();
gdb_assert (tp->last_status.kind () != TARGET_WAITKIND_IGNORE);
- prepare_resume_reply (own_buf, tp->id, &tp->last_status);
+ prepare_resume_reply (own_buf, tp->id, tp->last_status);
}
else
strcpy (own_buf, "W00");
/* Push a stop notification on the notification queue. */
static void
-push_stop_notification (ptid_t ptid, struct target_waitstatus *status)
+push_stop_notification (ptid_t ptid, const target_waitstatus &status)
{
struct vstop_notif *vstop_notif = new struct vstop_notif;
- vstop_notif->status = *status;
+ vstop_notif->status = status;
vstop_notif->ptid = ptid;
/* Push Stop notification. */
notif_push (¬if_stop, vstop_notif);
if (cs.last_status.kind () == TARGET_WAITKIND_NO_RESUMED)
{
if (gdb_connected () && report_no_resumed)
- push_stop_notification (null_ptid, &cs.last_status);
+ push_stop_notification (null_ptid, cs.last_status);
}
else if (cs.last_status.kind () != TARGET_WAITKIND_IGNORE)
{
}
}
else
- push_stop_notification (cs.last_ptid, &cs.last_status);
+ push_stop_notification (cs.last_ptid, cs.last_status);
}
/* Be sure to not change the selected thread behind GDB's back.