Token导航 LogoToken导航TokenDH.com
待分类执行命令github未标认证来源可访问许可证需确认审计异常

rust-debuggingRust 调试

Agent Skill

rust-debugging 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

2,118

周安装

91

GitHub Stars

80

下载量

743
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:rust-debugging(Rust 调试)
来源仓库:https://github.com/mohitmishra786/low-level-dev-skills
仓库路径:skills/rust-debugging
安装命令:
npx skills add https://github.com/mohitmishra786/low-level-dev-skills --skill rust-debugging
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/mohitmishra786/low-level-dev-skills --skill rust-debugging

简介

用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息。

  • 适合围绕仓库状态、代码变更或协作事项进行整理。
  • 可结合来源仓库和原始 README 核验具体用法。
  • 安装前建议确认权限范围和维护状态。rust-debugging 属于待分类类 Skill,可作为该场景下的辅助能力补充。
  • 注意是否会触发联网、命令执行或文件读写。

SKILL.md

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

# Debug build (default) — full debug info, no optimization
cargo build

# Release with debug info (for profiling real workloads)
cargo build --release --profile release-with-debug
# Or configure in Cargo.toml:
# [profile.release-with-debug]
# inherits = "release"
# debug = true

# Run directly
cargo run
cargo run -- arg1 arg2

2. GDB with Rust pretty-printers

# Use rust-gdb wrapper (sets up pretty-printers automatically)
rust-gdb target/debug/myapp

# Or set up manually in ~/.gdbinit:
# python
# import subprocess, sys
# ...

Common GDB session for Rust:

# Basic
(gdb) break main
(gdb) run arg1 arg2
(gdb) next           # step over
(gdb) step           # step into
(gdb) continue

# Rust-aware inspection
(gdb) print my_string     # Shows String content via pretty-printer
(gdb) print my_vec        # Shows Vec elements
(gdb) print my_option     # Shows Some(value) or None
(gdb) info locals

# Break on panic
(gdb) break rust_panic
(gdb) break core::panicking::panic

# Backtrace
(gdb) bt              # Short backtrace
(gdb) bt full         # Full with locals

3. LLDB with Rust pretty-printers

# Use rust-lldb wrapper
rust-lldb target/debug/myapp

# Manual setup
lldb target/debug/myapp
(lldb) command script import /path/to/rust/lib/rustlib/etc/lldb_lookup.py
(lldb) command source /path/to/rust/lib/rustlib/etc/lldb_commands

Common LLDB session:

(lldb) b main::main
(lldb) r arg1 arg2
(lldb) n              # next (step over)
(lldb) s              # step into
(lldb) c              # continue
(lldb) frame variable # show locals
(lldb) p my_string    # print variable with pretty-printer
(lldb) bt             # backtrace
(lldb) bt all         # all threads

4. Backtrace configuration

# Short backtrace (default on panic)
RUST_BACKTRACE=1 ./myapp

# Full backtrace with all frames
RUST_BACKTRACE=full ./myapp

# With symbols (requires debug build or separate debug info)
RUST_BACKTRACE=full ./target/debug/myapp

# Capture backtrace programmatically
use std::backtrace::Backtrace;
let bt = Backtrace::capture();
eprintln!("{bt}");

For release binaries, keep debug symbols in a separate file:

# Build release with debug info
cargo build --release
objcopy --only-keep-debug target/release/myapp target/release/myapp.debug
strip --strip-debug target/release/myapp
objcopy --add-gnu-debuglink=target/release/myapp.debug target/release/myapp

5. Panic triage

// Set a custom panic hook for structured logging
use std::panic;

panic::set_hook(Box::new(|info| {
    let backtrace = std::backtrace::Backtrace::force_capture();
    eprintln!("PANIC: {info}");
    eprintln!("{backtrace}");
    // Log to file, send to Sentry, etc.
}));

Common panic patterns:

Panic messageLikely cause
index out of bounds: the len is N but the index is MArray/vec OOB access
called Option::unwrap() on a None valueUnwrap on None
called Result::unwrap() on an Err valueUnwrap on error
attempt to subtract with overflowInteger underflow (debug build)
assertion failedFailed assert! or assert_eq!
stack overflowInfinite recursion

Use panic = "abort" in release to get a crash dump instead of unwind.

6. The dbg! macro

// dbg! prints file, line, value and returns the value
let result = dbg!(some_computation(x));
// prints: [src/main.rs:15] some_computation(x) = 42

// Chain multiple values
let (a, b) = dbg!((compute_a(), compute_b()));

// Inspect inside iterator chains
let sum: i32 = (0..10)
    .filter(|x| dbg!(x % 2 == 0))
    .map(|x| dbg!(x * x))
    .sum();

7. Structured logging with tracing

[dependencies]
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
use tracing::{debug, error, info, instrument, warn};

#[instrument]  // Auto-traces function entry/exit with arguments
fn process(id: u64, data: &str) -> Result<(), Error> {
    debug!("Processing item");
    info!(item_id = id, "Started processing");

    if data.is_empty() {
        warn!(item_id = id, "Empty data");
        return Err(Error::EmptyData);
    }

    error!(item_id = id, err = ?some_result, "Failed");
    Ok(())
}

// Initialize in main
tracing_subscriber::fmt()
    .with_env_filter("myapp=debug,warn")
    .init();
# Control log levels at runtime
RUST_LOG=debug ./myapp
RUST_LOG=myapp::module=trace,warn ./myapp

8. Async debugging with tokio-console

[dependencies]
console-subscriber = "0.3"
tokio = { version = "1", features = ["full", "tracing"] }
// In main
console_subscriber::init();
# Install and run tokio-console
cargo install tokio-console
tokio-console  # Connects to running Rust process at port 6669

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.

Related skills

  • Use skills/rust/rustc-basics for debug info flags and build configuration
  • Use skills/debuggers/gdb for GDB fundamentals
  • Use skills/debuggers/lldb for LLDB fundamentals
  • Use skills/rust/rust-sanitizers-miri for memory safety and undefined behaviour

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude

33.17%
按下载量换算246

Codex

32.66%
按下载量换算243

Cursor

20.7%
按下载量换算154

Gemini CLI

9.74%
按下载量换算72

安全审计

Gen Agent Trust Hub

未通过

Socket

通过

Snyk

通过

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/mohitmishra786/low-level-dev-skills --skill rust-debugging 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills