473,387 Members | 1,495 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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 3662
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Mike C. Fletcher | last post by:
Every few months I get to working on a Python C extension (built with distutils) and discover a pointer error or the like where I'd like to be able to step into my DLL and see where the extension...
0
by: timothy.williams | last post by:
Hi all. How do I tell distutils to run build_ext before build_py when I try to do a 'python setup.py build' ? I have a C extension using SWIG, and when I build with setup.py, build_py...
1
by: myheartinamerica | last post by:
Hello, I spent the morning figuring out how to use SWIG on Microsoft Windows. I compiled the example from the SWIG tutorial on http://www.swig.org. The biggest stumbling block was not knowing...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.