Rust
Debugger: GDB / LLDB Status: Stable
Prerequisites
Install GDB or LLDB. One or both must be present in your PATH.
bash
# Linux (GDB)
sudo apt install gdb # Debian/Ubuntu
sudo dnf install gdb # Fedora/RHEL
# macOS (LLDB, ships with Xcode Command Line Tools)
xcode-select --install
# Verify
gdb --version
lldb --versionThe adapter uses LLDB when available, falling back to GDB.
Quick Start
bash
# Build first, then debug
cargo build
krometrail launch "cargo run" --break src/order.rs:147
# Debug tests
cargo test --no-run # build test binary
krometrail launch "cargo test" --break src/order.rs:147
# Debug a specific test
krometrail launch "cargo test test_gold_discount -- --nocapture" \
--break src/order.rs:147Conditional Breakpoints
Rust expressions:
bash
krometrail break "src/order.rs:147 when discount < 0.0"
krometrail break "src/loop.rs:25 when i == 99"Inspecting Rust Types
The viewport renders Rust types using their Debug impl where available:
Locals:
discount = -149.97
order = Order { id: 482, total: 149.97, tier: Gold }
items = Vec(3): [Item { price: 49.99, qty: 3 }, ...]
result = Ok(ChargeResult { success: false, error: "card_declined" })Enum variants show their discriminant and associated data. Option renders as None or Some(value).
Tips
- Build with debug symbols (
cargo build, notcargo build --release) — release builds optimize out most debug information cargo testbuilds test binaries intarget/debug/deps/— the adapter locates them automatically- For workspace projects, specify
--binor--testto select the right binary - Unsafe blocks and raw pointers can be inspected via
debug_evaluateusing GDB/LLDB expressions