gdb

Debug C/C++ programs with GDB breakpoints, stepping, and core dumps.

159|20|Updated Feb 20, 2026
One-click install
npx skills add https://github.com/mohitmishra786/low-level-dev-skills --skill gdb
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gdb
Source: https://github.com/mohitmishra786/low-level-dev-skills/tree/main/skills/debuggers/gdb
Command: npx skills add https://github.com/mohitmishra786/low-level-dev-skills --skill gdb

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill empowers you to efficiently debug C/C++ programs, from basic execution control to advanced techniques like reverse debugging and remote target interaction, ensuring you can quickly identify and fix complex issues.

Core Features & Use Cases

  • Interactive Debugging: Step through code, inspect variables, and analyze call stacks.
  • Crash Analysis: Load core dumps to understand program failures.
  • Advanced Techniques: Utilize reverse debugging, multi-threading, and remote debugging with gdbserver.
  • Use Case: When your C++ application crashes with a segmentation fault, use this Skill to load the core dump, examine the state at the time of the crash, and pinpoint the exact line of code causing the error.

Quick Start

Use the gdb skill to debug the executable 'my_program' and set a breakpoint at the 'main' function.

Frequently Asked Questions about gdb

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I debug a segmentation fault in C++ using a core dump?

To debug a segmentation fault using a core dump, load the core dump into GDB to examine the program state and pinpoint the failing line of code. You can analyze the call stack and inspect variables directly at the moment of the crash.

How do I set breakpoints and step through C code in GDB?

Setting breakpoints and stepping through C code in GDB uses execution control commands to pause execution at specified functions or lines. You can then sequentially step through execution while inspecting variables and analyzing the call stack.

What is reverse debugging and how does it work with GDB?

Reverse debugging in GDB is an advanced technique allowing you to step backward through program execution to find error root causes. It records execution history, letting you rewind the program state to inspect variables at earlier points.

Can I use GDB for multi-threaded and remote debugging with gdbserver?

Yes, GDB supports multi-threaded debugging and remote target interaction using gdbserver. You can analyze concurrent applications and debug programs on different machines by connecting the debugger to a remote gdbserver instance.

What are the common issues and limitations when using GDB for crash analysis?

Common GDB issues during crash analysis include missing debugging symbols or incomplete core dumps, preventing accurate inspection of variables and call stacks. This Skill provides solutions for these limitations to ensure efficient diagnosis of program failures.