This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author robind
Recipients amaury.forgeotdarc, eric.araujo, loewis, robind, tarek
Date 2010-11-29.19:53:06
SpamBayes Score 2.0650148e-14
Marked as misclassified No
Message-id <1291060389.72.0.783152432979.issue4214@psf.upfronthosting.co.za>
In-reply-to
Content
No, MSVC does not behave that way any longer.  Now it simply creates a file named "None", so I expect that the newer versions simply do not support writing the "old-style" debug info written to the DLL or EXE. If a setup script creates more than one extension module then they all overwrite that None file.

In order to get debug info in a useable form, distutils simply can not use /pdb:None.  By removing that option entirely then debug info is generated like normal into a *.pdb file and using the debugger to trace through the extension module's code will happily work correctly.

I've had to have this hack in wxPython's setup.py since Python 2.6 to work around this problem:


# Yet another distutils hack, this time for the msvc9compiler.  There
# is a bug in at least version distributed with Python 2.6 where it
# adds '/pdb:None' to the linker command-line, but that just results
# in a 'None' file being created instead of putting the debug info
# into the .pyd files as expected.  So we'll strip out that option via
# a monkey-patch of the msvc9compiler.MSVCCompiler.initialize method.

if os.name == 'nt' and  sys.version_info >= (2,6):
    import distutils.msvc9compiler
    _orig_initialize = distutils.msvc9compiler.MSVCCompiler.initialize

    def _initialize(self, *args, **kw):
        rv = _orig_initialize(self, *args, **kw)
        try:
            self.ldflags_shared_debug.remove('/pdb:None')
        except ValueError:
            pass
        return rv

    distutils.msvc9compiler.MSVCCompiler.initialize = _initialize
History
Date User Action Args
2010-11-29 19:53:09robindsetrecipients: + robind, loewis, amaury.forgeotdarc, tarek, eric.araujo
2010-11-29 19:53:09robindsetmessageid: <1291060389.72.0.783152432979.issue4214@psf.upfronthosting.co.za>
2010-11-29 19:53:06robindlinkissue4214 messages
2010-11-29 19:53:06robindcreate