Easy way to configure SOS in LLDB

I don’t have much experience in using LLDB to debug .Net Core, so when I stumbled upon this little gem while looking at dotnet/diagnostics GitHub repository, I was instantly curious to try it: up to this point, in order to load the SOS plugin, I had to manually look up its folder, then specify it inside LLDB (via the load plugin command).
This tool, however, should configure LLDB to load SOS plugin automatically!
How? First install the tool via .Net Core CLI:

1
dotnet tool install -g dotnet-sos

Then use the tool to configure SOS:

1
dotnet sos install

After running the second command, you’d see something like this:

1
2
3
4
5
Installing SOS to /home/michael/.dotnet/sos from /home/michael/.dotnet/tools/.store/dotnet-sos/3.1.57502/dotnet-sos/3.1.57502/tools/netcoreapp2.1/any/linux-x64
Creating installation directory...
Copying files...
Creating new /home/michael/.lldbinit file - LLDB will load SOS automatically at startup
SOS install succeeded

That’s it. And it is awesome that Microsoft goes this far to create better developer experience, I think.


Comment