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:
authorEric Mellino <erme@microsoft.com>2017-04-28 03:14:44 +0300
committerGitHub <noreply@github.com>2017-04-28 03:14:44 +0300
commitc14185223acc62525b0af0887ebc4d3d4ecfeac7 (patch)
tree6152c4577fa6112ef573a2b02def0ffed20912cd /Documentation/debugging
parent35903a1cab676d100b5b90754e5313f43b30170d (diff)
Add core dump debugging instructions
Diffstat (limited to 'Documentation/debugging')
-rw-r--r--Documentation/debugging/unix-instructions.md32
1 files changed, 31 insertions, 1 deletions
diff --git a/Documentation/debugging/unix-instructions.md b/Documentation/debugging/unix-instructions.md
index 20f60b8a18..de8339ee82 100644
--- a/Documentation/debugging/unix-instructions.md
+++ b/Documentation/debugging/unix-instructions.md
@@ -6,10 +6,40 @@ CoreFX can be debugged on unix using both lldb and visual studio code
## Using lldb and SOS
- Run the test using msbuild at least once with `/t:BuildAndTest`.
-- Install version 3.6 of lldb and launch lldb with corerun as the process and arguments matching the arguments used when running the test through msbuild.
+- Install version 3.6 of lldb and launch lldb with dotnet as the process and arguments matching the arguments used when running the test through msbuild.
- Load the sos plugin using `plugin load libsosplugin.so`.
- Type `soshelp` to get help. You can now use all sos commands like `bpmd`.
+## Debugging core dumps with lldb
+
+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.
+- 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:
+ - Download the matching Jenkins archive onto your repro machine.
+ - Check out the corefx repository at the appropriate commit and re-build the necessary portions.
+- Symbols for libcoreclr.so. libcoreclr.so.dbg should be copied to your "runtime" folder. To get this file, you can:
+ - 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.
+ - 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 "@(#)"`
+
+Once you have everything listed above, you are ready to start debugging. You need to specify an extra 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>
+```
+
+- `<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.
+
+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.
+
+NOTE: Some older versions of lldb do not work with core dumps correctly. If you are encountering issues, try to use version 3.8 or higher.
+
## Using Visual Studio Code
- Install [Visual Studio Code](https://code.visualstudio.com/)