AgentSkillsCN

debugger

使用 rust-gdb 在不修改代码的前提下检查变量。在探究编译器内部机制或运行时行为时,相较于打印调试,更推荐采用此方法。

SKILL.md
--- frontmatter
name: debugger
description: Use rust-gdb to inspect variables without modifying code. Prefer this over print debugging when investigating compiler internals or runtime behavior.

Debugger

Debug wado compiler with rust-gdb.

Usage

sh
cat > /tmp/gdb_commands.txt << 'EOF'
file ./target/debug/wado
set pagination off
break wado-compiler/src/codegen.rs:5985
run compile -o /tmp/out.wasm example/hello.wado
info locals
print *expr
bt 5
quit
EOF
rust-gdb --batch -x /tmp/gdb_commands.txt

Common commands

CommandDescription
info localsShow local variables
print *exprDereference and print pointer
bt 5Backtrace (top 5 frames)
continueResume execution

Notes

lldb does not work in Claude Code Web due to ptrace restrictions:

code
error: Cannot launch '...': personality get failed: Invalid argument

Use rust-gdb instead.