//===- Minidump.h - Minidump constants and structures -----------*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // // This header constants and data structures pertaining to the Windows Minidump // core file format. // // Reference: // https://msdn.microsoft.com/en-us/library/windows/desktop/ms679293(v=vs.85).aspx // https://chromium.googlesource.com/breakpad/breakpad/ // //===----------------------------------------------------------------------===// #ifndef LLVM_BINARYFORMAT_MINIDUMP_H #define LLVM_BINARYFORMAT_MINIDUMP_H #include "llvm/ADT/BitmaskEnum.h" #include "llvm/ADT/DenseMapInfo.h" #include "llvm/Support/Endian.h" namespace llvm { namespace minidump { LLVM_ENABLE_BITMASK_ENUMS_IN_NAMESPACE(…); /// The minidump header is the first part of a minidump file. It identifies the /// file as a minidump file, and gives the location of the stream directory. struct Header { … }; static_assert …; /// The type of a minidump stream identifies its contents. Streams numbers after /// LastReserved are for application-defined data streams. enum class StreamType : uint32_t { … }; /// Specifies the location (and size) of various objects in the minidump file. /// The location is relative to the start of the file. struct LocationDescriptor { … }; static_assert …; /// Describes a single memory range (both its VM address and where to find it in /// the file) of the process from which this minidump file was generated. struct MemoryDescriptor { … }; static_assert …; struct MemoryDescriptor_64 { … }; static_assert …; struct MemoryListHeader { … }; static_assert …; struct Memory64ListHeader { … }; static_assert …; struct MemoryInfoListHeader { … }; static_assert …; enum class MemoryProtection : uint32_t { … }; enum class MemoryState : uint32_t { … }; enum class MemoryType : uint32_t { … }; struct MemoryInfo { … }; static_assert …; /// Specifies the location and type of a single stream in the minidump file. The /// minidump stream directory is an array of entries of this type, with its size /// given by Header.NumberOfStreams. struct Directory { … }; static_assert …; /// The processor architecture of the system that generated this minidump. Used /// in the ProcessorArch field of the SystemInfo stream. enum class ProcessorArchitecture : uint16_t { … }; /// The OS Platform of the system that generated this minidump. Used in the /// PlatformId field of the SystemInfo stream. enum class OSPlatform : uint32_t { … }; /// Detailed information about the processor of the system that generated this /// minidump. Its interpretation depends on the ProcessorArchitecture enum. CPUInfo; static_assert …; /// The SystemInfo stream, containing various information about the system where /// this minidump was generated. struct SystemInfo { … }; static_assert …; struct VSFixedFileInfo { … }; static_assert …; inline bool operator==(const VSFixedFileInfo &LHS, const VSFixedFileInfo &RHS) { … } struct Module { … }; static_assert …; /// Describes a single thread in the minidump file. Part of the ThreadList /// stream. struct Thread { … }; static_assert …; struct Exception { … }; static_assert …; struct ExceptionStream { … }; static_assert …; } // namespace minidump template <> struct DenseMapInfo<minidump::StreamType> { … }; } // namespace llvm #endif // LLVM_BINARYFORMAT_MINIDUMP_H