473,594 Members | 2,651 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

distutil and debugging

Hi,

I have a C-extention build with distutils that I would like to debug.

How can I specify to distuils to pass option "-g" and not "-O2" along to
the compiler (gcc)?

Jesper
Jul 18 '05 #1
4 2273
Jesper Olsen wrote:
Hi,

I have a C-extention build with distutils that I would like to debug.

How can I specify to distuils to pass option "-g" and not "-O2" along to
the compiler (gcc)?


python setup.py build --debug

-- Gerhard

Jul 18 '05 #2
Gerhard Häring <gh@ghaering.de > wrote in message news:<ma******* *************** *************** *@python.org>.. .
Jesper Olsen wrote:
Hi,

I have a C-extention build with distutils that I would like to debug.

How can I specify to distuils to pass option "-g" and not "-O2" along to
the compiler (gcc)?


python setup.py build --debug

-- Gerhard


No - that does not change the options. I think it only links against a version
of the python lib, which has been compiled for debugging.

However, I want to debug my own extention - not the python interpretor.

I'm not the first to have this problem:

http://tinyurl.com/35ddd

but that solution only works for the windows environment.
I'm on OpenBSD, and would prefer to stay there also while debugging...

Thanks
Jesper
Jul 18 '05 #3
Jesper Olsen wrote:
[...] No - that does not change the options. I think it only links against a version
of the python lib, which has been compiled for debugging.

However, I want to debug my own extention - not the python interpretor.

I'm not the first to have this problem:

http://tinyurl.com/35ddd

but that solution only works for the windows environment.
I'm on OpenBSD, and would prefer to stay there also while debugging...


I don't think that's relevant here. To be honest, I didn't need to add
any flags on Linux to debug my extensions. -g always gets added there
automatically.

Perhaps this comment from distutils/unixcompiler.py will help you fixing
your build environment:

# * optimization/debug/warning flags; we just use whatever's in Python's
# Makefile and live with it. Is this adequate? If not, we might
# have to have a bunch of subclasses GNUCCompiler, SGICCompiler,
# SunCCompiler, and I suspect down that road lies madness.

Maybe your OpenBSD Python was compiled without -g and thus your
extensions are compiled without -g as well.

-- Gerhard

Jul 18 '05 #4
Gerhard Häring <gh@ghaering.de > wrote in message news:<ma******* *************** *************** *@python.org>.. .
Jesper Olsen wrote:
[...] No - that does not change the options. I think it only links against a version
of the python lib, which has been compiled for debugging.

However, I want to debug my own extention - not the python interpretor.

I'm not the first to have this problem:

http://tinyurl.com/35ddd

but that solution only works for the windows environment.
I'm on OpenBSD, and would prefer to stay there also while debugging...


I don't think that's relevant here. To be honest, I didn't need to add
any flags on Linux to debug my extensions. -g always gets added there
automatically.

Perhaps this comment from distutils/unixcompiler.py will help you fixing
your build environment:

# * optimization/debug/warning flags; we just use whatever's in Python's
# Makefile and live with it. Is this adequate? If not, we might
# have to have a bunch of subclasses GNUCCompiler, SGICCompiler,
# SunCCompiler, and I suspect down that road lies madness.

Maybe your OpenBSD Python was compiled without -g and thus your
extensions are compiled without -g as well.

-- Gerhard


Thanks Gerhard.

I think you are right - it simply grabs the options that were used for
compiling the interpreter. So recompiling the interpreter would
probably solve the problem.

I thought I remembered that it was possible to specify your own
options in the setup.py script - but I can't find it in the online
manual, so maybe it is just
Alzheimer.

The easiest in this situation is probably to not use distutils, and
simply write a normal makefile for creating that .so library.
It is not hard to do, but I wish distutils could autogenerate it, and
let
me edit it.
Most of the time distutils does a good job, and this would only be a
small
addition given what it does now.

/Jesper
Jul 18 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1656
by: Holger Joukl | last post by:
Hi, what version of python are you using? I got the same error when invoking a customized, 2-year-old version of distutils with python 2.3.3 (instead of 1.5.2, as before). Reason is code in dist.py, using dir() to look up the attributes of a class instance. But dir() nowadays also returns the class methods, __doc__ etc. Changing this in the old distutils/dist.py made it work for me, again (line
0
3220
by: ZMan | last post by:
Scenario: This is about debugging server side scripts that make calls to middle-tier business DLLs. The server side scripts are legacy ASP 3.0 pages, and the DLLs are managed DLLs converted/developed with VB.NET. What I want from debugging is to be able to step into the methods in the DLLs called from ASP scripts using Visual Studio .NET. Background: For typical script debugging issues, you can read and follow the two documents on...
16
4194
by: Serdar Kalaycý | last post by:
Hi everybody, My problem seems a bit clichè but I could not work around. Well I read lots of MSDN papers and discussions, but my problem is a bit different from them. When I tried to run the project in debug mode (by hitting F5) it gives an error message "Error while trying to run project: Unable to start debugging on the web server.
2
1843
by: Andy Fish | last post by:
Hi, Using VS.NET 2003, when I use 'F5' to start debugging my web app, it obviously attaches the IDE to IIS for server debugging. However, it also seems to put IE into some kind of debugging mode (for javascript debugging) This causes IE to consume loads of CPU if the page is very large. Is there any way to have debugging of server side code but leave IE in "normal" mode?
5
2938
by: Velvet | last post by:
Can someone tell me to what process I need to attach to be able to step through my classic ASP code in VS.net 2003. I'm working on an XP box with IIS installed. I also have VS.net 2005 (The final, never installed beta) installed on this box if it makes a difference (I did not install VS Development Web Server as I'm already using the XP web server). I've seen that I need to attach to the native IIS engine, but I don't know what it's...
5
7789
by: phnimx | last post by:
Hi , We have developed a number of plug-in .NET Library Components that we typically deploy with our various applications by installing them into the GAC. Each of the applications contains an app.config file referencing arbitrary versions of the plug-in components they wish to consume. Here's the problem: Assuming I have installed any one of our application software,
0
1177
by: =?GB2312?B?zPC5zw==?= | last post by:
Howdy, This problem have puzzled me for a long time. I usually use python2.5 in Windows, while VC2005 is installed. However python25.lib is compiled by VC2003. When I use disutil to build some C extensions, it complaints that there is no VC2003. Well, IMO, the format of binary files generated by VC2003 and VC2005 is compatible in most cases. What should I do to workaround this error? I mean, disable distutil complaints and use VC2005 to...
1
159
by: =?GB2312?B?zPC5zw==?= | last post by:
The problem is not compiler, but runtime. For example, if python is Thank you for providing this document. Indeed, passing internal pointers of one CRT lib to another is dangerous. But in most cases, the python extension only focus on computational-intensive jobs rather than API-intensive jobs. Therefore it is safe to let VS2003-built python to call VS2005-built extensions with some attentions. When you use distutil to trigger...
4
12685
by: =?Utf-8?B?TWlrZSBHYWxl?= | last post by:
VS 2008 initially didn't debug classic ASP. SP1 fixes this in some ways. You can debug if you select the debug option to "Start Without Debugging, then either attach the debugger manually or place a stop directive in the code which ends up doing the same thing. The problem with this is that you can't debug browser side Javascript in the same debug run. You get a "The breakpoint will not currently be hit. The document is not loaded." if...
0
7937
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7874
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8368
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7997
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
8230
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6647
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5403
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3893
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2383
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.