summaryrefslogtreecommitdiffstats
path: root/llvm/include
diff options
context:
space:
mode:
authorJoseph Tremoulet <jotrem@microsoft.com>2019-10-18 14:43:15 +0000
committerJoseph Tremoulet <jotrem@microsoft.com>2019-10-18 14:43:15 +0000
commite44524736c4a97ae4fb37193e58647f838f6d36a (patch)
tree759e50f7b8b0cca6e2f834a233f6119caf5cdbac /llvm/include
parent92fea8bb8dffe8f5a7653c9635d409c17b7222eb (diff)
downloadbcm5719-llvm-e44524736c4a97ae4fb37193e58647f838f6d36a.tar.gz
bcm5719-llvm-e44524736c4a97ae4fb37193e58647f838f6d36a.zip
Add ExceptionStream to llvm::Object::minidump
Summary: This will allow updating MinidumpYAML and LLDB to use this common definition. Reviewers: labath, jhenderson, clayborg Reviewed By: labath Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D68656 llvm-svn: 375239
Diffstat (limited to 'llvm/include')
-rw-r--r--llvm/include/llvm/BinaryFormat/Minidump.h21
-rw-r--r--llvm/include/llvm/Object/Minidump.h9
2 files changed, 30 insertions, 0 deletions
diff --git a/llvm/include/llvm/BinaryFormat/Minidump.h b/llvm/include/llvm/BinaryFormat/Minidump.h
index 4ab5332e734..89cd779951c 100644
--- a/llvm/include/llvm/BinaryFormat/Minidump.h
+++ b/llvm/include/llvm/BinaryFormat/Minidump.h
@@ -227,6 +227,27 @@ struct Thread {
};
static_assert(sizeof(Thread) == 48, "");
+struct Exception {
+ static constexpr size_t MaxParameters = 15;
+
+ support::ulittle32_t ExceptionCode;
+ support::ulittle32_t ExceptionFlags;
+ support::ulittle64_t ExceptionRecord;
+ support::ulittle64_t ExceptionAddress;
+ support::ulittle32_t NumberParameters;
+ support::ulittle32_t UnusedAlignment;
+ support::ulittle64_t ExceptionInformation[MaxParameters];
+};
+static_assert(sizeof(Exception) == 152, "");
+
+struct ExceptionStream {
+ support::ulittle32_t ThreadId;
+ support::ulittle32_t UnusedAlignment;
+ Exception ExceptionRecord;
+ LocationDescriptor ThreadContext;
+};
+static_assert(sizeof(ExceptionStream) == 168, "");
+
} // namespace minidump
template <> struct DenseMapInfo<minidump::StreamType> {
diff --git a/llvm/include/llvm/Object/Minidump.h b/llvm/include/llvm/Object/Minidump.h
index 92cab92bfca..4429493aff4 100644
--- a/llvm/include/llvm/Object/Minidump.h
+++ b/llvm/include/llvm/Object/Minidump.h
@@ -81,6 +81,15 @@ public:
return getListStream<minidump::Thread>(minidump::StreamType::ThreadList);
}
+ /// Returns the contents of the Exception stream. An error is returned if the
+ /// file does not contain this stream, or the stream is smaller than the size
+ /// of the ExceptionStream structure. The internal consistency of the stream
+ /// is not checked in any way.
+ Expected<const minidump::ExceptionStream &> getExceptionStream() const {
+ return getStream<minidump::ExceptionStream>(
+ minidump::StreamType::Exception);
+ }
+
/// Returns the list of descriptors embedded in the MemoryList stream. The
/// descriptors provide the content of interesting regions of memory at the
/// time the minidump was taken. An error is returned if the file does not
OpenPOWER on IntegriCloud