openpilot is an open source driver assistance system. openpilot performs the functions of Automated Lane Centering and Adaptive Cruise Control for over 200 supported car makes and models.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
1.0 KiB

# Debugging Panda Safety with Replay Drive + LLDB
## Debugging Workflow
2 weeks ago
1. **Start the debugger in VS Code**
* Select **Replay drive + Safety LLDB**.
* Enter the route or segment when prompted.
2 weeks ago
2. **Attach LLDB**
* When prompted, pick the running **`replay_drive` process**.
* Attach quickly, or `replay_drive` will start consuming messages.
2 weeks ago
> [!TIP]
2 weeks ago
> Add a Python breakpoint at the start of `replay_drive.py` to pause execution and give yourself time to attach LLDB.
2 weeks ago
3. **Set breakpoints in VS Code**
Breakpoints can be set directly in `libsafety.c` (or any C file).
No extra LLDB commands are required — just place breakpoints in the editor.
2 weeks ago
4. **Resume execution**
Once attached, you can step through both Python and C safety code as CAN logs are replayed.
2 weeks ago
> [!NOTE]
> * Use short routes for quicker iteration.
> * Pause `replay_drive` early to avoid wasting log messages.
2 weeks ago
## Video
View a demo of this workflow on the PR that added it: https://github.com/commaai/openpilot/pull/36055#issue-3352911578