Debugging workflows for BartonCore, covering C++ reference apps and Python integration tests.
Install
mkdir -p .claude/skills/debug-rdkcentral && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/18731" && unzip -o skill.zip -d .claude/skills/debug-rdkcentral && rm skill.zipInstalls to .claude/skills/debug-rdkcentral
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Debug BartonCore applications and tests. Use when the user needs to set breakpoints, step through code, inspect state, or diagnose crashes. Covers three workflows — gdb for the C/C++ reference app and unit tests, pdb/debugpy for Python integration tests, and gdb-with-Python for debugging C code called from Python tests.Key capabilities
- →Debug C/C++ applications with GDB
- →Debug Python integration tests with PDB/debugpy
- →Debug C code called from Python tests using GDB + Python
- →Set breakpoints and step through code
- →Inspect state and diagnose crashes
How it works
The skill provides three distinct debugging workflows: GDB for C/C++ applications, PDB/debugpy for Python tests, and a combined GDB + Python approach for C code invoked from Python.
Inputs & outputs
When to use debug
- →Debug C++ application crashes
- →Inspect Python test state
- →Set breakpoints in source
- →Diagnose service failures
About this skill
Debug
Three debugging workflows depending on where the problem is.
1. GDB — Reference App and Unit Tests
Reference App
The binary is at build/reference/barton-core-reference.
gdb --args build/reference/barton-core-reference -b "core/deviceDrivers/matter/sbmd/specs"
CLI flags:
| Flag | Short | Description |
|---|---|---|
--sbmd-dirs | -b | Semicolon-delimited SBMD spec directories |
--noZigbee | -z | Disable Zigbee subsystem |
--noThread | -t | Disable Thread subsystem |
--noMatter | -m | Disable Matter subsystem |
--novt100 | -1 | Disable interactive linenoise prompt |
--storage-dir | -d | Persisted storage directory |
--wifi-ssid | -s | Wi-Fi SSID for commissioning |
--wifi-password | -p | Wi-Fi password for commissioning |
Common combinations:
# No Zigbee or Thread (Matter only)
gdb --args build/reference/barton-core-reference -b "core/deviceDrivers/matter/sbmd/specs" -z -t
# No Matter or Thread (Zigbee only)
gdb --args build/reference/barton-core-reference -m -t
Unit Tests
Debug a specific unit test with gdb:
gdb --args build/core/test/<test-binary>
In VS Code, use the Testing panel's debug button or the CMake panel's debug icon on a specific test target.
VS Code Launch Configs
Pre-configured launch configs in .vscode/launch.json:
- (gdb) Reference App — launches with
-bpointing to SBMD specs - (gdb) Reference App No Zigbee — adds
-z - (gdb) Reference App No Thread — adds
-t - (gdb) CMake Target — debug any CMake build target
- (gdb) CMake Test — debug a specific CTest test
All gdb configs enable pretty-printing.
2. PDB / debugpy — Python Integration Tests
For pure Python debugging of integration tests:
# Insert in test code
breakpoint()
Then run with output capture disabled:
./testing/py_test.sh -s --no-header testing/test/<test_file>.py
The -s flag is required for breakpoint() to work (disables output capture). --no-header keeps pytest's session header output minimal while stepping in the debugger.
In VS Code, use the Testing panel's debug button or gutter debug icons on test functions. The Python Debugger: Current File launch config works for non-pytest Python files.
Limitation: The Python debugger can only step through Python code. To debug into BartonCore C/C++ code called from Python, use workflow 3 below.
3. GDB + Python — C Code Called from Python Tests
When you need to set breakpoints in C/C++ code that is invoked from Python integration tests:
gdb python3
At the gdb prompt:
# If ASAN is enabled in the build (default for dev builds):
set env LD_PRELOAD /path/to/libasan.so
# Find the ASAN path:
# shell gcc -print-file-name=libasan.so
# Set breakpoints in C code (symbols load after first run):
break deviceServiceStart
# For additional breakpoints, use a real symbol from the current target:
# info functions deviceService
# info functions Matter
break 'Matter::Init'
# Run the test:
run -m pytest testing/test/<test_file>.py
After the first run, C symbols become available for tab-completion. Set breakpoints and re-run as needed.
Prerequisites
- Build first: The project must be built before debugging (
cmake --build build) - Install step for integration tests: Run the CMake install task before debugging integration tests — it installs the shared library, GIR/typelib, and
.pyistubs - Docker paths: Custom
GI_TYPELIB_PATHandLD_LIBRARY_PATHare auto-configured in the dev container viadocker/setupDockerEnv.sh
Error Recovery
If gdb is not found or reports missing debug symbols:
- Check if
/.dockerenvexists - If it does NOT exist, stop and tell the user: "gdb and debug symbols are not available. Please run inside the BartonCore development container."
- If it does exist, ensure the build was done with debug symbols (
CMAKE_BUILD_TYPE=Debug, which is the default dev profile)
When not to use it
- →When `gdb` is not found
- →When debug symbols are missing
- →When not running inside the BartonCore development container
Prerequisites
Limitations
- →Requires the BartonCore Docker development container
- →Requires `gdb` to be found
- →Requires debug symbols to be present
How it compares
This skill offers specialized debugging workflows tailored for BartonCore's mixed C/C++ and Python codebase within a Docker container, unlike generic debugging tools.
Compared to similar skills
debug side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| debug (this skill) | 0 | 2mo | Review | Advanced |
| benchmark-kernel | 1 | 6mo | Review | Advanced |
| nsys-capture | 0 | 1mo | Review | Advanced |
| debug-flydsl-kernel | 0 | 17d | Review | Advanced |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by rdkcentral
View all by rdkcentral →You might also like
benchmark-kernel
flashinfer-ai
Guide for benchmarking FlashInfer kernels with CUPTI timing
nsys-capture
gujialiang123
Wrap an arbitrary action (a bench run, a single curl, an N-second sleep) with `nsys profile`, then immediately export the .nsys-rep to SQLite so downstream skills can SQL-query it without reopening the binary trace.
debug-flydsl-kernel
ROCm
>
python-error-handling
wshobson
Python error handling patterns including input validation, exception hierarchies, and partial failure handling. Use when implementing validation logic, designing exception strategies, handling batch processing failures, or building robust APIs.
debugging-streamlit
streamlit
Debug Streamlit frontend and backend changes using make debug with hot-reload. Use when testing code changes, investigating bugs, checking UI behavior, or needing screenshots of the running app.
constant-time-analysis
trailofbits
Detects timing side-channel vulnerabilities in cryptographic code. Use when implementing or reviewing crypto code, encountering division on secrets, secret-dependent branches, or constant-time programming questions in C, C++, Go, Rust, Swift, Java, Kotlin, C#, PHP, JavaScript, TypeScript, Python, or Ruby.