Steps for setting up debugger for basilisk in VS Code: #536
ephraim271
started this conversation in
General
Replies: 1 comment
-
Do you have any issues viewing variables in python models. If I break in init I can see all variables but breaking in UpdateState has been problematic for me if i create a model like this
I'm able to see this this issue by debugging |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Required VS Code Extensions:
C/C++ (by Microsoft)
Python (by Microsoft)
Python C++ Debugger (by BeniBenj)
Open the Debug menu (Ctrl-Shift-D) and choose the option to create a launch.json file.
Add following configuration for Python C++ Debug in the launch.json file.
Note : For windows, use default (win) Attach as the cppConfig.
Set a breakpoint anywhere in the python file before the C/C++ Module is called:
Now set breakpoints as required in the corresponding C/C++ file:
Choose “Python C++ Debug” in the debug menu.
Press F5/Play to start debugging.
Wait till the call stack for the Python file goes from Running -> Paused on Breakpoint. This step can sometimes take 1min+ for larger files.
Press F5/Play to continue. It may ask for superuser access when attaching the C/C++ debugger. If so, grant it. The C/C++ debugger is attached to Python’s process ID.
Once (gdb) Attach is paused on breakpoint, click that. It opens the C/C++ file where the breakpoint is currently held.
The C/C++ variable values can now be accessed from the variables tab, Debug Console (Ctrl-Shift-Y) or hovering over the variable names in the code editor.
Hope its useful!
Beta Was this translation helpful? Give feedback.
All reactions