-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
rust-gdb cannot pretty print for Option<T> where T: non C-style enum #51347
Comments
Use a recent version gdb (8.0, 8.1) directly, without rust-gdb. |
Having said that, the output from gdb 8.1 is not ideal either:
Seems to suggest an issue is more general than gdb. |
This stack trace might help.
|
I believe this is a dup of #32920. Well, to be maybe a bit more precise, the newer enum optimizations are not reflected in the DWARF. Formerly the NonZero optimization was handled by emitting a specially named field, but this approach wasn't updated for the newer niche-filling approaches. The patch I have for #32920 does fix this bug:
I haven't yet submitted a PR with that patch because it breaks most debugging of enums for lldb. The Rust lldb plugin does mostly work for this (I did just find a bug with it, bleah), so I think once lldb ends up in rustup I could go ahead with the patch. Meanwhile I suppose this bug could be closed as a dup. |
I filed the lldb bug as https://github.com/tromey/lldb/issues/14 |
I'll close this issue since I understand that this is a dup. |
I've tried this code:
Expected:
Everything should be pretty printed.
This happened:
rust-gdb failed to pretty print every variable whose type is like
Option<T: non C-style enum>
, although pretty printing variables ofT
itself is fine.Most weird cases are
enum_*
variables.enum_some_b
is printed correctly, butenum_some_a
andenum_none
are printed incorrectly, not failed like other cases.#[repr(C)]
doesn't make any difference to result.It seems to be fine for other data structures like
struct
,struct <T>
Meta:
I'm using Ubuntu 18.04.
You can find this bug on Windows 10.
The text was updated successfully, but these errors were encountered: