-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Several bugs related to enum debugging #55586
Comments
Many problems in this area were fixed by #54004; though to see the benefits you will need the rust-enabled lldb (or gdb 8.2). Here's the results from this combo. Variants with the same names
Variant disappears
I didn't look at the final case yet. |
I get an error from the 3rd case when using gdb8.2. Probably when using a rust-enabled gdb or lldb, the enum printers should be disabled. There may be some underlying bug in gdb, though I don't know yet. |
Is "rust-enabled LLDB" just a bash script attaching pretty-printers to the default system LLDB? I realized I should just update Thank you for your help! |
Nope, it is the lldb that has the Rust language plugin. It is installable via rustup for macos. |
Could you please explain how can I install and use it? Let me just explain the context. I'm working on the new pretty-printers (now only for LLDB, but then for GDB too): [1], [2]. They will be bundled in the next version of IntelliJ Rust plugin, and later I'm going to create a pull request to Rust. So I don't want to develop it in isolation from the Rust compiler's development to avoid doing unnecessary work. Can I get in touch with you to coordinate the development of debuggers and pretty-printers? |
Yes. The
Definitely. I'm curious why IntelliJ needs its own pretty-printers. In gdb at least (I'm less familiar with lldb here) the goal was to avoid this sort of duplication. Anyway, for Rust I plan to disable some pretty-printers when a rust-enabled gdb or lldb is in use. In particular my view is that types that are intrinsic to the language should be supported directly by the debugger; while types that are in the standard library should have a pretty-printer (when needed). So, I'm working on a patch to disable the enum pretty-printers, among others. |
Thanks a lot for a link to "Rust Debugging Quest", I'll monitor the progress of it!
I ran it, but got this:
After
Could you please help me find a way to use it?
The current state of LLDB pretty-printers is poor. The main problem is they don't use synthetic children at all. Just look at the examples: After (summary + synthetic children): Some of GDB printers also don't work correctly (e.g. BTree).
I'm very glad to hear it and look forward to such updates! Then I'll get rid of enum/tuple printers and focus on the standard library: collections, |
For now you'll need xcode (or some other code-signed
Thanks for the info. I'm in favor of fixing this in the Rust repository if at all possible, FWIW.
Step 1 is here: #55767 |
3008: Bundled pretty-printer for LLDB: tuple and enum support r=Undin a=ortem This PR adds `tuple` and `enum` support to LLDB pretty-printers. <img width="495" alt="screen shot 2018-11-01 at 19 31 07" src="https://user-images.githubusercontent.com/4854600/47865325-f10dfe00-de0c-11e8-9911-21b583baba1e.png"> <img width="272" alt="screen shot 2018-11-01 at 19 31 21" src="https://user-images.githubusercontent.com/4854600/47865326-f10dfe00-de0c-11e8-88b9-2dd671223aa4.png"> This implementation still doesn't work in some cases due to compilers' (debuggers'?) bugs. I've opened the corresponding [issue](rust-lang/rust#55586). Co-authored-by: ortem <[email protected]>
I think everything here is fixed -- the rust lldb solves some of the problems, and disabling some pretty-printers for rust-enabled gdb fixed the rest. So if you concur I'd like to close it. |
…kfelix Implement new gdb/lldb pretty-printers This PR replaces current gdb and lldb pretty-printers with new ones which were originally written for [IntelliJ Rust](https://github.com/intellij-rust/intellij-rust/tree/master/prettyPrinters). The current state of lldb pretty-printers is poor, because [they don't use synthetic children](rust-lang#55586 (comment)). When I started to reimplement lldb pretty-printers with synthetic children support, I've found current version strange and hard to support. I think `debugger_pretty_printers_common.py` is overkill, so I got rid of it. The new pretty-printers have to support all types supported by current pretty-printers, and also support `Rc`, `Arc`, `Cell`, `Ref`, `RefCell`, `RefMut`, `HashMap`, `HashSet`.
…elix Implement new gdb/lldb pretty-printers Reopened rust-lang#60826 This PR replaces current gdb and lldb pretty-printers with new ones that were originally written for [IntelliJ Rust](https://github.com/intellij-rust/intellij-rust/tree/master/prettyPrinters). The current state of lldb pretty-printers is poor, because [they don't use synthetic children](rust-lang#55586 (comment)). When I started to reimplement lldb pretty-printers with synthetic children support, I've found current version strange and hard to support. I think `debugger_pretty_printers_common.py` is overkill, so I got rid of it. The new pretty-printers have to support all types supported by current pretty-printers, and also support `Rc`, `Arc`, `Cell`, `Ref`, `RefCell`, `RefMut`, `HashMap`, `HashSet`. Fixes rust-lang#56252
I have found some bugs related to enum debug info.
My LLDB version is
lldb-1000.0.37
(MacOS), GDB is8.1.0.20180409-git
(Ubuntu).Here they are:
Variants with the same names
Run LLDB (without pretty-printers):
RUST$ENUM$DISR = 4
?Variant disappears
Run LLDB (without pretty-printers):
No second variant?
Probably no discriminant
Run GDB + default pretty-printers:
Probably
e
doesn't contain valid discriminant inside the first variant.The text was updated successfully, but these errors were encountered: