gdb

Debug native C/C++ binaries with GDB breakpoints, backtraces, and core dumps.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/awfixers-stuff/opencode-config --skill gdb-awfixers-stuff
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gdb
Source: https://github.com/awfixers-stuff/opencode-config/tree/main/skills/gdb
Command: npx skills add https://github.com/awfixers-stuff/opencode-config --skill gdb-awfixers-stuff

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Guides developers to find and fix crashes, hangs, memory corruption, and logic errors in native C and C++ programs by using interactive and non-interactive GDB workflows for live processes, core dumps, and remote targets.

Core Features & Use Cases

  • Breakpoint management including conditional, temporary, regex, and address breakpoints to isolate faulty code paths.
  • State inspection with variable printing, memory examination, register views, and full or per-thread backtraces to pinpoint failure context.
  • Advanced workflows such as reverse debugging (record/replay), remote debugging with gdbserver, multi-threaded inspection and scheduler locking, and Python-based pretty-printers and scripting for custom data views.
  • Use case: investigate a production segfault by loading a core file, inspecting the backtrace and frame variables, setting watchpoints to detect memory corruption, or attaching to a remote embedded target via gdbserver.

Quick Start

Start a GDB session for your built binary, set a breakpoint at main, run the program with its arguments, and show a full backtrace when it crashes.

Frequently Asked Questions about gdb

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

FAQPage Schema
How do I debug a C++ program that crashes with a segfault?

Debug a C++ segfault by loading the crashed binary and its core dump into a debugger, then inspecting the full backtrace and frame variables to pinpoint the exact failure context and memory corruption source.

Can I debug a remote embedded target using gdbserver?

Yes, you can debug a remote embedded target by attaching a local debugger to a gdbserver connection, allowing you to set breakpoints and inspect state on the remote native Linux binary over the network.

Do I need debug symbols to diagnose memory corruption in C?

Yes, you need binaries compiled with debug symbols (-g) or access to debuginfo to diagnose memory corruption, as this provides the source line mapping required for frame inspection and variable printing.

What is reverse debugging and how does it help fix runtime errors?

Reverse debugging records program execution and replays it backward, allowing you to step back from a runtime error or crash to inspect the exact state changes and variable values that caused the fault.

How do I inspect memory and registers during a core dump analysis?

Inspect memory and registers during core dump analysis by loading the core file, examining memory addresses, viewing register states, and printing per-thread backtraces to diagnose the crash.

How do I set conditional breakpoints to isolate faulty code paths?

Set conditional breakpoints by specifying a condition expression that halts execution only when true, isolating faulty code paths without manually stepping through irrelevant program iterations.