here are several ways to debug a DLL from Visual Studio. One can use Project
Properties/Debugging page to setup a "Command" to run on debug request. One
can use "Debug/Attach to Process" to load the DLL into a currently running
process. If Visual Studio fails to load the symbols (pdb files) then one can
use Debug/Modules window (right click on module name) to load symbols
manually.
On my computer, however, none of it works with VS2008 for pyd extensions
generated with boost::python. My modules window is blank for some reason even
though the Output window show multitude of modules being loaded. I could not
find a solution on the web so I stumbled on the following work-around.
Start python.exe directly. Do not start cmd.exe and then call python.exe. Do
not write bat-file and start the bat-file. Do it directly. Then load your
pyd-extension (possibly after navigating, possibly by using a script for it).
After pyd-extension is loaded into the python.exe process, switch to Visual
Studio IDE and do "Debug/Attach to process".
The simplest boost::python project (both ide and make file versions) may be
found at OTSProjects/tests/hello_ext (see the Download page).
Note that one cannot combine Cuda API and some boost libraries in the same
compiler scope. These have to be separated. An example of such separation is
the PiecewisePoly project presented in the following sections.
|