[Gdal-dev] Debugging in Visual C++ with nmake build

bfraser at geoanalytic.com bfraser at geoanalytic.com
Tue Aug 9 21:11:24 EDT 2005


Dan,

  A trick I've used is to insert a
     DebugBreak();
statement in the C main I want to debug and compile gdal for debug using
nmake -f makefile.vc.  When you run the app, a dialog will popup asking if
you want to abort the application (or No to debug it).  If you answer No,
the VC++ IDE will be invoked, showing the assembler code.  Click the
"Single Step" icon twice in the IDE to advance to the source code, and
dismiss the assembler window.  You can then step thru the source.

Oh yeah, to be able to compile with the DebugBreak(); you need to do
#include <windows.h>

Sounds kinda complicated, but it's not too bad once you try it.  It's also
a handy way of debugging a CGI app like Mapserver...

Brent Fraser



> Is this even possible?  I'm getting tired of maintaining a separate gdal
> project to make the makefile.vc for the entire gdal tree.  Any visual c++
> experts? I'm using 6.0
>
> -- dan greve
> -- melbourne fl





More information about the Gdal-dev mailing list