cpp-debug

Diagnose C++ runtime failures including segfaults, deadlocks, and memory leaks.

Updated Mar 4, 2026
One-click install
npx skills add https://github.com/chisuhua/home --skill cpp-debug-chisuhua
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: cpp-debug
Source: https://github.com/chisuhua/home/tree/main/.config/opencode/skills/cpp-debug
Command: npx skills add https://github.com/chisuhua/home --skill cpp-debug-chisuhua

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? C++ programs that compile successfully but crash, hang, or leak memory at runtime are hard to diagnose without a structured process. This Skill provides a systematic workflow for triaging segmentation faults, deadlocks, and memory leaks, including CppHDL-specific ch_module lifecycle errors. ## Core Features & Use Cases - Classified Diagnosis: Separates failures into SIGSEGV, deadlock, and memory leak categories with targeted checks such as iterator invalidation, lock ordering, and dangling pointers. - Sanitizer Guidance: Recommends Valgrind, AddressSanitizer, and ThreadSanitizer commands for memory and concurrency verification. - CppHDL Support: Diagnoses ch_module lifecycle errors like "No active parent Component found" and explains correct ch_device versus ch_module usage patterns. - Use Case: A user's simulator crashes with "core dumped" after a recent change. The Skill walks through collecting the backtrace, checking recent git diffs, identifying a dangling pointer, and verifying the fix under ASan with zero errors. ## Quick Start Ask the assistant to debug your C++ program crash by sharing the stack trace and describing when the failure occurs.

Frequently Asked Questions about cpp-debug

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

FAQPage Schema
Does compiler optimization affect C++ debugging?▼

Yes, -O2 and -O3 optimizations can inline functions and reorder code, making stack traces harder to interpret. When diagnosing a crash, note the optimization level and consider rebuilding with -O0 -g for clearer debugging information.