53 using namespace dwarf;
54 using namespace object;
56 #define DEBUG_TYPE "dwarf"
67 OS <<
"\n." << Name <<
" contents:\n";
77 StringRef StringSection,
bool LittleEndian) {
82 while (Offset < SectionSize) {
85 unsigned EntrySize = 4;
88 OS <<
"error: invalid contribution to string offsets table in section ."
89 << SectionName <<
".\n";
93 uint64_t ContributionSize = StrOffsetExt.
getU32(&Offset);
97 if (ContributionSize == 0xffffffff) {
99 OS <<
"error: invalid contribution to string offsets table in section ."
100 << SectionName <<
".\n";
105 ContributionSize = StrOffsetExt.
getU64(&Offset);
106 }
else if (ContributionSize > 0xfffffff0) {
107 OS <<
"error: invalid contribution to string offsets table in section ."
108 << SectionName <<
".\n";
115 uint64_t ValidationSize =
116 4 + ((ContributionSize + EntrySize - 1) & (-(uint64_t)EntrySize));
118 OS <<
"error: contribution to string offsets table in section ."
119 << SectionName <<
" has invalid length.\n";
123 Version = StrOffsetExt.
getU16(&Offset);
125 OS <<
format(
"0x%8.8x: ", ContributionStart);
126 OS <<
"Contribution size = " << ContributionSize
127 <<
", Version = " << Version <<
"\n";
131 while (Offset - ContributionBase < ContributionSize) {
132 OS <<
format(
"0x%8.8x: ", Offset);
134 uint64_t StringOffset =
138 OS <<
format(
"%8.8x ", StringOffset32);
139 const char *S = StrData.
getCStr(&StringOffset32);
141 OS <<
format(
"\"%s\"", S);
143 OS <<
format(
"%16.16" PRIx64
" ", StringOffset);
157 StringRef StringSection,
bool LittleEndian,
158 unsigned MaxVersion) {
161 OS <<
"\n." << SectionName <<
" contents:\n";
167 StringSection, LittleEndian);
171 uint64_t size = StringOffsetsSection.
Data.
size();
173 if (size & ((uint64_t)(
sizeof(
uint32_t) - 1))) {
174 OS <<
"error: size of ." << SectionName <<
" is not a multiple of "
176 size &= -(uint64_t)
sizeof(
uint32_t);
179 while (offset < size) {
180 OS <<
format(
"0x%8.8x: ", offset);
182 OS <<
format(
"%8.8x ", StringOffset);
183 const char *S = StrData.
getCStr(&StringOffset);
185 OS <<
format(
"\"%s\"", S);
193 bool DumpEH = DumpOpts.
DumpEH;
197 OS <<
".debug_abbrev contents:\n";
198 getDebugAbbrev()->dump(OS);
203 OS <<
"\n.debug_abbrev.dwo contents:\n";
208 OS <<
"\n.debug_info contents:\n";
209 for (
const auto &CU : compile_units())
210 CU->dump(OS, DumpOpts);
214 getNumDWOCompileUnits()) {
215 OS <<
"\n.debug_info.dwo contents:\n";
216 for (
const auto &DWOCU : dwo_compile_units())
217 DWOCU->dump(OS, DumpOpts);
221 OS <<
"\n.debug_types contents:\n";
222 for (
const auto &TUS : type_unit_sections())
223 for (
const auto &TU : TUS)
224 TU->dump(OS, SummarizeTypes);
228 getNumDWOTypeUnits()) {
229 OS <<
"\n.debug_types.dwo contents:\n";
230 for (
const auto &DWOTUS : dwo_type_unit_sections())
231 for (
const auto &DWOTU : DWOTUS)
232 DWOTU->dump(OS, SummarizeTypes);
236 OS <<
"\n.debug_loc contents:\n";
237 getDebugLoc()->dump(OS);
241 OS <<
"\n.debug_loc.dwo contents:\n";
242 getDebugLocDWO()->dump(OS);
246 OS <<
"\n.debug_frame contents:\n";
247 getDebugFrame()->dump(OS);
249 OS <<
"\n.eh_frame contents:\n";
250 getEHFrame()->dump(OS);
255 OS <<
"\n.debug_macinfo contents:\n";
256 getDebugMacro()->dump(OS);
261 OS <<
"\n.debug_aranges contents:\n";
262 DataExtractor arangesData(getARangeSection(), isLittleEndian(), 0);
264 while (set.
extract(arangesData, &offset))
268 uint8_t savedAddressByteSize = 0;
270 OS <<
"\n.debug_line contents:\n";
271 for (
const auto &CU : compile_units()) {
272 savedAddressByteSize = CU->getAddressByteSize();
273 auto CUDIE = CU->getUnitDIE();
278 savedAddressByteSize);
281 LineTable.
parse(lineData, &Offset);
288 OS <<
"\n.debug_cu_index contents:\n";
289 getCUIndex().dump(OS);
293 OS <<
"\n.debug_tu_index contents:\n";
294 getTUIndex().dump(OS);
298 OS <<
"\n.debug_line.dwo contents:\n";
299 unsigned stmtOffset = 0;
301 savedAddressByteSize);
310 OS <<
"\n.debug_str contents:\n";
311 DataExtractor strData(getStringSection(), isLittleEndian(), 0);
314 while (
const char *s = strData.
getCStr(&offset)) {
315 OS <<
format(
"0x%8.8x: \"%s\"\n", strOffset, s);
321 !getStringDWOSection().empty()) {
322 OS <<
"\n.debug_str.dwo contents:\n";
323 DataExtractor strDWOData(getStringDWOSection(), isLittleEndian(), 0);
326 while (
const char *s = strDWOData.
getCStr(&offset)) {
327 OS <<
format(
"0x%8.8x: \"%s\"\n", strDWOOffset, s);
328 strDWOOffset = offset;
333 OS <<
"\n.debug_ranges contents:\n";
339 savedAddressByteSize);
342 while (rangeList.
extract(rangesData, &offset))
348 .
dump(
"debug_pubnames", OS);
352 .
dump(
"debug_pubtypes", OS);
357 .
dump(
"debug_gnu_pubnames", OS);
362 .
dump(
"debug_gnu_pubtypes", OS);
366 getStringSection(), isLittleEndian(),
371 getStringOffsetDWOSection(), getStringDWOSection(),
372 isLittleEndian(), getMaxVersion());
376 !getGdbIndexSection().empty()) {
377 OS <<
"\n.gnu_index contents:\n";
378 getGdbIndex().dump(OS);
383 getStringSection(), isLittleEndian());
387 getStringSection(), isLittleEndian());
391 getStringSection(), isLittleEndian());
395 getStringSection(), isLittleEndian());
401 for (
const auto &DWOCU : dwo_compile_units())
402 if (DWOCU->getDWOId() ==
Hash)
409 if (
auto *CU = CUs.getUnitForOffset(Offset))
410 return CU->getDIEForOffset(Offset);
436 DataExtractor CUIndexData(getCUIndexSection(), isLittleEndian(), 0);
438 CUIndex = llvm::make_unique<DWARFUnitIndex>(
DW_SECT_INFO);
439 CUIndex->parse(CUIndexData);
447 DataExtractor TUIndexData(getTUIndexSection(), isLittleEndian(), 0);
450 TUIndex->parse(TUIndexData);
459 GdbIndex = llvm::make_unique<DWARFGdbIndex>();
460 GdbIndex->parse(GdbIndexData);
468 DataExtractor abbrData(getAbbrevSection(), isLittleEndian(), 0);
471 Abbrev->extract(abbrData);
477 return AbbrevDWO.get();
479 DataExtractor abbrData(getAbbrevDWOSection(), isLittleEndian(), 0);
481 AbbrevDWO->extract(abbrData);
482 return AbbrevDWO.get();
491 if (getNumCompileUnits()) {
493 getCompileUnitAtIndex(0)->getAddressByteSize());
505 LocDWO->parse(LocData);
511 return Aranges.get();
515 return Aranges.get();
520 return DebugFrame.get();
531 DataExtractor debugFrameData(getDebugFrameSection(), isLittleEndian(),
534 DebugFrame->parse(debugFrameData);
535 return DebugFrame.get();
540 return EHFrame.get();
542 DataExtractor debugFrameData(getEHFrameSection(), isLittleEndian(),
545 DebugFrame->parse(debugFrameData);
546 return DebugFrame.get();
553 DataExtractor MacinfoData(getMacinfoSection(), isLittleEndian(), 0);
555 Macro->parse(MacinfoData);
584 return Line->getOrParseLineTable(lineData, stmtOffset);
587 void DWARFContext::parseCompileUnits() {
588 CUs.parse(*
this, getInfoSection());
591 void DWARFContext::parseTypeUnits() {
596 TUs.back().parse(*
this, S);
600 void DWARFContext::parseDWOCompileUnits() {
601 DWOCUs.parseDWO(*
this, getInfoDWOSection());
604 void DWARFContext::parseDWOTypeUnits() {
608 DWOTUs.emplace_back();
609 DWOTUs.back().parseDWO(*
this, S);
615 return CUs.getUnitForOffset(Offset);
620 uint32_t CUOffset = getDebugAranges()->findAddress(Address);
622 return getCompileUnitForOffset(CUOffset);
628 std::string &FunctionName,
635 if (InlinedChain.
empty())
639 bool FoundResult =
false;
640 const char *
Name =
nullptr;
646 StartLine = DeclLineResult;
679 std::string FunctionName =
"<invalid>";
690 Lines.
push_back(std::make_pair(Address, Result));
697 std::vector<uint32_t> RowVector;
701 for (
uint32_t RowIndex : RowVector) {
729 if (InlinedChain.
size() == 0) {
734 LineTable = getLineTableForUnit(CU);
743 uint32_t CallFile = 0, CallLine = 0, CallColumn = 0, CallDiscriminator = 0;
744 for (
uint32_t i = 0, n = InlinedChain.
size(); i != n; i++) {
745 DWARFDie &FunctionDIE = InlinedChain[i];
756 LineTable = getLineTableForUnit(CU);
767 Frame.
Line = CallLine;
768 Frame.
Column = CallColumn;
782 std::shared_ptr<DWARFContext>
784 if (
auto S = DWP.lock()) {
786 return std::shared_ptr<DWARFContext>(std::move(S), Ctxt);
789 std::weak_ptr<DWOFile> *Entry = &DWOFiles[AbsolutePath];
791 if (
auto S = Entry->lock()) {
793 return std::shared_ptr<DWARFContext>(std::move(S), Ctxt);
798 if (!CheckedForDWP) {
805 CheckedForDWP =
true;
821 auto S = std::make_shared<DWOFile>();
822 S->File = std::move(Obj.
get());
823 S->Context = llvm::make_unique<DWARFContextInMemory>(*S->File.getBinary());
825 auto *Ctxt = S->Context.get();
826 return std::shared_ptr<DWARFContext>(std::move(S), Ctxt);
830 return make_error<StringError>(Reason +
toString(std::move(E)),
844 const RelocationRef &Reloc,
846 std::map<SymbolRef, SymInfo> &Cache) {
851 std::map<SymbolRef, SymInfo>::iterator CacheIt = Cache.end();
856 std::tie(CacheIt, New) = Cache.insert({*Sym, {0, 0}});
858 return CacheIt->second;
862 return createError(
"failed to compute symbol address: ",
868 return createError(
"failed to get symbol section: ",
869 SectOrErr.takeError());
873 }
else if (
auto *MObj = dyn_cast<MachOObjectFile>(&Obj)) {
874 RSec = MObj->getRelocationSection(Reloc.getRawDataRefImpl());
875 Ret.
Address = RSec->getAddress();
890 Ret.
Address += SectionLoadAddress - RSec->getAddress();
892 if (CacheIt != Cache.end())
893 CacheIt->second = Ret;
899 const RelocationRef &Reloc) {
900 const MachOObjectFile *MachObj =
dyn_cast<MachOObjectFile>(&Obj);
905 auto RelocInfo = MachObj->getRelocation(Reloc.getRawDataRefImpl());
906 return MachObj->isRelocationScattered(RelocInfo);
909 Error DWARFContextInMemory::maybeDecompress(
const SectionRef &Sec,
911 if (!Decompressor::isCompressed(Sec))
915 Decompressor::create(Name, Data, IsLittleEndian, AddressSize == 8);
920 if (
auto Err = Decompressor->resizeAndDecompress(Out))
924 Data = UncompressedSections.
back();
937 : FileName(Obj.
getFileName()), IsLittleEndian(Obj.isLittleEndian()),
938 AddressSize(Obj.getBytesInAddress()) {
954 if (
auto Err = maybeDecompress(
Section, Name, Data)) {
956 createError(
"failed to decompress '" + Name +
"', ", std::move(Err)));
971 if (
StringRef *SectionData = mapSectionToMember(Name)) {
973 if (Name ==
"debug_ranges") {
977 }
else if (Name ==
"debug_types") {
981 }
else if (Name ==
"debug_types.dwo") {
990 RelocatedSection->getName(RelSecName);
1003 if (!L && isa<MachOObjectFile>(&Obj))
1006 RelSecName = RelSecName.
substr(
1016 if (RelSecName ==
"debug_types")
1017 Map = &TypesSections[*RelocatedSection].Relocs;
1018 else if (RelSecName ==
"debug_types.dwo")
1019 Map = &TypesDWOSections[*RelocatedSection].Relocs;
1028 std::map<SymbolRef, SymInfo> AddrCache;
1029 for (
const RelocationRef &Reloc :
Section.relocations()) {
1036 if (!SymInfoOrErr) {
1043 uint64_t Val = V.
visit(Reloc.getType(), Reloc, SymInfoOrErr->Address);
1046 Reloc.getTypeName(Type);
1048 createError(
"failed to compute relocation: " + Type +
", ",
1055 Map->
insert({Reloc.getOffset(), Rel});
1061 const StringMap<std::unique_ptr<MemoryBuffer>> &Sections, uint8_t AddrSize,
1062 bool isLittleEndian)
1063 : IsLittleEndian(isLittleEndian), AddressSize(AddrSize) {
1064 for (
const auto &SecIt : Sections) {
1065 if (
StringRef *SectionData = mapSectionToMember(SecIt.first()))
1066 *SectionData = SecIt.second->getBuffer();
1072 .Case(
"debug_info", &InfoSection)
1073 .
Case(
"debug_loc", &LocSection)
1074 .
Case(
"debug_line", &LineSection)
1075 .
Case(
"debug_str_offsets", &StringOffsetSection)
1076 .
Case(
"debug_ranges", &RangeSection)
1077 .
Case(
"debug_info.dwo", &InfoDWOSection)
1078 .
Case(
"debug_loc.dwo", &LocDWOSection)
1079 .
Case(
"debug_line.dwo", &LineDWOSection)
1080 .
Case(
"debug_str_offsets.dwo", &StringOffsetDWOSection)
1081 .
Case(
"debug_addr", &AddrSection)
1082 .
Case(
"apple_names", &AppleNamesSection)
1083 .
Case(
"apple_types", &AppleTypesSection)
1084 .
Case(
"apple_namespaces", &AppleNamespacesSection)
1085 .
Case(
"apple_namespac", &AppleNamespacesSection)
1086 .
Case(
"apple_objc", &AppleObjCSection)
1094 .Case(
"debug_abbrev", &AbbrevSection)
1095 .
Case(
"debug_aranges", &ARangeSection)
1096 .
Case(
"debug_frame", &DebugFrameSection)
1097 .
Case(
"eh_frame", &EHFrameSection)
1098 .
Case(
"debug_str", &StringSection)
1099 .
Case(
"debug_macinfo", &MacinfoSection)
1100 .
Case(
"debug_pubnames", &PubNamesSection)
1101 .
Case(
"debug_pubtypes", &PubTypesSection)
1102 .
Case(
"debug_gnu_pubnames", &GnuPubNamesSection)
1103 .
Case(
"debug_gnu_pubtypes", &GnuPubTypesSection)
1104 .
Case(
"debug_abbrev.dwo", &AbbrevDWOSection)
1105 .
Case(
"debug_str.dwo", &StringDWOSection)
1106 .
Case(
"debug_cu_index", &CUIndexSection)
1107 .
Case(
"debug_tu_index", &TUIndexSection)
1108 .
Case(
"gdb_index", &GdbIndexSection)
1113 void DWARFContextInMemory::anchor() {}
const DWARFUnitIndex & getTUIndex()
static Expected< OwningBinary< ObjectFile > > createObjectFile(StringRef ObjectPath)
Create ObjectFile from path.
void getInlinedChainForAddress(uint64_t Address, SmallVectorImpl< DWARFDie > &InlinedChain)
getInlinedChainForAddress - fetches inlined chain for a given address.
const DWARFDebugFrame * getEHFrame()
Get a pointer to the parsed eh frame information object.
void push_back(const T &Elt)
const DWARFDebugFrame * getDebugFrame()
Get a pointer to the parsed frame information object.
virtual uint64_t getSectionLoadAddress(const object::SectionRef &Sec) const
Obtain the Load Address of a section by SectionRef.
raw_ostream & errs()
This returns a reference to a raw_ostream for standard error.
virtual bool getLoadedSectionContents(const object::SectionRef &Sec, StringRef &Data) const
If conveniently available, return the content of the given Section.
A parsed .debug_frame or .eh_frame section.
const DWARFDebugLocDWO * getDebugLocDWO()
Get a pointer to the parsed DebugLoc object.
Represents structure for holding and parsing .debug_pub* tables.
const DWARFDebugLoc * getDebugLoc()
Get a pointer to the parsed DebugLoc object.
bool parse(const DWARFDataExtractor &DebugLineData, uint32_t *OffsetPtr)
Parse prologue and all rows.
ErrorPolicy
Used as a return value for a error callback passed to DWARF context.
DWARFDie getDIEForOffset(uint32_t Offset)
Get a DIE given an exact offset.
DWARFGdbIndex & getGdbIndex()
std::shared_ptr< DWARFContext > getDWOContext(StringRef AbsolutePath)
bool getFileNameByIndex(uint64_t FileIndex, const char *CompDir, DILineInfoSpecifier::FileLineInfoKind Kind, std::string &Result) const
Extracts filename by its index in filename table in prologue.
bool handleDebugLine()
Verify the information in the .debug_line section.
An efficient, type-erasing, non-owning reference to a callable.
uint32_t Line
An unsigned integer indicating a source line number.
This class is the base class for all object file types.
void addFrame(const DILineInfo &Frame)
const DWARFDebugAbbrev * getDebugAbbrevDWO()
Get a pointer to the parsed dwo abbreviations object.
DINameKind
A DINameKind is passed to name search methods to specify a preference regarding the type of name reso...
Error takeError()
Take ownership of the stored error.
LLVM_NODISCARD char back() const
back - Get the last character in the string.
void generate(DWARFContext *CTX)
static void dumpAccelSection(raw_ostream &OS, StringRef Name, const DWARFSection &Section, StringRef StringSection, bool LittleEndian)
const char * getSubroutineName(DINameKind Kind) const
If a DIE represents a subprogram (or inlined subroutine), returns its mangled name (or short name...
bool handleDebugInfo()
Verify the information in the .debug_info section.
DILineInfo - a format-neutral container for source line information.
std::pair< iterator, bool > insert(const std::pair< KeyT, ValueT > &KV)
static bool getFunctionNameAndStartLineForAddress(DWARFCompileUnit *CU, uint64_t Address, FunctionNameKind Kind, std::string &FunctionName, uint32_t &StartLine)
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
DwarfFormat
Constants that define the DWARF format as 32 or 64 bit.
const char * getCompilationDir()
void getCallerFrame(uint32_t &CallFile, uint32_t &CallLine, uint32_t &CallColumn, uint32_t &CallDiscriminator) const
Retrieves values of DW_AT_call_file, DW_AT_call_line and DW_AT_call_column from DIE (or zeroes if the...
void dump(StringRef Name, raw_ostream &OS) const
uint64_t Address
The program-counter value corresponding to a machine instruction generated by the compiler...
LLVM_ATTRIBUTE_ALWAYS_INLINE R Default(const T &Value) const
Tagged union holding either a T or a Error.
LLVM_NODISCARD bool empty() const
content_iterator< SectionRef > section_iterator
LLVM_ATTRIBUTE_ALWAYS_INLINE StringSwitch & Case(const char(&S)[N], const T &Value)
bool parse(const DWARFDataExtractor &DebugLineData, uint32_t *OffsetPtr)
const DWARFDebugAranges * getDebugAranges()
Get a pointer to the parsed DebugAranges object.
const DWARFDebugAbbrev * getDebugAbbrev()
Get a pointer to the parsed DebugAbbrev object.
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE size_t size() const
size - Get the string size.
format_object< Ts...> format(const char *Fmt, const Ts &...Vals)
These are helper functions used to produce formatted output.
Container for dump options that control which debug information will be dumped.
static Expected< StringRef > getFileName(const DebugStringTableSubsectionRef &Strings, const DebugChecksumsSubsectionRef &Checksums, uint32_t FileID)
Optional< uint64_t > toSectionOffset(const Optional< DWARFFormValue > &V)
Take an optional DWARFFormValue and try to extract an section offset.
A switch()-like statement whose cases are string literals.
Utility class that carries the DWARF compile/type unit and the debug info entry in an object...
* if(!EatIfPresent(lltok::kw_thread_local)) return false
ParseOptionalThreadLocal := /*empty.
void dump(raw_ostream &OS) const
DILineInfoSpecifier - controls which fields of DILineInfo container should be filled with data...
uint16_t File
An unsigned integer indicating the identity of the source file corresponding to a machine instruction...
Error errorCodeToError(std::error_code EC)
Helper for converting an std::error_code to a Error.
const DWARFDebugMacro * getDebugMacro()
Get a pointer to the parsed DebugMacro object.
DIInliningInfo - a format-neutral container for inlined code description.
A structured debug information entry.
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE StringRef substr(size_t Start, size_t N=npos) const
Return a reference to the substring from [Start, Start + N).
DIDumpType
Selects which debug sections get dumped.
static Error createError(const Twine &Reason, llvm::Error E)
DILineInfo getLineInfoForAddress(uint64_t Address, DILineInfoSpecifier Specifier=DILineInfoSpecifier()) override
static void dumpStringOffsetsSection(raw_ostream &OS, StringRef SectionName, const DWARFSection &StringOffsetsSection, StringRef StringSection, bool LittleEndian, unsigned MaxVersion)
void dump(raw_ostream &OS) const
virtual basic_symbol_iterator symbol_end() const =0
static bool isRelocScattered(const object::ObjectFile &Obj, const RelocationRef &Reloc)
section_iterator_range sections() const
LLVM_NODISCARD size_t find_first_not_of(char C, size_t From=0) const
Find the first character in the string that is not C or npos if not found.
void dump(raw_ostream &OS) const
void consumeError(Error Err)
Consume a Error without doing anything.
Standard .debug_line state machine structure.
DWARFContextInMemory(const object::ObjectFile &Obj, const LoadedObjectInfo *L=nullptr, function_ref< ErrorPolicy(Error)> HandleError=defaultErrorHandler)
Expected< uint64_t > getAddress() const
Returns the symbol virtual address (i.e.
bool verify(raw_ostream &OS, DIDumpType DumpType=DIDT_All) override
DWARFCompileUnit * getDWOCompileUnitForHash(uint64_t Hash)
uint16_t Column
An unsigned integer indicating a column number within a source line.
DWARFDie getUnitDIE(bool ExtractUnitDIEOnly=true)
static ErrorSuccess success()
Create a success value.
uint64_t getDeclLine() const
Returns the declaration line (start line) for a DIE, assuming it specifies a subprogram.
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
static Expected< SymInfo > getSymbolInfo(const object::ObjectFile &Obj, const RelocationRef &Reloc, const LoadedObjectInfo *L, std::map< SymbolRef, SymInfo > &Cache)
Returns the address of symbol relocation used against and a section index.
bool extract(DataExtractor data, uint32_t *offset_ptr)
DWARFContext This data structure is the top level entity that deals with dwarf debug information pars...
void dump(raw_ostream &OS) const
bool lookupAddressRange(uint64_t Address, uint64_t Size, std::vector< uint32_t > &Result) const
reference get()
Returns a reference to the stored T value.
const DWARFSection & getLineSection() const
Optional< const char * > toString(const Optional< DWARFFormValue > &V)
Take an optional DWARFFormValue and try to extract a string value from it.
StringMap - This is an unconventional map that is specialized for handling keys that are "strings"...
An inferface for inquiring the load address of a loaded object file to be used by the DIContext imple...
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE bool empty() const
empty - Check if the string is empty.
constexpr char Size[]
Key for Kernel::Arg::Metadata::mSize.
Expected< section_iterator > getSection() const
Get section this symbol is defined in reference to.
DILineInfoTable getLineInfoForAddressRange(uint64_t Address, uint64_t Size, DILineInfoSpecifier Specifier=DILineInfoSpecifier()) override
RelocAddrEntry contains relocated value and section index.
void emplace_back(ArgTypes &&...Args)
A class that verifies DWARF debug information given a DWARF Context.
virtual section_iterator section_end() const =0
virtual StringRef mapDebugSectionName(StringRef Name) const
Maps a debug section name to a standard DWARF section name.
LLVM_ATTRIBUTE_ALWAYS_INLINE size_type size() const
LLVM_NODISCARD std::enable_if<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type dyn_cast(const Y &Val)
bool getFileLineInfoForAddress(uint64_t Address, const char *CompDir, DILineInfoSpecifier::FileLineInfoKind Kind, DILineInfo &Result) const
Fills the Result argument with the file and line information corresponding to Address.
const DWARFUnitIndex & getCUIndex()
uint8_t getAddressByteSize() const
uint32_t getLineTableOffset() const
SymInfo contains information about symbol: it's address and section index which is -1LL for absolute ...
bool handleAppleNames()
Verify the information in the .apple_names accelerator table.
DINameKind FunctionNameKind
static void dumpDWARFv5StringOffsetsSection(raw_ostream &OS, StringRef SectionName, const DWARFSection &StringOffsetsSection, StringRef StringSection, bool LittleEndian)
const DWARFDebugLine::LineTable * getLineTableForUnit(DWARFUnit *cu)
Get a pointer to a parsed line table corresponding to a compile unit.
Lightweight error class with error context and mandatory checking.
This class implements an extremely fast bulk output stream that can only output to a stream...
std::string Hash(const Unit &U)
StringRef - Represent a constant reference to a string, i.e.
void dump(raw_ostream &OS, DIDumpOptions DumpOpts) override
bool extract(const DWARFDataExtractor &data, uint32_t *offset_ptr)
uint64_t visit(uint32_t Rel, RelocationRef R, uint64_t Value=0)
Base class for object file relocation visitors.
std::error_code inconvertibleErrorCode()
The value returned by this function can be returned from convertToErrorCode for Error values where no...