How to debug pyd File in Vs???

Neil Hodgson nhodgson at iinet.net.au
Fri Jan 25 13:01:09 CET 2013


Junze Liu:

>      Third, use the embed interpreter to execute a .py File.The .py File include the module that in .pyd File I created.
>      Here, the problem comes out! When I start my main project. I can only debug the problems in my main project, when my main project use the python interpreter to execute the python interpreter, I can't see what happened in my pyd File, the whole project collapsed.I know the error is in the pyd File, and if I set a break point in my resource files of pyd File, either the project will go to the break point.

    This normally works unless Visual Studio can't understand the 
relationship between the .pyd and source files. Make sure you have built 
the .pyd using a release configuration but with debugging information 
turned on for both compiling and linking.

    Or use a debug build of python along with a debug build of the .pyd.

>     Is there any methods to debug the resource file in this condition!

    You can call DebugBreak() somewhere in the .pyd code which will 
start up Visual Studio as a debugger. It normally works out where the 
source code is and then you can add more breakpoints and step through.

http://msdn.microsoft.com/en-us/library/windows/desktop/ms679297(v=vs.85).aspx

    Neil



More information about the Python-list mailing list