← ClaudeAtlas

rust-debugginglisted

Use when you debug a native Rust crash, panic, or hang across an FFI boundary. Covers host-first reproduction with RUST_BACKTRACE, rust-lldb and rust-gdb, Android logcat filtering, tombstone analysis, symbolication with llvm-addr2line and atos, LLDB attach from Android Studio and Xcode, panic hooks that work without RUST_BACKTRACE, catch_unwind at JNI exports, UniFFI panic and error propagation into Kotlin and Swift, tracing spans routed to logcat, tokio-console for async stalls, and a panic-to-cause triage table. Triggers on "native crash", "tombstone", "addr2line", "RUST_BACKTRACE", "lldb-server", "JNI panic", "UniFFI panic", "rust-gdb pretty-printers", or "debug async Rust".
po4yka/rust-skills · ★ 2 · Code & Development · score 76
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