aboutsummaryrefslogtreecommitdiffstats
path: root/libc/bionic/libc_init_common.cpp
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2013-04-04 13:46:46 -0700
committerElliott Hughes <enh@google.com>2013-04-05 11:24:19 -0700
commit0d787c1fa18c6a1f29ef9840e28a68cf077be1de (patch)
tree3f8efc05d80658c9be48513238104a5de01a9951 /libc/bionic/libc_init_common.cpp
parent014c75c78bdcad8acde8d0abb2450aa1f78e1a1f (diff)
downloadandroid_bionic-0d787c1fa18c6a1f29ef9840e28a68cf077be1de.tar.gz
android_bionic-0d787c1fa18c6a1f29ef9840e28a68cf077be1de.tar.bz2
android_bionic-0d787c1fa18c6a1f29ef9840e28a68cf077be1de.zip
Make abort messages available to debuggerd.
This adds __libc_fatal, cleans up the internal logging code a bit more, and switches suitable callers over to __libc_fatal. In addition to logging, __libc_fatal stashes the message somewhere that the debuggerd signal handler can find it before calling abort. In the debuggerd signal handler, we pass this address to debuggerd so that it can come back with ptrace to read the message and present it to the user. Bug: 8531731 Change-Id: I416ec1da38a8a1b0d0a582ccd7c8aaa681ed4a29
Diffstat (limited to 'libc/bionic/libc_init_common.cpp')
-rw-r--r--libc/bionic/libc_init_common.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/libc/bionic/libc_init_common.cpp b/libc/bionic/libc_init_common.cpp
index 33ec1db35..1fc490e23 100644
--- a/libc/bionic/libc_init_common.cpp
+++ b/libc/bionic/libc_init_common.cpp
@@ -45,6 +45,7 @@
#include "private/KernelArgumentBlock.h"
#include "pthread_internal.h"
+extern "C" abort_msg_t** __abort_message_ptr;
extern "C" unsigned __get_sp(void);
extern "C" int __system_properties_init(void);
@@ -96,6 +97,7 @@ void __libc_init_common(KernelArgumentBlock& args) {
errno = 0;
__libc_auxv = args.auxv;
__progname = args.argv[0] ? args.argv[0] : "<unknown>";
+ __abort_message_ptr = args.abort_message_ptr;
// AT_RANDOM is a pointer to 16 bytes of randomness on the stack.
__stack_chk_guard = *reinterpret_cast<uintptr_t*>(getauxval(AT_RANDOM));