-
Notifications
You must be signed in to change notification settings - Fork 13.3k
gdb pretty-printers not working for struct fields with gdb 10.x #85267
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 tried this with a fresh ubuntu 20.04 VM, (gdb 9.2) and it's working there:
Ubuntu 20.10 (gdb 9.2) works as well. With a fresh Ubuntu 21.04 VM (gdb 10.1), the problem occurs. So it seems possible this is related to the gdb version. |
gdb 10.2 is broken as well, but the problem goes away on a manual downgrade to gdb 9.2. So this is pretty clearly an issue with gdb 10+. |
I bisected through gdb's history and found that this is the offending commit: |
I've posted a question on this subject to the gdb mailing list; I'll update back here with any progress. |
Confirmed that this is a bug in gdb. |
I fixed it for gdb 11. There most likely won't be another release of gdb 10. https://sourceware.org/pipermail/gdb-patches/2021-May/178895.html |
We're working up to the gdb 12 release now. Given that this isn't a bug in rust, and because gdb 11 fixes the problem, I'm going to close this bug. |
Hi! I'm trying to get pretty printing to work smoothly for rust in gdb. For a long time I was pretty sure nothing was working at all, but after liberal amounts of print(...) debugging in the associated python scripts, it appears that the pretty printing only kicks in when directly printing out one of the special structs, and not when they appear as members of something else.
For example, if I have a Vec and print that directly from gdb, I see the result of the pretty printers. But if I have a struct TrivialNewtype(Vec) and try to print that from gdb, I see all the guts of the Vec (the pretty printer is not active).
I made a small repro: https://github.com/mullr/gdb-pretty-test
For convenience, the code is:
I am building and debugging like this:
I expected that when I print
newtype_vec
, the pretty printer for Vec would be used in a nested way.Instead, this was printed:
Meta
rustc --version --verbose
:This happens for nightly as well (rustc 1.54.0-nightly (5c02926 2021-05-11) (from rustc 1.54.0-nightly (ca82264 2021-05-09))
gdb --version
:The text was updated successfully, but these errors were encountered: