Skip to content

Commit

Permalink
Debugger: Disable instruction simplification
Browse files Browse the repository at this point in the history
  • Loading branch information
F0bes authored and refractionpcsx2 committed Oct 26, 2023
1 parent be405eb commit e9ead0d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
14 changes: 7 additions & 7 deletions pcsx2/DebugTools/DisassemblyManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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;
Expand Down
12 changes: 6 additions & 6 deletions pcsx2/DebugTools/DisassemblyManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class DisassemblyEntry
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) { };
};

Expand All @@ -71,7 +71,7 @@ class DisassemblyFunction: public DisassemblyEntry
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();
Expand All @@ -98,7 +98,7 @@ class DisassemblyOpcode: public DisassemblyEntry
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;
Expand All @@ -122,7 +122,7 @@ class DisassemblyMacro: public DisassemblyEntry
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 };

Expand All @@ -148,7 +148,7 @@ class DisassemblyData: public DisassemblyEntry
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();

Expand Down Expand Up @@ -179,7 +179,7 @@ class DisassemblyComment: public DisassemblyEntry
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;
Expand Down

0 comments on commit e9ead0d

Please sign in to comment.