Skip to content

Commit

Permalink
Debugger: Disable pseudo ops
Browse files Browse the repository at this point in the history
  • Loading branch information
F0bes authored and refractionpcsx2 committed Jun 13, 2024
1 parent 08e8248 commit bdeb0fc
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pcsx2-qt/Debugger/Models/BreakpointModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ QVariant BreakpointModel::data(const QModelIndex& index, int role) const
return m_cpu.GetSymbolMap().GetLabelName(bp->addr).c_str();
case BreakpointColumns::OPCODE:
// Note: Fix up the disassemblymanager so we can use it here, instead of calling a function through the disassemblyview (yuck)
return m_cpu.disasm(bp->addr, true).c_str();
return m_cpu.disasm(bp->addr, false).c_str();
case BreakpointColumns::CONDITION:
return bp->hasCond ? QString::fromLocal8Bit(bp->cond.expressionString) : "";
case BreakpointColumns::HITS:
Expand Down Expand Up @@ -149,7 +149,7 @@ QVariant BreakpointModel::data(const QModelIndex& index, int role) const
return m_cpu.GetSymbolMap().GetLabelName(bp->addr).c_str();
case BreakpointColumns::OPCODE:
// Note: Fix up the disassemblymanager so we can use it here, instead of calling a function through the disassemblyview (yuck)
return m_cpu.disasm(bp->addr, true).c_str();
return m_cpu.disasm(bp->addr, false).c_str();
case BreakpointColumns::CONDITION:
return bp->hasCond ? QString::fromLocal8Bit(bp->cond.expressionString) : "";
case BreakpointColumns::HITS:
Expand Down
23 changes: 21 additions & 2 deletions pcsx2/DebugTools/DisassemblyManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ void DisassemblyFunction::load()
}

MIPSAnalyst::MipsOpcodeInfo opInfo = MIPSAnalyst::GetOpcodeInfo(cpu,funcPos);
u32 opAddress = funcPos;
//u32 opAddress = funcPos;
funcPos += 4;

// skip branches and their delay slots
Expand All @@ -572,6 +572,25 @@ void DisassemblyFunction::load()
continue;
}

/*
The QT debugger doesn't follow the same logic as the disassembler
It _should_ follow the path of the disassembler, but instead it is naively reading the
disassembler output for every single instruction.
This causes issues disassembling:
0x1000 lui $t0, 0x1234
0x1004 ori $t0, $t0, 0x5678
0x1008 nop
Into:
0x1000 li $t0, 0x12345678
0x1004 li $t0, 0x12346789
0x1008 nop
Where it should be:
0x1000 li $t0, 0x12345678
0x1008 nop
As a quick remedy, I'm disabling the macro generation.
*/
#if 0
// lui
if (MIPS_GET_OP(opInfo.encodedOpcode) == 0x0F && funcPos < funcEnd && funcPos != nextData)
{
Expand Down Expand Up @@ -660,7 +679,7 @@ void DisassemblyFunction::load()
}
}
}

#endif
// just a normal opcode
}

Expand Down

0 comments on commit bdeb0fc

Please sign in to comment.