Skip to content

Debugging

Wyn supports source-level debugging with DWARF debug info.

Quick Start

bash
wyn debug app.wyn

This compiles your code at -O0 with full debug info and launches lldb.

Setting Breakpoints

(lldb) breakpoint set --file app.wyn --line 5
(lldb) run

The debugger maps machine addresses back to your .wyn source lines.

How It Works

When you use wyn debug, the compiler emits C code with #line directives that map back to your .wyn source, then compiles at -O0 -g to produce DWARF debug information:

  • Compile unit — your .wyn filename and directory
  • Subprograms — each function with line numbers
  • Line table — maps machine addresses to source lines

This is the same debug format used by C, C++, Rust, and Swift.

MIT License