From ec7787c56a1489e7a993e3abcfcd7e0ee655e0e8 Mon Sep 17 00:00:00 2001 From: Flyinghead Date: Fri, 11 Jan 2019 15:57:37 +0100 Subject: [PATCH] vixl: enable debug log on android --- .../vixl/aarch64/macro-assembler-aarch64.cc | 1 + core/deps/vixl/platform-vixl.h | 22 +++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/core/deps/vixl/aarch64/macro-assembler-aarch64.cc b/core/deps/vixl/aarch64/macro-assembler-aarch64.cc index f57efd6bb..0499eb20d 100644 --- a/core/deps/vixl/aarch64/macro-assembler-aarch64.cc +++ b/core/deps/vixl/aarch64/macro-assembler-aarch64.cc @@ -2633,6 +2633,7 @@ void MacroAssembler::PrintfNoPreserve(const char* format, } dc32(arg_pattern_list); // kPrintfArgPatternListOffset } else { +#undef printf Register tmp = temps.AcquireX(); Mov(tmp, reinterpret_cast(printf)); Blr(tmp); diff --git a/core/deps/vixl/platform-vixl.h b/core/deps/vixl/platform-vixl.h index a449241f2..32a579aa6 100644 --- a/core/deps/vixl/platform-vixl.h +++ b/core/deps/vixl/platform-vixl.h @@ -34,6 +34,28 @@ extern "C" { #define VIXL_CODE_BUFFER_MALLOC + +#if defined(_ANDROID) && defined(VIXL_DEBUG) +#include + +#ifdef printf +#undef printf +#endif + +#ifdef puts +#undef puts +#endif + +#define LOG_TAG "reicast" +#define LOGI(...) __android_log_print(ANDROID_LOG_INFO,LOG_TAG,__VA_ARGS__) +#define LOGW(...) __android_log_print(ANDROID_LOG_WARN,LOG_TAG,__VA_ARGS__) +#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR,LOG_TAG,__VA_ARGS__) +#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,__VA_ARGS__) +#define puts LOGI +#define printf LOGI +#define putinf LOGI +#endif + namespace vixl { inline void HostBreakpoint() { raise(SIGINT); } } // namespace vixl