AGENT SKILL

cdb-debugging

Windows-only. Drive WinDbg's command-line frontend `cdb.exe` non-interactively to diagnose crashes, startup failures, hangs, and unexplained behavior in the current development build. Assumes source tree + matching PDBs are available. Use when the user asks to "debug the crash", "run under cdb", "get a stack trace", "why does it crash on startup", "analyze the .dmp", or when reading source alone did not reveal the cause. Do NOT use for post-mortem symbol-less production dumps, remote kernel debugging, or as a general-purpose REPL — the workflow is scripted `-c "...;q"` batches.

License 许可
MIT
所属仓库
missdeer/skills
最近更新
2026-11-14
Stars
★ 0
Forks
0

01 前言 Front Matter

name
cdb-debugging
description
Windows-only. Drive WinDbg's command-line frontend `cdb.exe` non-interactively to diagnose crashes, startup failures, hangs, and unexplained behavior in the current development build. Assumes source tree + matching PDBs are available. Use when the user asks to "debug the crash", "run under cdb", "get a stack trace", "why does it crash on startup", "analyze the .dmp", or when reading source alone did not reveal the cause. Do NOT use for post-mortem symbol-less production dumps, remote kernel debugging, or as a general-purpose REPL — the workflow is scripted `-c "...;q"` batches.

03 SKILL.md 正文

cdb-debugging

Run the target program under cdb.exe (WinDbg's command-line frontend) in scripted mode to collect evidence about crashes, exceptions, or unexpected behavior: stacks, registers, exception codes, locals, module list. This is not an interactive debugger workflow — always feed commands via -c "cmd1;cmd2;q" and read the log file afterwards.

Locating cdb.exe

In priority order:

  1. Try PATH first: command -v cdb.exe or just cdb.exe -version.
  2. Fall back to the fixed Windows SDK path: "%ProgramFiles(x86)%\Windows Kits\10\Debuggers\x64\cdb.exe".

In Claude's Bash this is typically:

CDB="/c/Program Files (x86)/Windows Kits/10/Debuggers/x64/cdb.exe"

Or just cdb.exe if it's already on PATH.

Key flags

Mandatory:

  • -y <symbol-path> — symbol search path. For a development build use -y "<build dir>;srv*C:\symbols*https://msdl.microsoft.com/download/symbols": local PDBs first, Microsoft symbol server second (optional, needed only to resolve system DLL frames).
  • -srcpath <src-path> — source path, so lsa / .frame can show source lines.
  • -c "cmd1;cmd2;q" — commands to run automatically on start. Must end in q, otherwise cdb blocks at the prompt.
  • -logo <file> / -loga <file> — write the full session to a log (-logo overwrites, -loga appends).

Situational:

  • Launch a new process: cdb.exe [...] <program.exe> [args]. cdb breaks at the entry point by default. -g skips the initial breakpoint, -G skips the final breakpoint on normal exit. Do not pass -G for crash diagnosis — you want the exception context preserved.
  • Attach to a running process: -p <pid> or -pn <name.exe>.
  • Open a minidump: -z <path.dmp>.

Useful command blocks (chain into -c)

  • Init: .symfix+; .reload /f; .lines -e — fix symbol path, force reload, enable line info.
  • Crash analysis: !analyze -v — the workhorse; auto-locates the faulting instruction and thread.
  • Stacks:
    • kn current thread with frame numbers, kv adds parameter registers, kp shows C++ arguments.
    • ~*kn every thread's stack (essential for deadlock / UI hang).
  • Context: r (registers), .exr -1 (last exception record), .ecxr (switch to the exception context).
  • Locals / source: .frame <n> switch frame, dv /V /t (locals with type and address), lsa . (source around current frame).
  • Modules: lm vm <module> (timestamp / path / PDB status for one module), lm (all).
  • Running to the crash / a specific line: g to go; break on a symbol with bu <module>!<func> or on a source line with bp `<module>!<file.cpp>:<line>` .

Typical workflows

1) Crashes on launch, want the stack

"$CDB" -y "cmake-msvc-build\bin;srv*C:\symbols*https://msdl.microsoft.com/download/symbols" \
  -srcpath "src" \
  -logo tmp\cdb-crash.log \
  -c ".symfix+;.reload /f;g;!analyze -v;.ecxr;kv;~*kn;lm;q" \
  cmake-msvc-build\bin\MyApp.exe

Commands before g execute at the entry-point break, g runs until the crash, the rest run at the exception site, then q exits. Read tmp\cdb-crash.log.

2) Won't start / flashes and dies

Same shape, focused on early startup. Optionally add breakpoints like bu KERNEL32!LoadLibraryExW or bu ntdll!LdrpInitializeProcess. Or keep it minimal: -c ".symfix+;.reload /f;g;kv;lm;q" — if the program exits normally, q fires immediately; if it crashes, execution stops at the exception and the subsequent commands capture it.

3) Hang / unresponsive, need all thread stacks

Reproduce the hang, get the PID, then attach:

"$CDB" -pn MyApp.exe -y "cmake-msvc-build\bin" -srcpath "src" \
  -logo tmp\cdb-hang.log \
  -c ".symfix+;.reload /f;~*kn;!locks;q"

-pn breaks the target immediately on attach. Note: plain q on an attached process terminates the target; use qd (detach and quit) to keep it running.

4) Analyze an existing dump

"$CDB" -z tmp\crash.dmp -y "cmake-msvc-build\bin;srv*C:\symbols*https://msdl.microsoft.com/download/symbols" \
  -srcpath "src" \
  -logo tmp\cdb-dmp.log \
  -c ".symfix+;.reload /f;!analyze -v;.ecxr;kv;~*kn;lm;q"

Hard rules

  • -c must end with q (or qd for attach scenarios). Otherwise cdb sits at the prompt and the Bash call hangs until timeout.
  • Always write output with -logo <file> under tmp/; do not rely on stdout — cdb emits ANSI control sequences that pollute the terminal, whereas the log file is clean text.
  • When paths contain spaces, quote the whole -c string and use forward slashes or escaped backslashes inside; watch Bash escaping when passing Windows-style paths.
  • PDB timestamps must match the exe. lm vm MyApp should show Symbols loaded: ...pdb; if it says export symbols or deferred, the PDB did not match — check the -y path and the build artifact.
  • Even with a PDB, Release builds often report <value unavailable> for locals and fold frames due to inlining / optimization. That's a compiler-output limitation, not a cdb bug — rebuild as Debug or RelWithDebInfo to reproduce when you need reliable locals.
  • Do not use cdb as an interactive REPL by launching it repeatedly. Each invocation is a single scripted shot; analyze from the log afterwards.

04 同仓库更多 Skills

missdeer
missdeer/skills

plantuml

Render PlantUML diagrams through the self-hosted https://plantuml.yii.li server and open the encoded URL in the default browser. Use whenever the user asks to draw, render, or update a PlantUML diagram or sequence diagram. Never download the rendered image — build the encoded URL and open it instead.

★ 0
missdeer
missdeer/skills

pkg-go-dev

Query Go package and module documentation from pkg.go.dev's official v1beta REST API. ALWAYS prefer this skill over `go doc`, `go list -m -versions`, `go list -m`, or scraping pkg.go.dev HTML when the target is a published module on pkg.go.dev (`go doc` is only correct for code in the local working tree or local module cache). Use when the user asks to look up a Go package's docs, synopsis, exported symbols, available versions, latest version, imports, importers, vulnerabilities/CVEs, or to search pkg.go.dev. Triggers on requests like "find the latest version of X", "what versions of github.com/... exist", "show the symbols in package Y", "show docs / godoc / godoc.org / pkg.go.dev for Z", "search Go packages for Z", "what vulnerabilities affect module M", "who imports package P". Covers all of github.com/*, golang.org/x/*, standard library, and any other module indexed by pkg.go.dev.

★ 0
missdeer
missdeer/skills

multi-agent-review-plan

Review a high-level plan before implementation by sending prompts through the herdr skill to existing Codex and Antigravity sessions in adjacent panes. Use when the user or an authorized workflow requests multi-agent plan review; assess technology choices, architecture, and business rules, not code details.

★ 0
missdeer
missdeer/skills

multi-agent-review-code

Review a code diff by sending prompts through the herdr skill to existing Codex and Antigravity sessions in adjacent panes, and fix confirmed in-scope findings. Use when the user or an authorized workflow requests a heavyweight review-and-fix loop; ordinary one-pass reviews use audit.

★ 0
missdeer
missdeer/skills

jira

Read/write JIRA issues on https://jira.ismisv.com via REST API v2 only. Use ONLY for direct issue CRUD: get an issue by key (SHELFECOMM-1, FOO-123), JQL search, read/add comments, list/apply transitions, create a ticket, (re)assign, link/unlink issues, or list/upload/download/delete attachments. Do NOT use for end-to-end issue resolution workflows (planning, coding, reviewing, committing) — that is the `jira-issue-resolver` skill's job; do NOT use for non-JIRA ticketing (GitHub Issues, Lark Task); do NOT scrape HTML pages or invent endpoints. Authenticates with Basic Auth from `jira-auth.json` (gitignored).

★ 0
missdeer
missdeer/skills

jira-issue-resolver

End-to-end JIRA issue resolution workflow. Trigger for intents such as "resolve JIRA XXXX-nn", "fix XXXX-nn", "handle XXXX-nn", or a jira.ismisv.com/browse/ URL. It runs the full loop of finding the DAG root, creating an isolated Git worktree, producing and self-checking a brief change plan, attaching the plan, coding, testing and application black-box verification, reviewing code, committing, integrating into the main branch with rebase and fast-forward, and writing back to JIRA. One run handles only one issue. If a story has no subtasks, split it first and implement only the first subtask; if all subtasks of a parent are complete, use the parent closeout shortcut.

★ 0