https://github.com/dotnet/diagnostics/blob/master/documentation/dotnet-dump-instructions.md
Intro
The dotnet-dump CLI global tool is way to collect and analyze the managed data structures in Windows and Linux dumps all without any native debugger involved. This makes creating a managed dump easier, and on some platforms like Alpine Linux or Linux ARM32/ARM64 (where a fully working lldb isn‘t available) it makes creating a managed dump possible. The dotnet-dump tool will allow you to run SOS commands to analyze crashes and the GC, but it isn‘t a native debugger so things like displaying the native stack frames aren‘t supported.
Here‘s a table showing how dotnet-dump fits into your dump debugging options:
Windows native dumps | Windows managed eg from dotnet-dump collect
|
Linux system dump | Linux from dotnet-dump collect
|
macOS system dump | macOS from dotnet-dump collect
|
|
---|---|---|---|---|---|---|
Visual Studio | yes | yes | yes (1) | yes (1) | no, need lldb | no |
Windbg (including SOS) | yes | yes | yes (2) | yes (2) | no, need lldb | no |
dotnet-dump analyze |
no | yes | no | yes | no | yes |
(1) Requires Visual Studio 2019 version 16.8 Preview 3 or later. (2) Requires WinDbg Preview version 1.0.2007.01003 or later.
Installing dotnet-dump
The first step is to install the dotnet-dump CLI global tool. This requires at least the 2.1 or greater .NET Core SDK to be installed. If you see the error message Tool ‘dotnet-dump‘ is already installed
, you will need to uninstall the global tool (see below).
$ dotnet tool install -g dotnet-dump
You can invoke the tool using the following command: dotnet-dump
Tool ‘dotnet-dump‘ (version ‘3.0.47001‘) was successfully installed.
If this is the first global tool installed or you get message Could not execute because the specified command or file was not found.
you need to add $HOME/.dotnet/tools
to your path.
export PATH=$PATH:$HOME/.dotnet/tools
原文:https://www.cnblogs.com/panpanwelcome/p/14268988.html