29#define DEBUG_TYPE "DWARFReader"
32 CurrentScope =
nullptr;
33 CurrentSymbol =
nullptr;
34 CurrentType =
nullptr;
35 CurrentRanges.clear();
37 if (!
options().getPrintSymbols()) {
42 case dwarf::DW_TAG_formal_parameter:
43 case dwarf::DW_TAG_unspecified_parameters:
44 case dwarf::DW_TAG_member:
45 case dwarf::DW_TAG_variable:
46 case dwarf::DW_TAG_inheritance:
47 case dwarf::DW_TAG_constant:
48 case dwarf::DW_TAG_call_site_parameter:
49 case dwarf::DW_TAG_GNU_call_site_parameter:
58 case dwarf::DW_TAG_base_type:
59 CurrentType = createType();
60 CurrentType->setIsBase();
61 if (
options().getAttributeBase())
62 CurrentType->setIncludeInPrint();
64 case dwarf::DW_TAG_const_type:
65 CurrentType = createType();
66 CurrentType->setIsConst();
69 case dwarf::DW_TAG_enumerator:
70 CurrentType = createTypeEnumerator();
72 case dwarf::DW_TAG_imported_declaration:
73 CurrentType = createTypeImport();
74 CurrentType->setIsImportDeclaration();
76 case dwarf::DW_TAG_imported_module:
77 CurrentType = createTypeImport();
78 CurrentType->setIsImportModule();
80 case dwarf::DW_TAG_pointer_type:
81 CurrentType = createType();
82 CurrentType->setIsPointer();
85 case dwarf::DW_TAG_ptr_to_member_type:
86 CurrentType = createType();
87 CurrentType->setIsPointerMember();
90 case dwarf::DW_TAG_reference_type:
91 CurrentType = createType();
92 CurrentType->setIsReference();
95 case dwarf::DW_TAG_restrict_type:
96 CurrentType = createType();
97 CurrentType->setIsRestrict();
98 CurrentType->
setName(
"restrict");
100 case dwarf::DW_TAG_rvalue_reference_type:
101 CurrentType = createType();
102 CurrentType->setIsRvalueReference();
105 case dwarf::DW_TAG_subrange_type:
106 CurrentType = createTypeSubrange();
108 case dwarf::DW_TAG_template_value_parameter:
109 CurrentType = createTypeParam();
110 CurrentType->setIsTemplateValueParam();
112 case dwarf::DW_TAG_template_type_parameter:
113 CurrentType = createTypeParam();
114 CurrentType->setIsTemplateTypeParam();
116 case dwarf::DW_TAG_GNU_template_template_param:
117 CurrentType = createTypeParam();
118 CurrentType->setIsTemplateTemplateParam();
120 case dwarf::DW_TAG_typedef:
121 CurrentType = createTypeDefinition();
123 case dwarf::DW_TAG_unspecified_type:
124 CurrentType = createType();
125 CurrentType->setIsUnspecified();
127 case dwarf::DW_TAG_volatile_type:
128 CurrentType = createType();
129 CurrentType->setIsVolatile();
130 CurrentType->
setName(
"volatile");
134 case dwarf::DW_TAG_formal_parameter:
135 CurrentSymbol = createSymbol();
136 CurrentSymbol->setIsParameter();
137 return CurrentSymbol;
138 case dwarf::DW_TAG_unspecified_parameters:
139 CurrentSymbol = createSymbol();
140 CurrentSymbol->setIsUnspecified();
142 return CurrentSymbol;
143 case dwarf::DW_TAG_member:
144 CurrentSymbol = createSymbol();
145 CurrentSymbol->setIsMember();
146 return CurrentSymbol;
147 case dwarf::DW_TAG_variable:
148 CurrentSymbol = createSymbol();
149 CurrentSymbol->setIsVariable();
150 return CurrentSymbol;
151 case dwarf::DW_TAG_inheritance:
152 CurrentSymbol = createSymbol();
153 CurrentSymbol->setIsInheritance();
154 return CurrentSymbol;
155 case dwarf::DW_TAG_call_site_parameter:
156 case dwarf::DW_TAG_GNU_call_site_parameter:
157 CurrentSymbol = createSymbol();
158 CurrentSymbol->setIsCallSiteParameter();
159 return CurrentSymbol;
160 case dwarf::DW_TAG_constant:
161 CurrentSymbol = createSymbol();
162 CurrentSymbol->setIsConstant();
163 return CurrentSymbol;
166 case dwarf::DW_TAG_catch_block:
167 CurrentScope = createScope();
168 CurrentScope->setIsCatchBlock();
170 case dwarf::DW_TAG_lexical_block:
171 CurrentScope = createScope();
172 CurrentScope->setIsLexicalBlock();
174 case dwarf::DW_TAG_try_block:
175 CurrentScope = createScope();
176 CurrentScope->setIsTryBlock();
178 case dwarf::DW_TAG_compile_unit:
179 case dwarf::DW_TAG_skeleton_unit:
180 CurrentScope = createScopeCompileUnit();
183 case dwarf::DW_TAG_inlined_subroutine:
184 CurrentScope = createScopeFunctionInlined();
186 case dwarf::DW_TAG_namespace:
187 CurrentScope = createScopeNamespace();
189 case dwarf::DW_TAG_template_alias:
190 CurrentScope = createScopeAlias();
192 case dwarf::DW_TAG_array_type:
193 CurrentScope = createScopeArray();
195 case dwarf::DW_TAG_call_site:
196 case dwarf::DW_TAG_GNU_call_site:
197 CurrentScope = createScopeFunction();
198 CurrentScope->setIsCallSite();
200 case dwarf::DW_TAG_entry_point:
201 CurrentScope = createScopeFunction();
202 CurrentScope->setIsEntryPoint();
204 case dwarf::DW_TAG_subprogram:
205 CurrentScope = createScopeFunction();
206 CurrentScope->setIsSubprogram();
208 case dwarf::DW_TAG_subroutine_type:
209 CurrentScope = createScopeFunctionType();
211 case dwarf::DW_TAG_label:
212 CurrentScope = createScopeFunction();
213 CurrentScope->setIsLabel();
215 case dwarf::DW_TAG_class_type:
216 CurrentScope = createScopeAggregate();
217 CurrentScope->setIsClass();
219 case dwarf::DW_TAG_structure_type:
220 CurrentScope = createScopeAggregate();
221 CurrentScope->setIsStructure();
223 case dwarf::DW_TAG_union_type:
224 CurrentScope = createScopeAggregate();
225 CurrentScope->setIsUnion();
227 case dwarf::DW_TAG_enumeration_type:
228 CurrentScope = createScopeEnumeration();
230 case dwarf::DW_TAG_GNU_formal_parameter_pack:
231 CurrentScope = createScopeFormalPack();
233 case dwarf::DW_TAG_GNU_template_parameter_pack:
234 CurrentScope = createScopeTemplatePack();
245void LVDWARFReader::processOneAttribute(
const DWARFDie &Die,
248 uint64_t OffsetOnEntry = *OffsetPtr;
255 auto GetAsUnsignedConstant = [&]() -> int64_t {
267 auto GetBoundValue = [&AttrSpec](
const DWARFFormValue &FormValue) -> int64_t {
269 case dwarf::DW_FORM_ref_addr:
270 case dwarf::DW_FORM_ref1:
271 case dwarf::DW_FORM_ref2:
272 case dwarf::DW_FORM_ref4:
273 case dwarf::DW_FORM_ref8:
274 case dwarf::DW_FORM_ref_udata:
275 case dwarf::DW_FORM_ref_sig8:
277 case dwarf::DW_FORM_data1:
278 case dwarf::DW_FORM_flag:
279 case dwarf::DW_FORM_data2:
280 case dwarf::DW_FORM_data4:
281 case dwarf::DW_FORM_data8:
282 case dwarf::DW_FORM_udata:
283 case dwarf::DW_FORM_ref_sup4:
284 case dwarf::DW_FORM_ref_sup8:
286 case dwarf::DW_FORM_sdata:
288 case dwarf::DW_FORM_implicit_const:
300 switch (AttrSpec.
Attr) {
301 case dwarf::DW_AT_accessibility:
304 case dwarf::DW_AT_artificial:
305 CurrentElement->setIsArtificial();
307 case dwarf::DW_AT_bit_size:
308 CurrentElement->
setBitSize(GetAsUnsignedConstant());
310 case dwarf::DW_AT_call_file:
312 ? GetAsUnsignedConstant() + 1
313 : GetAsUnsignedConstant());
315 case dwarf::DW_AT_call_line:
318 case dwarf::DW_AT_comp_dir:
321 case dwarf::DW_AT_const_value:
326 llvm::toHex(llvm::toStringRef(Expr),
true));
330 if (FormValue.
getForm() == dwarf::DW_FORM_sdata) {
331 std::stringstream Stream;
338 CurrentElement->
setValue(Stream.str());
344 case dwarf::DW_AT_count:
345 CurrentElement->
setCount(GetAsUnsignedConstant());
347 case dwarf::DW_AT_decl_line:
350 case dwarf::DW_AT_decl_file:
352 ? GetAsUnsignedConstant() + 1
353 : GetAsUnsignedConstant());
355 case dwarf::DW_AT_enum_class:
356 if (GetFlag(FormValue))
357 CurrentElement->setIsEnumClass();
359 case dwarf::DW_AT_external:
360 if (GetFlag(FormValue))
361 CurrentElement->setIsExternal();
363 case dwarf::DW_AT_GNU_discriminator:
366 case dwarf::DW_AT_inline:
369 case dwarf::DW_AT_lower_bound:
372 case dwarf::DW_AT_name:
375 case dwarf::DW_AT_GNU_template_name:
378 case dwarf::DW_AT_linkage_name:
379 case dwarf::DW_AT_MIPS_linkage_name:
382 case dwarf::DW_AT_producer:
383 if (
options().getAttributeProducer())
386 case dwarf::DW_AT_upper_bound:
389 case dwarf::DW_AT_virtuality:
393 case dwarf::DW_AT_abstract_origin:
394 case dwarf::DW_AT_call_origin:
395 case dwarf::DW_AT_extension:
396 case dwarf::DW_AT_import:
397 case dwarf::DW_AT_specification:
398 case dwarf::DW_AT_type:
399 updateReference(AttrSpec.
Attr, FormValue);
402 case dwarf::DW_AT_low_pc:
403 if (
options().getGeneralCollectRanges()) {
409 CurrentLowPC = *
Value;
412 if (
U->getAddrOffsetSectionItem(UValue)) {
424 CurrentElement->setIsDiscarded();
433 case dwarf::DW_AT_high_pc:
434 if (
options().getGeneralCollectRanges()) {
457 case dwarf::DW_AT_ranges:
458 if (RangesDataAvailable &&
options().getGeneralCollectRanges()) {
461 if (FormValue.
getForm() == dwarf::DW_FORM_rnglistx)
466 GetRanges(FormValue, U);
467 if (!RangesOrError) {
470 dbgs() <<
format(
"error decoding address ranges = ",
492 CurrentRanges.emplace_back(
Range.LowPC,
Range.HighPC);
498 case dwarf::DW_AT_data_member_location:
499 if (
options().getAttributeAnyLocation())
500 processLocationMember(AttrSpec.
Attr, FormValue, Die, OffsetOnEntry);
504 case dwarf::DW_AT_location:
505 case dwarf::DW_AT_string_length:
506 case dwarf::DW_AT_use_location:
507 if (
options().getAttributeAnyLocation() && CurrentSymbol)
508 processLocationList(AttrSpec.
Attr, FormValue, Die, OffsetOnEntry);
511 case dwarf::DW_AT_call_data_value:
512 case dwarf::DW_AT_call_value:
513 case dwarf::DW_AT_GNU_call_site_data_value:
514 case dwarf::DW_AT_GNU_call_site_value:
515 if (
options().getAttributeAnyLocation() && CurrentSymbol)
516 processLocationList(AttrSpec.
Attr, FormValue, Die, OffsetOnEntry,
533 DIE.getDwarfUnit()->getDebugInfoExtractor();
540 CurrentEndOffset = 0;
554 CurrentElement = createElement(
Tag);
568 if (ElementTable.find(
Offset) == ElementTable.end()) {
570 ElementTable.emplace(std::piecewise_construct,
571 std::forward_as_tuple(
Offset),
572 std::forward_as_tuple(CurrentElement));
580 Target->setReference(CurrentElement);
582 Target->setType(CurrentElement);
592 else if (CurrentSymbol)
594 else if (CurrentType)
598 auto ProcessAttributes = [&](
const DWARFDie &TheDIE,
600 CurrentEndOffset =
Offset;
601 uint32_t abbrCode = DebugData.getULEB128(&CurrentEndOffset);
607 AbbrevDecl->attributes())
608 processOneAttribute(TheDIE, &CurrentEndOffset, AttrSpec);
612 ProcessAttributes(
DIE, DebugInfoData);
621 ProcessAttributes(InputDIE, DebugInfoData);
626 if (CurrentScope->getCanHaveRanges()) {
630 if (FoundLowPC && FoundHighPC) {
631 CurrentScope->
addObject(CurrentLowPC, CurrentHighPC);
634 if ((
options().getAttributePublics() ||
635 options().getPrintAnyLine()) &&
636 CurrentScope->getIsFunction() &&
637 !CurrentScope->getIsInlinedFunction())
638 CompileUnit->addPublicName(CurrentScope, CurrentLowPC,
646 if (CurrentScope->getHasRanges() &&
648 CurrentScope->getHasReferenceSpecification()) {
650 std::optional<DWARFFormValue> LinkageDIE =
651 DIE.findRecursively(dwarf::DW_AT_linkage_name);
652 if (LinkageDIE.has_value()) {
663 if (CurrentScope->getIsComdat())
668 if (!CurrentRanges.empty()) {
672 CurrentRanges.clear();
682 if (Parent->getIsAggregate())
683 CurrentScope->setIsMember();
687 if (
options().getAttributeAnyLocation() && CurrentSymbol &&
688 CurrentSymbol->getHasLocation())
689 SymbolsWithLocations.
push_back(CurrentSymbol);
692 if (CurrentType && CurrentType->getIsTemplateParam())
693 Parent->setIsTemplate();
709 traverseDieAndChildren(Child, Scope, DummyDie);
719void LVDWARFReader::processLocationGaps() {
720 if (
options().getAttributeAnyLocation())
721 for (
LVSymbol *Symbol : SymbolsWithLocations)
722 Symbol->fillLocationGaps();
725void LVDWARFReader::createLineAndFileRecords(
731 if (!
Lines->Prologue.FileNames.empty())
733 Lines->Prologue.FileNames) {
734 std::string Directory;
735 if (
Lines->getDirectoryForEntry(Entry, Directory))
737 if (Directory.empty())
738 Directory = std::string(
CompileUnit->getCompilationDirectory());
746 bool IncrementIndex =
Lines->Prologue.getVersion() >= 5;
760 CompileUnit->getFilename(IncrementIndex ? Row.File + 1 : Row.File));
761 Line->setLineNumber(Row.Line);
762 if (Row.Discriminator)
763 Line->setDiscriminator(Row.Discriminator);
765 Line->setIsNewStatement();
767 Line->setIsBasicBlock();
769 Line->setIsEndSequence();
770 if (Row.EpilogueBegin)
771 Line->setIsEpilogueBegin();
773 Line->setIsPrologueEnd();
776 <<
" Line: " <<
Line->lineNumberAsString(
true)
788 if (Opcode == dwarf::DW_OP_regval_type)
794 auto *MCRegInfo =
MRI.get();
798 if (std::optional<MCRegister> LLVMRegNum =
799 MCRegInfo->getLLVMRegNum(DwarfRegNum, IsEH))
800 if (
const char *
RegName = MCRegInfo->getName(*LLVMRegNum))
826 "Could not create DWARF information: %s",
829 if (
Error Err = loadTargetInfo(Obj))
838 DwarfContext->getNumCompileUnits() ? DwarfContext->compile_units()
839 : DwarfContext->dwo_compile_units();
840 for (
const std::unique_ptr<DWARFUnit> &
CU : CompileUnits) {
893 auto DeduceIncrementFileIndex = [&]() ->
bool {
894 if (
CU->getVersion() < 5)
899 CU->getContext().getLineTableForUnit(
CU.get())) {
901 if (LT->hasFileAtIndex(0) && LT->hasFileAtIndex(1)) {
903 LT->Prologue.getFileNameEntry(0);
905 LT->Prologue.getFileNameEntry(1);
911 std::string FileZero;
914 LT->getFileNameByIndex(
915 0,
None, DILineInfoSpecifier::FileLineInfoKind::RawValue,
917 LT->getFileNameByIndex(
918 1,
None, DILineInfoSpecifier::FileLineInfoKind::RawValue,
920 return FileZero.compare(FileOne);
928 IncrementFileIndex = DeduceIncrementFileIndex();
933 std::optional<const char *> DWOFileName =
934 CU->getVersion() >= 5
946 DWOAlternativeLocation);
958 RangesDataAvailable =
963 traverseDieAndChildren(CUDie,
Root, SkeletonDie);
965 createLineAndFileRecords(DwarfContext->getLineTableForUnit(
CU.get()));
975 ScopesWithRanges->
sort();
978 processLocationGaps();
981 ScopesWithRanges->
clear();
982 SymbolsWithLocations.clear();
994 bool CallSiteLocation) {
1011 U->getFormParams().Format);
1024 if (FormValue.
getForm() == dwarf::DW_FORM_loclistx) {
1025 std::optional<uint64_t> LoclistOffset = U->getLoclistOffset(
Offset);
1031 if (std::optional<SectionedAddress> BA =
U->getBaseAddress())
1037 if (
Entry.Kind == dwarf::DW_LLE_base_address) {
1041 if (
Entry.Kind == dwarf::DW_LLE_offset_pair) {
1049 U->getAddressByteSize());
1061 Error E =
U->getLocationTable().visitLocationList(
1063 ProcessLocationEntry(E);
1082 processLocationList(Attr, FormValue, Die, OffsetOnEntry);
1102 Attr == dwarf::DW_AT_import || Attr == dwarf::DW_AT_type);
1104 if (FormValue.
getForm() == dwarf::DW_FORM_ref_addr) {
1107 Target->setIsGlobalReference();
1109 removeGlobalOffset(
Offset);
1123 case dwarf::DW_AT_abstract_origin:
1124 case dwarf::DW_AT_call_origin:
1126 CurrentElement->setHasReferenceAbstract();
1128 case dwarf::DW_AT_extension:
1130 CurrentElement->setHasReferenceExtension();
1132 case dwarf::DW_AT_specification:
1134 CurrentElement->setHasReferenceSpecification();
1136 case dwarf::DW_AT_import:
1137 case dwarf::DW_AT_type:
1150 if (!
Entry.Element) {
1152 Entry.Types.insert(Element);
1154 Entry.References.insert(Element);
1156 return Entry.Element;
1174 FeaturesValue = *Features;
1178void LVDWARFReader::mapRangeAddress(
const ObjectFile &Obj) {
1198 bool IsSTAB =
false;
1219 if (!AddressOrErr) {
BlockVerifier::State From
mir Rename Register Operands
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
size_t size() const
size - Get the array size.
A structured debug information entry.
unsigned getOffset() const
Get the compile/type unit relative offset of this DIE.
dwarf::Tag getTag() const
DWARFContext This data structure is the top level entity that deals with dwarf debug information pars...
DWARFUnitVector::compile_unit_range compile_unit_range
bool isLittleEndian() const
static std::unique_ptr< DWARFContext > create(const object::ObjectFile &Obj, ProcessDebugRelocations RelocAction=ProcessDebugRelocations::Process, const LoadedObjectInfo *L=nullptr, std::string DWPName="", std::function< void(Error)> RecoverableErrorHandler=WithColor::defaultErrorHandler, std::function< void(Error)> WarningHandler=WithColor::defaultWarningHandler, bool ThreadSafe=false)
Utility class that carries the DWARF compile/type unit and the debug info entry in an object.
uint64_t getOffset() const
Get the absolute offset into the debug info or types section.
std::optional< DWARFFormValue > find(dwarf::Attribute Attr) const
Extract the specified attribute from this DIE.
DWARFUnit * getDwarfUnit() const
DWARFDie getSibling() const
Get the sibling of this DIE object.
const DWARFAbbreviationDeclaration * getAbbreviationDeclarationPtr() const
Get the abbreviation declaration for this DIE.
This class represents an Operation in the Expression.
ArrayRef< uint64_t > getRawOperands() const
static bool prettyPrintRegisterOp(DWARFUnit *U, raw_ostream &OS, DIDumpOptions DumpOpts, uint8_t Opcode, const ArrayRef< uint64_t > Operands)
DWARFDataExtractor getDebugInfoExtractor() const
uint64_t getOffset() const
Lightweight error class with error context and mandatory checking.
static ErrorSuccess success()
Create a success value.
Tagged union holding either a T or a Error.
Error takeError()
Take ownership of the stored error.
reference get()
Returns a reference to the stored T value.
Class representing an expression and its matching format.
virtual void printString(StringRef Value)
virtual raw_ostream & startLine()
SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better...
void push_back(const T &Elt)
StringRef - Represent a constant reference to a string, i.e.
std::string str() const
str - Get the contents as an std::string.
Manages the enabling and disabling of subtarget specific features.
std::string getString() const
Returns features as a string.
Target - Wrapper for Target specific information.
Triple - Helper class for working with autoconf configuration names.
The instances of the Type class are immutable: once they are created, they are never changed.
LLVM Value Representation.
Stores all information relating to a compile unit, be it in its original instance in the object file ...
LVSectionIndex updateSymbolTable(LVScope *Function)
LVSectionIndex getSectionIndex(LVScope *Scope) override
void addToSymbolTable(StringRef Name, LVScope *Function, LVSectionIndex SectionIndex=0)
void processLines(LVLines *DebugLines, LVSectionIndex SectionIndex)
void mapVirtualAddress(const object::ObjectFile &Obj)
std::unique_ptr< const MCRegisterInfo > MRI
LVRange * getSectionRanges(LVSectionIndex SectionIndex)
Error loadGenericTargetInfo(StringRef TheTriple, StringRef TheFeatures)
void addSectionRange(LVSectionIndex SectionIndex, LVScope *Scope)
Error createInstructions()
LVAddress WasmCodeSectionOffset
void setCUHighAddress(LVAddress Address)
void print(raw_ostream &OS) const
std::string getRegisterName(LVSmall Opcode, ArrayRef< uint64_t > Operands) override
void sortScopes() override
void setCUBaseAddress(LVAddress Address)
Error createScopes() override
virtual void setCount(int64_t Value)
virtual void setCallLineNumber(uint32_t Number)
virtual void setBitSize(uint32_t Size)
virtual void setLinkageName(StringRef LinkageName)
virtual void setProducer(StringRef ProducerName)
virtual void setUpperBound(int64_t Value)
virtual void setDiscriminator(uint32_t Value)
virtual void setLowerBound(int64_t Value)
virtual void setValue(StringRef Value)
void setInlineCode(uint32_t Code)
virtual void setReference(LVElement *Element)
void setName(StringRef ElementName) override
virtual bool isCompileUnit() const
void setAccessibilityCode(uint32_t Access)
void setVirtualityCode(uint32_t Virtuality)
void setType(LVElement *Element=nullptr)
void setFilenameIndex(size_t Index)
virtual void setCallFilenameIndex(size_t Index)
virtual size_t getLinkageNameIndex() const
void setOffset(LVOffset DieOffset)
void setLineNumber(uint32_t Number)
void setTag(dwarf::Tag Tag)
void addCompileUnitOffset(LVOffset Offset, LVScopeCompileUnit *CompileUnit)
std::string FileFormatName
std::string createAlternativePath(StringRef From)
StringRef getFilename() const
LVSectionIndex DotTextSectionIndex
virtual Error createScopes()
void addElement(LVElement *Element)
void addObject(LVLocation *Location)
void addLocation(dwarf::Attribute Attr, LVAddress LowPC, LVAddress HighPC, LVUnsigned SectionOffset, uint64_t LocDescOffset, bool CallSiteLocation=false)
void addLocationOperands(LVSmall Opcode, ArrayRef< uint64_t > Operands)
void addLocationConstant(dwarf::Attribute Attr, LVUnsigned Constant, uint64_t LocDescOffset)
StringRef getFileName() const
MachO::nlist getSymbolTableEntry(DataRefImpl DRI) const
MachO::nlist_64 getSymbol64TableEntry(DataRefImpl DRI) const
bool is64Bit() const override
This class is the base class for all object file types.
virtual section_iterator section_end() const =0
virtual Expected< SubtargetFeatures > getFeatures() const =0
virtual Triple::ArchType getArch() const =0
This is a value type class that represents a single symbol in the list of symbols in the object file.
virtual basic_symbol_iterator symbol_begin() const =0
virtual basic_symbol_iterator symbol_end() const =0
This class implements an extremely fast bulk output stream that can only output to a stream.
A raw_ostream that writes to an std::string.
std::string & str()
Returns the string's reference.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
std::optional< const char * > toString(const std::optional< DWARFFormValue > &V)
Take an optional DWARFFormValue and try to extract a string value from it.
StringRef toStringRef(const std::optional< DWARFFormValue > &V, StringRef Default={})
Take an optional DWARFFormValue and try to extract a string value from it.
Scope
Defines the scope in which this symbol should be visible: Default – Visible in the public interface o...
FormattedNumber hexValue(uint64_t N, unsigned Width=HEX_WIDTH, bool Upper=false)
std::string hexString(uint64_t Value, size_t Width=HEX_WIDTH)
const LVAddress MaxAddress
std::string transformPath(StringRef Path)
constexpr bool UpdateHighAddress
std::pair< LVAddress, LVAddress > LVAddressRange
This is an optimization pass for GlobalISel generic memory operations.
SmallVectorImpl< T >::const_pointer c_str(SmallVectorImpl< T > &str)
std::vector< DWARFAddressRange > DWARFAddressRangesVector
DWARFAddressRangesVector - represents a set of absolute address ranges.
Error createStringError(std::error_code EC, char const *Fmt, const Ts &... Vals)
Create formatted StringError object.
auto formatv(bool Validate, const char *Fmt, Ts &&...Vals)
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
format_object< Ts... > format(const char *Fmt, const Ts &... Vals)
These are helper functions used to produce formatted output.
const char * toString(DWARFSectionKind Kind)
void consumeError(Error Err)
Consume a Error without doing anything.
Container for dump options that control which debug information will be dumped.
std::function< llvm::StringRef(uint64_t DwarfRegNum, bool IsEH)> GetNameForDWARFReg
bool isImplicitConst() const
int64_t getImplicitConstValue() const
static bool mayHaveLocationList(dwarf::Attribute Attr)
Identify DWARF attributes that may contain a pointer to a location list.
static bool mayHaveLocationExpr(dwarf::Attribute Attr)
Identifies DWARF attributes that may contain a reference to a DWARF expression.
Standard .debug_line state machine structure.
A single location within a location list.
Represents a single DWARF expression, whose value is location-dependent.
static const uint64_t UndefSection