MacOS createdump and createdump cleanup. (#37224)
authorMike McLaughlin <mikem@microsoft.com>
Wed, 3 Jun 2020 16:51:25 +0000 (09:51 -0700)
committerGitHub <noreply@github.com>
Wed, 3 Jun 2020 16:51:25 +0000 (09:51 -0700)
commit2f563e3a456b2bbf37c53352955cbe380ca584c9
treeb1e085ba0a319e6d3d60a904255a2724055a5775
parent5966480046622fc3e3b1f62cbb26e18f5803209a
MacOS createdump and createdump cleanup. (#37224)

* General createdump cleanup.

Converted the char* name fields (process name in CrashInfo and module name in MemoryRegion) to std::string for easier cleanup and usage.

Removed the vestiges of the SOS support (the m_sos flag, ThreadInfo::GetRegistersWithDataTarget(), etc.).

Moved the Linux read memory code out of the DataTarget into CrashInfo. DataTarget is now a thin wrapper around CrashInfo.

In the dumpwriter, fix the "number of program headers" calculate to just the ones backed by memory. Only write the memory regions backed by memory.  This makes lldb fail the memory read in these regions instead of returning zeros.

Removed the TRACE macro from the ElfReader; use the Trace() virtual method directly.

* Add MacOS createdump

Add MachO in-memory module reader (MachOReader).

Refactor CrashInfo and ThreadInfo in Unix and MacOS versions.

Enabled crash/unhandled exception createdump trigger.

Add unwind and eh frame info to coredump
23 files changed:
src/coreclr/src/CMakeLists.txt
src/coreclr/src/debug/createdump/CMakeLists.txt
src/coreclr/src/debug/createdump/crashinfo.cpp
src/coreclr/src/debug/createdump/crashinfo.h
src/coreclr/src/debug/createdump/crashinfomac.cpp [new file with mode: 0644]
src/coreclr/src/debug/createdump/crashinfounix.cpp [new file with mode: 0644]
src/coreclr/src/debug/createdump/createdump.cpp
src/coreclr/src/debug/createdump/createdump.h
src/coreclr/src/debug/createdump/datatarget.cpp
src/coreclr/src/debug/createdump/datatarget.h
src/coreclr/src/debug/createdump/dumpwriter.cpp
src/coreclr/src/debug/createdump/dumpwriter.h
src/coreclr/src/debug/createdump/mac.h [new file with mode: 0644]
src/coreclr/src/debug/createdump/memoryregion.h
src/coreclr/src/debug/createdump/threadinfo.cpp
src/coreclr/src/debug/createdump/threadinfo.h
src/coreclr/src/debug/createdump/threadinfomac.cpp [new file with mode: 0644]
src/coreclr/src/debug/createdump/threadinfounix.cpp [new file with mode: 0644]
src/coreclr/src/debug/dbgutil/CMakeLists.txt
src/coreclr/src/debug/dbgutil/elfreader.cpp
src/coreclr/src/debug/dbgutil/machoreader.cpp [new file with mode: 0644]
src/coreclr/src/debug/dbgutil/machoreader.h [new file with mode: 0644]
src/coreclr/src/pal/src/thread/process.cpp