debuggerd: use __android_log_is_debuggable()
Test: compile and signal 8 to some component Bug: 27566046 Bug: 31456426 Change-Id: I35e83679fbc40d54217850521bff23d9306d86f8
This commit is contained in:
parent
5740a46e4e
commit
dafe384207
2 changed files with 3 additions and 4 deletions
|
|
@ -120,6 +120,7 @@ debuggerd_shared_libraries := \
|
||||||
libbacktrace \
|
libbacktrace \
|
||||||
libbase \
|
libbase \
|
||||||
libcutils \
|
libcutils \
|
||||||
|
liblog
|
||||||
|
|
||||||
debuggerd_c_includes := \
|
debuggerd_c_includes := \
|
||||||
$(LOCAL_PATH)/test \
|
$(LOCAL_PATH)/test \
|
||||||
|
|
|
||||||
|
|
@ -32,13 +32,13 @@
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include <android/log.h>
|
|
||||||
#include <android-base/stringprintf.h>
|
#include <android-base/stringprintf.h>
|
||||||
#include <backtrace/Backtrace.h>
|
#include <backtrace/Backtrace.h>
|
||||||
#include <backtrace/BacktraceMap.h>
|
#include <backtrace/BacktraceMap.h>
|
||||||
#include <cutils/properties.h>
|
#include <cutils/properties.h>
|
||||||
#include <log/logprint.h>
|
#include <log/logprint.h>
|
||||||
#include <private/android_filesystem_config.h>
|
#include <private/android_filesystem_config.h>
|
||||||
|
#include <private/android_logger.h>
|
||||||
|
|
||||||
#include <selinux/android.h>
|
#include <selinux/android.h>
|
||||||
|
|
||||||
|
|
@ -622,9 +622,7 @@ static void dump_logs(log_t* log, pid_t pid, unsigned int tail) {
|
||||||
static void dump_crash(log_t* log, BacktraceMap* map, pid_t pid, pid_t tid,
|
static void dump_crash(log_t* log, BacktraceMap* map, pid_t pid, pid_t tid,
|
||||||
const std::set<pid_t>& siblings, uintptr_t abort_msg_address) {
|
const std::set<pid_t>& siblings, uintptr_t abort_msg_address) {
|
||||||
// don't copy log messages to tombstone unless this is a dev device
|
// don't copy log messages to tombstone unless this is a dev device
|
||||||
char value[PROPERTY_VALUE_MAX];
|
bool want_logs = __android_log_is_debuggable();
|
||||||
property_get("ro.debuggable", value, "0");
|
|
||||||
bool want_logs = (value[0] == '1');
|
|
||||||
|
|
||||||
_LOG(log, logtype::HEADER,
|
_LOG(log, logtype::HEADER,
|
||||||
"*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***\n");
|
"*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***\n");
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue