[gdal-dev] Building debug Python bindings (e.g. _gdal.pyd) with MS Visual Studio

Howard Butler hobu.inc at gmail.com
Sat Jul 17 12:14:52 EDT 2010


On Jul 17, 2010, at 10:45 AM, Jason Roberts wrote:

> This is probably a question for Tamas Szekeres and Howard Butler, but I’m emailing the whole list in case others are knowledgeable or interested.
>  
> As part of trying to figure out http://trac.osgeo.org/gdal/ticket/3672, I would like to step through GDAL’s SWIG-generated Python bindings in the Visual Studio debugger. I downloaded release-1310-dev.zip, started a VS 2003 command line, and ran this:
>  
> C:\gdal_release-1310-dev> nmake gdal gdal-python DEBUG=YES
>  
> I noticed that .pdb files were generated for all of the apps such as ogr2ogr.exe. I noticed that gdal17.dll is now 9 MB rather than 6 MB, suggesting that it includes debug symbols internally. But the Python bindings such as _gdal.pyd _gdal_array.pyd are the same size as the release build and I could not find any .pdb files. I have not tried the debugger yet but I’m guessing it will not find any symbols.
>  
> Am I correct? If so, could you please advise me on how to build the Python bindings with debug symbols? Any other hints for stepping through the GDAL Python bindings or GDAL library code with Visual Studio?
>  
> Thanks for your help,

You need to build a *Python* with debug symbols as well, and then distutils/setuptools from that debug Python build will build a debug extension.  Otherwise, I think you have to hack distutils/setuptools to override and insert debug symbols, but it's been years since I've fooled with this stuff.  Searching for information about debugging windows python c extensions might get you some general help.  

Sorry I don't know more,

Howard



More information about the gdal-dev mailing list