Skip to content
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

Debug MIRAI in CLion #107

Closed
artemmukhin opened this issue Mar 30, 2019 · 9 comments
Closed

Debug MIRAI in CLion #107

artemmukhin opened this issue Mar 30, 2019 · 9 comments
Labels
question Further information is requested

Comments

@artemmukhin
Copy link

Hi everyone! I've just heard about MIRAI. The project is very exciting and I hope it will eventually become a part of IntelliJ Rust and RLS code analysis! However, while reading the documentation I was surprised to see that CLion doesn't support debugging MIRAI ([1] and [2]).

I've just tried it out and seems like it works fine:
Screenshot 2019-03-30 at 12 21 02

All I have to do is to provide the DYLD_LIBRARY_PATH as specified:
Screenshot 2019-03-30 at 12 35 29

Also [3],

debugging support for Rust is pretty much non existent

I'm sorry to hear that. I'm working on new lldb formatters for Rust; in CLion, they are enabled by default and configurable via Preferences | Build, Execution, Deployment | Debugger | Data Views | Rust. I hope debugging support gets better, though there is no Evaluate expression for Rust yet. So I really want to know if something related to debugging frontend doesn't work properly or if you have some ideas to improve it (at frontend level, like formatters, watches, remote debugging and so on). If so, you can open an issue here.

@hermanventer
Copy link
Collaborator

The CLion debugger does indeed work now and I use it all of the time. Rust support in Clion has improved with leaps and bounds in the last few months and I could not be happier about it. I'll update the MIRAI documentation to reflect this.

When it comes to debugging, my single greatest frustration is not being able to view non primitive values. Without that feature I consider any debugger to be close to useless. Beyond that, expression evaluation and conditional breakpoints are the most valuable features for me. And beyond that, if you can match or exceed the gold standard in debuggers, namely the Visual Studio C# debugger, you'll be leading the big league. :-)

@artemmukhin
Copy link
Author

my single greatest frustration is not being able to view non primitive values

Is this still relevant for now? CLion support formatting some composite values: String, Vec, VecDeque Rc, Arc, Ref, Cell, and few others. I'd like to know if there are other important unsupported types (except HashMap: currently it is not supported due to one debuginfo issue in rustc).

@hermanventer
Copy link
Collaborator

hermanventer commented Apr 1, 2019

Some is certainly better than none, so thanks for adding that support. Unfortunately, unless the debugger provides me with a way to look at the fields of an arbitrary structure (or enum) it will never be a real solution. Right now, even if it will just display what debug!("{:?}", some_struct) would display it would be a great improvement.

@artemmukhin
Copy link
Author

@hermanventer Structures are already supported (if I understand you correctly):
Screenshot 2019-04-01 at 20 41 16

But enums formatting was broken at least since 1.32.0 due to this (and I don't know why).

@hermanventer
Copy link
Collaborator

hermanventer commented Apr 1, 2019

Magic! I can debug now. Free at last. Well, no quite yet. Without support for enums, I can still do practically nothing without resorting to inserting debug! calls.

@hermanventer hermanventer added the question Further information is requested label Apr 3, 2019
@Undin
Copy link

Undin commented Feb 4, 2020

@hermanventer JFYI since CLion 2020.1 Rust enums are properly rendered while debugging with lldb

@hermanventer
Copy link
Collaborator

Thanks for the update. I've tried out debugging with the EAP Clion and while I do now see information about enums, I sadly see the wrong information. It seems that the enums I'm looking at are always displayed as if their values were 0, even when that is clearly not the case.

@artemmukhin
Copy link
Author

artemmukhin commented Feb 5, 2020

@hermanventer Could you please provide more details (exact enum and code you debug)? Enum debugging works fine on my macOS + CLion 2020.1 EAP + 0.2.116 Rust plugin. Thanks in advance!

Screenshot 2020-02-05 at 19 51 00

UPD: I've found the problem related to C-style enums. I've added this case in our meta-issue, so we'll try to fix it.
Screenshot 2020-02-05 at 19 56 58

However, feel free to tell us about any other problems related to enum debugging!

@hermanventer
Copy link
Collaborator

Debugging is much better now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants