| name | debugging |
| version | 3.0.0 |
| description | Production-grade skill for C++ debugging. Covers GDB, LLDB, sanitizers, memory debugging, crash analysis, and systematic bug investigation techniques.
|
| sasmp_version | 1.3.0 |
| skill_version | 3.0.0 |
| bonded_agent | cpp-debugger-agent |
| bond_type | PRIMARY_BOND |
| category | development |
| parameters | {"debugger":{"type":"string","required":false,"enum":["gdb","lldb","visual_studio","windbg"],"default":"gdb","description":"Debugger to use"},"issue_type":{"type":"string","required":false,"enum":["crash","memory","logic","performance","concurrency"],"description":"Type of issue being debugged"},"sanitizer":{"type":"string","required":false,"enum":["asan","ubsan","tsan","msan"],"description":"Sanitizer to enable"},"verbosity":{"type":"string","required":false,"enum":["minimal","standard","verbose"],"default":"standard","description":"Level of debug output"}} |
| error_handling | {"retry_logic":{"max_attempts":3,"backoff":"exponential","initial_delay_ms":500,"max_delay_ms":8000,"jitter":true},"fallback":{"on_crash_not_reproducible":"enable_core_dumps","on_debugger_fail":"use_logging","on_sanitizer_overhead":"use_sampling","on_heisenbug":"add_instrumentation"},"validation":{"verify_debug_symbols":true,"check_optimization_level":true,"confirm_reproducibility":true}} |
Debugging Skill
Production-Grade Development Skill | C++ Debugging & Error Analysis
Master C++ debugging tools and systematic investigation techniques.
Debugging Workflow
┌─────────────┐ ┌──────────────┐ ┌───────────────┐
│ REPRODUCE │───▶│ ISOLATE │───▶│ INSTRUMENT │
│ (confirm) │ │ (minimize) │ │ (observe) │
└─────────────┘ └──────────────┘ └───────────────┘
│ │
▼ ▼
┌─────────────┐ ┌──────────────┐ ┌───────────────┐
│ VERIFY │◀───│ FIX │◀───│ ANALYZE │
│ (test) │ │ (correct) │ │ (root cause) │
└─────────────┘ └──────────────┘ └───────────────┘
GDB (GNU Debugger)
Essential Commands
g++ -g -O0 program.cpp -o program
gdb ./program
gdb ./program core.dump
# Execution Control
run [args] # Start program
continue (c) # Continue execution
next (n) # Step over
step (s) # Step into
finish # Run until current function returns
until <line> # Run until line
# Breakpoints
break main # Break at function
break file.cpp:42 # Break at line
break *0x400520 # Break at address
break func if x > 5 # Conditional breakpoint
delete <num> # Remove breakpoint
disable/enable <num> # Toggle breakpoint
# Inspection
print variable # Print value
print/x variable # Print in hex
display variable # Print at each stop
info locals # Show local variables
info args # Show function arguments
ptype variable # Show type
# Stack Navigation
backtrace (bt) # Show call stack
frame <n> # Select frame
up/down # Move in stack
# Memory
x/10xw 0x400520 # Examine 10 words in hex
watch variable # Break when variable changes
rwatch variable # Break when variable is read
# Advanced
catch throw # Break on exception
set variable x = 5 # Modify variable
call func(args) # Call function
GDB Scripts
# .gdbinit - Auto-loaded configuration
set history save on
set print pretty on
set print array on
set pagination off
# Custom command
define pv
print *$arg0@$arg1
end
# Usage: pv array 10
LLDB (macOS/Clang)
lldb ./program
lldb -p <pid>