diff options
author | Christopher Ferris <cferris@google.com> | 2014-09-12 14:44:20 -0700 |
---|---|---|
committer | Christopher Ferris <cferris@google.com> | 2014-09-13 16:22:17 -0700 |
commit | 6bcc4acc6f0387f7907741de34c8c2d7e44c1dd7 (patch) | |
tree | 6172392f0eb29cd55fb652a264a336fca5169a77 /include/cutils | |
parent | 6e9798f2e44c82b0cd8257f96b7d23285a7edc67 (diff) | |
download | system_core-6bcc4acc6f0387f7907741de34c8c2d7e44c1dd7.zip system_core-6bcc4acc6f0387f7907741de34c8c2d7e44c1dd7.tar.gz system_core-6bcc4acc6f0387f7907741de34c8c2d7e44c1dd7.tar.bz2 |
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
(cherry picked from commit a9fa7b87f1aefd7b96f749a545d3385ad384c12b)
Change-Id: I3c9e0212c8720877a6af092071a3695df2a36df8
Diffstat (limited to 'include/cutils')
-rw-r--r-- | include/cutils/debugger.h | 19 |
1 files changed, 16 insertions, 3 deletions
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. |