diff options
author | Christopher Ferris <cferris@google.com> | 2014-09-12 14:44:20 -0700 |
---|---|---|
committer | Christopher Ferris <cferris@google.com> | 2014-09-12 20:12:11 -0700 |
commit | a9fa7b87f1aefd7b96f749a545d3385ad384c12b (patch) | |
tree | 1faa2707063de2d330e9258d6c1bd6f8cdb887b0 /include | |
parent | fcfa86403e206e2caa519299939480cb45deb8ba (diff) | |
download | system_core-a9fa7b87f1aefd7b96f749a545d3385ad384c12b.zip system_core-a9fa7b87f1aefd7b96f749a545d3385ad384c12b.tar.gz system_core-a9fa7b87f1aefd7b96f749a545d3385ad384c12b.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
Change-Id: Icf123a6f4508b1aeec073663aa1a0ceae5380aa1
Diffstat (limited to 'include')
-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. |