1 //===- CodeViewYAMLDebugSections.h - CodeView YAMLIO debug sections -------===//
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/DebugInfo/CodeView/CodeView.h"
19 #include "llvm/DebugInfo/CodeView/DebugSubsection.h"
20 #include "llvm/DebugInfo/CodeView/DebugSubsectionRecord.h"
21 #include "llvm/ObjectYAML/YAML.h"
26 class DebugStringTableSubsection;
27 class DebugStringTableSubsectionRef;
28 class DebugChecksumsSubsectionRef;
29 class DebugStringTableSubsection;
30 class DebugChecksumsSubsection;
31 class StringsAndChecksums;
32 class StringsAndChecksumsRef;
34 namespace CodeViewYAML {
37 struct YAMLSubsectionBase;
40 struct YAMLFrameData {
45 uint32_t MaxStackSize;
48 uint32_t SavedRegsSize;
52 struct YAMLCrossModuleImport {
54 std::vector<uint32_t> ImportIds;
57 struct SourceLineEntry {
64 struct SourceColumnEntry {
69 struct SourceLineBlock {
71 std::vector<SourceLineEntry> Lines;
72 std::vector<SourceColumnEntry> Columns;
75 struct HexFormattedString {
76 std::vector<uint8_t> Bytes;
79 struct SourceFileChecksumEntry {
81 codeview::FileChecksumKind Kind;
82 HexFormattedString ChecksumBytes;
85 struct SourceLineInfo {
87 uint32_t RelocSegment;
88 codeview::LineFlags Flags;
91 std::vector<SourceLineBlock> Blocks;
97 uint32_t SourceLineNum;
98 std::vector<StringRef> ExtraFiles;
103 std::vector<InlineeSite> Sites;
106 struct YAMLDebugSubsection {
107 static Expected<YAMLDebugSubsection>
108 fromCodeViewSubection(const codeview::StringsAndChecksumsRef &SC,
109 const codeview::DebugSubsectionRecord &SS);
111 std::shared_ptr<detail::YAMLSubsectionBase> Subsection;
114 struct DebugSubsectionState {};
116 Expected<std::vector<std::shared_ptr<codeview::DebugSubsection>>>
117 toCodeViewSubsectionList(BumpPtrAllocator &Allocator,
118 ArrayRef<YAMLDebugSubsection> Subsections,
119 const codeview::StringsAndChecksums &SC);
121 std::vector<YAMLDebugSubsection>
122 fromDebugS(ArrayRef<uint8_t> Data, const codeview::StringsAndChecksumsRef &SC);
124 void initializeStringsAndChecksums(ArrayRef<YAMLDebugSubsection> Sections,
125 codeview::StringsAndChecksums &SC);
127 } // namespace CodeViewYAML
130 LLVM_YAML_DECLARE_MAPPING_TRAITS(CodeViewYAML::YAMLDebugSubsection)
132 LLVM_YAML_IS_SEQUENCE_VECTOR(CodeViewYAML::YAMLDebugSubsection)