[Python-3000] Windows: debug mode

Christian Heimes lists at cheimes.de
Sun Feb 17 23:11:24 CET 2008


Giovanni Bajo wrote:
> Yes, I know it changes the ABI, and I know it must say as it is. I 
> believe that Py_DEBUG is mostly useful to core developers and not much to 
> extension developer or regular Python developers, but it's immaterial in 
> this discussion.

Py_DEBUG builds are useful to extension developers, too. It's the best
way to debug reference leaks. You'll need at least a Py_REF_DEBUG build
for the task.

> Yes, this is what I do everyday by manually hand-edit my setup.py script. 
> Is there a way to make distutils do this for me with a simple command-
> line switch?

Yes - provide a patch :)

> 2) Add the same compilation mode to Python itself, so that users can 
> easily compile a Python DLL which has debug symbols but with the release 
> ABI (since stepping into the Python's core can be useful while debugging 
> an extension).

The Windows build files were carefully design for the job. I've invested
quite some time to build a project inheritance tree. All projects
inherit settings from pyproject.vsprops. In order to build a release
version of Python with less optimization and debug symbols you've to
alter the global properties for Release|Win32 and recompile the project.

Christian



More information about the Python-3000 mailing list