Best way of debigging a C extension

Christian Heimes lists at cheimes.de
Thu Dec 11 18:57:10 EST 2008


Paul Moore schrieb:
> The trouble is, I only have mingw to build extensions, not MSVC7.1 -
> so I can't build Python (and I don't know if I still have the toolkit
> compiler to build with that - I certainly don't have all the pieces
> installed). With Python 2.6, I guess things will be better as I have
> VS2008 Express, so I can use this to build a debug Python plus my
> extension. It's more work than I really want to do to go that way, but
> I guess it'll work.

Pyhon 2.5 doesn't support VS 2008. It has unofficial support for VS 2005
in the PCbuild8 directory. You can mail Martin von Löwis and ask him for
a debug build of Python 2.5.2. I don't have the tools on my build box.

> That's what I thought. I was just hoping that using a debug build of
> an extension would be usable with a standard release build of Python,
> as that's what will be easy for most people to set up.

A debug build changes large parts of the ABI. Every PyObject struct
gains additional fields, lots of checks are added to Python's memory
allocation system and asserts are enabled. Debug extensions have a _d
suffix for a very good reason. We aren't just trying to make *your* life
harder. :)

Christian




More information about the Python-list mailing list