summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Object/Binary.cpp
diff options
context:
space:
mode:
authorPavel Labath <pavel@labath.sk>2019-03-21 09:18:59 +0000
committerPavel Labath <pavel@labath.sk>2019-03-21 09:18:59 +0000
commit581d79a440a6019d0c5b8218aa47403727a838d0 (patch)
treeb477bf2a2d570b318de0462d3244acef635a8048 /llvm/lib/Object/Binary.cpp
parentebfb7852bef5775c3b744c8ec7f6e0fea6fddf34 (diff)
downloadbcm5719-llvm-581d79a440a6019d0c5b8218aa47403727a838d0.tar.gz
bcm5719-llvm-581d79a440a6019d0c5b8218aa47403727a838d0.zip
[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
Diffstat (limited to 'llvm/lib/Object/Binary.cpp')
-rw-r--r--llvm/lib/Object/Binary.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Object/Binary.cpp b/llvm/lib/Object/Binary.cpp
index 87b2c1278c0..e1063a64b14 100644
--- a/llvm/lib/Object/Binary.cpp
+++ b/llvm/lib/Object/Binary.cpp
@@ -16,6 +16,7 @@
#include "llvm/Object/Archive.h"
#include "llvm/Object/Error.h"
#include "llvm/Object/MachOUniversal.h"
+#include "llvm/Object/Minidump.h"
#include "llvm/Object/ObjectFile.h"
#include "llvm/Object/WindowsResource.h"
#include "llvm/Support/Error.h"
@@ -81,6 +82,8 @@ Expected<std::unique_ptr<Binary>> object::createBinary(MemoryBufferRef Buffer,
case file_magic::coff_cl_gl_object:
// Unrecognized object file format.
return errorCodeToError(object_error::invalid_file_type);
+ case file_magic::minidump:
+ return MinidumpFile::create(Buffer);
}
llvm_unreachable("Unexpected Binary File Type");
}
OpenPOWER on IntegriCloud