mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-27 08:10:13 -06:00
DebugInterface: Make GetRawMemoryString return a std::string
This commit is contained in:
@ -2,16 +2,15 @@
|
||||
// Licensed under GPLv2+
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include "Core/Debugger/PPCDebugInterface.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "Common/GekkoDisassembler.h"
|
||||
#include "Common/StringUtil.h"
|
||||
|
||||
#include "Core/Core.h"
|
||||
#include "Core/Debugger/Debugger_SymbolMap.h"
|
||||
#include "Core/Debugger/PPCDebugInterface.h"
|
||||
#include "Core/HW/DSP.h"
|
||||
#include "Core/HW/Memmap.h"
|
||||
#include "Core/Host.h"
|
||||
#include "Core/PowerPC/JitCommon/JitBase.h"
|
||||
#include "Core/PowerPC/PPCSymbolDB.h"
|
||||
#include "Core/PowerPC/PowerPC.h"
|
||||
@ -48,24 +47,19 @@ std::string PPCDebugInterface::Disassemble(unsigned int address)
|
||||
}
|
||||
}
|
||||
|
||||
void PPCDebugInterface::GetRawMemoryString(int memory, unsigned int address, char* dest,
|
||||
int max_size)
|
||||
std::string PPCDebugInterface::GetRawMemoryString(int memory, unsigned int address)
|
||||
{
|
||||
if (IsAlive())
|
||||
{
|
||||
if (memory || PowerPC::HostIsRAMAddress(address))
|
||||
{
|
||||
snprintf(dest, max_size, "%08X%s", ReadExtraMemory(memory, address), memory ? " (ARAM)" : "");
|
||||
}
|
||||
else
|
||||
{
|
||||
strcpy(dest, memory ? "--ARAM--" : "--------");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
strcpy(dest, "<unknwn>"); // bad spelling - 8 chars
|
||||
const bool is_aram = memory != 0;
|
||||
|
||||
if (is_aram || PowerPC::HostIsRAMAddress(address))
|
||||
return StringFromFormat("%08X%s", ReadExtraMemory(memory, address), is_aram ? " (ARAM)" : "");
|
||||
|
||||
return is_aram ? "--ARAM--" : "--------";
|
||||
}
|
||||
|
||||
return "<unknwn>"; // bad spelling - 8 chars
|
||||
}
|
||||
|
||||
unsigned int PPCDebugInterface::ReadMemory(unsigned int address)
|
||||
|
Reference in New Issue
Block a user