9 #ifndef LLVM_OBJECT_MINIDUMP_H 10 #define LLVM_OBJECT_MINIDUMP_H 51 return getDataSlice(getData(), Desc.
RVA, Desc.
DataSize);
63 return getStream<minidump::SystemInfo>(minidump::StreamType::SystemInfo);
72 return getListStream<minidump::Module>(minidump::StreamType::ModuleList);
81 return getListStream<minidump::Thread>(minidump::StreamType::ThreadList);
89 return getStream<minidump::ExceptionStream>(
90 minidump::StreamType::Exception);
101 return getListStream<minidump::MemoryDescriptor>(
102 minidump::StreamType::MemoryList);
107 std::forward_iterator_tag,
108 minidump::MemoryInfo> {
111 : Storage(Storage), Stride(Stride) {
116 return Storage.
size() == R.Storage.
size();
148 static Error createEOFError() {
149 return make_error<GenericBinaryError>(
"Unexpected EOF",
155 size_t Offset,
size_t Size);
160 template <
typename T>
162 size_t Offset,
size_t Count);
168 StreamMap(std::move(StreamMap)) {}
176 template <
typename T>
181 template <
typename T>
189 template <
typename T>
192 if (Stream->size() >=
sizeof(
T))
193 return *
reinterpret_cast<const T *
>(Stream->data());
194 return createEOFError();
196 return createError(
"No such stream");
199 template <
typename T>
205 return createEOFError();
207 getDataSlice(Data, Offset,
sizeof(
T) * Count);
210 return ArrayRef<T>(
reinterpret_cast<const T *
>(Slice->data()), Count);
216 #endif // LLVM_OBJECT_MINIDUMP_H MemoryInfoIterator(ArrayRef< uint8_t > Storage, size_t Stride)
Expected< const minidump::ExceptionStream & > getExceptionStream() const
Returns the contents of the Exception stream.
static bool classof(const Binary *B)
This class represents lattice values for constants.
Specifies the location (and size) of various objects in the minidump file.
ArrayRef< uint8_t > arrayRefFromStringRef(StringRef Input)
Construct a string ref from an array ref of unsigned chars.
Error takeError()
Take ownership of the stored error.
ArrayRef< minidump::Directory > streams() const
Returns the list of streams (stream directory entries) in this file.
Expected< std::string > getString(size_t Offset) const
Returns the minidump string at the given offset.
StreamType
The type of a minidump stream identifies its contents.
const minidump::MemoryInfo & operator*() const
const minidump::Header & header() const
Returns the contents of the minidump header.
Tagged union holding either a T or a Error.
Expected< const minidump::SystemInfo & > getSystemInfo() const
Returns the contents of the SystemInfo stream, cast to the appropriate type.
Expected< ArrayRef< minidump::Module > > getModuleList() const
Returns the module list embedded in the ModuleList stream.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
CRTP base class which implements the entire standard iterator facade in terms of a minimal subset of ...
static Expected< std::unique_ptr< MinidumpFile > > create(MemoryBufferRef Source)
Construct a new MinidumpFile object from the given memory buffer.
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
The instances of the Type class are immutable: once they are created, they are never changed...
size_t size() const
size - Get the array size.
Expected< ArrayRef< minidump::MemoryDescriptor > > getMemoryList() const
Returns the list of descriptors embedded in the MemoryList stream.
Expected< ArrayRef< uint8_t > > getRawData(minidump::LocationDescriptor Desc) const
Returns the raw contents of an object given by the LocationDescriptor.
Expected< ArrayRef< minidump::Thread > > getThreadList() const
Returns the thread list embedded in the ThreadList stream.
bool operator==(const MemoryInfoIterator &R) const
MemoryInfoIterator & operator++()
ArrayRef< uint8_t > getRawStream(const minidump::Directory &Stream) const
Returns the raw contents of the stream given by the directory entry.
Align max(MaybeAlign Lhs, Align Rhs)
LocationDescriptor Location
Expected< iterator_range< MemoryInfoIterator > > getMemoryInfoList() const
Returns the list of descriptors embedded in the MemoryInfoList stream.
ArrayRef< T > slice(size_t N, size_t M) const
slice(n, m) - Chop off the first N elements of the array, and keep M elements in the array...
support::ulittle32_t DataSize
ArrayRef< T > drop_front(size_t N=1) const
Drop the first N elements of the array.
Specifies the location and type of a single stream in the minidump file.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Lightweight error class with error context and mandatory checking.
StringRef - Represent a constant reference to a string, i.e.
A class providing access to the contents of a minidump file.