diff options
Diffstat (limited to 'debuggerd/libdebuggerd')
-rw-r--r-- | debuggerd/libdebuggerd/include/libdebuggerd/utility.h | 2 | ||||
-rw-r--r-- | debuggerd/libdebuggerd/tombstone.cpp | 2 | ||||
-rw-r--r-- | debuggerd/libdebuggerd/utility.cpp | 11 |
3 files changed, 11 insertions, 4 deletions
diff --git a/debuggerd/libdebuggerd/include/libdebuggerd/utility.h b/debuggerd/libdebuggerd/include/libdebuggerd/utility.h index f189c451b..75bac87d3 100644 --- a/debuggerd/libdebuggerd/include/libdebuggerd/utility.h +++ b/debuggerd/libdebuggerd/include/libdebuggerd/utility.h @@ -20,6 +20,7 @@ #include <inttypes.h> #include <signal.h> +#include <stdarg.h> #include <stdbool.h> #include <sys/types.h> @@ -71,6 +72,7 @@ typedef uint32_t word_t; // Log information onto the tombstone. void _LOG(log_t* log, logtype ltype, const char* fmt, ...) __attribute__((format(printf, 3, 4))); +void _VLOG(log_t* log, logtype ltype, const char* fmt, va_list ap); namespace unwindstack { class Unwinder; diff --git a/debuggerd/libdebuggerd/tombstone.cpp b/debuggerd/libdebuggerd/tombstone.cpp index 1993840ab..236fcf7a0 100644 --- a/debuggerd/libdebuggerd/tombstone.cpp +++ b/debuggerd/libdebuggerd/tombstone.cpp @@ -428,7 +428,7 @@ void dump_registers(log_t* log, unwindstack::Regs* regs) { std::vector<std::pair<std::string, uint64_t>> special_row; #if defined(__arm__) || defined(__aarch64__) - static constexpr const char* special_registers[] = {"ip", "lr", "sp", "pc"}; + static constexpr const char* special_registers[] = {"ip", "lr", "sp", "pc", "pst"}; #elif defined(__i386__) static constexpr const char* special_registers[] = {"ebp", "esp", "eip"}; #elif defined(__x86_64__) diff --git a/debuggerd/libdebuggerd/utility.cpp b/debuggerd/libdebuggerd/utility.cpp index 9b2779a9e..5ce26fcde 100644 --- a/debuggerd/libdebuggerd/utility.cpp +++ b/debuggerd/libdebuggerd/utility.cpp @@ -67,6 +67,14 @@ static bool should_write_to_kmsg() { __attribute__((__weak__, visibility("default"))) void _LOG(log_t* log, enum logtype ltype, const char* fmt, ...) { + va_list ap; + va_start(ap, fmt); + _VLOG(log, ltype, fmt, ap); + va_end(ap); +} + +__attribute__((__weak__, visibility("default"))) +void _VLOG(log_t* log, enum logtype ltype, const char* fmt, va_list ap) { bool write_to_tombstone = (log->tfd != -1); bool write_to_logcat = is_allowed_in_logcat(ltype) && log->crashed_tid != -1 @@ -75,10 +83,7 @@ void _LOG(log_t* log, enum logtype ltype, const char* fmt, ...) { static bool write_to_kmsg = should_write_to_kmsg(); std::string msg; - va_list ap; - va_start(ap, fmt); android::base::StringAppendV(&msg, fmt, ap); - va_end(ap); if (msg.empty()) return; |