GDB debugger skill for C/C++ programs. An agent skill from mohitmishra786/low-level-dev-skills.

MITAuto-check passedDevelopment

Install Gdb

skills CLI
$ npx skills add mohitmishra786/low-level-dev-skills --skill gdb -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install mohitmishra786/low-level-dev-skills gdb --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/mohitmishra786/low-level-dev-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/debuggers/gdb .claude/skills/gdb && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
gdb
GitHub stars
253
Token cost
~1.6k tokens
SKILL.md length
341 words
Files
3 (incl. references)
Skills in repo
138
Repo updated
First seen
Licence
MIT

At a glance

GDB debugger skill for C/C++ programs. An agent skill from mohitmishra786/low-level-dev-skills.

  • Works in 10 steps: Prerequisite: compile with debug info → Start GDB → Essential commands → …
  • Starting a GDB session
  • SKILL.md covers Purpose, Triggers, Workflow and Related skills
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Gdb is an agent skill from mohitmishra786/low-level-dev-skills. GDB debugger skill for C/C++ programs. Use when starting a GDB session, setting breakpoints, stepping through code, inspecting variables, debugging crashes, using reverse debugging (record/replay), remote debugging with gdbserver, or loading core dumps. Activates on queries about GDB commands, segfaults, hangs, watchpoints, conditional breakpoints, pretty-printers, Python GDB scripting, or multi-threaded debugging.

Its SKILL.md is about 1.6k tokens, which your agent loads only when the skill is triggered. The skill folder holds 3 other files, including reference files (for example `references/cheatsheet.md` and `references/scripting.md`).

It sits in Development, covering Responsive design and Debugging. It works with C++ and Python. The repository describes itself as: A curated suite of AI agent skills for systems and low-level programming with C/C++, Rust, and Zig toolchains, covering compilers, debuggers, profilers, build systems…. The licence is MIT.

When your agent uses it

  • Starting a GDB session
  • Setting breakpoints
  • Stepping through code
  • Inspecting variables

Example prompts

  • “/gdb”

Requirements

  • Python 3

Workflow steps

10 steps, taken from the step headings in SKILL.md.

  1. Prerequisite: compile with debug info
  2. Start GDB
  3. Essential commands
  4. Breakpoints and watchpoints
  5. Inspect state
  6. Multi-thread debugging
  7. Reverse debugging (record/replay)
  8. Remote debugging with gdbserver
  9. Common problems
  10. GDB init file (~/.gdbinit)

What it can do on your machine

Read from SKILL.md and the folder at commit bdc5847. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are gdb and bash).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Gdb loads about 1.6k tokens when it runs, and up to ~3.5k if it reads all its reference files. Until then it costs about 106 tokens; SKILL.md has 341 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~106
When it runs · the whole SKILL.md, loaded when a task matches
~1.6k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~3.5k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from mohitmishra786/low-level-dev-skills at commit bdc5847, republished under its MIT licence (© mohitmishra786). 341 words, ~1,583 tokens.

Download SKILL.mdSave it as .claude/skills/gdb/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
gdb
description
GDB debugger skill for C/C++ programs. Use when starting a GDB session, setting breakpoints, stepping through code, inspecting variables, debugging crashes, using reverse debugging (record/replay), remote debugging with gdbserver, or loading core dumps. Activates on queries about GDB commands, segfaults, hangs, watchpoints, conditional breakpoints, pretty-printers, Python GDB scripting, or multi-threaded debugging.

GDB

Purpose

Walk agents through GDB sessions from first launch to advanced workflows: crash diagnosis, reverse debugging, remote debugging, and multi-thread inspection.

Triggers

  • "My program segfaults / crashes — how do I debug it?"
  • "How do I set a breakpoint on condition X?"
  • "How do I inspect memory / variables in GDB?"
  • "How do I debug a remote embedded target?"
  • "GDB shows ?? frames / no source"
  • "How do I replay a bug deterministically?" (record/replay)

Workflow

1. Prerequisite: compile with debug info

Always compile with -g (GCC/Clang). Use -Og or -O0 for most debuggable code.

bash
gcc -g -Og -o prog main.c

For release builds: use -g -O2 and keep the binary with symbols (strip separately with objcopy).

2. Start GDB
bash
gdb ./prog                          # load binary
gdb ./prog core                     # load with core dump
gdb -p 12345                        # attach to running process
gdb --args ./prog arg1 arg2         # pass arguments
gdb -batch -ex 'run' -ex 'bt' ./prog  # non-interactive (CI)
3. Essential commands
CommandShortcutEffect
run [args]rStart the program
continuecResume after break
nextnStep over (source line)
stepsStep into
nextiniStep over (instruction)
stepisiStep into (instruction)
finishRun to end of current function
until NRun to line N
return [val]Force return from function
quitqExit GDB
4. Breakpoints and watchpoints
gdb
break main                          # break at function
break file.c:42                     # break at line
break *0x400abc                     # break at address
break foo if x > 10                 # conditional break
tbreak foo                          # temporary breakpoint (fires once)
rbreak ^mylib_.*                    # regex breakpoint on all matching functions

