473,548 Members | 2,744 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3674
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\syst em32 (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*********@zo ran.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)

iD8DBQFCbn8E8jA dENsUuJsRAl0qAJ 43eLHGqA2LsFlDY gXgizDMqTOLfACf frFx
6JF9XLfBMd3GEzu YEBBM8es=
=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\syst em32 (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\syst em32 (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\syst em32 (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*********@zo ran.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)

iD8DBQFCb3R48jA dENsUuJsRArPJAK Cm0YexI5eK9Noss tLLBiOF5fDEaQCf V4jf
eXMBppfQJZywf02 U7/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
3360
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 is going wonky. Now, the "proper" way to debug a DLL is apparently to build Python in debug mode (i.e. with the _d form dll), then build each and...
0
1065
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 runs on the current module.py file before swig
1
3135
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 that I needed to rename the DLL created to have a PYD extension. I also ended up writing a .def file for exporting functions from the DLL. Here is...
0
7518
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7444
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7711
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7954
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7467
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5367
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3497
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3478
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
755
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.