Reputation: 11
I have a c project for an embedded device. I want to call parts of this code from CFFI for testing and developement purposes.
Compiling and running the CFFI on its own works great. I get get attaching the visual studio debugger to the python.exe to work for debugging the c files.
I am on windows 10 using visual studio 2022 and visual studio build tools 2022.
These are the steps I took:
I compile the cffi library with extra_compile_args = ['/Zi', '/Od', '/DEBUG'], extra_link_args = ['/DEBUG']
I told visual studio code where to find the .pdb file by adding its path to Tools>Debugging>Symbols
.
I start the python code, making it tell me its process-id and pausing it.
I attach visual studio code to this process.
I add breakpoints in the code where i want them.
At this points these breakpoints have a small warning sign, telling me:
This breakpoint will currently not be hit. No symbols have been loaded for this document
I noticed compiling the cffi also creates a Release
folder, with several .obj
, .exp
and .lib
files. Am I missing some linking here?
Note, my code is located in different locations, so i dont know if this is causing issues for visual studio code to find stuff:
python-project/
│
├── src/
│ └── cffi/
│ ├── cffi_compile
│ └── cffi_run
│
├── src-cffi/
│ └── foo.c
│
└── Release/
└── ... # this is generated by cffi, contains .obj, .exp, .lib
c-project/
├── bar.c
└── bar.h
Upvotes: 1
Views: 43