Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debugger: Disable pseudo ops #11105

Merged
merged 1 commit into from
Jun 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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