What problem does it solve?
Debugging code compiled with optimization often hides variables, reorders lines, inlines functions, and produces "<optimized out>" values that make breakpoints and backtraces confusing; this Skill guides engineers to reliable techniques for diagnosing and understanding program behavior in RelWithDebInfo, -Og, and -O2 builds.
Core Features & Use Cases
- Choose proper build flags: recommendations for -Og, -O0, -g, -gsplit-dwarf and CMake build types to balance performance and debuggability.
- Diagnose optimized variables and inlined frames: step-by-step GDB workflows to inspect registers, navigate inlined frames, and interpret "value optimized out".
- Optimized multi-thread and packaging workflows: use scheduler-locking for single-thread stepping and split-DWARF (.dwo/.dwp) guidance for faster link and symbol distribution.
- Use Case: when a crash in a RelWithDebInfo binary shows incomplete locals and inlined call chains, follow the Skill to pick flags, inspect registers, view mixed source/asm, and package debug info for post-mortem analysis.
Quick Start
Ask for step-by-step guidance to diagnose a "value optimized out" variable and to recommend compiler flags and GDB commands for a RelWithDebInfo build.