watch x                             # watchpoint: break when x changes
watch *(int*)0x601060               # watch memory address
rwatch x                            # break when x is read
awatch x                            # break on read or write

info breakpoints                    # list all breakpoints
delete 3                            # delete breakpoint 3
disable 3                           # disable without deleting
enable 3
5. Inspect state
gdb
print x                             # print variable
print/x x                           # print in hex
print *ptr                          # dereference pointer
print arr[0]@10                     # print 10 elements of array
display x                           # auto-print x on every stop
undisplay 1

info locals                         # all local variables
info args                           # function arguments
info registers                      # all CPU registers
info registers rip rsp rbp          # specific registers
x/10wx 0x7fff0000                   # examine 10 words at address
x/s 0x400abc                        # examine as string
x/i $rip                            # examine current instruction

backtrace                           # call stack (bt)
bt full                             # bt + local vars
frame 2                             # switch to frame 2
up / down                           # move up/down the stack
6. Multi-thread debugging
gdb
info threads                        # list threads
thread 3                            # switch to thread 3
thread apply all bt                 # backtrace all threads
thread apply all bt full            # full bt all threads
set scheduler-locking on            # pause other threads while stepping
7. Reverse debugging (record/replay)

Record requires target record-full or target record-btrace (Intel PT):

gdb
# Software record (slow but universal)
record                              # start recording
run
# ... trigger the bug ...
reverse-continue                    # go back to last break
reverse-next                        # step backwards
reverse-step
reverse-finish

# Intel Processor Trace (fast, hardware)
target record-btrace pt
run
# view instruction history
record instruction-history
8. Remote debugging with gdbserver

On target:

bash
gdbserver :1234 ./prog
# Or attach:
gdbserver :1234 --attach 5678

On host:

bash
gdb ./prog
(gdb) target remote 192.168.1.10:1234
(gdb) break main
(gdb) continue

For cross-compilation: use aarch64-linux-gnu-gdb on the host.

9. Common problems
SymptomCauseFix
No symbol tableBinary not compiled with -gRecompile with -g
?? frames in backtraceMissing debug info or stack corruptionInstall debuginfo package; check for stack smash
Cannot access memory at addressNull dereference / freed memoryCheck pointer before deref; use ASan
SIGABRT in backtraceabort() or assertion failureGo up frames to find the assertion
GDB hangs on runBinary waiting for inputRedirect stdin: run < /dev/null
Breakpoint in wrong placeOptimiser moved codeCompile with -Og; or use nexti
10. GDB init file (~/.gdbinit)
gdb
set history save on
set history size 1000
set print pretty on
set print array on
set print array-indexes on
set pagination off
set confirm off

For a command cheatsheet, see references/cheatsheet.md. For pretty-printers and Python scripting, see references/scripting.md.

  • Use skills/debuggers/core-dumps for loading core files
  • Use skills/debuggers/lldb for LLDB-based workflows
  • Use skills/runtimes/sanitizers to catch bugs before needing the debugger
  • Use skills/compilers/gcc for -g flag details

© mohitmishra786, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 2 other files (references) in skills/debuggers/gdb of mohitmishra786/low-level-dev-skills.

  • SKILL.md
  • references/cheatsheet.md
  • references/scripting.md

Open the folder on GitHubat commit bdc5847

Compare with similar skills

Gdb next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Gdb compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Gdb this skillmohitmishra786/low-level-dev-skills253—~1.6kAutomated safety check: PassMIT
Dbgtheodo-group/debug-that158—~2.5kAutomated safety check: PassMIT
Ue Live DebuggingJasonMa0012/MooaToon750—~2.9kAutomated safety check: NotesCustom licence
MCP Debuggerdebugmcp/mcp-debugger172—~3.8kAutomated safety check: PassMIT
Tilelang Debug Helpertile-ai/tilelang-ascend402—~1.7kAutomated safety check: NotesMIT
SlintMoosync/Moosync259—~2.4kAutomated safety check: PassGPL-3.0

