rust-debugginglisted
Install: claude install-skill po4yka/rust-skills
# Rust Debugging (Host First, Then Android and iOS)
## Purpose
Debug Rust libraries and binaries that crash, panic, or misbehave, including
libraries that run behind an FFI boundary on mobile. Use one order of attack:
1. **Host** (macOS or Linux) — the fastest path. Run a CLI or a test that drives
the same code, set `RUST_BACKTRACE=1`, attach `rust-lldb` or `rust-gdb`. No
device, no emulator, no bindings layer.
2. **Android** — logcat, tombstones, `llvm-addr2line` against the `cdylib`, LLDB
from Android Studio.
3. **iOS** — `atos` against the `.dSYM`, LLDB from Xcode against the `staticlib`.
Move to a device only after you prove the bug does not reproduce on the host.
A host repro gives you a debugger, a backtrace, a sanitizer, and a fast loop.
## Decision Rule: Where To Debug
| Symptom | Start here |
|---|---|
| Panic message and a Rust backtrace are visible | Host. Write a test that calls the same function. |
| Crash only under a specific input file or payload | Host. Feed the input to a CLI or a unit test. |
| Crash only on device, no panic message | Android or iOS. Pull the tombstone or crash report. |
| Signal 11 (SIGSEGV) with no Rust frames | Native memory bug. Symbolicate first, then see [rust-sanitizers-miri](../rust-sanitizers-miri/). |
| Kotlin or Swift gets an error but Rust logs nothing | FFI boundary. See "Panics At The FFI Boundary". |
| Process hangs, no CPU load | Async stall or deadlock. See "Async Debugging". |
| Snapshot or golden test outpu