This is an archive of the discontinued LLVM Phabricator instance.

[AsmPrinter] Allow emitting codeview for any windows target
ClosedPublic

Authored by mstorsjo on May 1 2018, 12:12 AM.

Details

Summary

Before SVN r244158, codeview debug info was emitted always emitted for msvc if debug info was enabled, but that commit added a module flag.

Since it's still restricted by the flag, we can allow it for any target if the user requests it, not only msvc (and windows-itanium, added in SVN r287567).

Add a test for emitting it for a mingw target.

Diff Detail

Event Timeline

mstorsjo created this revision.May 1 2018, 12:12 AM

Tests with this with a mingw target look like it's working fine, but on x86_64, the VS debugger can't traverse the call stack if using dwarf for exception handling; that requires using SEH. (On i386, the debugger doesn't seem to rely on any specific exception handling mechanism.)

mstorsjo updated this revision to Diff 144728.May 1 2018, 8:17 AM

Actually check for windows instead of allowing any os

rnk accepted this revision.May 8 2018, 11:16 AM

lgtm

One thing that users will need to look out is that Microsoft debuggers make assumptions about how the C++ ABI works. If you debug classes with interesting virtual adjustments, you probably won't see the right data members. At some point, it might be good to write a holistic document about Clang's Windows support, detailing which features are available in mingw vs msvc environments. Maybe we already have one that I forgot about.

This revision is now accepted and ready to land.May 8 2018, 11:16 AM
In D46303#1091664, @rnk wrote:

lgtm

One thing that users will need to look out is that Microsoft debuggers make assumptions about how the C++ ABI works. If you debug classes with interesting virtual adjustments, you probably won't see the right data members. At some point, it might be good to write a holistic document about Clang's Windows support, detailing which features are available in mingw vs msvc environments. Maybe we already have one that I forgot about.

Thanks for letting me know about that! Another detail I noticed so far, is that the debugger requires SEH in order to traverse the call stack on x86_64 (and I normally build with dwarf for exceptions, and one can*t have both enabled at the same time), but on i386 it doesn't matter what I use.

This revision was automatically updated to reflect the committed changes.