gdb-debug

Debug C/GTK4 memory errors and segfaults with GDB and LLDB.

8|2|Updated Oct 5, 2024
One-click install
npx skills add https://github.com/chebizarro/nostrc --skill gdb-debug
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gdb-debug
Source: https://github.com/chebizarro/nostrc/tree/main/skills/gdb-debug
Command: npx skills add https://github.com/chebizarro/nostrc --skill gdb-debug

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides systematic workflows for diagnosing and fixing critical bugs like segfaults, memory leaks, and use-after-free errors in C/GTK4 applications, making debugging more efficient.

Core Features & Use Cases

  • Cross-Platform Debugging: Supports GDB on Linux and LLDB on macOS.
  • Advanced Diagnostics: Integrates with AddressSanitizer (ASan) for memory error detection, and provides techniques for GObject reference counting, signal handler tracing, and NDB transaction analysis.
  • LLM Agent Friendly: Designed for AI agents to execute debugger commands and interpret structured output for crash diagnosis.
  • Use Case: When your GNostr application crashes with a segfault, this Skill guides you through using GDB to pinpoint the exact line of code and the state of variables at the time of the crash, even helping to identify if it's a memory corruption issue.

Quick Start

Run the application 'gnostr' under GDB with a full backtrace and then quit.

Frequently Asked Questions about gdb-debug

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

FAQPage Schema
How do I debug segfaults and memory errors in C GTK4 applications?

Debug C GTK4 segfaults and memory errors by running applications under GDB on Linux or LLDB on macOS to capture full backtraces. This Skill guides systematic diagnosis of use-after-free errors and variable states at the crash site.

Can I use AddressSanitizer with GDB to diagnose use-after-free errors in C?

AddressSanitizer integrates with GDB to diagnose use-after-free errors in C applications. This Skill facilitates advanced memory corruption diagnostics by interpreting structured ASan output alongside debugger execution.

How does an LLM agent execute debugger commands for automated crash diagnosis?

An LLM agent executes structured debugger commands for automated crash diagnosis by leveraging this Skill to interpret GDB and LLDB output. It provides systematic workflows for pinpointing exact lines of code during failures.

What is the best way to trace GObject reference counting issues during a GTK4 crash?

Tracing GObject reference counting issues during a GTK4 crash is best handled through GDB signal handler tracing. This Skill provides targeted techniques for analyzing reference counting and memory leaks in C applications.

Does this debugging workflow support both Linux GDB and macOS LLDB?

This debugging workflow supports cross-platform memory error diagnosis using GDB on Linux and LLDB on macOS. It enables consistent crash analysis and variable state inspection across both operating systems.