30#define DEBUG_TYPE "ElfReader"
33 CurrentScope =
nullptr;
34 CurrentSymbol =
nullptr;
35 CurrentType =
nullptr;
36 CurrentRanges.clear();
38 if (!
options().getPrintSymbols()) {
43 case dwarf::DW_TAG_formal_parameter:
44 case dwarf::DW_TAG_unspecified_parameters:
45 case dwarf::DW_TAG_member:
46 case dwarf::DW_TAG_variable:
47 case dwarf::DW_TAG_inheritance:
48 case dwarf::DW_TAG_constant:
49 case dwarf::DW_TAG_call_site_parameter:
50 case dwarf::DW_TAG_GNU_call_site_parameter:
59 case dwarf::DW_TAG_base_type:
60 CurrentType = createType();
61 CurrentType->setIsBase();
62 if (
options().getAttributeBase())
63 CurrentType->setIncludeInPrint();
65 case dwarf::DW_TAG_const_type:
66 CurrentType = createType();
67 CurrentType->setIsConst();
70 case dwarf::DW_TAG_enumerator:
71 CurrentType = createTypeEnumerator();
73 case dwarf::DW_TAG_imported_declaration:
74 CurrentType = createTypeImport();
75 CurrentType->setIsImportDeclaration();
77 case dwarf::DW_TAG_imported_module:
78 CurrentType = createTypeImport();
79 CurrentType->setIsImportModule();
81 case dwarf::DW_TAG_pointer_type:
82 CurrentType = createType();
83 CurrentType->setIsPointer();
86 case dwarf::DW_TAG_ptr_to_member_type:
87 CurrentType = createType();
88 CurrentType->setIsPointerMember();
91 case dwarf::DW_TAG_reference_type:
92 CurrentType = createType();
93 CurrentType->setIsReference();
96 case dwarf::DW_TAG_restrict_type:
97 CurrentType = createType();
98 CurrentType->setIsRestrict();
99 CurrentType->
setName(
"restrict");
101 case dwarf::DW_TAG_rvalue_reference_type:
102 CurrentType = createType();
103 CurrentType->setIsRvalueReference();
106 case dwarf::DW_TAG_subrange_type:
107 CurrentType = createTypeSubrange();
109 case dwarf::DW_TAG_template_value_parameter:
110 CurrentType = createTypeParam();
111 CurrentType->setIsTemplateValueParam();
113 case dwarf::DW_TAG_template_type_parameter:
114 CurrentType = createTypeParam();
115 CurrentType->setIsTemplateTypeParam();
117 case dwarf::DW_TAG_GNU_template_template_param:
118 CurrentType = createTypeParam();
119 CurrentType->setIsTemplateTemplateParam();
121 case dwarf::DW_TAG_typedef:
122 CurrentType = createTypeDefinition();
124 case dwarf::DW_TAG_unspecified_type:
125 CurrentType = createType();
126 CurrentType->setIsUnspecified();
128 case dwarf::DW_TAG_volatile_type:
129 CurrentType = createType();
130 CurrentType->setIsVolatile();
131 CurrentType->
setName(
"volatile");
135 case dwarf::DW_TAG_formal_parameter:
136 CurrentSymbol = createSymbol();
137 CurrentSymbol->setIsParameter();
138 return CurrentSymbol;
139 case dwarf::DW_TAG_unspecified_parameters:
140 CurrentSymbol = createSymbol();
141 CurrentSymbol->setIsUnspecified();
143 return CurrentSymbol;
144 case dwarf::DW_TAG_member:
145 CurrentSymbol = createSymbol();
146 CurrentSymbol->setIsMember();
147 return CurrentSymbol;
148 case dwarf::DW_TAG_variable:
149 CurrentSymbol = createSymbol();
150 CurrentSymbol->setIsVariable();
151 return CurrentSymbol;
152 case dwarf::DW_TAG_inheritance:
153 CurrentSymbol = createSymbol();
154 CurrentSymbol->setIsInheritance();
155 return CurrentSymbol;
156 case dwarf::DW_TAG_call_site_parameter:
157 case dwarf::DW_TAG_GNU_call_site_parameter:
158 CurrentSymbol = createSymbol();
159 CurrentSymbol->setIsCallSiteParameter();
160 return CurrentSymbol;
161 case dwarf::DW_TAG_constant:
162 CurrentSymbol = createSymbol();
163 CurrentSymbol->setIsConstant();
164 return CurrentSymbol;
167 case dwarf::DW_TAG_catch_block:
168 CurrentScope = createScope();
169 CurrentScope->setIsCatchBlock();
171 case dwarf::DW_TAG_lexical_block:
172 CurrentScope = createScope();
173 CurrentScope->setIsLexicalBlock();
175 case dwarf::DW_TAG_try_block:
176 CurrentScope = createScope();
177 CurrentScope->setIsTryBlock();
179 case dwarf::DW_TAG_compile_unit:
180 case dwarf::DW_TAG_skeleton_unit:
181 CurrentScope = createScopeCompileUnit();
184 case dwarf::DW_TAG_inlined_subroutine:
185 CurrentScope = createScopeFunctionInlined();
187 case dwarf::DW_TAG_namespace:
188 CurrentScope = createScopeNamespace();
190 case dwarf::DW_TAG_template_alias:
191 CurrentScope = createScopeAlias();
193 case dwarf::DW_TAG_array_type:
194 CurrentScope = createScopeArray();
196 case dwarf::DW_TAG_call_site:
197 case dwarf::DW_TAG_GNU_call_site:
198 CurrentScope = createScopeFunction();
199 CurrentScope->setIsCallSite();
201 case dwarf::DW_TAG_entry_point:
202 CurrentScope = createScopeFunction();
203 CurrentScope->setIsEntryPoint();
205 case dwarf::DW_TAG_subprogram:
206 CurrentScope = createScopeFunction();
207 CurrentScope->setIsSubprogram();
209 case dwarf::DW_TAG_subroutine_type:
210 CurrentScope = createScopeFunctionType();
212 case dwarf::DW_TAG_label:
213 CurrentScope = createScopeFunction();
214 CurrentScope->setIsLabel();
216 case dwarf::DW_TAG_class_type:
217 CurrentScope = createScopeAggregate();
218 CurrentScope->setIsClass();
220 case dwarf::DW_TAG_structure_type:
221 CurrentScope = createScopeAggregate();
222 CurrentScope->setIsStructure();
224 case dwarf::DW_TAG_union_type:
225 CurrentScope = createScopeAggregate();
226 CurrentScope->setIsUnion();
228 case dwarf::DW_TAG_enumeration_type:
229 CurrentScope = createScopeEnumeration();
231 case dwarf::DW_TAG_GNU_formal_parameter_pack:
232 CurrentScope = createScopeFormalPack();
234 case dwarf::DW_TAG_GNU_template_parameter_pack:
235 CurrentScope = createScopeTemplatePack();
246void LVELFReader::processOneAttribute(
const DWARFDie &Die,
LVOffset *OffsetPtr,
248 uint64_t OffsetOnEntry = *OffsetPtr;
255 auto GetAsUnsignedConstant = [&]() -> int64_t {
264 auto GetBoundValue = [](
const DWARFFormValue &FormValue) -> int64_t {
266 case dwarf::DW_FORM_ref_addr:
267 case dwarf::DW_FORM_ref1:
268 case dwarf::DW_FORM_ref2:
269 case dwarf::DW_FORM_ref4:
270 case dwarf::DW_FORM_ref8:
271 case dwarf::DW_FORM_ref_udata:
272 case dwarf::DW_FORM_ref_sig8:
274 case dwarf::DW_FORM_data1:
275 case dwarf::DW_FORM_flag:
276 case dwarf::DW_FORM_data2:
277 case dwarf::DW_FORM_data4:
278 case dwarf::DW_FORM_data8:
279 case dwarf::DW_FORM_udata:
280 case dwarf::DW_FORM_ref_sup4:
281 case dwarf::DW_FORM_ref_sup8:
283 case dwarf::DW_FORM_sdata:
295 switch (AttrSpec.
Attr) {
296 case dwarf::DW_AT_accessibility:
299 case dwarf::DW_AT_artificial:
300 CurrentElement->setIsArtificial();
302 case dwarf::DW_AT_bit_size:
305 case dwarf::DW_AT_call_file:
308 case dwarf::DW_AT_call_line:
310 ? GetAsUnsignedConstant() + 1
311 : GetAsUnsignedConstant());
313 case dwarf::DW_AT_comp_dir:
316 case dwarf::DW_AT_const_value:
325 if (FormValue.
getForm() == dwarf::DW_FORM_sdata) {
326 std::stringstream Stream;
333 CurrentElement->
setValue(Stream.str());
340 case dwarf::DW_AT_count:
343 case dwarf::DW_AT_decl_line:
346 case dwarf::DW_AT_decl_file:
348 ? GetAsUnsignedConstant() + 1
349 : GetAsUnsignedConstant());
351 case dwarf::DW_AT_enum_class:
352 if (GetFlag(FormValue))
353 CurrentElement->setIsEnumClass();
355 case dwarf::DW_AT_external:
356 if (GetFlag(FormValue))
357 CurrentElement->setIsExternal();
359 case dwarf::DW_AT_GNU_discriminator:
362 case dwarf::DW_AT_inline:
365 case dwarf::DW_AT_lower_bound:
368 case dwarf::DW_AT_name:
371 case dwarf::DW_AT_linkage_name:
372 case dwarf::DW_AT_MIPS_linkage_name:
375 case dwarf::DW_AT_producer:
376 if (
options().getAttributeProducer())
379 case dwarf::DW_AT_upper_bound:
382 case dwarf::DW_AT_virtuality:
386 case dwarf::DW_AT_abstract_origin:
387 case dwarf::DW_AT_call_origin:
388 case dwarf::DW_AT_extension:
389 case dwarf::DW_AT_import:
390 case dwarf::DW_AT_specification:
391 case dwarf::DW_AT_type:
392 updateReference(AttrSpec.
Attr, FormValue);
395 case dwarf::DW_AT_low_pc:
396 if (
options().getGeneralCollectRanges()) {
402 CurrentLowPC = *
Value;
405 if (
U->getAddrOffsetSectionItem(UValue)) {
417 CurrentElement->setIsDiscarded();
424 case dwarf::DW_AT_high_pc:
425 if (
options().getGeneralCollectRanges()) {
432 CurrentHighPC = CurrentLowPC + *
Offset;
441 case dwarf::DW_AT_ranges:
442 if (RangesDataAvailable &&
options().getGeneralCollectRanges()) {
445 if (FormValue.
getForm() == dwarf::DW_FORM_rnglistx)
450 GetRanges(FormValue, U);
451 if (!RangesOrError) {
454 dbgs() <<
format(
"error decoding address ranges = ",
473 CurrentRanges.emplace_back(
Range.LowPC,
Range.HighPC);
479 case dwarf::DW_AT_data_member_location:
480 if (
options().getAttributeAnyLocation())
481 processLocationMember(AttrSpec.
Attr, FormValue, Die, OffsetOnEntry);
485 case dwarf::DW_AT_location:
486 case dwarf::DW_AT_string_length:
487 case dwarf::DW_AT_use_location:
488 if (
options().getAttributeAnyLocation() && CurrentSymbol)
489 processLocationList(AttrSpec.
Attr, FormValue, Die, OffsetOnEntry);
492 case dwarf::DW_AT_call_data_value:
493 case dwarf::DW_AT_call_value:
494 case dwarf::DW_AT_GNU_call_site_data_value:
495 case dwarf::DW_AT_GNU_call_site_value:
496 if (
options().getAttributeAnyLocation() && CurrentSymbol)
497 processLocationList(AttrSpec.
Attr, FormValue, Die, OffsetOnEntry,
514 DIE.getDwarfUnit()->getDebugInfoExtractor();
521 CurrentEndOffset = 0;
535 CurrentElement = createElement(
Tag);
549 if (ElementTable.find(
Offset) == ElementTable.end()) {
551 ElementTable.emplace(std::piecewise_construct,
552 std::forward_as_tuple(
Offset),
553 std::forward_as_tuple(CurrentElement));
561 Target->setReference(CurrentElement);
563 Target->setType(CurrentElement);
573 else if (CurrentSymbol)
575 else if (CurrentType)
579 auto ProcessAttributes = [&](
const DWARFDie &TheDIE,
581 CurrentEndOffset =
Offset;
582 uint32_t abbrCode = DebugData.getULEB128(&CurrentEndOffset);
588 AbbrevDecl->attributes())
589 processOneAttribute(TheDIE, &CurrentEndOffset, AttrSpec);
593 ProcessAttributes(
DIE, DebugInfoData);
602 ProcessAttributes(InputDIE, DebugInfoData);
607 if (CurrentScope->getCanHaveRanges()) {
611 if (FoundLowPC && FoundHighPC) {
612 CurrentScope->
addObject(CurrentLowPC, CurrentHighPC);
615 if ((
options().getAttributePublics() ||
616 options().getPrintAnyLine()) &&
617 CurrentScope->getIsFunction() &&
618 !CurrentScope->getIsInlinedFunction())
619 CompileUnit->addPublicName(CurrentScope, CurrentLowPC,
627 if (CurrentScope->getHasRanges() &&
629 CurrentScope->getHasReferenceSpecification()) {
631 std::optional<DWARFFormValue> LinkageDIE =
632 DIE.findRecursively(dwarf::DW_AT_linkage_name);
633 if (LinkageDIE.has_value()) {
644 if (CurrentScope->getIsComdat())
649 if (!CurrentRanges.empty()) {
653 CurrentRanges.clear();
663 if (Parent->getIsAggregate())
664 CurrentScope->setIsMember();
668 if (
options().getAttributeAnyLocation() && CurrentSymbol &&
669 CurrentSymbol->getHasLocation())
670 SymbolsWithLocations.
push_back(CurrentSymbol);
673 if (CurrentType && CurrentType->getIsTemplateParam())
674 Parent->setIsTemplate();
690 traverseDieAndChildren(Child, Scope, DummyDie);
700void LVELFReader::processLocationGaps() {
701 if (
options().getAttributeAnyLocation())
702 for (
LVSymbol *Symbol : SymbolsWithLocations)
703 Symbol->fillLocationGaps();
706void LVELFReader::createLineAndFileRecords(
712 if (!
Lines->Prologue.FileNames.empty())
714 Lines->Prologue.FileNames) {
715 std::string Directory;
716 if (
Lines->getDirectoryForEntry(Entry, Directory))
718 if (Directory.empty())
719 Directory = std::string(
CompileUnit->getCompilationDirectory());
727 bool IncrementIndex =
Lines->Prologue.getVersion() >= 5;
738 Line->setAddress(Row.Address.Address);
740 CompileUnit->getFilename(IncrementIndex ? Row.File + 1 : Row.File));
741 Line->setLineNumber(Row.Line);
742 if (Row.Discriminator)
743 Line->setDiscriminator(Row.Discriminator);
745 Line->setIsNewStatement();
747 Line->setIsBasicBlock();
749 Line->setIsEndSequence();
750 if (Row.EpilogueBegin)
751 Line->setIsEpilogueBegin();
753 Line->setIsPrologueEnd();
756 <<
" Line: " <<
Line->lineNumberAsString(
true)
768 if (Opcode == dwarf::DW_OP_regval_type)
774 auto *MCRegInfo =
MRI.get();
778 if (std::optional<unsigned> LLVMRegNum =
779 MCRegInfo->getLLVMRegNum(DwarfRegNum, IsEH))
780 if (
const char *
RegName = MCRegInfo->getName(*LLVMRegNum))
806 "Could not create DWARF information: %s",
809 if (
Error Err = loadTargetInfo(Obj))
818 DwarfContext->getNumCompileUnits() ? DwarfContext->compile_units()
819 : DwarfContext->dwo_compile_units();
820 for (
const std::unique_ptr<DWARFUnit> &
CU : CompileUnits) {
873 auto DeduceIncrementFileIndex = [&]() ->
bool {
874 if (
CU->getVersion() < 5)
879 CU->getContext().getLineTableForUnit(
CU.get())) {
881 if (LT->hasFileAtIndex(0) && LT->hasFileAtIndex(1)) {
883 LT->Prologue.getFileNameEntry(0);
885 LT->Prologue.getFileNameEntry(1);
891 std::string FileZero;
894 LT->getFileNameByIndex(
895 0,
None, DILineInfoSpecifier::FileLineInfoKind::RawValue,
897 LT->getFileNameByIndex(
898 1,
None, DILineInfoSpecifier::FileLineInfoKind::RawValue,
900 return FileZero.compare(FileOne);
908 IncrementFileIndex = DeduceIncrementFileIndex();
913 std::optional<const char *> DWOFileName =
914 CU->getVersion() >= 5
926 DWOAlternativeLocation);
938 RangesDataAvailable =
943 traverseDieAndChildren(CUDie,
Root, SkeletonDie);
945 createLineAndFileRecords(DwarfContext->getLineTableForUnit(
CU.get()));
955 ScopesWithRanges->
sort();
958 processLocationGaps();
961 ScopesWithRanges->
clear();
962 SymbolsWithLocations.clear();
974 bool CallSiteLocation) {
991 U->getFormParams().Format);
1004 if (FormValue.
getForm() == dwarf::DW_FORM_loclistx) {
1005 std::optional<uint64_t> LoclistOffset = U->getLoclistOffset(
Offset);
1011 if (std::optional<SectionedAddress> BA =
U->getBaseAddress())
1017 if (Entry.Kind == dwarf::DW_LLE_base_address) {
1021 if (Entry.Kind == dwarf::DW_LLE_offset_pair) {
1026 Range.SectionIndex = Entry.SectionIndex;
1029 U->getAddressByteSize());
1041 Error E =
U->getLocationTable().visitLocationList(
1043 ProcessLocationEntry(
E);
1062 processLocationList(Attr, FormValue, Die, OffsetOnEntry);
1075 Attr == dwarf::DW_AT_import || Attr == dwarf::DW_AT_type);
1077 if (FormValue.
getForm() == dwarf::DW_FORM_ref_addr) {
1080 Target->setIsGlobalReference();
1096 case dwarf::DW_AT_abstract_origin:
1097 case dwarf::DW_AT_call_origin:
1099 CurrentElement->setHasReferenceAbstract();
1101 case dwarf::DW_AT_extension:
1103 CurrentElement->setHasReferenceExtension();
1105 case dwarf::DW_AT_specification:
1107 CurrentElement->setHasReferenceSpecification();
1109 case dwarf::DW_AT_import:
1110 case dwarf::DW_AT_type:
1121 auto Iter = ElementTable.try_emplace(
Offset).first;
1123 LVElementEntry &Entry = Iter->second;
1124 if (!Entry.Element) {
1126 Entry.Types.insert(Element);
1128 Entry.References.insert(Element);
1130 return Entry.Element;
1148 FeaturesValue = *Features;
1152void LVELFReader::mapRangeAddress(
const ObjectFile &Obj) {
1172 bool IsSTAB =
false;
1193 if (!AddressOrErr) {
BlockVerifier::State From
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
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.
Stores all information relating to a compile unit, be it in its original instance in the object file ...
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
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.
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()
void print(raw_ostream &OS) const
std::string getRegisterName(LVSmall Opcode, ArrayRef< uint64_t > Operands) override
Error createScopes() override
void sortScopes() override
void setCUHighAddress(LVAddress Address)
void setCUBaseAddress(LVAddress Address)
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.
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.
auto formatv(const char *Fmt, Ts &&... Vals) -> formatv_object< decltype(std::make_tuple(detail::build_format_adapter(std::forward< Ts >(Vals))...))>
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.
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.
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