aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Ferris <cferris@google.com>2015-01-19 11:16:52 -0800
committerChristopher Ferris <cferris@google.com>2015-01-20 17:22:25 -0800
commit151da681000c07da3c24cd30a3279b1ca017f452 (patch)
tree5b869b41571ea55cbd80324f65ff0235c880f9b0
parentffad8df672363bad43528898cc47aa2ed3d08c66 (diff)
downloadandroid_bionic-151da681000c07da3c24cd30a3279b1ca017f452.tar.gz
android_bionic-151da681000c07da3c24cd30a3279b1ca017f452.tar.bz2
android_bionic-151da681000c07da3c24cd30a3279b1ca017f452.zip
Contact proper debuggerd when crashing.
Make the request structure match the new structure found in debuggerd code. On 64 bit systems, make sure that the 32 bit compiled linker is contacted. Bug: https://code.google.com/p/android/issues/detail?id=97024 Change-Id: I675b8ff222fcf836b05de4e9b5976ff91ca929bf
-rw-r--r--linker/Android.mk4
-rw-r--r--linker/debugger.cpp17
2 files changed, 11 insertions, 10 deletions
diff --git a/linker/Android.mk b/linker/Android.mk
index 720389f0e..e1302dbc9 100644
--- a/linker/Android.mk
+++ b/linker/Android.mk
@@ -36,6 +36,10 @@ LOCAL_CONLYFLAGS += \
LOCAL_CPPFLAGS += \
-std=gnu++11 \
+ifeq ($(TARGET_IS_64_BIT),true)
+LOCAL_CPPFLAGS += -DTARGET_IS_64_BIT
+endif
+
# We need to access Bionic private headers in the linker.
LOCAL_CFLAGS += -I$(LOCAL_PATH)/../libc/
diff --git a/linker/debugger.cpp b/linker/debugger.cpp
index ac466a5b4..decc22cbd 100644
--- a/linker/debugger.cpp
+++ b/linker/debugger.cpp
@@ -41,8 +41,10 @@
extern "C" int tgkill(int tgid, int tid, int sig);
-#if __LP64__
-#define DEBUGGER_SOCKET_NAME "android:debuggerd64"
+// Crash actions have to be sent to the proper debuggerd.
+// On 64 bit systems, the 32 bit debuggerd is named differently.
+#if defined(TARGET_IS_64_BIT) && !defined(__LP64__)
+#define DEBUGGER_SOCKET_NAME "android:debuggerd32"
#else
#define DEBUGGER_SOCKET_NAME "android:debuggerd"
#endif
@@ -57,15 +59,10 @@ enum debugger_action_t {
};
/* message sent over the socket */
-struct debugger_msg_t {
- // version 1 included:
- debugger_action_t action;
+struct __attribute__((packed)) debugger_msg_t {
+ int32_t action;
pid_t tid;
-
- // version 2 added:
- uintptr_t abort_msg_address;
-
- // version 3 added:
+ uint64_t abort_msg_address;
int32_t original_si_code;
};