[Object] Add basic minidump support
authorPavel Labath <pavel@labath.sk>
Thu, 21 Mar 2019 09:18:59 +0000 (09:18 +0000)
committerPavel Labath <pavel@labath.sk>
Thu, 21 Mar 2019 09:18:59 +0000 (09:18 +0000)
commit581d79a440a6019d0c5b8218aa47403727a838d0
treeb477bf2a2d570b318de0462d3244acef635a8048
parentebfb7852bef5775c3b744c8ec7f6e0fea6fddf34
[Object] Add basic minidump support

Summary:
This patch adds basic support for reading minidump files. It contains
the definitions of various important minidump data structures (header,
stream directory), and of one minidump stream (SystemInfo). The ability
to read other streams will be added in follow-up patches. However, all
streams can be read even now as raw data, which means lldb's minidump
support (where this code is taken from) can be immediately rebased on
top of this patch as soon as it lands.

As we don't have any support for generating minidump files (yet), this
tests the code via unit tests with some small handcrafted binaries in
the form of c char arrays.

Reviewers: Bigcheese, jhenderson, zturner

Subscribers: srhines, dschuff, mgorny, fedor.sergeev, lemo, clayborg, JDevlieghere, aprantl, lldb-commits, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D59291

llvm-svn: 356652
15 files changed:
llvm/include/llvm/BinaryFormat/Magic.h
llvm/include/llvm/BinaryFormat/Minidump.h [new file with mode: 0644]
llvm/include/llvm/BinaryFormat/MinidumpConstants.def [new file with mode: 0644]
llvm/include/llvm/Object/Binary.h
llvm/include/llvm/Object/Minidump.h [new file with mode: 0644]
llvm/lib/BinaryFormat/CMakeLists.txt
llvm/lib/BinaryFormat/Magic.cpp
llvm/lib/BinaryFormat/Minidump.cpp [new file with mode: 0644]
llvm/lib/Object/Binary.cpp
llvm/lib/Object/CMakeLists.txt
llvm/lib/Object/Minidump.cpp [new file with mode: 0644]
llvm/lib/Object/ObjectFile.cpp
llvm/lib/Object/SymbolicFile.cpp
llvm/unittests/Object/CMakeLists.txt
llvm/unittests/Object/MinidumpTest.cpp [new file with mode: 0644]