From 39a28c2526ae815cc3d074f01b908365f5c0c325 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Tue, 7 Jul 2015 14:34:39 -0700 Subject: [PATCH] Fix debuggerd's gdbclient instructions. We improved gdbclient to make the process simpler, but didn't update debuggerd to match. Bug: http://b/22233857 Change-Id: If4137943f567a9e566a3ac7f485c9b1eab2c68e9 --- debuggerd/debuggerd.cpp | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/debuggerd/debuggerd.cpp b/debuggerd/debuggerd.cpp index 26d63894d..deb4a9b5c 100644 --- a/debuggerd/debuggerd.cpp +++ b/debuggerd/debuggerd.cpp @@ -63,32 +63,18 @@ struct debugger_request_t { int32_t original_si_code; }; -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", request.pid); - - char exe[PATH_MAX]; - int count; - if ((count = readlink(path, exe, sizeof(exe) - 1)) == -1) { - ALOGE("readlink('%s') failed: %s", path, strerror(errno)); - strlcpy(exe, "unknown", sizeof(exe)); - } else { - exe[count] = '\0'; - } - +static void wait_for_user_action(const debugger_request_t& request) { // Explain how to attach the debugger. - ALOGI("********************************************************\n" + ALOGI("***********************************************************\n" "* Process %d has been suspended while crashing.\n" - "* To attach gdbserver for a gdb connection on port 5039\n" - "* and start gdbclient:\n" + "* To attach gdbserver and start gdb, run this on the host:\n" "*\n" - "* gdbclient %s :5039 %d\n" + "* gdbclient %d\n" "*\n" "* Wait for gdb to start, then press the VOLUME DOWN key\n" "* to let the process continue crashing.\n" - "********************************************************", - request.pid, exe, request.tid); + "***********************************************************", + request.pid, request.tid); // Wait for VOLUME DOWN. if (init_getevent() == 0) {