Debugging extensions under VS .NET 2003

Michael Geary Mike at DeleteThis.Geary.com
Fri Apr 9 13:28:00 EDT 2004


Gus Tabares wrote:
> If you want to be able to debug your extensions, you will
> [need] to build a debug version of the Python interpreter.

I'm very curious about this: Can anyone explain why it is necessary? (And is
it *really* necessary?)

It's a very unusual requirement. In ordinary Windows coding, one DLL is
independent from another. You can mix and match debug and nondebug DLLs with
no problem.

For example, suppose you are developing an Adobe Acrobat plug-in. You don't
have a debug version of Acrobat nor debug versions of the other plug-ins and
DLLs that Acrobat uses. But that doesn't matter. You can still build a debug
version of your own plug-in.

For that matter, consider any ordinary Windows application or DLL. You don't
have debug versions of the numerous standard Windows DLLs that will be
loaded alongside your code. But that has no effect on whether you can debug
your own code or not.

So what's going on with Python that it would require a debug version of
pythonxx.dll in order to debug your own extension DLL?

Obviously, if you want to trace through the pythonxx.dll code, you'd want a
debug version of that code. Is that the reason?

Other than that, the only possible reason would be if there are #if's in the
Python headers that compile different and incompatible data structures or
APIs depending on whether DEBUG is defined. If that is the problem, you
could easily work around it by building a *release* version of your DLL, and
in your project settings turn off optimization and turn on symbols.

-Mike





More information about the Python-list mailing list