LLVM
17.0.0git
|
#include "llvm/DebugInfo/DWARF/DWARFFormValue.h"
Classes | |
struct | UnitOffset |
Public Types | |
enum | FormClass { FC_Unknown, FC_Address, FC_Block, FC_Constant, FC_String, FC_Flag, FC_Reference, FC_Indirect, FC_SectionOffset, FC_Exprloc } |
Static Public Member Functions | |
static DWARFFormValue | createFromSValue (dwarf::Form F, int64_t V) |
static DWARFFormValue | createFromUValue (dwarf::Form F, uint64_t V) |
static DWARFFormValue | createFromPValue (dwarf::Form F, const char *V) |
static DWARFFormValue | createFromBlockValue (dwarf::Form F, ArrayRef< uint8_t > D) |
static DWARFFormValue | createFromUnit (dwarf::Form F, const DWARFUnit *Unit, uint64_t *OffsetPtr) |
static void | dumpAddress (raw_ostream &OS, uint8_t AddressSize, uint64_t Address) |
static void | dumpAddressSection (const DWARFObject &Obj, raw_ostream &OS, DIDumpOptions DumpOpts, uint64_t SectionIndex) |
static bool | skipValue (dwarf::Form Form, DataExtractor DebugInfoData, uint64_t *OffsetPtr, const dwarf::FormParams FormParams) |
Skip a form's value in DebugInfoData at the offset specified by OffsetPtr . More... | |
Definition at line 26 of file DWARFFormValue.h.
Enumerator | |
---|---|
FC_Unknown | |
FC_Address | |
FC_Block | |
FC_Constant | |
FC_String | |
FC_Flag | |
FC_Reference | |
FC_Indirect | |
FC_SectionOffset | |
FC_Exprloc |
Definition at line 28 of file DWARFFormValue.h.
|
inline |
Definition at line 67 of file DWARFFormValue.h.
|
static |
Definition at line 94 of file DWARFFormValue.cpp.
|
static |
Definition at line 90 of file DWARFFormValue.cpp.
References F.
Referenced by llvm::DWARFDebugLine::LineTable::parse().
|
static |
Definition at line 82 of file DWARFFormValue.cpp.
References F.
Referenced by llvm::DWARFAbbreviationDeclaration::getAttributeValueFromOffset().
|
static |
Definition at line 102 of file DWARFFormValue.cpp.
References extractValue(), F, llvm::DWARFUnit::getDebugInfoExtractor(), and llvm::DWARFUnit::getFormParams().
|
static |
void DWARFFormValue::dump | ( | raw_ostream & | OS, |
DIDumpOptions | DumpOpts = DIDumpOptions() |
||
) | const |
Definition at line 407 of file DWARFFormValue.cpp.
References llvm::Address, llvm::format(), llvm::WithColor::get(), llvm::dwarf::getDwarfOffsetByteSize(), llvm::nulls(), llvm::DIDumpOptions::ShowAddresses, llvm::DIDumpOptions::Verbose, and llvm::raw_ostream::write_escaped().
Referenced by llvm::DWARFDebugLine::Prologue::dump(), dumpAttribute(), and dumpLocationList().
void llvm::DWARFFormValue::dumpAddress | ( | raw_ostream & | OS, |
uint64_t | Address | ||
) | const |
|
static |
Definition at line 378 of file DWARFFormValue.cpp.
References llvm::format().
|
static |
Definition at line 392 of file DWARFFormValue.cpp.
References llvm::format(), llvm::DWARFObject::getSectionNames(), and llvm::DIDumpOptions::Verbose.
Referenced by llvm::DWARFAddressRange::dump().
void DWARFFormValue::dumpSectionedAddress | ( | raw_ostream & | OS, |
DIDumpOptions | DumpOpts, | ||
object::SectionedAddress | SA | ||
) | const |
Definition at line 384 of file DWARFFormValue.cpp.
References llvm::object::SectionedAddress::Address, and llvm::object::SectionedAddress::SectionIndex.
bool DWARFFormValue::extractValue | ( | const DWARFDataExtractor & | Data, |
uint64_t * | OffsetPtr, | ||
dwarf::FormParams | FormParams, | ||
const DWARFContext * | Context = nullptr , |
||
const DWARFUnit * | Unit = nullptr |
||
) |
Extracts a value in Data
at offset *OffsetPtr
.
The information in FormParams
is needed to interpret some forms. The optional Context
and Unit
allows extracting information if the form refers to other sections (e.g., .debug_str).
Definition at line 246 of file DWARFFormValue.cpp.
References FP.
Referenced by createFromUnit(), extractValue(), llvm::DWARFAbbreviationDeclaration::getAttributeValueFromOffset(), and llvm::AppleAcceleratorTable::readAtoms().
|
inline |
Definition at line 100 of file DWARFFormValue.h.
References llvm::Data, and extractValue().
std::optional< uint64_t > DWARFFormValue::getAsAddress | ( | ) | const |
Definition at line 669 of file DWARFFormValue.cpp.
Referenced by dumpAttribute().
std::optional< ArrayRef< uint8_t > > DWARFFormValue::getAsBlock | ( | ) | const |
Definition at line 756 of file DWARFFormValue.cpp.
References llvm::ArrayRef().
Referenced by dumpLocationExpr().
Definition at line 628 of file DWARFFormValue.cpp.
References llvm::dwarf::FormEncodingString(), llvm::DataExtractor::getCStr(), llvm::inconvertibleErrorCode(), llvm::AMDGPU::SendMsg::Msg, llvm::StringRef::str(), and llvm::Expected< T >::takeError().
std::optional< uint64_t > DWARFFormValue::getAsCStringOffset | ( | ) | const |
Definition at line 763 of file DWARFFormValue.cpp.
std::optional< std::string > DWARFFormValue::getAsFile | ( | DILineInfoSpecifier::FileLineInfoKind | Kind | ) | const |
Correctly extract any file paths from a form value.
These attributes can be in the from DW_AT_decl_file or DW_AT_call_file attributes. We need to use the file index in the correct DWARFUnit's line table prologue, and each DWARFFormValue has the DWARFUnit the form value was extracted from.
Kind | The kind of path to extract. |
Definition at line 776 of file DWARFFormValue.cpp.
References llvm::DWARFUnit::getCompilationDir(), llvm::DWARFUnit::getContext(), llvm::DWARFContext::getLineTableForUnit(), and llvm::AArch64CC::LT.
std::optional< uint64_t > DWARFFormValue::getAsReference | ( | ) | const |
getAsFoo functions below return the extracted value as Foo if only DWARFFormValue has form class is suitable for representing Foo.
Definition at line 696 of file DWARFFormValue.cpp.
std::optional< uint64_t > DWARFFormValue::getAsReferenceUVal | ( | ) | const |
Definition at line 769 of file DWARFFormValue.cpp.
std::optional< DWARFFormValue::UnitOffset > DWARFFormValue::getAsRelativeReference | ( | ) | const |
Definition at line 703 of file DWARFFormValue.cpp.
Referenced by llvm::DWARFDie::getAttributeValueAsReferencedDie().
std::optional< object::SectionedAddress > DWARFFormValue::getAsSectionedAddress | ( | ) | const |
Definition at line 676 of file DWARFFormValue.cpp.
References if().
std::optional< uint64_t > DWARFFormValue::getAsSectionOffset | ( | ) | const |
Definition at line 724 of file DWARFFormValue.cpp.
Referenced by dumpAttribute(), and dumpLocationList().
std::optional< int64_t > DWARFFormValue::getAsSignedConstant | ( | ) | const |
Definition at line 737 of file DWARFFormValue.cpp.
References llvm::max().
std::optional< uint64_t > DWARFFormValue::getAsUnsignedConstant | ( | ) | const |
Definition at line 730 of file DWARFFormValue.cpp.
Referenced by dumpAttribute(), and llvm::AppleAcceleratorTable::readAtoms().
|
inline |
Definition at line 77 of file DWARFFormValue.h.
Referenced by dumpAttribute(), dumpLocationList(), and llvm::AppleAcceleratorTable::validateForms().
|
inline |
Definition at line 78 of file DWARFFormValue.h.
Definition at line 81 of file DWARFFormValue.h.
bool DWARFFormValue::isFormClass | ( | DWARFFormValue::FormClass | FC | ) | const |
Definition at line 214 of file DWARFFormValue.cpp.
References llvm::ArrayRef(), DWARF5FormClasses, R600_InstFlag::FC, and llvm::size().
Referenced by dumpAttribute(), dumpLocationExpr(), dumpLocationList(), llvm::shouldSkipAttribute(), and llvm::AppleAcceleratorTable::validateForms().
|
inline |
Skip a form's value in DebugInfoData
at the offset specified by OffsetPtr
.
Skips the bytes for the current form and updates the offset.
DebugInfoData | The data where we want to skip the value. |
OffsetPtr | A reference to the offset that will be updated. |
Params | DWARF parameters to help interpret forms. |
Definition at line 145 of file DWARFFormValue.h.
Referenced by llvm::DWARFDebugInfoEntry::extractFast(), llvm::DWARFAbbreviationDeclaration::getAttributeOffsetFromIndex(), and getCUIdentifiers().
|
static |
Skip a form's value in DebugInfoData
at the offset specified by OffsetPtr
.
Skips the bytes for the specified form and updates the offset.
Form | The DW_FORM enumeration that indicates the form to skip. |
DebugInfoData | The data where we want to skip the value. |
OffsetPtr | A reference to the offset that will be updated. |
FormParams | DWARF parameters to help interpret forms. |
Definition at line 110 of file DWARFFormValue.cpp.
References llvm::DataExtractor::getCStr(), llvm::dwarf::getFixedFormByteSize(), llvm::DataExtractor::getSLEB128(), llvm::DataExtractor::getU16(), llvm::DataExtractor::getU32(), llvm::DataExtractor::getU8(), llvm::DataExtractor::getULEB128(), and llvm::size().