Python sample for remote debugging¶
This sample shows how remote debugging can be done with Python.
If you use a ctrlX COREvirtual enable port forwarding of your remote debug port e.g. for port 15678
Remote debugging is enabled with by the package debugpy
The script debug.py provides the function debug.remote_debugging_wait_for_client() were debugpy is used.
In main.py debug.remote_debugging_wait_for_client() is called.
Installed on a ctrlX CORE the service stops executing and waits until a remote debug client will attach.
Feel free to use the script debug.py in your own projects.
Build snap and install and start it¶
For this job we recommend to use our shell script, here for a ctrlX ctrlX COREvirtual with port forwarding
and here with network adapter
For a bare metal ctrlX CORE you are able to provide all settings via command line, call this for help:
When build and installation succeeded the snap is started as a service waiting for a remote debug client to connect. This print out should be shown e.g.:
__Accepting remote debug client attaches to port 15678__
In Visual Studio Code you can use menu item Terminal - Run Build Task... - Build upload snap ...
Start debugging wih Visual Studio Code¶
The file .vscode/launch.json contains launch configurations for remote debugging.
We assume to debug the snap on a ctrlX ctrlX COREvirtual with port forwarding click the launch icon on the side bar and select configuration 'Remote ctrlX COREvirtual - Port forwarding'.
The debugging client of Visual Studio Code will connect to the waiting server and debugging will start.
SPDX-FileCopyrightText: Bosch Rexroth AG SPDX-License-Identifier: MIT