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.zip

Installs 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.
321 chars✓ has a “when” triggerlonger than Claude Code's old 250-char listing cap (fine on current versions)
Advanced

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

You give it
A BartonCore application or test that needs debugging
You get back
Diagnostic information, identified crash causes, or stepped-through code execution

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:

FlagShortDescription
--sbmd-dirs-bSemicolon-delimited SBMD spec directories
--noZigbee-zDisable Zigbee subsystem
--noThread-tDisable Thread subsystem
--noMatter-mDisable Matter subsystem
--novt100-1Disable interactive linenoise prompt
--storage-dir-dPersisted storage directory
--wifi-ssid-sWi-Fi SSID for commissioning
--wifi-password-pWi-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 -b pointing 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 .pyi stubs
  • Docker paths: Custom GI_TYPELIB_PATH and LD_LIBRARY_PATH are auto-configured in the dev container via docker/setupDockerEnv.sh

Error Recovery

If gdb is not found or reports missing debug symbols:

  1. Check if /.dockerenv exists
  2. If it does NOT exist, stop and tell the user: "gdb and debug symbols are not available. Please run inside the BartonCore development container."
  3. 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

BartonCore Docker development container with gdb, python3-gdb, and SYS_PTRACE capability

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.

SkillInstallsUpdatedSafetyDifficulty
debug (this skill)02moReviewAdvanced
benchmark-kernel16moReviewAdvanced
nsys-capture01moReviewAdvanced
debug-flydsl-kernel017dReviewAdvanced

Try saying

Example prompts that trigger this skill in your AI assistant.

Search skills

Search the agent skills registry