Debugger: Disable instruction simplification

This commit is contained in:
Ty Lamontagne 2023-10-20 16:29:55 -04:00 committed by refractionpcsx2
parent be405eb705
commit e9ead0d33d
2 changed files with 13 additions and 13 deletions

View File

@ -408,13 +408,13 @@ 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, bool simplify)
{
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,simplify, simplify);
}
void DisassemblyFunction::getBranchLines(u32 start, u32 size, std::vector<BranchLine>& dest)
@ -695,11 +695,11 @@ void DisassemblyFunction::clear()
hash = 0;
}
bool DisassemblyOpcode::disassemble(u32 address, DisassemblyLineInfo& dest, bool insertSymbols)
bool DisassemblyOpcode::disassemble(u32 address, DisassemblyLineInfo& dest, bool insertSymbols, bool simplify)
{
char opcode[64],arguments[256];
std::string dis = cpu->disasm(address,insertSymbols);
std::string dis = cpu->disasm(address,simplify);
parseDisasm(cpu->GetSymbolMap(),dis.c_str(),opcode,arguments,std::size(arguments),insertSymbols);
dest.type = DISTYPE_OPCODE;
dest.name = opcode;
@ -765,7 +765,7 @@ void DisassemblyMacro::setMacroMemory(const std::string& _name, u32 _immediate,
numOpcodes = 2;
}
bool DisassemblyMacro::disassemble(u32 address, DisassemblyLineInfo& dest, bool insertSymbols)
bool DisassemblyMacro::disassemble(u32 address, DisassemblyLineInfo& dest, bool insertSymbols, bool simplify)
{
char buffer[64];
dest.type = DISTYPE_MACRO;
@ -836,7 +836,7 @@ void DisassemblyData::recheck()
}
}
bool DisassemblyData::disassemble(u32 address, DisassemblyLineInfo& dest, bool insertSymbols)
bool DisassemblyData::disassemble(u32 address, DisassemblyLineInfo& dest, bool insertSymbols, bool simplify)
{
dest.type = DISTYPE_DATA;
@ -1034,7 +1034,7 @@ DisassemblyComment::DisassemblyComment(DebugInterface* _cpu, u32 _address, u32 _
}
bool DisassemblyComment::disassemble(u32 address, DisassemblyLineInfo& dest, bool insertSymbols)
bool DisassemblyComment::disassemble(u32 address, DisassemblyLineInfo& dest, bool insertSymbols, bool simplify)
{
dest.type = DISTYPE_OTHER;
dest.name = name;

View File

@ -58,7 +58,7 @@ public:
virtual int getLineNum(u32 address, bool findStart) = 0;
virtual u32 getLineAddress(int line) = 0;
virtual u32 getTotalSize() = 0;
virtual bool disassemble(u32 address, DisassemblyLineInfo& dest, bool insertSymbols) = 0;
virtual bool disassemble(u32 address, DisassemblyLineInfo& dest, bool insertSymbols, bool simplify = false) = 0;
virtual void getBranchLines(u32 start, u32 size, std::vector<BranchLine>& dest) { };
};
@ -71,7 +71,7 @@ public:
virtual int getLineNum(u32 address, bool findStart);
virtual u32 getLineAddress(int line);
virtual u32 getTotalSize() { return size; };
virtual bool disassemble(u32 address, DisassemblyLineInfo& dest, bool insertSymbols);
virtual bool disassemble(u32 address, DisassemblyLineInfo& dest, bool insertSymbols, bool simplify = false);
virtual void getBranchLines(u32 start, u32 size, std::vector<BranchLine>& dest);
private:
void generateBranchLines();
@ -98,7 +98,7 @@ public:
virtual int getLineNum(u32 address, bool findStart) { return (address-this->address)/4; };
virtual u32 getLineAddress(int line) { return address+line*4; };
virtual u32 getTotalSize() { return num*4; };
virtual bool disassemble(u32 address, DisassemblyLineInfo& dest, bool insertSymbols);
virtual bool disassemble(u32 address, DisassemblyLineInfo& dest, bool insertSymbols, bool simplify = false);
virtual void getBranchLines(u32 start, u32 size, std::vector<BranchLine>& dest);
private:
DebugInterface* cpu;
@ -122,7 +122,7 @@ public:
virtual int getLineNum(u32 address, bool findStart) { return 0; };
virtual u32 getLineAddress(int line) { return address; };
virtual u32 getTotalSize() { return numOpcodes*4; };
virtual bool disassemble(u32 address, DisassemblyLineInfo& dest, bool insertSymbols) ;
virtual bool disassemble(u32 address, DisassemblyLineInfo& dest, bool insertSymbols, bool simplify = false);
private:
enum MacroType { MACRO_LI, MACRO_MEMORYIMM };
@ -148,7 +148,7 @@ public:
virtual int getLineNum(u32 address, bool findStart);
virtual u32 getLineAddress(int line) { return lineAddresses[line]; };
virtual u32 getTotalSize() { return size; };
virtual bool disassemble(u32 address, DisassemblyLineInfo& dest, bool insertSymbols);
virtual bool disassemble(u32 address, DisassemblyLineInfo& dest, bool insertSymbols, bool simplify = false);
private:
void createLines();
@ -179,7 +179,7 @@ public:
virtual int getLineNum(u32 address, bool findStart) { return 0; };
virtual u32 getLineAddress(int line) { return address; };
virtual u32 getTotalSize() { return size; };
virtual bool disassemble(u32 address, DisassemblyLineInfo& dest, bool insertSymbols);
virtual bool disassemble(u32 address, DisassemblyLineInfo& dest, bool insertSymbols, bool simplify = false);
private:
[[maybe_unused]]DebugInterface* cpu;
u32 address;