LLVM: include/llvm/DebugInfo/LogicalView/Readers/LVBinaryReader.h Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

13

14#ifndef LLVM_DEBUGINFO_LOGICALVIEW_READERS_LVBINARYREADER_H

15#define LLVM_DEBUGINFO_LOGICALVIEW_READERS_LVBINARYREADER_H

16

29

30namespace llvm {

32

34

35

47

48

50 using LVSymbolNames = std::map<std::string, LVSymbolTableEntry, std::less<>>;

51 LVSymbolNames SymbolNames;

52

53public:

55

58 bool IsComdat);

60

65

67};

68

70

72

73

74

75

76 using LVInlineeLine = std::map<LVScope *, std::unique_ptr>;

77 LVInlineeLine CUInlineeLines;

78

79

80

82

83

85

86

87

88 using LVSectionAddresses = std::map<LVSectionIndex, object::SectionRef>;

89 LVSectionAddresses SectionAddresses;

90

92 if (SectionAddresses.find(Section.getAddress()) == SectionAddresses.end())

93 SectionAddresses.emplace(Section.getAddress(), Section);

94 }

95

96

97 uint64_t ImageBaseAddress = 0;

99

100

101 using LVSections = std::map<LVSectionIndex, object::SectionRef>;

102 LVSections Sections;

103

104 std::vector<std::unique_ptr> DiscoveredLines;

105

106protected:

107

108

110

111 std::unique_ptr MRI;

112 std::unique_ptr MAI;

113 std::unique_ptr STI;

114 std::unique_ptr MII;

115 std::unique_ptr MD;

116 std::unique_ptr MC;

117 std::unique_ptr MIP;

118

119

120

121

122

123

124

125

126

127

128

129

130

131

132

133

134

135

136

137

138

139

140

141

142

143

144

145

146

147

148

149

150

151

152

153

154

155

156

157

158

160

161

164

169

170

173

176

178

183

187

188public:

196

198 CUInlineeLines.emplace(Scope, std::make_unique(std::move(Lines)));

199 }

200

201

204 return ImageBaseAddress + (Segment * VirtualAddress) + Offset + Addendum;

205 }

206

212

217

222

224

225#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)

227#endif

228};

229

230}

231}

232

233#endif

Lightweight error class with error context and mandatory checking.

Tagged union holding either a T or a Error.

StringRef - Represent a constant reference to a string, i.e.

const LVSymbolTableEntry & getSymbolTableEntry(StringRef Name)

LVSectionIndex updateSymbolTable(LVScope *Function)

Expected< std::pair< LVSectionIndex, object::SectionRef > > getSection(LVScope *Scope, LVAddress Address, LVSectionIndex SectionIndex)

~LVBinaryReader() override=default

LVSectionIndex getSectionIndex(LVScope *Scope) override

Definition LVBinaryReader.h:218

std::unique_ptr< MCContext > MC

Definition LVBinaryReader.h:116

void includeInlineeLines(LVSectionIndex SectionIndex, LVScope *Function)

std::unique_ptr< const MCInstrInfo > MII

Definition LVBinaryReader.h:114

Error loadGenericTargetInfo(StringRef TheTriple, StringRef TheFeatures, StringRef TheCPU)

void addInlineeLines(LVScope *Scope, LVLines &Lines)

Definition LVBinaryReader.h:197

LVBinaryReader(const LVBinaryReader &)=delete

LVAddress getSymbolTableAddress(StringRef Name)

void dump() const

Definition LVBinaryReader.h:226

void print(raw_ostream &OS) const

std::unique_ptr< const MCSubtargetInfo > STI

Definition LVBinaryReader.h:113

LVAddress linearAddress(uint16_t Segment, uint32_t Offset, LVAddress Addendum=0)

Definition LVBinaryReader.h:202

LVLines CULines

Definition LVBinaryReader.h:109

void addToSymbolTable(StringRef Name, LVScope *Function, LVSectionIndex SectionIndex=0)

virtual void mapRangeAddress(const object::ObjectFile &Obj)

Definition LVBinaryReader.h:165

void processLines(LVLines *DebugLines, LVSectionIndex SectionIndex)

void mapVirtualAddress(const object::ObjectFile &Obj)

std::unique_ptr< const MCAsmInfo > MAI

Definition LVBinaryReader.h:112

LVSectionIndex getSymbolTableIndex(StringRef Name)

LVBinaryReader & operator=(const LVBinaryReader &)=delete

virtual void mapRangeAddress(const object::ObjectFile &Obj, const object::SectionRef &Section, bool IsComdat)

Definition LVBinaryReader.h:166

bool getSymbolTableIsComdat(StringRef Name)

std::unique_ptr< const MCRegisterInfo > MRI

Definition LVBinaryReader.h:111

LVBinaryReader(StringRef Filename, StringRef FileFormatName, ScopedPrinter &W, LVBinaryType BinaryType)

Definition LVBinaryReader.h:190

std::unique_ptr< const MCDisassembler > MD

Definition LVBinaryReader.h:115

Error createInstructions()

std::unique_ptr< MCInstPrinter > MIP

Definition LVBinaryReader.h:117

LVAddress WasmCodeSectionOffset

Definition LVBinaryReader.h:159

std::string FileFormatName

LVSectionIndex DotTextSectionIndex

Definition LVBinaryReader.h:49

LVSectionIndex getIndex(StringRef Name)

bool getIsComdat(StringRef Name)

void print(raw_ostream &OS)

LVAddress getAddress(StringRef Name)

void add(StringRef Name, LVScope *Function, LVSectionIndex SectionIndex=0)

LVSectionIndex update(LVScope *Function)

const LVSymbolTableEntry & getEntry(StringRef Name)

This class is the base class for all object file types.

This is a value type class that represents a single section in the list of sections in the object fil...

This class implements an extremely fast bulk output stream that can only output to a stream.

std::pair< LVAddress, uint64_t > LVNameInfo

constexpr bool UpdateHighAddress

Definition LVBinaryReader.h:33

SmallVector< LVLine *, 8 > LVLines

This is an optimization pass for GlobalISel generic memory operations.

LLVM_ABI raw_ostream & dbgs()

dbgs() - This returns a reference to a raw_ostream for debugging messages.

Definition LVBinaryReader.h:36

LVScope * Scope

Definition LVBinaryReader.h:37

LVSectionIndex SectionIndex

Definition LVBinaryReader.h:39

LVSymbolTableEntry()=default

LVAddress Address

Definition LVBinaryReader.h:38

LVSymbolTableEntry(LVScope *Scope, LVAddress Address, LVSectionIndex SectionIndex, bool IsComdat)

Definition LVBinaryReader.h:42

bool IsComdat

Definition LVBinaryReader.h:40