Similar skills

  • Dbg

    theodo-group/debug-that

    Debug applications using the dbg CLI debugger. An agent skill from theodo-group/debug-that.

    158 GitHub stars~2.5k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Ue Live Debugging

    JasonMa0012/MooaToon

    A skill your agent uses when debugging UE C++ crashes, runtime bugs, or unexpected behavior with Rider MCP available.

    750 GitHub stars~2.9k tokensUpdated 21 days ago
    DevelopmentAuto-check: notes
  • MCP Debugger

    debugmcp/mcp-debugger

    A skill your agent uses when investigating a bug, failing test, or unexpected runtime behavior and the mcp-debugger MCP server is available — drives real step-through debuggers (breakpoints, stack…

    172 GitHub stars~3.8k tokensUpdated 2 days ago
    DevelopmentAuto-check passed
  • Tilelang Debug Helper

    tile-ai/tilelang-ascend

    How to add debugging capabilities to TileLang Ascend example operators.

    402 GitHub stars~1.7k tokensUpdated yesterday
    DevelopmentAuto-check: notes
  • Slint

    Moosync/Moosync

    Expert guidance for building, debugging, and working with Slint GUI applications.

    259 GitHub stars~2.4k tokensUpdated 8 days ago
    DevelopmentAuto-check passed
  • State Snapshot Instrumenter

    ArabelaTso/Skills-4-SE

    Instrument programs (Python, C/C++, Java) to capture snapshots of key program states at runtime, including variables, memory, and call stacks.

    253 GitHub stars~2.2k tokensUpdated 1 mo ago
    DevelopmentAuto-check passed

More from mohitmishra786/low-level-dev-skills

All 138 skills in this repo
  • ARM and AArch64 Assembly

    mohitmishra786/low-level-dev-skills

    Guides reading and writing AArch64 and ARM Thumb assembly: compiler output, inline asm, registers, the AAPCS calling convention and NEON or SVE basics.

    253 GitHub stars~1.9k tokensUpdated 3 mo ago
    Auto-check passed
  • RISC-V Assembly Guide

    mohitmishra786/low-level-dev-skills

    Reference for RISC-V assembly on RV32 and RV64: register names and calling convention, extension naming, GCC and Clang inline asm, and QEMU with GDB debugging.

    253 GitHub stars~1.8k tokensUpdated 3 mo ago
    Auto-check passed
  • x86-64 Assembly Reference

    mohitmishra786/low-level-dev-skills

    Explains x86-64 registers, the System V AMD64 calling convention, and how to read compiler-generated or inline assembly.

    253 GitHub stars~1.5k tokensUpdated 3 mo ago
    Auto-check passed
  • Bazel for C and C++

    mohitmishra786/low-level-dev-skills

    Guides your agent through Bazel for C/C++ projects: BUILD files, Bzlmod dependencies, toolchain registration, remote execution, dependency queries and sandbox debugging.

    253 GitHub stars~1.5k tokensUpdated 3 mo ago
    Auto-check passed
  • Binary Hardening

    mohitmishra786/low-level-dev-skills

    Binary hardening skill for security-hardened C/C++ builds. An agent skill from mohitmishra786/low-level-dev-skills.

    253 GitHub stars~2k tokensUpdated 3 mo ago
    Auto-check passed
  • Binutils

    mohitmishra786/low-level-dev-skills

    GNU binutils skill for binary manipulation and analysis. An agent skill from mohitmishra786/low-level-dev-skills.

    253 GitHub stars~1.2k tokensUpdated 3 mo ago
    Auto-check passed

Works with

Questions about Gdb

What does Gdb do?

GDB debugger skill for C/C++ programs. An agent skill from mohitmishra786/low-level-dev-skills. Gdb is an agent skill from mohitmishra786/low-level-dev-skills. GDB debugger skill for C/C++ programs.

When should I use Gdb?

Gdb fits situations like: starting a GDB session; setting breakpoints; stepping through code; inspecting variables.

How do I install Gdb in Claude Code?

Run `npx skills add mohitmishra786/low-level-dev-skills --skill gdb -a claude-code`. Or copy the skill folder (skills/debuggers/gdb in mohitmishra786/low-level-dev-skills) into .claude/skills/gdb in your project. Claude Code loads it when a task matches its description.

How do I install Gdb in Codex?

Run `npx skills add mohitmishra786/low-level-dev-skills --skill gdb -a codex`. Or copy the skill folder (skills/debuggers/gdb in mohitmishra786/low-level-dev-skills) into .agents/skills/gdb in your project. Codex loads it when a task matches its description.

Can I use Gdb in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add mohitmishra786/low-level-dev-skills --skill gdb -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/gdb, .gemini/skills/gdb, .github/skills/gdb and .opencode/skills/gdb in your project.

What does Gdb need to run?

SKILL.md names no scripts, command-line tools or credentials: Gdb is instructions for the agent only. Our summary lists: Python 3.

Does Gdb access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Gdb safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Gdb use?

Gdb is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Gdb use?

About 1.6k tokens (SKILL.md is roughly 6.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 1.9k tokens, read only when the agent opens those files.

What are the alternatives to Gdb?

Skills that share tags, products or a category with Gdb: Dbg (theodo-group/debug-that, 158 stars), Ue Live Debugging (JasonMa0012/MooaToon, 750 stars), MCP Debugger (debugmcp/mcp-debugger, 172 stars) and Tilelang Debug Helper (tile-ai/tilelang-ascend, 402 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Gdb?

mohitmishra786 (a GitHub user) maintains it in mohitmishra786/low-level-dev-skills, which has 253 GitHub stars. The repository holds 138 skills in this directory. The repository was last updated on June 27, 2026.

Source: mohitmishra786/low-level-dev-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.