X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gdb%2Flinux-nat.c;h=0a2bfdc57d48624936f4b85ab55f2194f3a7d75d;hb=a435742a7fb32f6320ce0e6074e2500e28378104;hp=66004e5be81ac20e5cae4c13dab13f4466956797;hpb=6c2659886f7018fcca26ee0fc813bc9748fb8513;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c index 66004e5be8..0a2bfdc57d 100644 --- a/gdb/linux-nat.c +++ b/gdb/linux-nat.c @@ -47,7 +47,7 @@ #include /* for struct stat */ #include /* for O_RDONLY */ #include "inf-loop.h" -#include "event-loop.h" +#include "gdbsupport/event-loop.h" #include "event-top.h" #include #include @@ -440,8 +440,8 @@ typedef std::unique_ptr lwp_info_up; ptid of the followed inferior. At return, inferior_ptid will be unchanged. */ -int -linux_nat_target::follow_fork (int follow_child, int detach_fork) +bool +linux_nat_target::follow_fork (bool follow_child, bool detach_fork) { if (!follow_child) { @@ -611,7 +611,7 @@ linux_nat_target::follow_fork (int follow_child, int detach_fork) check_for_thread_db (); } - return 0; + return false; } @@ -1166,8 +1166,8 @@ attach_proc_task_lwp_callback (ptid_t ptid) matching libthread_db is not found (or the process uses raw clone). */ add_thread (linux_target, lp->ptid); - set_running (linux_target, lp->ptid, 1); - set_executing (linux_target, lp->ptid, 1); + set_running (linux_target, lp->ptid, true); + set_executing (linux_target, lp->ptid, true); } return 1; @@ -1700,7 +1700,8 @@ linux_nat_target::resume (ptid_t ptid, int step, enum gdb_signal signo) resume_many = (minus_one_ptid == ptid || ptid.is_pid ()); - /* Mark the lwps we're resuming as resumed. */ + /* Mark the lwps we're resuming as resumed and update their + last_resume_kind to resume_continue. */ iterate_over_lwps (ptid, resume_set_callback); /* See if it's the current inferior that should be handled @@ -1977,6 +1978,10 @@ linux_handle_extended_wait (struct lwp_info *lp, int status) inferior. */ linux_target->low_new_fork (lp, new_pid); } + else if (event == PTRACE_EVENT_CLONE) + { + linux_target->low_new_clone (lp, new_pid); + } if (event == PTRACE_EVENT_FORK && linux_fork_checkpointing_p (lp->ptid.pid ())) @@ -2037,8 +2042,8 @@ linux_handle_extended_wait (struct lwp_info *lp, int status) internal to this module, from the perspective of infrun and the user/frontend, this new thread is running until it next reports a stop. */ - set_running (linux_target, new_lp->ptid, 1); - set_executing (linux_target, new_lp->ptid, 1); + set_running (linux_target, new_lp->ptid, true); + set_executing (linux_target, new_lp->ptid, true); if (WSTOPSIG (status) != SIGSTOP) { @@ -2725,7 +2730,7 @@ save_stop_reason (struct lwp_info *lp) { /* If we determine the LWP stopped for a SW breakpoint, trust it. Particularly don't check watchpoint - registers, because at least on s390, we'd find + registers, because, at least on s390, we'd find stopped-by-watchpoint as long as there's a watchpoint set. */ lp->stop_reason = TARGET_STOPPED_BY_SW_BREAKPOINT; @@ -2929,7 +2934,7 @@ resumed_callback (struct lwp_info *lp) } /* Check if we should go on and pass this event to common code. - Return the affected lwp if we are, or NULL otherwise. */ + Return the affected lwp if we should, or NULL otherwise. */ static struct lwp_info * linux_nat_filter_event (int lwpid, int status) @@ -3122,7 +3127,7 @@ linux_nat_filter_event (int lwpid, int status) /* Don't report signals that GDB isn't interested in, such as signals that are neither printed nor stopped upon. Stopping all - threads can be a bit time-consuming so if we want decent + threads can be a bit time-consuming, so if we want decent performance with heavily multi-threaded programs, especially when they're using a high frequency timer, we'd better avoid it if we can. */ @@ -4212,8 +4217,7 @@ sigchld_handler (int signo) int old_errno = errno; if (debug_linux_nat) - ui_file_write_async_safe (gdb_stdlog, - "sigchld\n", sizeof ("sigchld\n") - 1); + gdb_stdlog->write_async_safe ("sigchld\n", sizeof ("sigchld\n") - 1); if (signo == SIGCHLD && linux_nat_event_pipe[0] != -1)