Files
ppsspp/Core/Debugger/WebSocket
Henrik RydgårdandClaude Opus 5 256de40a30 Tidy up the breakpoint skip-first mechanism
The tick basis was actually sound - CoreTiming::GetTicks() is continuous across
Advance(), so "ticks unchanged" really does mean "no instruction retired since",
which is exactly the window the suppression needs. The plumbing around it was
the problem:

- ExecRegBreakpoint() applied the skip only to the pause, so stepping off a
  log+pause register breakpoint printed it again and counted a second hit. The
  check now sits at the top of ExecBreakPoint(), ExecMemCheck(), ExecOpMemCheck()
  and ExecRegBreakpoint() instead of being repeated at seven call sites across
  the interpreter and four JIT frontends, where one of them had it wrong and
  another checked a different address than the rest.
- Address 0 doubled as "nothing to skip" (ClearSkipFirst() existed but was dead
  code; the JITs cleared by calling SetSkipFirst(0)), so a breakpoint at 0 would
  have been permanently suppressed. There's an explicit valid flag now, and
  ClearSkipFirst() is what clears it.
- The marker was set from five places and never cleared when execution stopped,
  so one could outlive the resume that armed it. Core_Break() clears it now, and
  the two WebSocket subscribers that set it immediately before asking for a
  step - which sets it again itself - no longer do.
- SetSkipFirst() now only arms when some breakpoint machinery actually exists,
  so a stale marker can't sit around waiting to swallow a breakpoint added later.

CheckSkipFirst() returning an address (compared against pc by each caller) is
replaced by ShouldSkipBreakpoint(addr), which compares against both addr and
currentMIPS->pc - under a JIT those differ, and only some callers knew that.

Covered by the Breakpoints unit test, including that a suppressed breakpoint
neither logs nor counts a hit.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GZq8ZtJmFY7bkX5FVkr3P9
2026-08-17 23:25:56 +02:00
..
2024-11-06 11:59:34 +01:00