Rust Debugging
Purpose
Guide agents through debugging Rust programs: GDB/LLDB with Rust pretty-printers, backtrace configuration, panic triage, async debugging with tokio-console, and #[no_std] debugging strategies.
Triggers
- "How do I use GDB/LLDB to debug a Rust binary?"
- "How do I get a full backtrace from a Rust panic?"
- "How do I debug async Rust / Tokio?"
- "Rust pretty-printers aren't working in GDB"
- "How do I debug a Rust panic in production?"
- "How do I use dbg! and tracing in Rust?"
Workflow
1. Build for debugging
2. GDB with Rust pretty-printers
Common GDB session for Rust:
3. LLDB with Rust pretty-printers
Common LLDB session:
4. Backtrace configuration
For release binaries, keep debug symbols in a separate file:
5. Panic triage
Common panic patterns:
Use panic = "abort" in release to get a crash dump instead of unwind.
6. The dbg! macro
7. Structured logging with tracing
8. Async debugging with tokio-console
tokio-console shows: task states, waker activity, blocked tasks, poll durations.
For GDB/LLDB command reference and pretty-printer setup, see references/rust-gdb-pretty-printers.md [blocked].
Related skills
- Use
skills/rust/rustc-basicsfor debug info flags and build configuration - Use
skills/debuggers/gdbfor GDB fundamentals - Use
skills/debuggers/lldbfor LLDB fundamentals - Use
skills/rust/rust-sanitizers-mirifor memory safety and undefined behaviour


