Skip to content

GDB debugger workflows for C and C++ covering breakpoints, inspection, crash analysis, and remote debugging.

CCM score
62 of 100
skills.sh installs
1.3K
GitHub stars
303
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers the session lifecycle: launching or attaching, stepping, breakpoints and watchpoints, state inspection, and reverse record/replay
  • Includes a command reference table, a common-problems troubleshooting table, a ~/.gdbinit template, and links to a cheatsheet and scripting guide
  • Provides multi-thread inspection with thread apply all bt and set scheduler-locking on, plus gdbserver remote setup for embedded targets
  • Designed for diagnosing segfaults, hangs, and crashes in C/C++ builds compiled with -g

Install

$ npx -y skills add mohitmishra786/low-level-dev-skills --skill gdb -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

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.

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

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

Details

Repository
github.com/mohitmishra786/low-level-dev-skills
Categories
Debugging, CLI & Terminal
First seen
Jun 3, 2026

Questions

What does the gdb skill for Claude Code cover?

The gdb skill walks an agent through GDB sessions for C and C++ programs, from first launch to crash diagnosis, reverse debugging, remote debugging with gdbserver and multi-thread inspection. It also covers breakpoints, watchpoints, pretty-printers and Python GDB scripting.

How do I install the gdb skill?

Run npx -y skills add mohitmishra786/low-level-dev-skills --skill gdb -y in your project. After that, the agent can use the skill when you ask about GDB commands, segfaults, hangs or core dumps.

Can the gdb skill help me debug a segfault or hang?

Yes, the skill targets crashes and hangs directly, covering segfaults, core dumps and programs that hang on run. It explains how to read backtraces and inspect variables and registers at the point of failure.

Where does the gdb skill stand in the Debugging category?

The gdb skill sits in the Debugging category on Claude Marketplaces, alongside diagnosing-bugs, safe-debug, systematic-debugging and sentry-cli. It is the one focused on GDB itself for C and C++ work.

Does the gdb skill support record and replay debugging?

Yes, the skill covers reverse debugging with record and replay, including software recording and Intel Processor Trace. It also explains how to step backwards and continue to an earlier breakpoint.

More from mohitmishra786/low-level-dev-skills

All 54

Similar to Gdb

More Debugging