-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Poor debug info in optimized code #53036
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
Comments
I expect that's totally up to LLVM. GCC has had a few |
The way to check a specific case is to following the instructions here: https://rust-lang-nursery.github.io/rustc-guide/compiler-debugging.html#debugging-llvm. In particular what you want to do is compile a small test program, have it emit the LLVM IR (see the discussion of |
Bug #46698 is a specific case to still be investigated, FWIW. |
For what it's worth, Gecko's code when compiled with LLVM contains both a lot of C++ and a lot of Rust at this point, and the debug information we are getting from Rust code in optimized builds are a lot worse than the C++ ones. |
Triage: while this bug does contain one specific case, it's also very general. We have a bunch of bugs open related to debuginfo not being sufficient. I'm going to make a judgement call and give this one a close. Please file follow-up issues for specific things that can be improved, if issues aren't open already. Thanks! |
At the moment debugging optimized code is pretty tricky. Even with full debug info enabled, most/all of the locals and parameters are
<optimized out>
. (Linux + gdb)I believe that DWARF can include info to regenerate the logical value of a variable that has been removed by optimization. Is this something llvm needs to support, or rustc, or both?
In general how can this be improved?
cc @tromey @Mark-Simulacrum
The text was updated successfully, but these errors were encountered: