-
Notifications
You must be signed in to change notification settings - Fork 13.3k
GDB pretty printer error when compiled with -Copt-level=1 #41970
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
With a more recent gdb I get a different error:
At least for me the location expressions look reasonable:
Offhand I'm not sure where the synthetic pointer might come into play. It would be useful to see the location expressions from your compilation. That can help clarify whether it's a compiler bug (in your case, seemingly not in mine) or a gdb bug. |
gdb patch here: https://sourceware.org/ml/gdb-patches/2017-05/msg00603.html |
This Rust bug report: rust-lang/rust#41970 noted an error from gdb. What is happening here (for me, the original report had a different error) is that a pieced DWARF expression is not writing to every byte in the resulting value. GDB errors in this case. However, it seems to me that it is always valid to write fewer bytes; the issue comes from writing too many -- that is, the test is reversed. The test was also checking the sub-object, but this also seems incorrect, as it's expected for the expression to write the entirety of the enclosing object. So, this patch reverses the test and applies it to the outer type, not the subobject type. Regtested on the buildbot. gdb/ChangeLog 2017-07-09 Tom Tromey <[email protected]> * dwarf2loc.c (dwarf2_evaluate_loc_desc_full): Reverse size check and apply to outer type. gdb/testsuite/ChangeLog 2017-07-09 Tom Tromey <[email protected]> * gdb.dwarf2/shortpiece.exp: New file.
I've checked in the gdb patch. I think this bug can probably be closed now. |
When debugging the code from #41888 I noticed that this
when compiled with
rustc test.rs -g -Copt-level=1
and run under gdb:Works fine in lldb, works fine without optimisation.
The text was updated successfully, but these errors were encountered: