468,530 Members | 1,556 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,530 developers. It's quick & easy.

Howto debug c++ (SWIG) extension under Windows

Hi alltogether,

I use ActivePython 2.4.1 , also the debug part from
http://ftp.activestate.com/ActivePython/etc/ and VC 6.0 unter Windows XP.

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. If I
compile as debug I get the Error-window:

.... missing MSVCR71D.dll ...

when I try to start or debug my application. Now I've only ;-) two
questions:

1) Is it possible to debug a C++ extension in that environment anyhow ?
2) How do I have to setup the development environment in that I can debug ?

Thank you in advance for your ideas, links, help, hints or whatever ...

Regards
Alexander
Jul 19 '05 #1
4 3467
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 <mi*********@zoran.com>
http://tebeka.bizhat.com
The only difference between children and adults is the price of the toys
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (Cygwin)

iD8DBQFCbn8E8jAdENsUuJsRAl0qAJ43eLHGqA2LsFlDYgXgiz DMqTOLfACffrFx
6JF9XLfBMd3GEzuYEBBM8es=
=CXqj
-----END PGP SIGNATURE-----

Jul 19 '05 #2
Miki Tebeka schrieb:
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.


Don't work because of my MSVCR71D.dll problem. It seems, that if I
include DEBUG informations in my project, there is a reference to that
(debug) DLL.
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).


I don't have the dll MSVCR71D.dll on my system path. What I'm a bit
confused about is, that I can't even start python_d (installed by
ActiveState DEBUG extension to ActivePython). It requires also the DLL.

Does anybody know, where to get that DLL ?

Regards
Alexander
Jul 19 '05 #3
Miki Tebeka schrieb:
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.


Don't work because of my MSVCR71D.dll problem. It seems, that if I
include DEBUG informations in my project, there is a reference to that
(debug) DLL.
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).


I don't have the dll MSVCR71D.dll on my system path. What I'm a bit
confused about is, that I can't even start python_d (installed by
ActiveState DEBUG extension to ActivePython). It requires also the DLL.

Does anybody know, where to get that DLL ?

Regards
Alexander
Jul 19 '05 #4
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.


Don't work because of my MSVCR71D.dll problem. It seems, that if I
include DEBUG informations in my project, there is a reference to that
(debug) DLL.

But I'm talking about *release* build.
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).


I don't have the dll MSVCR71D.dll on my system path. What I'm a bit
confused about is, that I can't even start python_d (installed by
ActiveState DEBUG extension to ActivePython). It requires also the DLL.

Does anybody know, where to get that DLL ?

Try "download MSVCR71D.dll" in google.

Another option if to compile you extension in debug mode but to link it to
the "regular" Python. Just undef _DEBUG when compiling the SWIG output
file.

Bye.
--
------------------------------------------------------------------------
Miki Tebeka <mi*********@zoran.com>
http://tebeka.bizhat.com
The only difference between children and adults is the price of the toys

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (Cygwin)

iD8DBQFCb3R48jAdENsUuJsRArPJAKCm0YexI5eK9NosstLLBi OF5fDEaQCfV4jf
eXMBppfQJZywf02U7/SaFJI=
=eGTF
-----END PGP SIGNATURE-----

Jul 19 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

By using this site, you agree to our Privacy Policy and Terms of Use.