mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-11 16:49:27 +01:00
Add GPR write breakpoints (break when a register is written, anywhere)
New debugging primitive: break whenever any instruction writes to a
given general-purpose register (0-31), regardless of which address
executes the write. Requested for continuing the reboot.bin trace,
where the actual blocker is "what sets $s3 to this bad value", not
"what happens at a specific address" - existing address/memory
breakpoints can't express that directly.
- GPRBreakpoint (Core/Debugger/Breakpoints.h) mirrors the existing
BreakPoint/MemCheck shape (result/condition/logFormat/hit count),
keyed by register index instead of address/range.
- BreakpointManager keeps a u32 bitmask (bit i = register i has an
active breakpoint) alongside the GPRBreakpoint vector, so the
interpreter loop can test "would this write trip anything" with a
single shift+and against a value already cached in a local.
- RunUntilDowncountZeroWithChecks (Core/MIPS/MIPSTables.cpp) computes
the about-to-be-written register from the current instruction's
OUT_RT/OUT_RD/OUT_RA flags (GetGPRWriteTarget()) and checks it
against the mask, same convention as the existing memcheck handling
right above it (checked before the instruction executes, bails via
CORE_STEPPING_CPU without running it if tripped).
- New BreakReason::GPRBreakpoint ("cpu.gprBreakpoint") for Core_Break.
- WebSocket API: cpu.gprBreakpoint.add/update/remove/list, accepting
either a 0-31 'register' index or a case-insensitive 'name' (e.g.
"s3"), documented in docs/WebSocketDebugger.md.
Interpreter-only for now, deliberately.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GZq8ZtJmFY7bkX5FVkr3P9
This commit is contained in:
1 parent
3f6743d40d
commit
75174af77b
8 files changed
+500
-2
No files matched your search
@@ -213,6 +213,7 @@ const char *BreakReasonToString(BreakReason reason) {
|
||||
case BreakReason::SavestateCrash: return "savestate.crash";
|
||||
case BreakReason::MemoryBreakpoint: return "memory.breakpoint";
|
||||
case BreakReason::CpuBreakpoint: return "cpu.breakpoint";
|
||||
case BreakReason::GPRBreakpoint: return "cpu.gprBreakpoint";
|
||||
case BreakReason::MemoryAccess: return "memory.access"; // ???
|
||||
case BreakReason::JitBranchDebug: return "jit.branchdebug";
|
||||
case BreakReason::RABreak: return "ra.break";
|
||||
|
||||
Reference in new issue
Block a user