Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/corefx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSantiago Fernandez Madero <safern@microsoft.com>2017-11-21 03:29:26 +0300
committerGitHub <noreply@github.com>2017-11-21 03:29:26 +0300
commit8543f077fb48ee135dcc83d6305c0c439b4370c5 (patch)
treeaaae5a390084b328e7f774ba4502bd40435f865f /Documentation/debugging
parent30a0f7f753162b89ad110b4beba3fdeda434fe8c (diff)
Update core dumps docs (#25398)
* Update core dumps docs * Change quotes.
Diffstat (limited to 'Documentation/debugging')
-rw-r--r--Documentation/debugging/unix-instructions.md38
1 files changed, 25 insertions, 13 deletions
diff --git a/Documentation/debugging/unix-instructions.md b/Documentation/debugging/unix-instructions.md
index b088094881..9e3f209b69 100644
--- a/Documentation/debugging/unix-instructions.md
+++ b/Documentation/debugging/unix-instructions.md
@@ -14,32 +14,44 @@ CoreFX can be debugged on unix using both lldb and visual studio code
It is also possible to debug .NET Core crash dumps using lldb and SOS. In order to do this, you need all of the following:
-- A machine whose environment matches the one used to produce the crash dumps. For crash dumps occurring on CI machines, you can either
- - Log onto a matching machine in the pool.
- - Create a new VM from the matching image.
+- You will find the dump url to download the crash dump file in the test logs, something similar to:
+<pre>
+2017-10-10 21:17:48,020: INFO: proc(54): run_and_log_output: Output: dumplingid: eefcb1cc36977ccf86f457ee28a33a7b4cc24e13
+2017-10-10 21:17:48,020: INFO: proc(54): run_and_log_output: Output: <b>https://dumpling.azurewebsites.net/api/dumplings/archived/eefcb1cc36977ccf86f457ee28a33a7b4cc24e13</b>
+</pre>
- The crash dump file. We have a service called "Dumpling" which collects, uploads, and archives crash dump files during all of our CI jobs and official builds.
-- Matching runtime bits from the crash. To get these, you should either:
+- On Linux, there is an utility called `createdump` (see [doc](https://github.com/dotnet/coreclr/blob/master/Documentation/botr/xplat-minidump-generation.md "doc")) that can be setup to generate core dumps when a managed app throws an unhandled exception or faults.
+- Matching coreclr/corefx runtime bits from the crash. To get these, you should either:
- Download the matching Jenkins archive onto your repro machine.
- - Check out the corefx repository at the appropriate commit and re-build the necessary portions.
-- lldb version 3.9.
-- libsosplugin.so built against a matching version of lldb. The official libsosplugin.so is now built against 3.9.
-- Symbols for libcoreclr.so. libcoreclr.so.dbg should be copied to your "runtime" folder. To get this file, you can:
- - Build coreclr at the matching commit. In order to determine which commit was used to build a version of libcoreclr.so, run the following command:
- `strings libcoreclr.so | grep "@(#)"`
- - You can also download the matching "symbols" nuget package from myget.org. You want the same package version that is used to build corefx. There is a "Download Symbols" button in the myget UI for this purpose.
+ - Check out the coreclr and corefx repositories at the appropriate commit and re-build the necessary portions.
+ - You can also download the matching "symbols" nuget package from myget.org. There is a "Download Symbols" button in the myget UI for this purpose.
+- lldb version 3.9. The SOS plugin (i.e. libsosplugin.so) provided is now built for lldb 3.9. In order to install lldb 3.9 just run the following commands:
+```
+~$ echo "deb http://llvm.org/apt/trusty/ llvm-toolchain-trusty-3.9 main" | sudo tee /etc/apt/sources.list.d/llvm.list
+~$ wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key | sudo apt-key add -
+~$ sudo apt-get update
+~$ sudo apt-get install lldb-3.9
+```
Once you have everything listed above, you are ready to start debugging. You need to specify an extra parameter to lldb in order for it to correctly resolve the symbols for libcoreclr.so. Use a command like this:
```
-lldb -O "settings set target.exec-search-paths <runtime-path>" --core <core-file-path> <dotnet-path>
+lldb-3.9 -O "settings set target.exec-search-paths <runtime-path>" -o "plugin load <path-to-libsosplugin.so>" --core <core-file-path> <host-path>
```
- `<runtime-path>`: The path containing libcoreclr.so.dbg, as well as the rest of the runtime and framework assemblies.
- `<core-file-path>`: The path to the core dump you are attempting to debug.
-- `<dotnet-path>`: The path to the dotnet executable, potentially in the `<runtime-path>` folder.
+- `<host-path>`: The path to the dotnet or corerun executable, potentially in the `<runtime-path>` folder.
+- `<path-to-libsosplugin.so>`: The path to libsosplugin.so, should be in the `<runtime-path>` folder.
lldb should start debugging successfully at this point. You should see stacktraces with resolved symbols for libcoreclr.so. At this point, you can run `plugin load <libsosplugin.so-path>`, and begin using SOS commands, as above.
+##### Example
+
+```
+lldb-3.9 -O "settings set target.exec-search-paths /home/parallels/Downloads/System.Drawing.Common.Tests/home/helixbot/dotnetbuild/work/2a74cf82-3018-4e08-9e9a-744bb492869e/Payload/shared/Microsoft.NETCore.App/9.9.9/" -o "plugin load /home/parallels/Downloads/System.Drawing.Common.Tests/home/helixbot/dotnetbuild/work/2a74cf82-3018-4e08-9e9a-744bb492869e/Payload/shared/Microsoft.NETCore.App/9.9.9/libsosplugin.so" --core /home/parallels/Downloads/System.Drawing.Common.Tests/home/helixbot/dotnetbuild/work/2a74cf82-3018-4e08-9e9a-744bb492869e/Work/f6414a62-9b41-4144-baed-756321e3e075/Unzip/core /home/parallels/Downloads/System.Drawing.Common.Tests/home/helixbot/dotnetbuild/work/2a74cf82-3018-4e08-9e9a-744bb492869e/Payload/shared/Microsoft.NETCore.App/9.9.9/dotnet
+```
+
## Using Visual Studio Code
- Install [Visual Studio Code](https://code.visualstudio.com/)