Skip to content

Persist breakpoints and add go-to-address to the debugger - #59

Merged
asterick merged 1 commit into
mainfrom
asterick/debugger-usability
Jun 7, 2026
Merged

Persist breakpoints and add go-to-address to the debugger#59
asterick merged 1 commit into
mainfrom
asterick/debugger-usability

Conversation

@asterick

@asterick asterick commented Jun 7, 2026

Copy link
Copy Markdown
Owner

Summary

Debugger follow-ups from the rewrite:

  • Breakpoints persist across reloads via the existing preserve()/restore() localStorage path (alongside EEPROM/RTC)
  • Found & fixed a chicken-and-egg flaw that persistence surfaced: halting at a breakpoint stops the CPU before the instruction executes, so on a fresh classification map the breakpoint's own byte never becomes code — and markers only rendered on code lines. The breakpoints that fire are exactly the ones that were invisible. Markers now render on any line whose byte range contains a breakpoint; double-click clears from any marked line, setting stays code-line-only per the spec
  • Go-to-address in the toolbar (hex; 0x/h decorations accepted): jumping unfollows the PC and scrolls by exact offset (fixed-height rows; scrollToIndex estimates can land a row short)
  • window.minimon exposes the system instance for console debugging

Verification

Headless, in-context reloads:

  • Set breakpoint → reload → marker present (live: [3388] restored, rendered on the halted-at row even though it classifies as hex)
  • Double-click a marked hex row clears it; code-row toggling unchanged
  • goto 0000 → unfollows, scrollTop 0, first row 0000; goto 0x2100 lands the target in view while running
  • npm run check + vite build clean

🤖 Generated with Claude Code

Breakpoints ride the existing preserve()/restore() localStorage path,
so they survive reloads alongside EEPROM and RTC state.

Persisting them surfaced a chicken-and-egg flaw: halting at a
breakpoint stops the CPU before the instruction executes, so on a
fresh classification map the breakpoint's own byte never becomes code
— and the marker only rendered on code lines, hiding exactly the
breakpoints that fire. Markers now render on any line whose byte range
contains a breakpoint (hex rows included), and double-clicking such a
line clears them; setting new breakpoints stays code-line-only.

The toolbar gains a go-to-address field (hex, 0x/h decorations
accepted): jumping turns follow-PC off and scrolls by exact offset —
rows are fixed-height, and scrollToIndex works from estimates that can
land a row short.

The system instance is also exposed as window.minimon for console
debugging.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@asterick
asterick merged commit bc71c19 into main Jun 7, 2026
3 checks passed
@asterick
asterick deleted the asterick/debugger-usability branch June 7, 2026 07:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant