unittest: Fix jit harness init.

This commit is contained in:
Unknown W. Brackets 2021-04-24 15:48:17 -07:00
parent 8d0ca1e4f1
commit 86585e9551
2 changed files with 6 additions and 1 deletions

View File

@ -458,7 +458,7 @@ bool Jit::DescribeCodePtr(const u8 *ptr, std::string &name) {
name = "UnknownOrDeletedBlock";
} else if (jitAddr != (u32)-1) {
char temp[1024];
const std::string label = g_symbolMap->GetDescription(jitAddr);
const std::string label = g_symbolMap ? g_symbolMap->GetDescription(jitAddr) : "";
if (!label.empty())
snprintf(temp, sizeof(temp), "%08x_%s", jitAddr, label.c_str());
else

View File

@ -23,12 +23,14 @@
#include "Common/System/System.h"
#include "Common/TimeUtil.h"
#include "Core/ConfigValues.h"
#include "Core/Debugger/SymbolMap.h"
#include "Core/MIPS/JitCommon/JitCommon.h"
#include "Core/MIPS/JitCommon/JitBlockCache.h"
#include "Core/MIPS/MIPSCodeUtils.h"
#include "Core/MIPS/MIPSDebugInterface.h"
#include "Core/MIPS/MIPSAsm.h"
#include "Core/MIPS/MIPSTables.h"
#include "Core/MIPS/MIPSVFPUUtils.h"
#include "Core/MemMap.h"
#include "Core/Core.h"
#include "Core/CoreTiming.h"
@ -82,6 +84,7 @@ static void SetupJitHarness() {
// This is pretty much the bare minimum required to setup jit.
coreState = CORE_POWERUP;
currentMIPS = &mipsr4k;
g_symbolMap = new SymbolMap();
Memory::g_MemorySize = Memory::RAM_NORMAL_SIZE;
PSP_CoreParameter().cpuCore = CPUCore::INTERPRETER;
PSP_CoreParameter().unthrottle = true;
@ -89,6 +92,7 @@ static void SetupJitHarness() {
Memory::Init();
mipsr4k.Reset();
CoreTiming::Init();
InitVFPUSinCos(true);
}
static void DestroyJitHarness() {
@ -99,6 +103,7 @@ static void DestroyJitHarness() {
Memory::Shutdown();
coreState = CORE_POWERDOWN;
currentMIPS = nullptr;
delete g_symbolMap;
}
bool TestJit() {