/odin-native:zig-debuggingfrom ODIN Native
Maps Zig panics and error return traces to source lines, and guides GDB/LLDB debugging sessions for Zig binaries.
Ships in ODIN Native. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
| Field | Bound contract |
|---|---|
| Trigger | The user shows a Zig panic or error return trace, wants to step through a Zig binary in GDB or LLDB, needs print or log tracing, or wants to inspect a comptime value. |
| Authority | Read-only. The skill emits build commands, debugger commands, and readings to chat; the user runs them. Rollback is not needed. No remote mutation. |
| Side effect | Chat output; scratch builds and debugger sessions in a scratch directory. |
| Done | The panic or trace is mapped to the source line it names, or the debugger session reaches the requested breakpoint with locals visible, confirmed on the installed Zig and debugger. |
zig version and the debugger available (gdb, lldb): required. Samples ran on Zig 0.14.1 with GDB and LLDB.ReleaseFast and ReleaseSmall drop safety checks and error tracing.main under it (ob.main for ob.zig).zig build-exe src/main.zig -O Debug -femit-bin=myapp, or zig build which defaults to Debug (-Doptimize=Debug to be explicit). Debug builds carry DWARF that GDB and LLDB read directly. Done when: the debug binary exists.thread <id> panic: <reason> followed by file:line:col: 0x<addr> in <function> (<module>) frames with the source line and a caret; read the first frame under the panic line. Reasons seen from the safety checks: index out of bounds: index N, len M, integer overflow, attempt to use null value, reached unreachable code, integer cast truncated bits, and invalid enum value. These fire only in Debug and ReleaseSafe. Done when: the reason maps to the operation on the named line.main returns an error, Zig prints error: <Name> and then the frames where the error was created and each try that propagated it, innermost first. Read from the bottom to see the call chain (main, then run, then the function that failed). Error tracing is on in Debug and ReleaseSafe; enable it in ReleaseFast with -ferror-tracing or .error_tracing = true on the addExecutable options, and disable with -fno-error-tracing. Done when: the originating try is identified.gdb ./myapp, then break main.main (the function is namespaced under the root file: break ob.main for ob.zig), run, next, step, continue, print var, info locals, bt. Break on any panic with break debug.defaultPanic, which is the symbol Zig 0.14.1's std uses; the older __zig_panic names do not exist. Done when: the breakpoint hits and locals print.lldb ./myapp, b ob.main, r, n, s, p var, frame variable, bt, c; b debug.defaultPanic for panics. Done when: the breakpoint hits.std.debug.print("x = {d}, name = {s}\n", .{ x, name }) writes to stderr unconditionally; {any} prints a struct with its fields, {x} and {b} print hex and binary. Dump the current stack with std.debug.dumpCurrentStackTrace(null); capture one with std.debug.captureStackTrace and print later with std.debug.dumpStackTrace. Done when: the print shows the value at the point of interest.std.log. A scoped logger is const log = std.log.scoped(.my_module); with log.debug, log.info, log.warn, log.err. Configure in the root file with pub const std_options: std.Options = .{ .log_level = .debug, .logFn = logFn };, where logFn has the signature fn (comptime level: std.log.Level, comptime scope: @TypeOf(.enum_literal), comptime format: []const u8, args: anytype) void. Done when: the log lines appear at the configured level.@compileLog(value), which prints during compilation and then reports error: found compile log statement; remove it after reading. Done when: the comptime value is known.lldb pointing program at zig-out/bin/myapp with a zig build pre-launch task works because the binary carries standard DWARF. Done when: the editor stops at a breakpoint.| Failure class | Behavior |
|---|---|
Function "main" not defined in GDB | Use the namespaced name <rootfile>.main; list candidates with info functions main. |
| No panic in a release build | Safety checks are off in ReleaseFast and ReleaseSmall; reproduce under ReleaseSafe. |
Error trace absent in ReleaseFast | Build with -ferror-tracing. |
| Leak report from an allocator | Use std.testing.allocator in a test to pin the leak: use zig-testing. |
| Mixed C and Zig frames | Frames from C objects need the C side built with debug info; the interop rules are in zig-cinterop. |
A chat report with the reading of the panic or trace against the named source line, or the debugger command sequence that reached the breakpoint, plus the print or log lines added, each confirmed on the installed Zig and debugger.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
138 skills in this plugin
/abi-and-calling-conventionsUse when explaining System V AMD64, ARM AAPCS, RISC-V psABI, stack frames, variadic calls, or FFI register rules. Not for the Rust FFI binding layer: use rust-ffi./adc-dac-baremetalUse when configuring ADC sampling time, DMA-driven ADC, calibration, or DAC channel setup on bare-metal MCUs. Not for the DMA stream itself: use dma-baremetal./af-xdpUse when creating AF_XDP sockets, configuring UMEM and XSK rings, writing an XDP redirect program, or choosing copy versus zero-copy mode. Not for full kernel bypass: use dpdk./apple-siliconUse when tuning or profiling native code on Apple M-series Macs: unified memory, 16 KiB pages, Accelerate and Metal for matrix work, xctrace and leaks, Rosetta 2, or sysctl hardware queries./arm-sveUse when writing or porting AArch64 SIMD to SVE or SVE2: arm_sve.h intrinsics, predicates, vector-length-agnostic loops, auto-vectorization, or SVE registers in GDB. Not for NEON: use simd-intrinsics./assembly-armUse when reading or writing AArch64 or AArch32 Thumb assembly, inline asm in C, AAPCS64 register roles, or NEON and SVE vector code. Not for ABI detail across ISAs: use abi-and-calling-conventions.npx claudepluginhub outlinedriven/odin-claude-plugin --plugin odin-nativeOther plugins' skills for the same job