1 //=- CodeViewYAMLDebugSections.h - CodeView YAMLIO debug sections -*- C++ -*-=//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file defines classes for handling the YAML representation of CodeView
13 //===----------------------------------------------------------------------===//
15 #ifndef LLVM_OBJECTYAML_CODEVIEWYAMLDEBUGSECTIONS_H
16 #define LLVM_OBJECTYAML_CODEVIEWYAMLDEBUGSECTIONS_H
18 #include "llvm/ADT/ArrayRef.h"
19 #include "llvm/ADT/StringRef.h"
20 #include "llvm/DebugInfo/CodeView/CodeView.h"
21 #include "llvm/DebugInfo/CodeView/DebugSubsection.h"
22 #include "llvm/DebugInfo/CodeView/DebugSubsectionRecord.h"
23 #include "llvm/Support/Error.h"
24 #include "llvm/Support/YAMLTraits.h"
33 class StringsAndChecksums;
34 class StringsAndChecksumsRef;
36 } // end namespace codeview
38 namespace CodeViewYAML {
42 struct YAMLSubsectionBase;
44 } // end namespace detail
46 struct YAMLFrameData {
51 uint32_t MaxStackSize;
54 uint32_t SavedRegsSize;
58 struct YAMLCrossModuleImport {
60 std::vector<uint32_t> ImportIds;
63 struct SourceLineEntry {
70 struct SourceColumnEntry {
75 struct SourceLineBlock {
77 std::vector<SourceLineEntry> Lines;
78 std::vector<SourceColumnEntry> Columns;
81 struct HexFormattedString {
82 std::vector<uint8_t> Bytes;
85 struct SourceFileChecksumEntry {
87 codeview::FileChecksumKind Kind;
88 HexFormattedString ChecksumBytes;
91 struct SourceLineInfo {
93 uint32_t RelocSegment;
94 codeview::LineFlags Flags;
96 std::vector<SourceLineBlock> Blocks;
102 uint32_t SourceLineNum;
103 std::vector<StringRef> ExtraFiles;
108 std::vector<InlineeSite> Sites;
111 struct YAMLDebugSubsection {
112 static Expected<YAMLDebugSubsection>
113 fromCodeViewSubection(const codeview::StringsAndChecksumsRef &SC,
114 const codeview::DebugSubsectionRecord &SS);
116 std::shared_ptr<detail::YAMLSubsectionBase> Subsection;
119 struct DebugSubsectionState {};
121 Expected<std::vector<std::shared_ptr<codeview::DebugSubsection>>>
122 toCodeViewSubsectionList(BumpPtrAllocator &Allocator,
123 ArrayRef<YAMLDebugSubsection> Subsections,
124 const codeview::StringsAndChecksums &SC);
126 std::vector<YAMLDebugSubsection>
127 fromDebugS(ArrayRef<uint8_t> Data, const codeview::StringsAndChecksumsRef &SC);
129 void initializeStringsAndChecksums(ArrayRef<YAMLDebugSubsection> Sections,
130 codeview::StringsAndChecksums &SC);
132 } // end namespace CodeViewYAML
134 } // end namespace llvm
136 LLVM_YAML_DECLARE_MAPPING_TRAITS(CodeViewYAML::YAMLDebugSubsection)
138 LLVM_YAML_IS_SEQUENCE_VECTOR(CodeViewYAML::YAMLDebugSubsection)
140 #endif // LLVM_OBJECTYAML_CODEVIEWYAMLDEBUGSECTIONS_H