mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-27 00:03:37 +01:00
Debugger: Add debug interfaces for threads.
This way we can switch context.
This commit is contained in:
1 parent
3193772e78
commit
5670fc03ae
9 files changed
+239
-63
No files matched your search
@@ -236,7 +236,7 @@ std::vector<BranchLine> DisassemblyManager::getBranchLines(u32 start, u32 size)
|
||||
return result;
|
||||
}
|
||||
|
||||
void DisassemblyManager::getLine(u32 address, bool insertSymbols, DisassemblyLineInfo& dest)
|
||||
void DisassemblyManager::getLine(u32 address, bool insertSymbols, DisassemblyLineInfo &dest, DebugInterface *cpuDebug)
|
||||
{
|
||||
// This is here really to avoid lock ordering issues.
|
||||
auto memLock = Memory::Lock();
|
||||
@@ -250,7 +250,7 @@ void DisassemblyManager::getLine(u32 address, bool insertSymbols, DisassemblyLin
|
||||
|
||||
if (it != entries.end()) {
|
||||
DisassemblyEntry *entry = it->second;
|
||||
if (entry->disassemble(address, dest, insertSymbols))
|
||||
if (entry->disassemble(address, dest, insertSymbols, cpuDebug))
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -432,14 +432,14 @@ u32 DisassemblyFunction::getLineAddress(int line)
|
||||
return lineAddresses[line];
|
||||
}
|
||||
|
||||
bool DisassemblyFunction::disassemble(u32 address, DisassemblyLineInfo& dest, bool insertSymbols)
|
||||
bool DisassemblyFunction::disassemble(u32 address, DisassemblyLineInfo &dest, bool insertSymbols, DebugInterface *cpuDebug)
|
||||
{
|
||||
std::lock_guard<std::recursive_mutex> guard(lock_);
|
||||
auto it = findDisassemblyEntry(entries,address,false);
|
||||
if (it == entries.end())
|
||||
return false;
|
||||
|
||||
return it->second->disassemble(address,dest,insertSymbols);
|
||||
return it->second->disassemble(address, dest, insertSymbols, cpuDebug);
|
||||
}
|
||||
|
||||
void DisassemblyFunction::getBranchLines(u32 start, u32 size, std::vector<BranchLine>& dest)
|
||||
@@ -720,16 +720,19 @@ void DisassemblyFunction::clear()
|
||||
hash = 0;
|
||||
}
|
||||
|
||||
bool DisassemblyOpcode::disassemble(u32 address, DisassemblyLineInfo& dest, bool insertSymbols)
|
||||
bool DisassemblyOpcode::disassemble(u32 address, DisassemblyLineInfo &dest, bool insertSymbols, DebugInterface *cpuDebug)
|
||||
{
|
||||
if (!cpuDebug)
|
||||
cpuDebug = DisassemblyManager::getCpu();
|
||||
|
||||
char opcode[64],arguments[256];
|
||||
const char *dizz = DisassemblyManager::getCpu()->disasm(address,4);
|
||||
const char *dizz = cpuDebug->disasm(address, 4);
|
||||
parseDisasm(dizz,opcode,arguments,insertSymbols);
|
||||
dest.type = DISTYPE_OPCODE;
|
||||
dest.name = opcode;
|
||||
dest.params = arguments;
|
||||
dest.totalSize = 4;
|
||||
dest.info = MIPSAnalyst::GetOpcodeInfo(DisassemblyManager::getCpu(),address);
|
||||
dest.info = MIPSAnalyst::GetOpcodeInfo(cpuDebug, address);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -789,11 +792,14 @@ void DisassemblyMacro::setMacroMemory(std::string _name, u32 _immediate, u8 _rt,
|
||||
numOpcodes = 2;
|
||||
}
|
||||
|
||||
bool DisassemblyMacro::disassemble(u32 address, DisassemblyLineInfo& dest, bool insertSymbols)
|
||||
bool DisassemblyMacro::disassemble(u32 address, DisassemblyLineInfo &dest, bool insertSymbols, DebugInterface *cpuDebug)
|
||||
{
|
||||
if (!cpuDebug)
|
||||
cpuDebug = DisassemblyManager::getCpu();
|
||||
|
||||
char buffer[64];
|
||||
dest.type = DISTYPE_MACRO;
|
||||
dest.info = MIPSAnalyst::GetOpcodeInfo(DisassemblyManager::getCpu(),address);
|
||||
dest.info = MIPSAnalyst::GetOpcodeInfo(cpuDebug, address);
|
||||
|
||||
std::string addressSymbol;
|
||||
switch (type)
|
||||
@@ -802,11 +808,10 @@ bool DisassemblyMacro::disassemble(u32 address, DisassemblyLineInfo& dest, bool
|
||||
dest.name = name;
|
||||
|
||||
addressSymbol = g_symbolMap->GetLabelString(immediate);
|
||||
if (!addressSymbol.empty() && insertSymbols)
|
||||
{
|
||||
sprintf(buffer,"%s,%s",DisassemblyManager::getCpu()->GetRegName(0,rt),addressSymbol.c_str());
|
||||
if (!addressSymbol.empty() && insertSymbols) {
|
||||
sprintf(buffer, "%s,%s", cpuDebug->GetRegName(0, rt), addressSymbol.c_str());
|
||||
} else {
|
||||
sprintf(buffer,"%s,0x%08X",DisassemblyManager::getCpu()->GetRegName(0,rt),immediate);
|
||||
sprintf(buffer, "%s,0x%08X", cpuDebug->GetRegName(0, rt), immediate);
|
||||
}
|
||||
|
||||
dest.params = buffer;
|
||||
@@ -818,11 +823,10 @@ bool DisassemblyMacro::disassemble(u32 address, DisassemblyLineInfo& dest, bool
|
||||
dest.name = name;
|
||||
|
||||
addressSymbol = g_symbolMap->GetLabelString(immediate);
|
||||
if (!addressSymbol.empty() && insertSymbols)
|
||||
{
|
||||
sprintf(buffer,"%s,%s",DisassemblyManager::getCpu()->GetRegName(0,rt),addressSymbol.c_str());
|
||||
if (!addressSymbol.empty() && insertSymbols) {
|
||||
sprintf(buffer, "%s,%s", cpuDebug->GetRegName(0, rt), addressSymbol.c_str());
|
||||
} else {
|
||||
sprintf(buffer,"%s,0x%08X",DisassemblyManager::getCpu()->GetRegName(0,rt),immediate);
|
||||
sprintf(buffer, "%s,0x%08X", cpuDebug->GetRegName(0, rt), immediate);
|
||||
}
|
||||
|
||||
dest.params = buffer;
|
||||
@@ -867,7 +871,7 @@ void DisassemblyData::recheck()
|
||||
}
|
||||
}
|
||||
|
||||
bool DisassemblyData::disassemble(u32 address, DisassemblyLineInfo& dest, bool insertSymbols)
|
||||
bool DisassemblyData::disassemble(u32 address, DisassemblyLineInfo &dest, bool insertSymbols, DebugInterface *cpuDebug)
|
||||
{
|
||||
dest.type = DISTYPE_DATA;
|
||||
|
||||
@@ -1065,7 +1069,7 @@ DisassemblyComment::DisassemblyComment(u32 _address, u32 _size, std::string _nam
|
||||
|
||||
}
|
||||
|
||||
bool DisassemblyComment::disassemble(u32 address, DisassemblyLineInfo& dest, bool insertSymbols)
|
||||
bool DisassemblyComment::disassemble(u32 address, DisassemblyLineInfo &dest, bool insertSymbols, DebugInterface *cpuDebug)
|
||||
{
|
||||
dest.type = DISTYPE_OTHER;
|
||||
dest.name = name;
|
||||
|
||||
Reference in new issue
Block a user