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
This commit is contained in:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user