Skip to content

v0.2.0 — Working DAP debugger

Latest

Choose a tag to compare

@parenworks parenworks released this 16 Aug 06:11

Summary

First release with a functional Debug Adapter Protocol layer. The DAP debugger was structurally complete but had three gaps that prevented it from actually working — all three are now closed.

Fixed

  • Stack frames report real source lines — Previously hardcoded to 0, so clicking a frame in the debugger did nothing. A new code-location-to-line helper uses sb-di:code-location-toplevel-form-offset and debug-source-start-positions to map code locations to 1-based line numbers by counting newlines in the source file.

  • Line and function breakpoints now halt execution — Breakpoints were stored but never checked. They are now installed via sb-int:encapsulate on the function enclosing the requested line (resolved through the source index). The wrapper calls dap-stop with :breakpoint reason when the debugger is active. setBreakpoints and setFunctionBreakpoints sync encapsulations live; install-pending-breakpoints handles breakpoints set before launch/attach. The stopped callback now dispatches on reason (:breakpoint, :step, :entry, :exception) and sends the correct DAP stopped event.

  • stackTrace respects paginationhandle-dap-stack-trace now reads startFrame and levels from the request and slices the frame list accordingly. totalFrames reports the full frame count per the DAP spec.

Changed

  • Bumped version to 0.2.0.

Test plan

  • Build succeeds (make)
  • DAP client connects on port 6009
  • Set a line breakpoint in a loaded file, run code, verify execution halts with reason: breakpoint
  • Click a stack frame in the debugger UI, verify it jumps to the correct source line
  • Set a function breakpoint by name, verify it halts on call
  • Request stackTrace with startFrame/levels, verify pagination works
  • Trigger an error, verify reason: exception and restarts appear in the debug console