Files
onepilot/docs/DEBUGGING_SAFETY.md
github-actions[bot] 7fa972be6a sunnypilot v2026.02.09-4080
version: sunnypilot v2025.003.000 (dev)
date: 2026-02-09T02:04:38
master commit: 254f55ac15a40343d7255f2f098de3442e0c4a6f
2026-02-09 02:04:38 +00:00

1.2 KiB

Debugging Panda Safety with Replay Drive + LLDB

1. Start the debugger in VS Code

  • Select Replay drive + Safety LLDB.
  • Enter the route or segment when prompted.

2. Attach LLDB

  • When prompted, pick the running replay_drive process.
  • ⚠️ Attach quickly, or replay_drive will start consuming messages.

Tip

Add a Python breakpoint at the start of replay_drive.py to pause execution and give yourself time to attach LLDB.

3. Set breakpoints in VS Code

Breakpoints can be set directly in modes/xxx.h (or any C file). No extra LLDB commands are required — just place breakpoints in the editor.

4. Resume execution

Once attached, you can step through both Python (on the replay) and C safety code as CAN logs are replayed.

Note

  • Use short routes for quicker iteration.
  • Pause replay_drive early to avoid wasting log messages.

Video

View a demo of this workflow on the PR that added it: https://github.com/commaai/openpilot/pull/36055#issue-3352911578