You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: documentation/debugging-coredump.md
+21-4Lines changed: 21 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -7,20 +7,31 @@ Dumps created with gdb or gcore do not have all the managed state so various SOS
7
7
8
8
### Getting symbols ###
9
9
10
-
Because SOS now has symbol download support, this step can be skipped if the matching version of the "host" programis available on the machine loading the dump. Usually the host program is "dotnet" but each .NET Core SDK has a different version.
10
+
Because SOS now has symbol download support (both managed PDBs and native symbols via `loadsymbols`) all that lldb requires is the host program. The host is usually `dotnet` but for self-contained applications it the .NET Core `apphost` renamed to the program/project name. These steps will handle either case and download the host lldb needs to properly diagnose a core dump.
11
11
12
-
First install the dotnet CLI symbol tool. This only needs to be down once. See this [link](https://github.com/dotnet/symstore/tree/master/src/dotnet-symbol#install) for more details.
12
+
First install or update the dotnet CLI symbol tool. This only needs to be done once. See this [link](https://github.com/dotnet/symstore/tree/master/src/dotnet-symbol#install) for more details. We need version 1.0.52901 or greater of dotnet-symbol installed.
13
13
14
14
~$ dotnet tool install -g dotnet-symbol
15
+
You can invoke the tool using the following command: dotnet-symbol
16
+
Tool 'dotnet-symbol' (version '1.0.52901') was successfully installed.
17
+
18
+
Or update if already installed:
19
+
20
+
~$ dotnet tool update -g dotnet-symbol
21
+
Tool 'dotnet-symbol' was successfully updated from version '1.0.51501' to version '1.0.52901'.
15
22
16
23
Copy the core dump to a tmp directory.
17
24
18
25
~$ mkdir /tmp/dump
19
26
~$ cp ~/coredump.32232 /tmp/dump
20
27
21
-
Download the modules and symbols for the core dump:
If the `--host-only` option is not found, update dotnet-symbol to the latest with the above step.
22
33
23
-
~$ dotnet-symbol /tmp/dump/coredump.32232
34
+
If your project/program binaries are not on the machine the core dump is being loaded on, copy them to a temporary directory. You can use the lldb/SOS command `setsymbolserver -directory <temp-dir>` to add this directory to the search path.
24
35
25
36
### Install lldb ###
26
37
@@ -44,13 +55,19 @@ Add the directory with the core dump and symbols to the symbol search path:
44
55
Added symbol directory path: /tmp/dump
45
56
(lldb)
46
57
58
+
Optionally load the native symbols. The managed PDBs will be loaded on demand when needed:
59
+
60
+
(lldb) loadsymbols
61
+
47
62
Even if the core dump was not generated on this machine, the native and managed .NET Core symbols should be available along with all the SOS commands.
48
63
49
64
### Launch lldb under MacOS ###
50
65
51
66
~$ lldb --core /cores/core.32232 <host-program>
52
67
(lldb)
53
68
69
+
Follow the rest of the above Linux steps to set the symbol server and load native symbols.
70
+
54
71
The MacOS lldb has a bug that prevents SOS clrstack from properly working. Because of this bug SOS can't properly match the lldb native with with the managed thread OSID displayed by `clrthreads`. The `setsostid` command is a work around for this lldb bug. This command maps the OSID from this command:
0 commit comments