mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-18 11:54:30 +01:00
Debugger: Remove opcode-fusion display and fix cpu step size units
DisassemblyManager used to fuse lui+addiu/load/store into single pseudo-
instructions ("li", fused loads/stores) for display. This only applied to a
handful of opcodes, complicated DisassemblyManager, and was the root cause of
a stepping bug: Core_PerformCPUStep's Into/Over cases treated stepSize as a
byte count, while the WebSocket cpu.stepInto handler computed it as an
instruction count (needed to step over a whole fused macro in one go) - so a
plain, non-fused stepInto silently executed zero instructions.
Removed the fusion logic entirely (DisassemblyMacro, DISTYPE_MACRO) - every
disassembly line is now exactly one 4-byte instruction. With that,
"how many instructions does this line span" is always 1, so the
getInstructionSizeAt() byte-size queries in the legacy Windows and ImGui
debuggers are gone too; step requests just pass 1. Core_RequestCPUStep's
stepSize is now consistently in instructions everywhere.
Also fixes the PPSSPPHeadless build, broken since 0ed1f3e added
OpenWebDebugger() (which calls System_LaunchUrl) without a headless stub.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hqm11k99viLfbJm2MkH4BH
This commit is contained in:
1 parent
0ed1f3eceb
commit
b1f0112cef
12 files changed
+16
-226
No files matched your search
@@ -44,7 +44,6 @@ struct WebSocketSteppingState : public DebuggerSubscriber {
|
||||
|
||||
protected:
|
||||
uint32_t GetNextAddress(DebugInterface *cpuDebug);
|
||||
int GetNextInstructionCount(DebugInterface *cpuDebug);
|
||||
void PrepareResume();
|
||||
void AddThreadCondition(uint32_t breakpointAddress, uint32_t threadID);
|
||||
};
|
||||
@@ -103,8 +102,7 @@ void WebSocketSteppingState::Into(DebuggerRequest &req) {
|
||||
// If the current PC is on a breakpoint, the user doesn't want to do nothing.
|
||||
g_breakpoints.SetSkipFirst(currentMIPS->pc);
|
||||
|
||||
int c = GetNextInstructionCount(cpuDebug);
|
||||
Core_RequestCPUStep(CPUStepType::Into, c);
|
||||
Core_RequestCPUStep(CPUStepType::Into, 1);
|
||||
} else {
|
||||
uint32_t breakpointAddress = cpuDebug->GetPC();
|
||||
PrepareResume();
|
||||
@@ -267,10 +265,6 @@ uint32_t WebSocketSteppingState::GetNextAddress(DebugInterface *cpuDebug) {
|
||||
return g_disassemblyManager.getNthNextAddress(current, 1);
|
||||
}
|
||||
|
||||
int WebSocketSteppingState::GetNextInstructionCount(DebugInterface *cpuDebug) {
|
||||
return (GetNextAddress(cpuDebug) - cpuDebug->GetPC()) / 4;
|
||||
}
|
||||
|
||||
void WebSocketSteppingState::PrepareResume() {
|
||||
if (currentMIPS->inDelaySlot) {
|
||||
// Delay slot instructions are never joined, so we pass 1.
|
||||
|
||||
Reference in new issue
Block a user