21 using namespace llvm::object;
24 std::unique_ptr<IPDBSession> PDBSession,
26 :
DIContext(CK_PDB), Session(std::move(PDBSession)) {
27 if (!RelativeAddress) {
28 uint64_t ImageBase = 0;
38 ImageBase =
static_cast<uint64_t
>(Header->
ImageBase);
40 Session->setLoadAddress(ImageBase);
52 std::unique_ptr<PDBSymbol>
Symbol =
54 if (
auto Func = dyn_cast_or_null<PDBSymbolFunc>(Symbol.get())) {
55 Length =
Func->getLength();
56 }
else if (
auto Data = dyn_cast_or_null<PDBSymbolData>(Symbol.get())) {
57 Length =
Data->getLength();
62 auto LineNumbers = Session->findLineNumbersByAddress(Address, Length);
68 auto SourceFile = Session->getSourceFileById(LineInfo->getSourceFileId());
72 Result.
FileName = SourceFile->getFileName();
73 Result.
Column = LineInfo->getColumnNumber();
74 Result.
Line = LineInfo->getLineNumber();
85 auto LineNumbers = Session->findLineNumbersByAddress(Address, Size);
92 Table.
push_back(std::make_pair(LineInfo->getVirtualAddress(), LineEntry));
109 return std::string();
117 if (
auto PS = dyn_cast_or_null<PDBSymbolPublicSymbol>(PublicSym.get()))
118 return PS->getName();
129 if (
auto Func = dyn_cast_or_null<PDBSymbolFunc>(FuncSymbol.get()))
130 return Func->getName();
132 return std::string();
void push_back(const T &Elt)
void addFrame(const DILineInfo &Frame)
DINameKind
A DINameKind is passed to name search methods to specify a preference regarding the type of name reso...
DIInliningInfo getInliningInfoForAddress(uint64_t Address, DILineInfoSpecifier Specifier=DILineInfoSpecifier()) override
DILineInfo - a format-neutral container for source line information.
void dump(raw_ostream &OS, DIDumpType DumpType=DIDT_All) override
DILineInfoTable getLineInfoForAddressRange(uint64_t Address, uint64_t Size, DILineInfoSpecifier Specifier=DILineInfoSpecifier()) override
DILineInfoSpecifier - controls which fields of DILineInfo container should be filled with data...
DIInliningInfo - a format-neutral container for inlined code description.
DIDumpType
Selects which debug sections get dumped.
std::error_code getPE32PlusHeader(const pe32plus_header *&Res) const
SmallVector< std::pair< uint64_t, DILineInfo >, 16 > DILineInfoTable
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
static StringRef getFunctionName(const DISubprogram *SP)
std::error_code getPE32Header(const pe32_header *&Res) const
This class implements an extremely fast bulk output stream that can only output to a stream...
DILineInfo getLineInfoForAddress(uint64_t Address, DILineInfoSpecifier Specifier=DILineInfoSpecifier()) override