Howto debug c++ (SWIG) extension under Windows

Miki Tebeka miki.tebeka at zoran.com
Tue Apr 26 13:48:52 EDT 2005


Hello Alexander,

> I can't figure out howto debug my c++ extension. If i compile it as 
> release version, I've of course no chance to set a breakpoint.
This is not true. You *can* set breakpoints in release mode, make sure to
add debug information to your release build so you'll be able to see the
sources.
There are several cases (such as inlined functions) that you *can't* set
breakpoint to.

> If I > compile as debug I get the Error-window:
> 
> ... missing MSVCR71D.dll ...
Just copy it (and msvcp71d.dll) from your c:\windows\system32 (or wherever
your windows is installed) to the "Debug" library (or to the Python install
library).

> 1) Is it possible to debug a C++ extension in that environment anyhow ?
Yes. See above.

> 2) How do I have to setup the development environment in that I can debug ?
Just as above again.

If you still can't stop try "forcing" breakpoints using
    __asm int 3
in your code. This way you can even run it out of MSDEV and you'll get a
message box when the "breakpoint" it hit. Just open the debugger on it.

HTH.
--
------------------------------------------------------------------------
Miki Tebeka <miki.tebeka at zoran.com>
http://tebeka.bizhat.com
The only difference between children and adults is the price of the toys

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 193 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20050426/b8aa2f90/attachment.sig>


More information about the Python-list mailing list