gdb: pass more const target_waitstatus by reference

While working on target_waitstatus changes, I noticed a few places where
const target_waitstatus objects could be passed by reference instead of
by pointers.  And in some cases, places where a target_waitstatus could
be passed as const, but was not.  Convert them as much as possible.

Change-Id: Ied552d464be5d5b87489913b95f9720a5ad50c5a
This commit is contained in:
Simon Marchi
2021-11-22 11:27:31 -05:00
committed by Simon Marchi
parent 06de25b7af
commit c272a98cbf
10 changed files with 124 additions and 125 deletions

View File

@ -149,16 +149,16 @@ static int
signal_catchpoint_breakpoint_hit (const struct bp_location *bl, signal_catchpoint_breakpoint_hit (const struct bp_location *bl,
const address_space *aspace, const address_space *aspace,
CORE_ADDR bp_addr, CORE_ADDR bp_addr,
const struct target_waitstatus *ws) const target_waitstatus &ws)
{ {
const struct signal_catchpoint *c const struct signal_catchpoint *c
= (const struct signal_catchpoint *) bl->owner; = (const struct signal_catchpoint *) bl->owner;
gdb_signal signal_number; gdb_signal signal_number;
if (ws->kind () != TARGET_WAITKIND_STOPPED) if (ws.kind () != TARGET_WAITKIND_STOPPED)
return 0; return 0;
signal_number = ws->sig (); signal_number = ws.sig ();
/* If we are catching specific signals in this breakpoint, then we /* If we are catching specific signals in this breakpoint, then we
must guarantee that the called signal is the same signal we are must guarantee that the called signal is the same signal we are

View File

@ -143,7 +143,7 @@ remove_catch_syscall (struct bp_location *bl, enum remove_bp_reason reason)
static int static int
breakpoint_hit_catch_syscall (const struct bp_location *bl, breakpoint_hit_catch_syscall (const struct bp_location *bl,
const address_space *aspace, CORE_ADDR bp_addr, 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 /* We must check if we are catching specific syscalls in this
breakpoint. If we are, then we must guarantee that the called breakpoint. If we are, then we must guarantee that the called
@ -152,11 +152,11 @@ breakpoint_hit_catch_syscall (const struct bp_location *bl,
const struct syscall_catchpoint *c const struct syscall_catchpoint *c
= (const struct syscall_catchpoint *) bl->owner; = (const struct syscall_catchpoint *) bl->owner;
if (ws->kind () != TARGET_WAITKIND_SYSCALL_ENTRY if (ws.kind () != TARGET_WAITKIND_SYSCALL_ENTRY
&& ws->kind () != TARGET_WAITKIND_SYSCALL_RETURN) && ws.kind () != TARGET_WAITKIND_SYSCALL_RETURN)
return 0; return 0;
syscall_number = ws->syscall_number (); syscall_number = ws.syscall_number ();
/* Now, checking if the syscall is the same. */ /* Now, checking if the syscall is the same. */
if (!c->syscalls_to_be_caught.empty ()) if (!c->syscalls_to_be_caught.empty ())

View File

@ -4771,7 +4771,7 @@ bpstat::bpstat ()
watchpoints have triggered, according to the target. */ watchpoints have triggered, according to the target. */
int int
watchpoints_triggered (struct target_waitstatus *ws) watchpoints_triggered (const target_waitstatus &ws)
{ {
bool stopped_by_watchpoint = target_stopped_by_watchpoint (); bool stopped_by_watchpoint = target_stopped_by_watchpoint ();
CORE_ADDR addr; CORE_ADDR addr;
@ -5014,7 +5014,7 @@ watchpoint_check (bpstat *bs)
static int static int
bpstat_check_location (const struct bp_location *bl, bpstat_check_location (const struct bp_location *bl,
const address_space *aspace, CORE_ADDR bp_addr, const address_space *aspace, CORE_ADDR bp_addr,
const struct target_waitstatus *ws) const target_waitstatus &ws)
{ {
struct breakpoint *b = bl->owner; struct breakpoint *b = bl->owner;
@ -5349,7 +5349,7 @@ need_moribund_for_location_type (struct bp_location *loc)
bpstat * bpstat *
build_bpstat_chain (const address_space *aspace, CORE_ADDR bp_addr, 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 *bs_head = nullptr, **bs_link = &bs_head;
@ -5425,7 +5425,7 @@ build_bpstat_chain (const address_space *aspace, CORE_ADDR bp_addr,
bpstat * bpstat *
bpstat_stop_status (const address_space *aspace, bpstat_stop_status (const address_space *aspace,
CORE_ADDR bp_addr, thread_info *thread, CORE_ADDR bp_addr, thread_info *thread,
const struct target_waitstatus *ws, const target_waitstatus &ws,
bpstat *stop_chain) bpstat *stop_chain)
{ {
struct breakpoint *b = NULL; struct breakpoint *b = NULL;
@ -7760,14 +7760,14 @@ remove_catch_fork (struct bp_location *bl, enum remove_bp_reason reason)
static int static int
breakpoint_hit_catch_fork (const struct bp_location *bl, breakpoint_hit_catch_fork (const struct bp_location *bl,
const address_space *aspace, CORE_ADDR bp_addr, 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; struct fork_catchpoint *c = (struct fork_catchpoint *) bl->owner;
if (ws->kind () != TARGET_WAITKIND_FORKED) if (ws.kind () != TARGET_WAITKIND_FORKED)
return 0; return 0;
c->forked_inferior_pid = ws->child_ptid (); c->forked_inferior_pid = ws.child_ptid ();
return 1; return 1;
} }
@ -7876,14 +7876,14 @@ remove_catch_vfork (struct bp_location *bl, enum remove_bp_reason reason)
static int static int
breakpoint_hit_catch_vfork (const struct bp_location *bl, breakpoint_hit_catch_vfork (const struct bp_location *bl,
const address_space *aspace, CORE_ADDR bp_addr, 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; struct fork_catchpoint *c = (struct fork_catchpoint *) bl->owner;
if (ws->kind () != TARGET_WAITKIND_VFORKED) if (ws.kind () != TARGET_WAITKIND_VFORKED)
return 0; return 0;
c->forked_inferior_pid = ws->child_ptid (); c->forked_inferior_pid = ws.child_ptid ();
return 1; return 1;
} }
@ -7998,11 +7998,11 @@ static int
breakpoint_hit_catch_solib (const struct bp_location *bl, breakpoint_hit_catch_solib (const struct bp_location *bl,
const address_space *aspace, const address_space *aspace,
CORE_ADDR bp_addr, CORE_ADDR bp_addr,
const struct target_waitstatus *ws) const target_waitstatus &ws)
{ {
struct solib_catchpoint *self = (struct solib_catchpoint *) bl->owner; struct solib_catchpoint *self = (struct solib_catchpoint *) bl->owner;
if (ws->kind () == TARGET_WAITKIND_LOADED) if (ws.kind () == TARGET_WAITKIND_LOADED)
return 1; return 1;
for (breakpoint *other : all_breakpoints ()) for (breakpoint *other : all_breakpoints ())
@ -8274,14 +8274,14 @@ remove_catch_exec (struct bp_location *bl, enum remove_bp_reason reason)
static int static int
breakpoint_hit_catch_exec (const struct bp_location *bl, breakpoint_hit_catch_exec (const struct bp_location *bl,
const address_space *aspace, CORE_ADDR bp_addr, 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; struct exec_catchpoint *c = (struct exec_catchpoint *) bl->owner;
if (ws->kind () != TARGET_WAITKIND_EXECD) if (ws.kind () != TARGET_WAITKIND_EXECD)
return 0; return 0;
c->exec_pathname = make_unique_xstrdup (ws->execd_pathname ()); c->exec_pathname = make_unique_xstrdup (ws.execd_pathname ());
return 1; return 1;
} }
@ -9781,10 +9781,10 @@ static int
breakpoint_hit_ranged_breakpoint (const struct bp_location *bl, breakpoint_hit_ranged_breakpoint (const struct bp_location *bl,
const address_space *aspace, const address_space *aspace,
CORE_ADDR bp_addr, CORE_ADDR bp_addr,
const struct target_waitstatus *ws) const target_waitstatus &ws)
{ {
if (ws->kind () != TARGET_WAITKIND_STOPPED if (ws.kind () != TARGET_WAITKIND_STOPPED
|| ws->sig () != GDB_SIGNAL_TRAP) || ws.sig () != GDB_SIGNAL_TRAP)
return 0; return 0;
return breakpoint_address_match_range (bl->pspace->aspace, bl->address, return breakpoint_address_match_range (bl->pspace->aspace, bl->address,
@ -10125,7 +10125,7 @@ remove_watchpoint (struct bp_location *bl, enum remove_bp_reason reason)
static int static int
breakpoint_hit_watchpoint (const struct bp_location *bl, breakpoint_hit_watchpoint (const struct bp_location *bl,
const address_space *aspace, CORE_ADDR bp_addr, const address_space *aspace, CORE_ADDR bp_addr,
const struct target_waitstatus *ws) const target_waitstatus &ws)
{ {
struct breakpoint *b = bl->owner; struct breakpoint *b = bl->owner;
struct watchpoint *w = (struct watchpoint *) b; struct watchpoint *w = (struct watchpoint *) b;
@ -12280,7 +12280,7 @@ static int
base_breakpoint_breakpoint_hit (const struct bp_location *bl, base_breakpoint_breakpoint_hit (const struct bp_location *bl,
const address_space *aspace, const address_space *aspace,
CORE_ADDR bp_addr, CORE_ADDR bp_addr,
const struct target_waitstatus *ws) const target_waitstatus &ws)
{ {
internal_error_pure_virtual_called (); internal_error_pure_virtual_called ();
} }
@ -12447,10 +12447,10 @@ bkpt_remove_location (struct bp_location *bl, enum remove_bp_reason reason)
static int static int
bkpt_breakpoint_hit (const struct bp_location *bl, bkpt_breakpoint_hit (const struct bp_location *bl,
const address_space *aspace, CORE_ADDR bp_addr, const address_space *aspace, CORE_ADDR bp_addr,
const struct target_waitstatus *ws) const target_waitstatus &ws)
{ {
if (ws->kind () != TARGET_WAITKIND_STOPPED if (ws.kind () != TARGET_WAITKIND_STOPPED
|| ws->sig () != GDB_SIGNAL_TRAP) || ws.sig () != GDB_SIGNAL_TRAP)
return 0; return 0;
if (!breakpoint_address_match (bl->pspace->aspace, bl->address, if (!breakpoint_address_match (bl->pspace->aspace, bl->address,
@ -12468,7 +12468,7 @@ bkpt_breakpoint_hit (const struct bp_location *bl,
static int static int
dprintf_breakpoint_hit (const struct bp_location *bl, dprintf_breakpoint_hit (const struct bp_location *bl,
const address_space *aspace, CORE_ADDR bp_addr, const address_space *aspace, CORE_ADDR bp_addr,
const struct target_waitstatus *ws) const target_waitstatus &ws)
{ {
if (dprintf_style == dprintf_style_agent if (dprintf_style == dprintf_style_agent
&& target_can_run_breakpoint_commands ()) && target_can_run_breakpoint_commands ())
@ -12822,7 +12822,7 @@ tracepoint_re_set (struct breakpoint *b)
static int static int
tracepoint_breakpoint_hit (const struct bp_location *bl, tracepoint_breakpoint_hit (const struct bp_location *bl,
const address_space *aspace, CORE_ADDR bp_addr, 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 /* By definition, the inferior does not report stops at
tracepoints. */ tracepoints. */
@ -15194,7 +15194,7 @@ is_non_inline_function (struct breakpoint *b)
int int
pc_at_non_inline_function (const address_space *aspace, CORE_ADDR pc, 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 ()) for (breakpoint *b : all_breakpoints ())
{ {

View File

@ -587,7 +587,7 @@ struct breakpoint_ops
int (*breakpoint_hit) (const struct bp_location *bl, int (*breakpoint_hit) (const struct bp_location *bl,
const address_space *aspace, const address_space *aspace,
CORE_ADDR bp_addr, CORE_ADDR bp_addr,
const struct target_waitstatus *ws); const target_waitstatus &ws);
/* Check internal conditions of the breakpoint referred to by BS. /* Check internal conditions of the breakpoint referred to by BS.
If we should not stop for this breakpoint, set BS->stop to 0. */ If we should not stop for this breakpoint, set BS->stop to 0. */
@ -948,7 +948,7 @@ extern bpstat *bpstat_copy (bpstat *);
extern bpstat *build_bpstat_chain (const address_space *aspace, extern bpstat *build_bpstat_chain (const address_space *aspace,
CORE_ADDR bp_addr, CORE_ADDR bp_addr,
const struct target_waitstatus *ws); const target_waitstatus &ws);
/* Get a bpstat associated with having just stopped at address /* Get a bpstat associated with having just stopped at address
BP_ADDR in thread PTID. STOP_CHAIN may be supplied as a previously BP_ADDR in thread PTID. STOP_CHAIN may be supplied as a previously
@ -972,7 +972,7 @@ extern bpstat *build_bpstat_chain (const address_space *aspace,
extern bpstat *bpstat_stop_status (const address_space *aspace, extern bpstat *bpstat_stop_status (const address_space *aspace,
CORE_ADDR pc, thread_info *thread, CORE_ADDR pc, thread_info *thread,
const struct target_waitstatus *ws, const target_waitstatus &ws,
bpstat *stop_chain = nullptr); bpstat *stop_chain = nullptr);
/* This bpstat_what stuff tells wait_for_inferior what to do with a /* This bpstat_what stuff tells wait_for_inferior what to do with a
@ -1609,7 +1609,7 @@ extern int insert_single_step_breakpoints (struct gdbarch *);
/* Check if any hardware watchpoints have triggered, according to the /* Check if any hardware watchpoints have triggered, according to the
target. */ target. */
int watchpoints_triggered (struct target_waitstatus *); int watchpoints_triggered (const target_waitstatus &);
/* Helper for transparent breakpoint hiding for memory read and write /* Helper for transparent breakpoint hiding for memory read and write
routines. routines.
@ -1745,7 +1745,7 @@ const std::vector<bp_location *> &all_bp_locations ();
extern int pc_at_non_inline_function (const address_space *aspace, extern int pc_at_non_inline_function (const address_space *aspace,
CORE_ADDR pc, CORE_ADDR pc,
const struct target_waitstatus *ws); const target_waitstatus &ws);
extern int user_breakpoint_p (struct breakpoint *); extern int user_breakpoint_p (struct breakpoint *);

View File

@ -3470,7 +3470,7 @@ delete_just_stopped_threads_single_step_breakpoints (void)
void void
print_target_wait_results (ptid_t waiton_ptid, ptid_t result_ptid, 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) =", infrun_debug_printf ("target_wait (%s [%s], status) =",
waiton_ptid.to_string ().c_str (), waiton_ptid.to_string ().c_str (),
@ -3478,7 +3478,7 @@ print_target_wait_results (ptid_t waiton_ptid, ptid_t result_ptid,
infrun_debug_printf (" %s [%s],", infrun_debug_printf (" %s [%s],",
result_ptid.to_string ().c_str (), result_ptid.to_string ().c_str (),
target_pid_to_str (result_ptid).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 /* Select a thread at random, out of those which are resumed and have
@ -3833,7 +3833,7 @@ prepare_for_detach (void)
event.ptid = do_target_wait_1 (inf, pid_ptid, &event.ws, 0); event.ptid = do_target_wait_1 (inf, pid_ptid, &event.ws, 0);
if (debug_infrun) 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); handle_one (event);
} }
@ -3880,7 +3880,7 @@ wait_for_inferior (inferior *inf)
ecs->target = inf->process_target (); ecs->target = inf->process_target ();
if (debug_infrun) 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. */ /* Now figure out what to do with the result of the result. */
handle_inferior_event (ecs); handle_inferior_event (ecs);
@ -4070,7 +4070,7 @@ fetch_inferior_event ()
switch_to_target_no_thread (ecs->target); switch_to_target_no_thread (ecs->target);
if (debug_infrun) 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 /* If an error happens while handling the event, propagate GDB's
knowledge of the executing state to the frontend/user running knowledge of the executing state to the frontend/user running
@ -4257,7 +4257,7 @@ context_switch (execution_control_state *ecs)
static void static void
adjust_pc_after_break (struct thread_info *thread, adjust_pc_after_break (struct thread_info *thread,
const target_waitstatus *ws) const target_waitstatus &ws)
{ {
struct regcache *regcache; struct regcache *regcache;
struct gdbarch *gdbarch; struct gdbarch *gdbarch;
@ -4284,10 +4284,10 @@ adjust_pc_after_break (struct thread_info *thread,
target with both of these set in GDB history, and it seems unlikely to be 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. */ correct, so gdbarch_have_nonsteppable_watchpoint is not checked here. */
if (ws->kind () != TARGET_WAITKIND_STOPPED) if (ws.kind () != TARGET_WAITKIND_STOPPED)
return; return;
if (ws->sig () != GDB_SIGNAL_TRAP) if (ws.sig () != GDB_SIGNAL_TRAP)
return; return;
/* In reverse execution, when a breakpoint is hit, the instruction /* In reverse execution, when a breakpoint is hit, the instruction
@ -4494,7 +4494,7 @@ handle_syscall_event (struct execution_control_state *ecs)
ecs->event_thread->control.stop_bpstat ecs->event_thread->control.stop_bpstat
= bpstat_stop_status (regcache->aspace (), = bpstat_stop_status (regcache->aspace (),
ecs->event_thread->stop_pc (), ecs->event_thread->stop_pc (),
ecs->event_thread, &ecs->ws); ecs->event_thread, ecs->ws);
if (handle_stop_requested (ecs)) if (handle_stop_requested (ecs))
return false; return false;
@ -4593,7 +4593,7 @@ poll_one_curr_target (struct target_waitstatus *ws)
event_ptid = target_wait (minus_one_ptid, ws, TARGET_WNOHANG); event_ptid = target_wait (minus_one_ptid, ws, TARGET_WNOHANG);
if (debug_infrun) 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; return event_ptid;
} }
@ -4674,23 +4674,23 @@ wait_one ()
/* Save the thread's event and stop reason to process it later. */ /* Save the thread's event and stop reason to process it later. */
static void 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", infrun_debug_printf ("saving status %s for %s",
ws->to_string ().c_str (), ws.to_string ().c_str (),
tp->ptid.to_string ().c_str ()); tp->ptid.to_string ().c_str ());
/* Record for later. */ /* Record for later. */
tp->set_pending_waitstatus (*ws); tp->set_pending_waitstatus (ws);
if (ws->kind () == TARGET_WAITKIND_STOPPED if (ws.kind () == TARGET_WAITKIND_STOPPED
&& ws->sig () == GDB_SIGNAL_TRAP) && ws.sig () == GDB_SIGNAL_TRAP)
{ {
struct regcache *regcache = get_thread_regcache (tp); struct regcache *regcache = get_thread_regcache (tp);
const address_space *aspace = regcache->aspace (); const address_space *aspace = regcache->aspace ();
CORE_ADDR pc = regcache_read_pc (regcache); 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; scoped_restore_current_thread restore_thread;
switch_to_thread (tp); switch_to_thread (tp);
@ -4824,7 +4824,7 @@ handle_one (const wait_one_event &event)
switch_to_thread_no_regs (t); switch_to_thread_no_regs (t);
mark_non_executing_threads (event.target, event.ptid, mark_non_executing_threads (event.target, event.ptid,
event.ws); event.ws);
save_waitstatus (t, &event.ws); save_waitstatus (t, event.ws);
t->stop_requested = false; t->stop_requested = false;
} }
} }
@ -4878,7 +4878,7 @@ handle_one (const wait_one_event &event)
t->ptid.to_string ().c_str ()); t->ptid.to_string ().c_str ());
/* Record for later. */ /* Record for later. */
save_waitstatus (t, &event.ws); save_waitstatus (t, event.ws);
sig = (event.ws.kind () == TARGET_WAITKIND_STOPPED sig = (event.ws.kind () == TARGET_WAITKIND_STOPPED
? event.ws.sig () : GDB_SIGNAL_0); ? event.ws.sig () : GDB_SIGNAL_0);
@ -5236,7 +5236,7 @@ handle_inferior_event (struct execution_control_state *ecs)
} }
/* Dependent on valid ECS->EVENT_THREAD. */ /* 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. */ /* Dependent on the current PC value modified by adjust_pc_after_break. */
reinit_frame_cache (); reinit_frame_cache ();
@ -5295,7 +5295,7 @@ handle_inferior_event (struct execution_control_state *ecs)
ecs->event_thread->control.stop_bpstat ecs->event_thread->control.stop_bpstat
= bpstat_stop_status (regcache->aspace (), = bpstat_stop_status (regcache->aspace (),
ecs->event_thread->stop_pc (), ecs->event_thread->stop_pc (),
ecs->event_thread, &ecs->ws); ecs->event_thread, ecs->ws);
if (handle_stop_requested (ecs)) if (handle_stop_requested (ecs))
return; return;
@ -5538,7 +5538,7 @@ handle_inferior_event (struct execution_control_state *ecs)
ecs->event_thread->control.stop_bpstat ecs->event_thread->control.stop_bpstat
= bpstat_stop_status (get_current_regcache ()->aspace (), = bpstat_stop_status (get_current_regcache ()->aspace (),
ecs->event_thread->stop_pc (), ecs->event_thread->stop_pc (),
ecs->event_thread, &ecs->ws); ecs->event_thread, ecs->ws);
if (handle_stop_requested (ecs)) if (handle_stop_requested (ecs))
return; return;
@ -5649,7 +5649,7 @@ handle_inferior_event (struct execution_control_state *ecs)
ecs->event_thread->control.stop_bpstat ecs->event_thread->control.stop_bpstat
= bpstat_stop_status (get_current_regcache ()->aspace (), = bpstat_stop_status (get_current_regcache ()->aspace (),
ecs->event_thread->stop_pc (), ecs->event_thread->stop_pc (),
ecs->event_thread, &ecs->ws); ecs->event_thread, ecs->ws);
if (handle_stop_requested (ecs)) if (handle_stop_requested (ecs))
return; return;
@ -5886,7 +5886,7 @@ finish_step_over (struct execution_control_state *ecs)
gdb_assert (pending != tp); gdb_assert (pending != tp);
/* Record the event thread's event for later. */ /* 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 /* This was cleared early, by handle_inferior_event. Set it
so this pending event is considered by so this pending event is considered by
do_target_wait. */ do_target_wait. */
@ -6061,7 +6061,7 @@ handle_signal_stop (struct execution_control_state *ecs)
&& ecs->event_thread->stepping_over_watchpoint) && ecs->event_thread->stepping_over_watchpoint)
stopped_by_watchpoint = 0; stopped_by_watchpoint = 0;
else 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 /* If necessary, step over this watchpoint. We'll be back to display
it in a moment. */ it in a moment. */
@ -6134,16 +6134,16 @@ handle_signal_stop (struct execution_control_state *ecs)
that's an extremely unlikely scenario. */ that's an extremely unlikely scenario. */
if (!pc_at_non_inline_function (aspace, if (!pc_at_non_inline_function (aspace,
ecs->event_thread->stop_pc (), ecs->event_thread->stop_pc (),
&ecs->ws) ecs->ws)
&& !(ecs->event_thread->stop_signal () == GDB_SIGNAL_TRAP && !(ecs->event_thread->stop_signal () == GDB_SIGNAL_TRAP
&& ecs->event_thread->control.trap_expected && ecs->event_thread->control.trap_expected
&& pc_at_non_inline_function (aspace, && pc_at_non_inline_function (aspace,
ecs->event_thread->prev_pc, ecs->event_thread->prev_pc,
&ecs->ws))) ecs->ws)))
{ {
stop_chain = build_bpstat_chain (aspace, stop_chain = build_bpstat_chain (aspace,
ecs->event_thread->stop_pc (), ecs->event_thread->stop_pc (),
&ecs->ws); ecs->ws);
skip_inline_frames (ecs->event_thread, stop_chain); skip_inline_frames (ecs->event_thread, stop_chain);
/* Re-fetch current thread's frame in case that invalidated /* Re-fetch current thread's frame in case that invalidated
@ -6195,7 +6195,7 @@ handle_signal_stop (struct execution_control_state *ecs)
ecs->event_thread->control.stop_bpstat ecs->event_thread->control.stop_bpstat
= bpstat_stop_status (get_current_regcache ()->aspace (), = bpstat_stop_status (get_current_regcache ()->aspace (),
ecs->event_thread->stop_pc (), 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 /* Following in case break condition called a
function. */ function. */
@ -8258,14 +8258,14 @@ print_no_history_reason (struct ui_out *uiout)
based on the event(s) that just occurred. */ based on the event(s) that just occurred. */
static void static void
print_stop_location (struct target_waitstatus *ws) print_stop_location (const target_waitstatus &ws)
{ {
int bpstat_ret; int bpstat_ret;
enum print_what source_flag; enum print_what source_flag;
int do_frame_printing = 1; int do_frame_printing = 1;
struct thread_info *tp = inferior_thread (); 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) switch (bpstat_ret)
{ {
case PRINT_UNKNOWN: case PRINT_UNKNOWN:
@ -8325,7 +8325,7 @@ print_stop_event (struct ui_out *uiout, bool displays)
{ {
scoped_restore save_uiout = make_scoped_restore (&current_uiout, uiout); scoped_restore save_uiout = make_scoped_restore (&current_uiout, uiout);
print_stop_location (&last); print_stop_location (last);
/* Display the auto-display expressions. */ /* Display the auto-display expressions. */
if (displays) if (displays)

View File

@ -209,7 +209,7 @@ extern void print_stop_event (struct ui_out *uiout, bool displays = true);
/* Pretty print the results of target_wait, for debugging purposes. */ /* Pretty print the results of target_wait, for debugging purposes. */
extern void print_target_wait_results (ptid_t waiton_ptid, ptid_t result_ptid, 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); extern int signal_stop_state (int);

View File

@ -762,7 +762,7 @@ public: /* Remote specific methods. */
target_waitstatus *status); target_waitstatus *status);
ptid_t select_thread_for_ambiguous_stop_reply 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); void remote_notice_new_inferior (ptid_t currthread, bool executing);
@ -4542,7 +4542,7 @@ remote_target::process_initial_stop_replies (int from_tty)
event_ptid = target_wait (waiton_ptid, &ws, TARGET_WNOHANG); event_ptid = target_wait (waiton_ptid, &ws, TARGET_WNOHANG);
if (remote_debug) if (remote_debug)
print_target_wait_results (waiton_ptid, event_ptid, &ws); print_target_wait_results (waiton_ptid, event_ptid, ws);
switch (ws.kind ()) switch (ws.kind ())
{ {
@ -7224,11 +7224,11 @@ struct notif_client notif_client_stop =
-1 if we want to check all threads. */ -1 if we want to check all threads. */
static int 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) ptid_t thread_ptid)
{ {
if (ws->kind () == TARGET_WAITKIND_FORKED if (ws.kind () == TARGET_WAITKIND_FORKED
|| ws->kind () == TARGET_WAITKIND_VFORKED) || ws.kind () == TARGET_WAITKIND_VFORKED)
{ {
if (event_pid == -1 || event_pid == thread_ptid.pid ()) if (event_pid == -1 || event_pid == thread_ptid.pid ())
return 1; return 1;
@ -7240,13 +7240,13 @@ is_pending_fork_parent (const target_waitstatus *ws, int event_pid,
/* Return the thread's pending status used to determine whether the /* Return the thread's pending status used to determine whether the
thread is a fork parent stopped at a fork event. */ 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) thread_pending_fork_status (struct thread_info *thread)
{ {
if (thread->has_pending_waitstatus ()) if (thread->has_pending_waitstatus ())
return &thread->pending_waitstatus (); return thread->pending_waitstatus ();
else else
return &thread->pending_follow; return thread->pending_follow;
} }
/* Determine if THREAD is a pending fork parent thread. */ /* Determine if THREAD is a pending fork parent thread. */
@ -7254,7 +7254,7 @@ thread_pending_fork_status (struct thread_info *thread)
static int static int
is_pending_fork_parent_thread (struct thread_info *thread) 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; int pid = -1;
return is_pending_fork_parent (ws, pid, thread->ptid); return is_pending_fork_parent (ws, pid, thread->ptid);
@ -7276,10 +7276,10 @@ remote_target::remove_new_fork_children (threads_listing_context *context)
fork child threads from the CONTEXT list. */ fork child threads from the CONTEXT list. */
for (thread_info *thread : all_non_exited_threads (this)) 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)) 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) /* Check for any pending fork events (not reported or processed yet)
@ -7940,15 +7940,15 @@ remote_notif_get_pending_events (remote_target *remote, notif_client *nc)
ptid_t ptid_t
remote_target::select_thread_for_ambiguous_stop_reply remote_target::select_thread_for_ambiguous_stop_reply
(const struct target_waitstatus *status) (const target_waitstatus &status)
{ {
REMOTE_SCOPED_DEBUG_ENTER_EXIT; REMOTE_SCOPED_DEBUG_ENTER_EXIT;
/* Some stop events apply to all threads in an inferior, while others /* Some stop events apply to all threads in an inferior, while others
only apply to a single thread. */ only apply to a single thread. */
bool process_wide_stop bool process_wide_stop
= (status->kind () == TARGET_WAITKIND_EXITED = (status.kind () == TARGET_WAITKIND_EXITED
|| status->kind () == TARGET_WAITKIND_SIGNALLED); || status.kind () == TARGET_WAITKIND_SIGNALLED);
remote_debug_printf ("process_wide_stop = %d", process_wide_stop); remote_debug_printf ("process_wide_stop = %d", process_wide_stop);
@ -8030,7 +8030,7 @@ remote_target::process_stop_reply (struct stop_reply *stop_reply,
/* If no thread/process was reported by the stub then select a suitable /* If no thread/process was reported by the stub then select a suitable
thread/process. */ thread/process. */
if (ptid == null_ptid) 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); gdb_assert (ptid != null_ptid);
if (status->kind () != TARGET_WAITKIND_EXITED if (status->kind () != TARGET_WAITKIND_EXITED
@ -10056,11 +10056,11 @@ remote_target::kill_new_fork_children (int pid)
that are stopped at a fork event. */ that are stopped at a fork event. */
for (thread_info *thread : all_non_exited_threads (this)) 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)) 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; int res;
res = remote_vkill (child_pid); res = remote_vkill (child_pid);
@ -10073,7 +10073,7 @@ remote_target::kill_new_fork_children (int pid)
in process PID and kill those fork child threads as well. */ in process PID and kill those fork child threads as well. */
remote_notif_get_pending_events (notif); remote_notif_get_pending_events (notif);
for (auto &event : rs->stop_reply_queue) 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 child_pid = event->ws.child_ptid ().pid ();
int res; int res;

View File

@ -1081,15 +1081,14 @@ outreg (struct regcache *regcache, int regno, char *buf)
} }
void void
prepare_resume_reply (char *buf, ptid_t ptid, prepare_resume_reply (char *buf, ptid_t ptid, const target_waitstatus &status)
struct target_waitstatus *status)
{ {
client_state &cs = get_client_state (); client_state &cs = get_client_state ();
if (debug_threads) if (debug_threads)
debug_printf ("Writing resume reply for %s:%d\n", 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_STOPPED:
case TARGET_WAITKIND_FORKED: case TARGET_WAITKIND_FORKED:
@ -1104,27 +1103,27 @@ prepare_resume_reply (char *buf, ptid_t ptid,
const char **regp; const char **regp;
struct regcache *regcache; struct regcache *regcache;
if ((status->kind () == TARGET_WAITKIND_FORKED && cs.report_fork_events) if ((status.kind () == TARGET_WAITKIND_FORKED && cs.report_fork_events)
|| (status->kind () == TARGET_WAITKIND_VFORKED || (status.kind () == TARGET_WAITKIND_VFORKED
&& cs.report_vfork_events)) && cs.report_vfork_events))
{ {
enum gdb_signal signal = GDB_SIGNAL_TRAP; 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"); ? "fork" : "vfork");
sprintf (buf, "T%02x%s:", signal, event); sprintf (buf, "T%02x%s:", signal, event);
buf += strlen (buf); buf += strlen (buf);
buf = write_ptid (buf, status->child_ptid ()); buf = write_ptid (buf, status.child_ptid ());
strcat (buf, ";"); strcat (buf, ";");
} }
else if (status->kind () == TARGET_WAITKIND_VFORK_DONE else if (status.kind () == TARGET_WAITKIND_VFORK_DONE
&& cs.report_vfork_events) && cs.report_vfork_events)
{ {
enum gdb_signal signal = GDB_SIGNAL_TRAP; enum gdb_signal signal = GDB_SIGNAL_TRAP;
sprintf (buf, "T%02xvforkdone:;", signal); 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; enum gdb_signal signal = GDB_SIGNAL_TRAP;
const char *event = "exec"; const char *event = "exec";
@ -1134,32 +1133,32 @@ prepare_resume_reply (char *buf, ptid_t ptid,
buf += strlen (buf); buf += strlen (buf);
/* Encode pathname to hexified format. */ /* Encode pathname to hexified format. */
bin2hex ((const gdb_byte *) status->execd_pathname (), bin2hex ((const gdb_byte *) status.execd_pathname (),
hexified_pathname, hexified_pathname,
strlen (status->execd_pathname ())); strlen (status.execd_pathname ()));
sprintf (buf, "%s;", hexified_pathname); sprintf (buf, "%s;", hexified_pathname);
buf += strlen (buf); buf += strlen (buf);
} }
else if (status->kind () == TARGET_WAITKIND_THREAD_CREATED else if (status.kind () == TARGET_WAITKIND_THREAD_CREATED
&& cs.report_thread_events) && cs.report_thread_events)
{ {
enum gdb_signal signal = GDB_SIGNAL_TRAP; enum gdb_signal signal = GDB_SIGNAL_TRAP;
sprintf (buf, "T%02xcreate:;", signal); sprintf (buf, "T%02xcreate:;", signal);
} }
else if (status->kind () == TARGET_WAITKIND_SYSCALL_ENTRY else if (status.kind () == TARGET_WAITKIND_SYSCALL_ENTRY
|| status->kind () == TARGET_WAITKIND_SYSCALL_RETURN) || status.kind () == TARGET_WAITKIND_SYSCALL_RETURN)
{ {
enum gdb_signal signal = GDB_SIGNAL_TRAP; 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"); ? "syscall_entry" : "syscall_return");
sprintf (buf, "T%02x%s:%x;", signal, event, sprintf (buf, "T%02x%s:%x;", signal, event,
status->syscall_number ()); status.syscall_number ());
} }
else else
sprintf (buf, "T%02x", status->sig ()); sprintf (buf, "T%02x", status.sig ());
if (disable_packet_T) if (disable_packet_T)
{ {
@ -1281,19 +1280,19 @@ prepare_resume_reply (char *buf, ptid_t ptid,
case TARGET_WAITKIND_EXITED: case TARGET_WAITKIND_EXITED:
if (cs.multi_process) if (cs.multi_process)
sprintf (buf, "W%x;process:%x", sprintf (buf, "W%x;process:%x",
status->exit_status (), ptid.pid ()); status.exit_status (), ptid.pid ());
else else
sprintf (buf, "W%02x", status->exit_status ()); sprintf (buf, "W%02x", status.exit_status ());
break; break;
case TARGET_WAITKIND_SIGNALLED: case TARGET_WAITKIND_SIGNALLED:
if (cs.multi_process) if (cs.multi_process)
sprintf (buf, "X%x;process:%x", sprintf (buf, "X%x;process:%x",
status->sig (), ptid.pid ()); status.sig (), ptid.pid ());
else else
sprintf (buf, "X%02x", status->sig ()); sprintf (buf, "X%02x", status.sig ());
break; break;
case TARGET_WAITKIND_THREAD_EXITED: case TARGET_WAITKIND_THREAD_EXITED:
sprintf (buf, "w%x;", status->exit_status ()); sprintf (buf, "w%x;", status.exit_status ());
buf += strlen (buf); buf += strlen (buf);
buf = write_ptid (buf, ptid); buf = write_ptid (buf, ptid);
break; break;

View File

@ -41,7 +41,7 @@ void enable_async_io (void);
void disable_async_io (void); void disable_async_io (void);
void check_remote_input_interrupt_request (void); void check_remote_input_interrupt_request (void);
void prepare_resume_reply (char *buf, ptid_t ptid, 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); const char *decode_address_to_semicolon (CORE_ADDR *addrp, const char *start);
void decode_address (CORE_ADDR *addrp, const char *start, int len); void decode_address (CORE_ADDR *addrp, const char *start, int len);

View File

@ -173,12 +173,12 @@ get_client_state ()
/* Put a stop reply to the stop reply queue. */ /* Put a stop reply to the stop reply queue. */
static void 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; struct vstop_notif *new_notif = new struct vstop_notif;
new_notif->ptid = ptid; new_notif->ptid = ptid;
new_notif->status = *status; new_notif->status = status;
notif_event_enque (&notif_stop, new_notif); notif_event_enque (&notif_stop, new_notif);
} }
@ -225,7 +225,7 @@ vstop_notif_reply (struct notif_event *event, char *own_buf)
{ {
struct vstop_notif *vstop = (struct vstop_notif *) event; 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. */ /* Helper for in_queued_stop_replies. */
@ -2795,7 +2795,7 @@ handle_pending_status (const struct thread_resume *resumption,
cs.last_status = thread->last_status; cs.last_status = thread->last_status;
cs.last_ptid = thread->id; 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 1;
} }
return 0; return 0;
@ -2963,7 +2963,7 @@ resume (struct thread_resume *actions, size_t num_actions)
so by now). Tag all threads as "want-stopped", so we don't so by now). Tag all threads as "want-stopped", so we don't
resume them implicitly without the client telling us to. */ resume them implicitly without the client telling us to. */
gdb_wants_all_threads_stopped (); 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 (); disable_async_io ();
if (cs.last_status.kind () == TARGET_WAITKIND_EXITED if (cs.last_status.kind () == TARGET_WAITKIND_EXITED
@ -2996,7 +2996,7 @@ handle_v_attach (char *own_buf)
write_ok (own_buf); write_ok (own_buf);
} }
else else
prepare_resume_reply (own_buf, cs.last_ptid, &cs.last_status); prepare_resume_reply (own_buf, cs.last_ptid, cs.last_status);
} }
else else
write_enn (own_buf); write_enn (own_buf);
@ -3114,7 +3114,7 @@ handle_v_run (char *own_buf)
if (cs.last_status.kind () == TARGET_WAITKIND_STOPPED) 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 /* 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 thread, but GDB assumes a vRun sets it (this is so GDB can
@ -3313,7 +3313,7 @@ queue_stop_reply_callback (thread_info *thread)
/* Pass the last stop reply back to GDB, but don't notify /* Pass the last stop reply back to GDB, but don't notify
yet. */ yet. */
queue_stop_reply (thread->id, &thread->last_status); queue_stop_reply (thread->id, thread->last_status);
} }
} }
} }
@ -3436,7 +3436,7 @@ handle_status (char *own_buf)
set_desired_thread (); set_desired_thread ();
gdb_assert (tp->last_status.kind () != TARGET_WAITKIND_IGNORE); 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 else
strcpy (own_buf, "W00"); strcpy (own_buf, "W00");
@ -4562,11 +4562,11 @@ handle_serial_event (int err, gdb_client_data client_data)
/* Push a stop notification on the notification queue. */ /* Push a stop notification on the notification queue. */
static void 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; struct vstop_notif *vstop_notif = new struct vstop_notif;
vstop_notif->status = *status; vstop_notif->status = status;
vstop_notif->ptid = ptid; vstop_notif->ptid = ptid;
/* Push Stop notification. */ /* Push Stop notification. */
notif_push (&notif_stop, vstop_notif); notif_push (&notif_stop, vstop_notif);
@ -4587,7 +4587,7 @@ handle_target_event (int err, gdb_client_data client_data)
if (cs.last_status.kind () == TARGET_WAITKIND_NO_RESUMED) if (cs.last_status.kind () == TARGET_WAITKIND_NO_RESUMED)
{ {
if (gdb_connected () && report_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 if (cs.last_status.kind () != TARGET_WAITKIND_IGNORE)
{ {
@ -4645,7 +4645,7 @@ handle_target_event (int err, gdb_client_data client_data)
} }
} }
else 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. /* Be sure to not change the selected thread behind GDB's back.