Loading debuggerd/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -150,6 +150,7 @@ cc_library { shared_libs: [ "libbase", "libcutils", "libprocinfo", ], export_header_lib_headers: ["libdebuggerd_common_headers"], Loading debuggerd/client/debuggerd_client.cpp +15 −2 Original line number Diff line number Diff line Loading @@ -33,6 +33,7 @@ #include <android-base/strings.h> #include <android-base/unique_fd.h> #include <cutils/sockets.h> #include <procinfo/process.h> #include "debuggerd/handler.h" #include "protocol.h" Loading Loading @@ -62,8 +63,20 @@ static void populate_timeval(struct timeval* tv, const Duration& duration) { tv->tv_usec = static_cast<long>(microseconds.count()); } bool debuggerd_trigger_dump(pid_t pid, DebuggerdDumpType dump_type, unsigned int timeout_ms, bool debuggerd_trigger_dump(pid_t tid, DebuggerdDumpType dump_type, unsigned int timeout_ms, unique_fd output_fd) { pid_t pid = tid; if (dump_type == kDebuggerdJavaBacktrace) { // Java dumps always get sent to the tgid, so we need to resolve our tid to a tgid. android::procinfo::ProcessInfo procinfo; std::string error; if (!android::procinfo::GetProcessInfo(tid, &procinfo, &error)) { LOG(ERROR) << "libdebugged_client: failed to get process info: " << error; return -1; } pid = procinfo.pid; } LOG(INFO) << "libdebuggerd_client: started dumping process " << pid; unique_fd sockfd; const auto end = std::chrono::steady_clock::now() + std::chrono::milliseconds(timeout_ms); Loading Loading @@ -162,7 +175,7 @@ bool debuggerd_trigger_dump(pid_t pid, DebuggerdDumpType dump_type, unsigned int return false; } if (!send_signal(pid, dump_type)) { if (!send_signal(tid, dump_type)) { return false; } Loading Loading
debuggerd/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -150,6 +150,7 @@ cc_library { shared_libs: [ "libbase", "libcutils", "libprocinfo", ], export_header_lib_headers: ["libdebuggerd_common_headers"], Loading
debuggerd/client/debuggerd_client.cpp +15 −2 Original line number Diff line number Diff line Loading @@ -33,6 +33,7 @@ #include <android-base/strings.h> #include <android-base/unique_fd.h> #include <cutils/sockets.h> #include <procinfo/process.h> #include "debuggerd/handler.h" #include "protocol.h" Loading Loading @@ -62,8 +63,20 @@ static void populate_timeval(struct timeval* tv, const Duration& duration) { tv->tv_usec = static_cast<long>(microseconds.count()); } bool debuggerd_trigger_dump(pid_t pid, DebuggerdDumpType dump_type, unsigned int timeout_ms, bool debuggerd_trigger_dump(pid_t tid, DebuggerdDumpType dump_type, unsigned int timeout_ms, unique_fd output_fd) { pid_t pid = tid; if (dump_type == kDebuggerdJavaBacktrace) { // Java dumps always get sent to the tgid, so we need to resolve our tid to a tgid. android::procinfo::ProcessInfo procinfo; std::string error; if (!android::procinfo::GetProcessInfo(tid, &procinfo, &error)) { LOG(ERROR) << "libdebugged_client: failed to get process info: " << error; return -1; } pid = procinfo.pid; } LOG(INFO) << "libdebuggerd_client: started dumping process " << pid; unique_fd sockfd; const auto end = std::chrono::steady_clock::now() + std::chrono::milliseconds(timeout_ms); Loading Loading @@ -162,7 +175,7 @@ bool debuggerd_trigger_dump(pid_t pid, DebuggerdDumpType dump_type, unsigned int return false; } if (!send_signal(pid, dump_type)) { if (!send_signal(tid, dump_type)) { return false; } Loading