diff options
author | Josh Gao <jmgao@google.com> | 2016-03-23 14:02:52 -0700 |
---|---|---|
committer | Josh Gao <jmgao@google.com> | 2016-03-23 14:28:01 -0700 |
commit | 6eb4eab106bd5161373adb61bb81e926a8575134 (patch) | |
tree | 470a4a582181581e38c7c7d64545affd2c1569b6 /debuggerd/debuggerd.cpp | |
parent | a6219eae8d5efe6c364c44a546f4d09ccccef8bb (diff) |
debuggerd: waitpid for all children, and log the result.
Change-Id: Ic575e6db76ab153b4b238589a8cd299812d0e046
(cherry picked from commit 280800552165b4685fbe86fd8e9dc3b9d9b062cb)
Diffstat (limited to 'debuggerd/debuggerd.cpp')
-rw-r--r-- | debuggerd/debuggerd.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/debuggerd/debuggerd.cpp b/debuggerd/debuggerd.cpp index 18c608b1c..842bf0968 100644 --- a/debuggerd/debuggerd.cpp +++ b/debuggerd/debuggerd.cpp @@ -580,9 +580,20 @@ static void monitor_worker_process(int child_pid, const debugger_request_t& requ siginfo_t siginfo; int signal = TEMP_FAILURE_RETRY(sigtimedwait(&signal_set, &siginfo, &timeout)); if (signal == SIGCHLD) { - pid_t rc = waitpid(0, &status, WNOHANG | WUNTRACED); + pid_t rc = waitpid(-1, &status, WNOHANG | WUNTRACED); if (rc != child_pid) { ALOGE("debuggerd: waitpid returned unexpected pid (%d), committing murder-suicide", rc); + + if (WIFEXITED(status)) { + ALOGW("debuggerd: pid %d exited with status %d", rc, WEXITSTATUS(status)); + } else if (WIFSIGNALED(status)) { + ALOGW("debuggerd: pid %d received signal %d", rc, WTERMSIG(status)); + } else if (WIFSTOPPED(status)) { + ALOGW("debuggerd: pid %d stopped by signal %d", rc, WSTOPSIG(status)); + } else if (WIFCONTINUED(status)) { + ALOGW("debuggerd: pid %d continued", rc); + } + kill_worker = true; kill_target = true; kill_self = true; |