From 58ff826b730aba8b3af582fb5cc170101a5e84e6 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sun, 7 Dec 2014 15:20:34 -0800 Subject: [PATCH] Cleanup to link assembler on arm unittest builds. --- Core/Debugger/SymbolMap.cpp | 6 +++--- Core/Debugger/SymbolMap.h | 4 +--- Core/MIPS/MIPSAsm.cpp | 11 ++++++----- unittest/JitHarness.cpp | 5 +++-- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Core/Debugger/SymbolMap.cpp b/Core/Debugger/SymbolMap.cpp index 44df95b550..7ce894c4e4 100644 --- a/Core/Debugger/SymbolMap.cpp +++ b/Core/Debugger/SymbolMap.cpp @@ -942,9 +942,7 @@ DataType SymbolMap::GetDataType(u32 startAddress) const { return it->second.type; } -#if defined(_WIN32) - -void SymbolMap::getLabels(std::vector& dest) const +void SymbolMap::GetLabels(std::vector &dest) const { lock_guard guard(lock_); for (auto it = activeLabels.begin(); it != activeLabels.end(); it++) { @@ -955,6 +953,8 @@ void SymbolMap::getLabels(std::vector& dest) const } } +#if defined(_WIN32) + struct DefaultSymbol { u32 address; const char* name; diff --git a/Core/Debugger/SymbolMap.h b/Core/Debugger/SymbolMap.h index 7056f51093..17caa3024a 100644 --- a/Core/Debugger/SymbolMap.h +++ b/Core/Debugger/SymbolMap.h @@ -26,9 +26,7 @@ #include "Common/CommonTypes.h" -#ifdef _WIN32 #include "ext/armips/Core/Assembler.h" -#endif enum SymbolType { ST_NONE = 0, @@ -85,8 +83,8 @@ public: #ifdef _WIN32 void FillSymbolListBox(HWND listbox, SymbolType symType) const; - void getLabels(std::vector& dest) const; #endif + void GetLabels(std::vector &dest) const; void AddModule(const char *name, u32 address, u32 size); void UnloadModule(u32 address, u32 size); diff --git a/Core/MIPS/MIPSAsm.cpp b/Core/MIPS/MIPSAsm.cpp index ae7668caf1..7401d4560e 100644 --- a/Core/MIPS/MIPSAsm.cpp +++ b/Core/MIPS/MIPSAsm.cpp @@ -9,20 +9,20 @@ #include "Core/MIPS/JitCommon/JitCommon.h" #include "Core/Debugger/SymbolMap.h" -#ifdef _WIN32 +#if defined(_WIN32) || defined(ANDROID) #include "ext/armips/Core/Assembler.h" #endif namespace MIPSAsm { - std::wstring errorText; + static std::wstring errorText; std::wstring GetAssembleError() { return errorText; } -#ifdef _WIN32 +#if defined(_WIN32) || defined(ANDROID) class PspAssemblerFile: public AssemblerFile { public: @@ -65,7 +65,7 @@ private: bool MipsAssembleOpcode(const char* line, DebugInterface* cpu, u32 address) { -#ifdef _WIN32 +#if defined(_WIN32) || defined(ANDROID) PspAssemblerFile file; StringList errors; @@ -79,7 +79,7 @@ bool MipsAssembleOpcode(const char* line, DebugInterface* cpu, u32 address) args.memoryFile = &file; args.errorsResult = &errors; - symbolMap.getLabels(args.labels); + symbolMap.GetLabels(args.labels); errorText = L""; if (!runArmips(args)) @@ -96,6 +96,7 @@ bool MipsAssembleOpcode(const char* line, DebugInterface* cpu, u32 address) return true; #else + errorText = L"Unsupported platform"; return false; #endif } diff --git a/unittest/JitHarness.cpp b/unittest/JitHarness.cpp index 73975b7a38..638b1d8b33 100644 --- a/unittest/JitHarness.cpp +++ b/unittest/JitHarness.cpp @@ -18,6 +18,7 @@ #include #include "base/timeutil.h" +#include "input/input_state.h" #include "Core/MIPS/JitCommon/JitCommon.h" #include "Core/MIPS/MIPSCodeUtils.h" #include "Core/MIPS/MIPSDebugInterface.h" @@ -144,7 +145,7 @@ bool TestJit() { for (size_t j = 0; j < ARRAY_SIZE(lines); ++j) { p++; if (!MIPSAsm::MipsAssembleOpcode(lines[j], currentDebugMIPS, addr)) { - printf("ERROR: %S\n", MIPSAsm::GetAssembleError().c_str()); + printf("ERROR: %ls\n", MIPSAsm::GetAssembleError().c_str()); compileSuccess = false; } addr += 4; @@ -165,7 +166,7 @@ bool TestJit() { printf("\n"); - double jit_speed, interp_speed; + double jit_speed = 0.0, interp_speed = 0.0; if (compileSuccess) { interp_speed = ExecCPUTest(); mipsr4k.UpdateCore(CPU_JIT);