-
Notifications
You must be signed in to change notification settings - Fork 5k
Add NativeAOT.py for lldb visualization #115747
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
base: main
Are you sure you want to change the base?
Conversation
Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas |
Nice. It's too bad that lldb doesn't support just directly embedding this in the symbols, but I guess this is the next best thing. |
|
||
Add to ~/.lldbinit: | ||
|
||
command script import {path-to-ilcompiler-package}/build/NativeAOT.lldb.py |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
path-to-ilcompiler-package
is not constant. It changes every month.
Would it be better to include this in our LLDB debugger extension?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It has same release cadence as SDK. File is next to NativeAOT.natvis.
dotnet-debugger-extensions
and dotnet-sos
have different release cadence. Also, debugger extension
is not open source and unavailable in VMR distro builds; the only option there is dotnet-sos, so we will need to add it to two packages that way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NativeAOT.natvis is bundled into the .pdb file. People do not need to worry about explicitly setting a path to it. This python script is not like .natvis.
Yes, .NET debuggers are on a different shipping train and licensing plan than .NET itself.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hoyosjs, @mikem8361, should we emit it from https://github.com/dotnet/diagnostics/blob/ce653def0d1969dca0d518a95559b2acc3c6128c/src/SOS/SOS.InstallHelper/InstallHelper.cs#L65 at InstallLocation
and include command script import
line in ~/.lldbinit
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like the Python script could be embedded into symbols and LLDB would pick it up but I only see it implemented for mach-O: https://github.com/llvm/llvm-project/blob/705e27c23474f3177670a791b5b54eefedee0cd8/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp#L202-L318
From what I see in the source code, the experience would be that LLDB will notify there's a debugging script and one then needs to make a gesture to allow it.
I like the approach from #115406 (comment) - the only unfortunate thing about that one is that the LLDB change to read the embedded formatters was only made 5 months ago so it'll take years until Linux distros pick that up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It can be implemented as SOS sub-command in C++ which gives us full control.
Adding @jbevain script from #115406 (comment).
Context:
Before:
After: