-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
debug info: resolve relative paths to source files into absolute paths #13843
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
This will make stack traces and debugging experience more consistent in the sense that the presence of source lines in stack traces will not be dependent on the current working directory of the running process.
Happy to accept a patch that avoids |
|
Do you mean |
yes, |
Thanks for clearing that up @semarie! |
Follow-up issue: #16571 |
This change brings back
stage1
behavior in that all debug info paths that are emitted in DWARF/PDB are always absolute. Note that the paths are resolved only when committing them into either a respective LLVM type (llvm.DIFile
), or when emitting DWARF (as is the case with self-hosted backends).This change will make stack traces and debugging experience more consistent in the sense that the presence of source lines in stack traces will not be dependent on the current working directory of the running process, making cases like #13831 non-existent (I am referring here to lack of source lines in submitted stack trace, not the actual linker bug which is unrelated).
Additional bonus is that we no longer need to mess with
lld-link
s output on Windows by including special PDB path manipulating flag,-PDBSOURCEPATH
as all source paths are now absolute by design.Finally, as generating valid debug info output is important but not critical, if a call to
std.os.realpath
fails for whatever reason, we simply fallback to relative paths readily available.If we merge this, this patch will obsolete #13540
cc @Vexu