From a9fa7b87f1aefd7b96f749a545d3385ad384c12b Mon Sep 17 00:00:00 2001 From: Christopher Ferris Date: Fri, 12 Sep 2014 14:44:20 -0700 Subject: Use the correct debuggerd given the tid. On 64 bit systems, calling dump_backtrace_to_file will automatically call debuggerd64. If the process to dump is actually 32 bit, this creates an unrecognizable dump backtrace. Modify the code to check the type of the process and connect to the appropriate debuggerd process. This change refactors both the tombstone and backtrace functionality to allow both to work properly on 64 bit systems when dealing with mixed processes. Bug: 17487122 Change-Id: Icf123a6f4508b1aeec073663aa1a0ceae5380aa1 --- include/cutils/debugger.h | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/cutils/debugger.h b/include/cutils/debugger.h index ae6bfc4..4bcc8e6 100644 --- a/include/cutils/debugger.h +++ b/include/cutils/debugger.h @@ -23,10 +23,13 @@ extern "C" { #endif -#if __LP64__ -#define DEBUGGER_SOCKET_NAME "android:debuggerd64" +#define DEBUGGER32_SOCKET_NAME "android:debuggerd" +#define DEBUGGER64_SOCKET_NAME "android:debuggerd64" + +#if defined(__LP64__) +#define DEBUGGER_SOCKET_NAME DEBUGGER64_SOCKET_NAME #else -#define DEBUGGER_SOCKET_NAME "android:debuggerd" +#define DEBUGGER_SOCKET_NAME DEBUGGER32_SOCKET_NAME #endif typedef enum { @@ -45,6 +48,16 @@ typedef struct { int32_t original_si_code; } debugger_msg_t; +#if defined(__LP64__) +// For a 64 bit process to contact the 32 bit debuggerd. +typedef struct { + debugger_action_t action; + pid_t tid; + uint32_t abort_msg_address; + int32_t original_si_code; +} debugger32_msg_t; +#endif + /* Dumps a process backtrace, registers, and stack to a tombstone file (requires root). * Stores the tombstone path in the provided buffer. * Returns 0 on success, -1 on error. -- cgit v1.1