diff options
author | Brigid Smith <brigidsmith@google.com> | 2014-06-26 13:22:48 -0700 |
---|---|---|
committer | Brigid Smith <brigidsmith@google.com> | 2014-06-27 09:21:12 -0700 |
commit | 75582957cfe1c985aa58dd64d7e1405fa93b04e0 (patch) | |
tree | 65ada54a148a025442d0d420169be2e29c5bb0c4 /debuggerd/debuggerd.cpp | |
parent | 01ad77107bfdc641ad818fe452448f0887aef961 (diff) | |
download | system_core-75582957cfe1c985aa58dd64d7e1405fa93b04e0.tar.gz system_core-75582957cfe1c985aa58dd64d7e1405fa93b04e0.tar.bz2 system_core-75582957cfe1c985aa58dd64d7e1405fa93b04e0.zip |
Fixed tid/pid mixup in debuggerd gdbclient output.
Now the debugging output shows the tid of the crashed thread instead of
the pid of the process that crashed.
Change-Id: I637f409ff02d73d458edc6d1a5c462c21d128211
Diffstat (limited to 'debuggerd/debuggerd.cpp')
-rw-r--r-- | debuggerd/debuggerd.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/debuggerd/debuggerd.cpp b/debuggerd/debuggerd.cpp index fc13977b0..61805c932 100644 --- a/debuggerd/debuggerd.cpp +++ b/debuggerd/debuggerd.cpp @@ -53,10 +53,10 @@ struct debugger_request_t { int32_t original_si_code; }; -static void wait_for_user_action(pid_t pid) { +static void wait_for_user_action(const debugger_request_t &request) { // Find out the name of the process that crashed. char path[64]; - snprintf(path, sizeof(path), "/proc/%d/exe", pid); + snprintf(path, sizeof(path), "/proc/%d/exe", request.pid); char exe[PATH_MAX]; int count; @@ -78,7 +78,7 @@ static void wait_for_user_action(pid_t pid) { "* Wait for gdb to start, then press the VOLUME DOWN key\n" "* to let the process continue crashing.\n" "********************************************************\n", - pid, exe, pid); + request.pid, exe, request.tid); // Wait for VOLUME DOWN. if (init_getevent() == 0) { @@ -93,7 +93,7 @@ static void wait_for_user_action(pid_t pid) { uninit_getevent(); } - ALOGI("debuggerd resuming process %d", pid); + ALOGI("debuggerd resuming process %d", request.pid); } static int get_process_info(pid_t tid, pid_t* out_pid, uid_t* out_uid, uid_t* out_gid) { @@ -323,7 +323,7 @@ static void handle_request(int fd) { // for user action for the crashing process. // in this case, we log a message and turn the debug LED on // waiting for a gdb connection (for instance) - wait_for_user_action(request.pid); + wait_for_user_action(request); } else { // just detach if (ptrace(PTRACE_DETACH, request.tid, 0, 0)) { |