In Linux, I am trying to debug the C++ code of a shared library which is loaded from Python code. The loading is done using the ctypes package. In Eclipse, I set breakpoints both in the Python and in the C++ code, however Eclipse just skips the breakpoints in the C++ code (breakpoints in the Python code work OK).
I have tried using attach to application in Eclipse (under Debug Configurations) and choosing the Python process, but it didn't change anything. In the attach to application dialog box I choose the shared library as the Project, and I choose /usr/bin/python2.6 as the C/C++ application. Is that the correct way?
I've tried it both before running the python code, and after a breakpoint in the Python code was caught, just before the line calling a function of the shared library.
EDIT
Meanwhile I am using a workaround of calling the python code and debugging using a gdb command-line session by attaching to the python process. But I would like to hear a solution to doing this from within Eclipse.
I have been able to debug the c++ shared library loaded by the python in Eclipse successfully.
The prerequisites: Two eclipse projects in an eclipse workspace: one is the C++ project, from which the c++ shared library is generated, the other is the python project (PyDev), which loads the generated c++ shared library.
The steps are:
I tested the above procedure with Eclipse Mars version.
Hopefully it helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With