Skip to content

feat(gdb): Amiberry GDB remote snapshot init and trace-seeded analysis - #10

Open
mikolas wants to merge 3 commits into
masterfrom
feat/gdb-snapshot
Open

mikolas wants to merge 3 commits into
masterfrom
feat/gdb-snapshot

Conversation

@mikolas

@mikolas mikolas commented Oct 31, 2026

Copy link
Copy Markdown
Owner

Summary

Implements live Amiberry GDB Remote Serial Protocol (RSP) snapshot initialization (hunks init --gdb) and snapshot-seeded static + trace analysis (hunks -m <mod> analyze --trace).

Key Additions

  • internal/gdb: Pure-Go GDB RSP client (Dial, WaitProcessBreak, ReadRegisters, chunked 16 KiB ReadMemory, ReadCustomSnapshot, MemoryMap JSON + XML fallback, Segments, Detach).
  • internal/amiga/custom_snapshot.go: CustomSnapshot ([512]byte) decoder for Amiberry's $DFF000–$DFF1FF save_custom aperture (DMACON, INTENA, INTREQ, ADKCON, COP1LC, COP2LC, BPLPT, BPLCON0..2, BPL1MOD/BPL2MOD, SPRPT, Palette12, SummaryMap).
  • internal/project: SnapshotState in project.json storing captured CPU registers (D0..D7, A0..A7, PC, SR), custom.bin, and custom_info.
  • internal/analyzer:
    • SeedFromSnapshot: statically seeds Entry_PC, zero-page exception/IRQ vectors ($64..$BC), stack return addresses (A7 pointing after BSR/JSR), $DFF000 base-register invariants, and COP1LC/COP2LC/BPLxPT/SPRxPT labels.
    • RunTrace & Chipset.LoadCustomSnapshot: preloads CPU registers, chipset registers, and multi-segment RAM (chip + $C00000 slow Ranger RAM) so analyze --trace resumes directly from the captured machine state.
  • internal/tui: BitplaneState.ApplyCustomSnapshot pre-populates BPLxPT, BPLCON0, BPL1MOD, and COLOR00..31 when opening the Bitplane Viewer (B).

Testing

  • go build ./... && go vet ./... && go test -count=1 ./...
  • Ready for end-to-end live testing against Amiberry (gdb_server=true).

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