Best way of debigging a C extension

Paul Moore p.f.moore at gmail.com
Sat Dec 13 18:27:23 CET 2008


On 11 Dec, 23:57, Christian Heimes <li... at cheimes.de> wrote:
> Paul Moore schrieb:
> > 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. :)

Ah. That's the bit of information I was missing. If the ABI changes,
it's a wonder my hacking of my extension to build in debug mode worked
at all!

I suspect that if I could get distutils to let me specify that it
keeps debug symbols in a release-mode build, I could get what I
needed. But the arcane contortions needed to get distutils to do this
are beyond me :-)

I'll stick with printf - it's served me well enough so far :-)

Thanks for clarifying,
Paul.



More information about the Python-list mailing list