native-debugger-triage

Installation
SKILL.md

native-debugger-triage — drive GNU gdb on native binaries, including head-less batch mode

Quick Ref: gdb -batch -ex run -ex bt --args ./prog ARGS reproduces a crash and prints a backtrace in one non-interactive command. For a core file: gdb -batch -ex bt PROG core.

⚠️ Critical Constraints

  • Build with debug info or the backtrace is useless. A stripped/-O2 binary gives ?? frames and optimized-out locals. Why: gdb reads DWARF symbols; without them frames have no names or line numbers.

    • WRONG: cc prog.c -o prog then wonder why bt shows 0x4011 a6 in ?? ().
    • CORRECT: cc -g -O0 prog.c -o prog (add -ggdb3 for macros; keep symbols un-stripped).
  • Never run an interactive gdb session inside an automated/agent context — it hangs. An agent has no TTY to answer the (gdb) prompt. Why: gdb blocks waiting for stdin; the tool call times out with no output.

    • WRONG: gdb ./prog (drops to an interactive prompt and stalls).
    • CORRECT: gdb -batch -ex run -ex bt --args ./prog (runs, prints, exits non-zero on crash).
Installs
1
Repository
boshu2/agentops
GitHub Stars
399
First Seen
Jun 7, 2026
native-debugger-triage — boshu2/agentops