has anyone successfully attached msvc6 debugger to mapserv.exe?

Brent Fraser bfraser at GEOANALYTIC.COM
Wed Nov 15 11:34:49 EST 2006


Robert,

There are several ways to debug Mapserver:

1.  Use mapserver's DEBUG map file keyword (I can solve 10% of my problems
this way)

2.  Debug shp2img.exe instead of mapserv.exe (if your problems are data
related) (good for 70% of problems).

3.  Debug mapserv.exe without a webserver by simply putting the query_string
portion of your web URL on the command line (you can do this within msvc++6
too):
            mapserv QUERY_STRING="mapfile=..."
(good for another 15%)

4. And when none of the above will catch the problem (the last 5%)
    - set up IIS on your development machine,
    - insert a DebugBreak(); in mapserv.c's main() (you'll need to add
#include <windows.h>)
    - 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.

Brent Fraser
GeoAnalytic Inc
Calgary, Alberta, Canada

> << I tried to send similar message yesterday, but I
> can't post successfully from the interface inside
> listserv >>
>
> I build mapserver-4.8.3 using modified
> nmake.opt/makefile.vc under msvc++6 on XP/Pro.  Using
> DEBUG option.  But haven't created msvc
> workspace/project files, of course.  Can run under IIS
> or apache if one is easier to debug over the other.
> Precious little detail in msvc help for attaching
> debugger to running process; no pids appear in the
> table when I bring up Attach-To-Process.
>
> If anyone has any pointers on doing this, would be
> great.
>
> Thanks,
> REH



More information about the mapserver-dev mailing list