LLVM: lib/DebugInfo/PDB/PDBContext.cpp Source File (original) (raw)
1
2
3
4
5
6
7
8
20
21using namespace llvm;
24
26 std::unique_ptr PDBSession)
29 if (ImageBase)
30 Session->setLoadAddress(ImageBase.get());
31}
32
34
35std::optional
39 Result.FunctionName = getFunctionName(Address.Address, Specifier.FNKind);
40
42 std::unique_ptr Symbol =
45 Length = Func->getLength();
48 }
49
50
51
54 return Result;
55
58 auto SourceFile = Session->getSourceFileById(LineInfo->getSourceFileId());
59
60 if (SourceFile &&
62 Result.FileName = SourceFile->getFileName();
63 Result.Column = LineInfo->getColumnNumber();
64 Result.Line = LineInfo->getLineNumber();
65 return Result;
66}
67
68std::optional
74
79 if (Size == 0)
81
85 return Table;
86
87 while (auto LineInfo = LineNumbers->getNext()) {
89 {LineInfo->getVirtualAddress(), Address.SectionIndex}, Specifier))
91 std::make_pair(LineInfo->getVirtualAddress(), *LineEntry));
92 }
93 return Table;
94}
95
102
103
104 std::unique_ptr ParentFunc =
106 if (!ParentFunc) {
109 }
110
111 auto Frames = ParentFunc->findInlineFramesByVA(Address.Address);
112 if (!Frames || Frames->getChildCount() == 0) {
115 }
116
117 while (auto Frame = Frames->getNext()) {
121 break;
122
123 std::unique_ptr Line = LineNumbers->getNext();
125
128 auto SourceFile = Session->getSourceFileById(Line->getSourceFileId());
129 if (SourceFile &&
131 LineInfo.FileName = SourceFile->getFileName();
132 LineInfo.Line = Line->getLineNumber();
133 LineInfo.Column = Line->getColumnNumber();
135 }
136
139}
140
141std::vector
143 return std::vector();
144}
145
149 return std::string();
150
151 std::unique_ptr FuncSymbol =
154
156
157
158
159 auto PublicSym =
162
163
164
165 if (!Func || Func->getVirtualAddress() == PS->getVirtualAddress())
166 return PS->getName();
167 }
168 }
169
170 return Func ? Func->getName() : std::string();
171}
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
DIContext(DIContextKind K)
A format-neutral container for inlined code description.
Represents either an error or a value T.
void push_back(const T &Elt)
DILineInfoTable getLineInfoForAddressRange(object::SectionedAddress Address, uint64_t Size, DILineInfoSpecifier Specifier=DILineInfoSpecifier()) override
Definition PDBContext.cpp:76
DIInliningInfo getInliningInfoForAddress(object::SectionedAddress Address, DILineInfoSpecifier Specifier=DILineInfoSpecifier()) override
Definition PDBContext.cpp:97
std::vector< DILocal > getLocalsForAddress(object::SectionedAddress Address) override
Definition PDBContext.cpp:142
std::optional< DILineInfo > getLineInfoForAddress(object::SectionedAddress Address, DILineInfoSpecifier Specifier=DILineInfoSpecifier()) override
Definition PDBContext.cpp:36
std::optional< DILineInfo > getLineInfoForDataAddress(object::SectionedAddress Address) override
Definition PDBContext.cpp:69
PDBContext(const object::COFFObjectFile &Object, std::unique_ptr< IPDBSession > PDBSession)
Definition PDBContext.cpp:25
void dump(raw_ostream &OS, DIDumpOptions DIDumpOpts) override
Definition PDBContext.cpp:33
This class implements an extremely fast bulk output stream that can only output to a stream.
This is an optimization pass for GlobalISel generic memory operations.
SmallVector< std::pair< uint64_t, DILineInfo >, 16 > DILineInfoTable
auto dyn_cast_or_null(const Y &Val)
DINameKind
A DINameKind is passed to name search methods to specify a preference regarding the type of name reso...
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
Implement std::hash so that hash_code can be used in STL containers.
Container for dump options that control which debug information will be dumped.
Controls which fields of DILineInfo container should be filled with data.
A format-neutral container for source line information.