Integrate Memory Inspector in Theia repository
What it does
This PR transfers the Memory Inspector functionality from the Theia CPP Extensions to the Theia repository. Relative to the current state of that repository, this PR makes some minor changes necessary to operate with [email protected] and transfers some functionality that is not fully determined by the Debug Adapter Protocol into the MemoryProviderService, where it can be more easily adjusted for adapters with specific known properties.
How to test
- With the CDT-GDB adapter, the instructions from this PR still apply
- To demonstrate the functionality with another debug adapter: (less convenient than GDB, because it supports fewer reference options)
- Create and open a new Rust project or use this one
- In your workspace, make sure that the preference
lldb.rpcServeris set tonullto work around #11392 - Install
Rust AnalyzerandCodeLLDB - (If using the example project linked above) open
main.rsand put a breakpoint on line 12. - Use the code lenses provided by Rust Analyzer to start a debug session from the testson lines 16-25.
- When you hit the breakpoint, the terminal in which the program is running will have printed two addresses.
- Open the memory inspector from the right panel and input one of the addresses into the address selector and hit
Go. The memory location should load, and it should match the data of the struct whose address you entered.
Review checklist
- [x] As an author, I have thoroughly tested my changes and carefully followed the review guidelines
Reminder for reviewers
- As a reviewer, I agree to behave in accordance with the review guidelines
Just out of interest: Did you consider moving this to CDT.cloud instead of the Theia main repo?
@JonasHelming, I've made this PR for two reasons: I believe that having the code in this repo will make it easier to ensure its compatibility with latest Theia, and I believe that it's advantageous with respect to the features requested in #10841. What would be the benefit of placing it in CDT.cloud?
Basically to keep the core Theia project as slim as possible. Most components would benefit from beeing moved to the core project/repo in terms of ensuring compatibility. Are the people maintaining this component the same team that are core Theia developers? Again: I am not opposed to move this to Theia core, I just wanted to raise the question as we had a tendency to try to keep the core repo as small as possible.
One example that you could aim at when hosting it at CDT.cloud would be to ensure compatibility for community releases only. Again, up to you!
Thinking about this again: the memory inspector is not necessarily bound to C/C++, correct? This would be an argument in favor to keep it in Theia.
@JonasHelming, exactly. I've been waiting till I could get it working on at least one non-C(++) debug adapter before trying to move it here, and I was finally able to get it working for Rust. :-)
@colin-grant-work Is this ready for a re-review?
@vince-fugnitto @colin-grant-work: Thanks again for the great work! Is there any chance this PR can make it in the upcoming release? If there is any way I can help out, please let me know.
@martin-fleck-at, I'll devote some time to this today to address the outstanding comments.
@vince-fugnitto, @martin-fleck-at, I've addressed most of y'all's comments - since there's some interest in getting this into the release, would you mind taking another look?
@martin-fleck-at, I've pushed commits that I hope should address your concerns and requests.
@vince-fugnitto Do you want to have another look at it or do you think we can merge this?