LLVM: lib/DebugInfo/PDB/Native/NativeFunctionSymbol.cpp Source File (original) (raw)

1

2

3

4

5

6

7

8

10

20

21using namespace llvm;

24

31

33

43

45 return Sym.CodeOffset;

46}

47

50 return std::string(Sym.Name);

51}

52

54

56 return Session.getRVAFromSectOffset(Sym.Segment, Sym.CodeOffset);

57}

58

60 return Session.getVAFromSectOffset(Sym.Segment, Sym.CodeOffset);

61}

62

65

66 bool Found = false;

69 switch (Annot.OpCode) {

75 Found = true;

76 break;

79 if (Found && OffsetInFunc < CodeOffset)

80 return true;

81 Found = false;

82 break;

86 return true;

87 Found = false;

88 break;

89 default:

90 break;

91 }

92 }

93 return false;

94}

95

96std::unique_ptr

99 if (Session.moduleIndexForVA(VA, Modi))

100 return nullptr;

101

103 if (!ModS) {

105 return nullptr;

106 }

108

109

110

111 std::vector Frames;

114 auto End = Syms.at(Sym.End);

115 while (Start != End) {

116 bool Found = false;

117

118 for (; Start != End; ++Start) {

119 if (Start->kind() != S_INLINESITE)

120 continue;

121

125

126 SymIndexId Id = Session.getSymbolCache().getOrCreateInlineSymbol(

128 Frames.insert(Frames.begin(), Id);

129

130

131 ++Start;

132 End = Syms.at(IS.End);

133 Found = true;

134 break;

135 }

136

137 Start = Syms.at(IS.End);

138 if (Start == End)

139 break;

140 }

141

142 if (!Found)

143 break;

144 }

145

146 return std::make_unique(Session, std::move(Frames));

147}

static bool inlineSiteContainsAddress(InlineSiteSym &IS, uint32_t OffsetInFunc)

Definition NativeFunctionSymbol.cpp:63

Tagged union holding either a T or a Error.

Error takeError()

Take ownership of the stored error.

Iterator at(uint32_t Offset) const

given an offset into the array's underlying stream, return an iterator to the record at that offset.

iterator_range< BinaryAnnotationIterator > annotations() const

static Error deserializeAs(CVSymbol Symbol, T &Record)

NativeFunctionSymbol(NativeSession &Session, SymIndexId Id, const codeview::ProcSym &Sym, uint32_t RecordOffset)

Definition NativeFunctionSymbol.cpp:25

uint32_t getAddressSection() const override

Definition NativeFunctionSymbol.cpp:48

std::unique_ptr< IPDBEnumSymbols > findInlineFramesByVA(uint64_t VA) const override

Definition NativeFunctionSymbol.cpp:97

uint64_t getVirtualAddress() const override

Definition NativeFunctionSymbol.cpp:59

void dump(raw_ostream &OS, int Indent, PdbSymbolIdField ShowIdFields, PdbSymbolIdField RecurseIdFields) const override

Definition NativeFunctionSymbol.cpp:34

uint32_t getAddressOffset() const override

Definition NativeFunctionSymbol.cpp:44

~NativeFunctionSymbol() override

std::string getName() const override

Definition NativeFunctionSymbol.cpp:49

const codeview::ProcSym Sym

uint64_t getLength() const override

Definition NativeFunctionSymbol.cpp:53

uint32_t getRelativeVirtualAddress() const override

Definition NativeFunctionSymbol.cpp:55

NativeRawSymbol(NativeSession &PDBSession, PDB_SymType Tag, SymIndexId SymbolId)

void dump(raw_ostream &OS, int Indent, PdbSymbolIdField ShowIdFields, PdbSymbolIdField RecurseIdFields) const override

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

@ ChangeCodeLengthAndCodeOffset

@ ChangeCodeOffsetAndLineOffset

VarStreamArray< CVSymbol > CVSymbolArray

void dumpSymbolField(raw_ostream &OS, StringRef Name, T Value, int Indent)

PDB_SymType

These values correspond to the SymTagEnum enumeration, and are documented here: https://msdn....

This is an optimization pass for GlobalISel generic memory operations.

void cantFail(Error Err, const char *Msg=nullptr)

Report a fatal error if Err is a failure value.

void consumeError(Error Err)

Consume a Error without doing anything.