-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[debuginfo][codeview] avoid using line zero artificial location for t… #72534
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@swift-ci please test |
@swift-ci please test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Long-term, I wonder if we should investigate whether we couldn't produce both CodeView and DWARF at the same time, so users of WinDbg see something, while users of LLDB get the full experience.
lib/IRGen/IRGenDebugInfo.cpp
Outdated
: 0, | ||
Opts.DebugInfoFormat == IRGenDebugInfoFormat::CodeView ? TrapLoc.getCol() | ||
: 0, | ||
TrapSP, TrapLoc); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will likely result in larger debug info, since the abstract origin of the inlined function can no longer be uniqued but that's the kind of tradeoff you'll need to make.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, I agree. I think the win in crash investigation is worth it here.
…raps when emitting codeview This fixes an issue where the debug locations for Swift traps were dropped in the produced PDB files, as they were pointing to line 0 I validated this on a sample project using WinDbgx, which can now correctly trap on the same line in multiple places
What specifically are you thinking of? making the frontend emit IR that's compatible with both DWARF and CodeView, and then lowering it to something that emits both DWARF and CodeView files in LLVM? |
@swift-ci please test |
Yes something along those lines. Of course we'd then need to make the kinds of decisions done in this patch in the backend instead. |
…raps when emitting codeview
This fixes an issue where the debug locations for Swift traps were dropped in the produced PDB files, as they were pointing to line 0
I validated this on a sample project using WinDbgx, which can now correctly trap on the same line in multiple places.
Before:

After:
