21 using namespace llvm::object;
22 using namespace llvm::pdb;
25 std::unique_ptr<IPDBSession> PDBSession)
26 :
DIContext(CK_PDB), Session(std::move(PDBSession)) {
29 Session->setLoadAddress(ImageBase.
get());
33 bool SummarizeTypes) {}
41 std::unique_ptr<PDBSymbol>
Symbol =
43 if (
auto Func = dyn_cast_or_null<PDBSymbolFunc>(Symbol.get())) {
44 Length =
Func->getLength();
45 }
else if (
auto Data = dyn_cast_or_null<PDBSymbolData>(Symbol.get())) {
46 Length =
Data->getLength();
51 auto LineNumbers = Session->findLineNumbersByAddress(Address, Length);
57 auto SourceFile = Session->getSourceFileById(LineInfo->getSourceFileId());
61 Result.
FileName = SourceFile->getFileName();
62 Result.
Column = LineInfo->getColumnNumber();
63 Result.
Line = LineInfo->getLineNumber();
74 auto LineNumbers = Session->findLineNumbersByAddress(Address, Size);
81 Table.
push_back(std::make_pair(LineInfo->getVirtualAddress(), LineEntry));
95 std::string PDBContext::getFunctionName(uint64_t
Address,
100 std::unique_ptr<PDBSymbol> FuncSymbol =
102 auto *
Func = dyn_cast_or_null<PDBSymbolFunc>(FuncSymbol.get());
110 if (
auto *
PS = dyn_cast_or_null<PDBSymbolPublicSymbol>(PublicSym.get())) {
114 if (!
Func ||
Func->getVirtualAddress() ==
PS->getVirtualAddress())
115 return PS->getName();
119 return Func ?
Func->getName() : std::string();
void push_back(const T &Elt)
Represents either an error or a value T.
void addFrame(const DILineInfo &Frame)
DINameKind
A DINameKind is passed to name search methods to specify a preference regarding the type of name reso...
DILineInfo - a format-neutral container for source line information.
DILineInfo getLineInfoForAddress(uint64_t Address, DILineInfoSpecifier Specifier=DILineInfoSpecifier()) override
uint64_t getImageBase() const
DILineInfoSpecifier - controls which fields of DILineInfo container should be filled with data...
void dump(raw_ostream &OS, DIDumpType DumpType=DIDT_All, bool DumpEH=false, bool SummarizeTypes=false) override
DIInliningInfo - a format-neutral container for inlined code description.
DIDumpType
Selects which debug sections get dumped.
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...
DIInliningInfo getInliningInfoForAddress(uint64_t Address, DILineInfoSpecifier Specifier=DILineInfoSpecifier()) override
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
DILineInfoTable getLineInfoForAddressRange(uint64_t Address, uint64_t Size, DILineInfoSpecifier Specifier=DILineInfoSpecifier()) override
This class implements an extremely fast bulk output stream that can only output to a stream...