diff options
author | Mike McLaughlin <mikem@microsoft.com> | 2017-07-18 14:33:53 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-18 14:33:53 -0700 |
commit | 901e0d12de9b956946b805aa4799c783daf2aeda (patch) | |
tree | 814a0843f91ef80d504c0271758ca40b9cfbaa8b /Documentation | |
parent | c059ec9cbbedd8a25a785a2c4d1a0515732134d6 (diff) | |
download | coreclr-901e0d12de9b956946b805aa4799c783daf2aeda.tar.gz coreclr-901e0d12de9b956946b805aa4799c783daf2aeda.tar.bz2 coreclr-901e0d12de9b956946b805aa4799c783daf2aeda.zip |
Update minidump and debugging doc (#12884)
Update debugging doc on loading sos on Windows.
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/botr/xplat-minidump-generation.md | 5 | ||||
-rw-r--r-- | Documentation/building/debugging-instructions.md | 8 |
2 files changed, 10 insertions, 3 deletions
diff --git a/Documentation/botr/xplat-minidump-generation.md b/Documentation/botr/xplat-minidump-generation.md index 03cd517a4a..47d6e5cb7c 100644 --- a/Documentation/botr/xplat-minidump-generation.md +++ b/Documentation/botr/xplat-minidump-generation.md @@ -24,6 +24,8 @@ Core dump generation is triggered anytime coreclr is going to abort (via [PROCAb The _createdump_ utility starts by using ptrace to enumerate and suspend all the threads in the target process. The process and thread info (status, registers, etc.) is gathered. The auxv entries and _DSO_ info is enumerated. _DSO_ is the in memory data structures that described the shared modules loaded by the target. This memory is needed in the dump by gdb and lldb to enumerate the shared modules loaded and access their symbols. The module memory mappings are gathered from /proc/$pid/maps. None of the program or shared modules memory regions are explicitly added to dump's memory regions. The _DAC_ is loaded and the enumerate memory region interfaces are used to build the memory regions list just like on Windows. The threads stacks and one page of code around the IP are added. The byte sized regions are rounded up to pages and then combined into contagious regions. +All the memory mappings from /proc/$pid/maps are in the PT_LOAD sections even though the memory is not actually in the dump. They have a file offset/size of 0. + After all the process crash information has been gathered, the ELF core dump with written. The main ELF header created and written. The PT\_LOAD note section is written one entry for each memory region in the dump. The process info, auxv data and NT_FILE entries are written to core. The NT\_FILE entries are built from module memory mappings from /proc/$pid/maps. The threads state and registers are then written. Lastly all the memory regions gather above by the _DAC_, etc. are read from the target process and written to the core dump. All the threads in the target process are resumed and _createdump_ terminates. **Severe memory corruption** @@ -49,7 +51,7 @@ Any configuration or policy is set with environment variables which are passed a Environment variables supported: - `COMPlus_DbgEnableMiniDump`: if set to "1", enables this core dump generation. The default is NOT to generate a dump. -- `COMPlus_DbgMiniDumpType`: if set to "1" generates _MiniDumpNormal_, "2" _MiniDumpWithPrivateReadWriteMemory_, "3" _MiniDumpFilterTriage_. Default is _MiniDumpNormal_. +- `COMPlus_DbgMiniDumpType`: if set to "1" generates _MiniDumpNormal_, "2" _MiniDumpWithPrivateReadWriteMemory_, "3" _MiniDumpFilterTriage_, "4" _MiniDumpWithFullMemory_. Default is _MiniDumpNormal_. - `COMPlus_DbgMiniDumpName`: if set, use as the template to create the dump path and file name. The pid can be placed in the name with %d. The default is _/tmp/coredump.%d_. - `COMPlus_CreateDumpDiagnostics`: if set to "1", enables the _createdump_ utilities diagnostic messages (TRACE macro). @@ -71,7 +73,6 @@ The test plan is to modify the SOS tests in the (still) private debuggertests re # Open Issues # -- Do we need a full memory dump option? It would not use the _DAC_ to get the memory regions but all the readable memory from the shared module list. Do we include the shared modules' code? - May need more than just the pid for decorating dump names for docker containers because I think the _pid_ is always 1. - Do we need all the memory mappings from `/proc/$pid/maps` in the PT\_LOAD sections even though the memory is not actually in the dump? They have a file offset/size of 0. Full dumps generated by the system or _gdb_ do have these un-backed regions. - There is no way to get the signal number, etc. that causes the abort from the _createdump_ utility using _ptrace_ or a /proc file. It would have to be passed from CoreCLR on the command line. diff --git a/Documentation/building/debugging-instructions.md b/Documentation/building/debugging-instructions.md index 1a3b0234c9..9b3c2723d5 100644 --- a/Documentation/building/debugging-instructions.md +++ b/Documentation/building/debugging-instructions.md @@ -22,6 +22,12 @@ Debugging CoreCLR on Windows Steps 1-8 only need to be done once, and then (9) can be repeated whenever you want to start debugging. The above can be done with Visual Studio 2013. +### Using SOS with windbg or cdb on Windows ### + +If you know the path of the `sos.dll` for the version of your runtime, load it like `.load c:\path\to\sos\sos.dll`. Use can use the `lm` command to find the path of the "coreclr.dll" module. `.loadby sos coreclr` should also work. + +For more information on SOS commands click [here](https://msdn.microsoft.com/en-us/library/bb190764(v=vs.110).aspx). + Debugging CoreCLR on OS X ========================== @@ -135,4 +141,4 @@ The "gcroot" command either crashes lldb 3.6 or returns invalid results. Works f Loading Linux core dumps with lldb 3.7 doesn't work. lldb 3.7 loads OS X and FreeBSD core dumps just fine. lldb 3.8 loads all the platform's core dumps without problem. -For more information on SOS commands see: https://msdn.microsoft.com/en-us/library/bb190764(v=vs.110).aspx +For more information on SOS commands click [here](https://msdn.microsoft.com/en-us/library/bb190764(v=vs.110).aspx). |