diff options
author | Joseph Tremoulet <jotrem@microsoft.com> | 2019-10-18 14:56:19 +0000 |
---|---|---|
committer | Joseph Tremoulet <jotrem@microsoft.com> | 2019-10-18 14:56:19 +0000 |
commit | a50272f8261f775d085524672d33cf67b27cd045 (patch) | |
tree | f69262e954e1a7f6564b21bbcce2ed9fcb9f5125 /llvm/lib/ObjectYAML/MinidumpEmitter.cpp | |
parent | 6c7d7eebda38340d8bbaf99c6ceedb55e32c3a72 (diff) | |
download | bcm5719-llvm-a50272f8261f775d085524672d33cf67b27cd045.tar.gz bcm5719-llvm-a50272f8261f775d085524672d33cf67b27cd045.zip |
Update MinidumpYAML to use minidump::Exception for exception stream
Reviewers: labath, jhenderson, clayborg, MaskRay, grimar
Reviewed By: grimar
Subscribers: lldb-commits, grimar, MaskRay, hiraditya, llvm-commits
Tags: #llvm, #lldb
Differential Revision: https://reviews.llvm.org/D68657
llvm-svn: 375242
Diffstat (limited to 'llvm/lib/ObjectYAML/MinidumpEmitter.cpp')
-rw-r--r-- | llvm/lib/ObjectYAML/MinidumpEmitter.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/llvm/lib/ObjectYAML/MinidumpEmitter.cpp b/llvm/lib/ObjectYAML/MinidumpEmitter.cpp index 9029be80ad7..bbfd2cd8cba 100644 --- a/llvm/lib/ObjectYAML/MinidumpEmitter.cpp +++ b/llvm/lib/ObjectYAML/MinidumpEmitter.cpp @@ -118,6 +118,23 @@ static LocationDescriptor layout(BlobAllocator &File, yaml::BinaryRef Data) { support::ulittle32_t(File.allocateBytes(Data))}; } +static size_t layout(BlobAllocator &File, MinidumpYAML::ExceptionStream &S) { + File.allocateObject(S.MDExceptionStream); + + size_t DataEnd = File.tell(); + + // Lay out the thread context data, (which is not a part of the stream). + // TODO: This usually (always?) matches the thread context of the + // corresponding thread, and may overlap memory regions as well. We could + // add a level of indirection to the MinidumpYAML format (like an array of + // Blobs that the LocationDescriptors index into) to be able to distinguish + // the cases where location descriptions overlap vs happen to reference + // identical data. + S.MDExceptionStream.ThreadContext = layout(File, S.ThreadContext); + + return DataEnd; +} + static void layout(BlobAllocator &File, MemoryListStream::entry_type &Range) { Range.Entry.Memory = layout(File, Range.Content); } @@ -158,6 +175,9 @@ static Directory layout(BlobAllocator &File, Stream &S) { Result.Location.RVA = File.tell(); Optional<size_t> DataEnd; switch (S.Kind) { + case Stream::StreamKind::Exception: + DataEnd = layout(File, cast<MinidumpYAML::ExceptionStream>(S)); + break; case Stream::StreamKind::MemoryInfoList: { MemoryInfoListStream &InfoList = cast<MemoryInfoListStream>(S); File.allocateNewObject<minidump::MemoryInfoListHeader>( |