vixl: enable debug log on android

This commit is contained in:
Flyinghead 2019-01-11 15:57:37 +01:00
parent 0f026552c9
commit ec7787c56a
2 changed files with 23 additions and 0 deletions

View File

@ -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<uintptr_t>(printf));
Blr(tmp);

View File

@ -34,6 +34,28 @@ extern "C" {
#define VIXL_CODE_BUFFER_MALLOC
#if defined(_ANDROID) && defined(VIXL_DEBUG)
#include <android/log.h>
#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