summaryrefslogtreecommitdiffstats
path: root/debuggerd
diff options
context:
space:
mode:
authorPete Delaney <piet@cyngn.com>2015-06-04 17:33:14 -0700
committerSteve Kondik <steve@cyngn.com>2015-10-29 22:20:22 -0700
commit19e0a6639aea559714db5f7763650bd9c36721c1 (patch)
treee16bda8b06c2a42527127f8fa8e28f23fd13fcf0 /debuggerd
parentbd7b151aba517208e57535444fcfe27f69f1262e (diff)
downloadsystem_core-19e0a6639aea559714db5f7763650bd9c36721c1.zip
system_core-19e0a6639aea559714db5f7763650bd9c36721c1.tar.gz
system_core-19e0a6639aea559714db5f7763650bd9c36721c1.tar.bz2
Provide better advice on using gdb with debuggerd on crashed applications.
Let CyanogenMod developers know of a Cyanogen enhancement made by Clark Scheff and Steve Kondik where the graphical debugger interface ddd can be used with crashed applications. The new in-line function, dddclient, is now available in addition to the std Google gdbclient interface. Also, let users know that they have set their property debug.db.uid too low to enable debuggerd to wait for gdb to attach. If they haven't set debug.db.uid; let them know; and offer a hint on how to do it, without their having to Google for the web page. Change-Id: I467d861c0fffe34e8532a8bc7cf7bfdab9f56447 Signed-off-by: Pete Delaney <piet@cyngn.com>
Diffstat (limited to 'debuggerd')
-rw-r--r--debuggerd/debuggerd.cpp20
1 files changed, 18 insertions, 2 deletions
diff --git a/debuggerd/debuggerd.cpp b/debuggerd/debuggerd.cpp
index b84a4e5..e0a864d 100644
--- a/debuggerd/debuggerd.cpp
+++ b/debuggerd/debuggerd.cpp
@@ -14,6 +14,8 @@
* limitations under the License.
*/
+#define LOG_TAG "DEBUG"
+
#include <stdio.h>
#include <errno.h>
#include <signal.h>
@@ -84,11 +86,13 @@ static void wait_for_user_action(const debugger_request_t &request) {
"* and start gdbclient:\n"
"*\n"
"* gdbclient %s :5039 %d\n"
+ "* or\n"
+ "* dddclient %s :5039 %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, exe, request.tid, exe, request.tid);
// Wait for VOLUME DOWN.
if (init_getevent() == 0) {
@@ -258,7 +262,19 @@ static bool should_attach_gdb(debugger_request_t* request) {
char value[PROPERTY_VALUE_MAX];
property_get("debug.db.uid", value, "-1");
int debug_uid = atoi(value);
- return debug_uid >= 0 && request->uid <= (uid_t)debug_uid;
+ if (debug_uid >= 0 && request->uid <= (uid_t)debug_uid) {
+ return true;
+ } else {
+ /* External docs say to use 10,000 but more is likely needed; be helpful. */
+ if (request->uid > (uid_t)debug_uid) {
+ ALOGI("request->uid:%d > property debug.db.uid:%d; NOT waiting for gdb.",
+ request->uid, debug_uid);
+ } else {
+ ALOGI("property debug.db.uid not set; NOT waiting for gdb.");
+ ALOGI("HINT: adb shell setprop debug.db.uid 100000");
+ ALOGI("HINT: adb forward tcp:5039 tcp:5039");
+ }
+ }
}
return false;
}