static bool
follow_fork_inferior (bool follow_child, bool detach_fork)
{
+ INFRUN_SCOPED_DEBUG_ENTER_EXIT;
+
+ infrun_debug_printf ("follow_child = %d, detach_fork = %d",
+ follow_child, detach_fork);
+
target_waitkind fork_kind = inferior_thread ()->pending_follow.kind ();
gdb_assert (fork_kind == TARGET_WAITKIND_FORKED
|| fork_kind == TARGET_WAITKIND_VFORKED);
parent_inf->thread_waiting_for_vfork_done
= detach_fork ? inferior_thread () : nullptr;
parent_inf->pspace->breakpoints_not_allowed = detach_fork;
+
+ infrun_debug_printf
+ ("parent_inf->thread_waiting_for_vfork_done == %s",
+ (parent_inf->thread_waiting_for_vfork_done == nullptr
+ ? "nullptr"
+ : (parent_inf->thread_waiting_for_vfork_done
+ ->ptid.to_string ().c_str ())));
}
}
else
static bool
follow_fork ()
{
+ INFRUN_SCOPED_DEBUG_ENTER_EXIT;
+
bool follow_child = (follow_fork_mode_string == follow_fork_mode_child);
bool should_resume = true;
static void
handle_vfork_child_exec_or_exit (int exec)
{
+ INFRUN_SCOPED_DEBUG_ENTER_EXIT;
+
struct inferior *inf = current_inferior ();
if (inf->vfork_parent)
static void
handle_vfork_done (thread_info *event_thread)
{
+ INFRUN_SCOPED_DEBUG_ENTER_EXIT;
+
/* We only care about this event if inferior::thread_waiting_for_vfork_done is
set, that is if we are waiting for a vfork child not under our control
(because we detached it) to exec or exit.
return;
}
- INFRUN_SCOPED_DEBUG_ENTER_EXIT;
-
/* We stopped all threads (other than the vforking thread) of the inferior in
follow_fork and kept them stopped until now. It should therefore not be
possible for another thread to have reported a vfork during that window.
thread_info *cur_thr = inferior_thread ();
+ infrun_debug_printf ("cur_thr = %s", cur_thr->ptid.to_string ().c_str ());
+
/* Fill in with reasonable starting values. */
init_thread_stepping_state (cur_thr);
if (!cur_thr->control.in_infcall)
set_running (resume_target, resume_ptid, true);
- infrun_debug_printf ("addr=%s, signal=%s", paddress (gdbarch, addr),
- gdb_signal_to_symbol_string (siggnal));
+ infrun_debug_printf ("addr=%s, signal=%s, resume_ptid=%s",
+ paddress (gdbarch, addr),
+ gdb_signal_to_symbol_string (siggnal),
+ resume_ptid.to_string ().c_str ());
annotate_starting ();
static void
detach_one_lwp (struct lwp_info *lp, int *signo_p)
{
+ LINUX_NAT_SCOPED_DEBUG_ENTER_EXIT;
+
+ linux_nat_debug_printf ("lwp %s (stopped = %d)",
+ lp->ptid.to_string ().c_str (), lp->stopped);
+
int lwpid = lp->ptid.lwp ();
int signo;
else
signo = *signo_p;
+ linux_nat_debug_printf ("preparing to resume lwp %s (stopped = %d)",
+ lp->ptid.to_string ().c_str (),
+ lp->stopped);
+
/* Preparing to resume may try to write registers, and fail if the
lwp is zombie. If that happens, ignore the error. We'll handle
it below, when detach fails with ESRCH. */
void
linux_nat_target::detach (inferior *inf, int from_tty)
{
+ LINUX_NAT_SCOPED_DEBUG_ENTER_EXIT;
+
struct lwp_info *main_lwp;
int pid = inf->pid;
linux_nat_wait_1 (ptid_t ptid, struct target_waitstatus *ourstatus,
target_wait_flags target_options)
{
+ LINUX_NAT_SCOPED_DEBUG_ENTER_EXIT;
+
sigset_t prev_mask;
enum resume_kind last_resume_kind;
struct lwp_info *lp;
int status;
- linux_nat_debug_printf ("enter");
-
/* The first time we get here after starting a new inferior, we may
not have added it to the LWP list yet - this is the earliest
moment at which we know its PID. */
if (target_options & TARGET_WNOHANG)
{
- linux_nat_debug_printf ("exit (ignore)");
+ linux_nat_debug_printf ("no interesting events found");
ourstatus->set_ignore ();
restore_child_signals_mask (&prev_mask);
else
*ourstatus = host_status_to_waitstatus (status);
- linux_nat_debug_printf ("exit");
+ linux_nat_debug_printf ("event found");
restore_child_signals_mask (&prev_mask);
linux_nat_target::wait (ptid_t ptid, struct target_waitstatus *ourstatus,
target_wait_flags target_options)
{
+ LINUX_NAT_SCOPED_DEBUG_ENTER_EXIT;
+
ptid_t event_ptid;
linux_nat_debug_printf ("[%s], [%s]", ptid.to_string ().c_str (),
void
linux_nat_target::mourn_inferior ()
{
+ LINUX_NAT_SCOPED_DEBUG_ENTER_EXIT;
+
int pid = inferior_ptid.pid ();
purge_lwp_list (pid);