LLVM
15.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 28 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 30 of file DWARFFormValue.h.
|
inline |
Definition at line 69 of file DWARFFormValue.h.
|
static |
Definition at line 95 of file DWARFFormValue.cpp.
|
static |
Definition at line 91 of file DWARFFormValue.cpp.
References F.
Referenced by llvm::DWARFDebugLine::LineTable::parse().
|
static |
Definition at line 83 of file DWARFFormValue.cpp.
References F.
Referenced by llvm::DWARFAbbreviationDeclaration::getAttributeValueFromOffset().
|
static |
Definition at line 103 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 408 of file DWARFFormValue.cpp.
References llvm::Address, llvm::format(), llvm::WithColor::get(), llvm::dwarf::getDwarfOffsetByteSize(), llvm::None, 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 379 of file DWARFFormValue.cpp.
References llvm::format().
|
static |
Definition at line 393 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 385 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 247 of file DWARFFormValue.cpp.
References FP.
Referenced by createFromUnit(), extractValue(), llvm::DWARFAbbreviationDeclaration::getAttributeValueFromOffset(), and llvm::AppleAcceleratorTable::readAtoms().
|
inline |
Definition at line 102 of file DWARFFormValue.h.
References llvm::Data, and extractValue().
Definition at line 668 of file DWARFFormValue.cpp.
References llvm::None.
Referenced by dumpAttribute().
Definition at line 753 of file DWARFFormValue.cpp.
References llvm::makeArrayRef(), and llvm::None.
Referenced by dumpLocationExpr().
Definition at line 627 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().
Definition at line 760 of file DWARFFormValue.cpp.
References llvm::None.
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 773 of file DWARFFormValue.cpp.
References llvm::DWARFUnit::getCompilationDir(), llvm::DWARFUnit::getContext(), llvm::DWARFContext::getLineTableForUnit(), llvm::AArch64CC::LT, and llvm::None.
getAsFoo functions below return the extracted value as Foo if only DWARFFormValue has form class is suitable for representing Foo.
Definition at line 694 of file DWARFFormValue.cpp.
References llvm::None.
Definition at line 766 of file DWARFFormValue.cpp.
References llvm::None.
Optional< DWARFFormValue::UnitOffset > DWARFFormValue::getAsRelativeReference | ( | ) | const |
Definition at line 700 of file DWARFFormValue.cpp.
References llvm::None.
Referenced by llvm::DWARFDie::getAttributeValueAsReferencedDie().
Optional< object::SectionedAddress > DWARFFormValue::getAsSectionedAddress | ( | ) | const |
Definition at line 675 of file DWARFFormValue.cpp.
References llvm::object::SectionedAddress::Address, if(), and llvm::None.
Definition at line 721 of file DWARFFormValue.cpp.
References llvm::None.
Referenced by dumpAttribute(), and dumpLocationList().
Optional< int64_t > DWARFFormValue::getAsSignedConstant | ( | ) | const |
Definition at line 734 of file DWARFFormValue.cpp.
References llvm::max(), and llvm::None.
Definition at line 727 of file DWARFFormValue.cpp.
References llvm::None.
Referenced by dumpAttribute(), and llvm::AppleAcceleratorTable::readAtoms().
|
inline |
Definition at line 79 of file DWARFFormValue.h.
Referenced by dumpAttribute(), dumpLocationList(), and llvm::AppleAcceleratorTable::validateForms().
|
inline |
Definition at line 80 of file DWARFFormValue.h.
Definition at line 83 of file DWARFFormValue.h.
bool DWARFFormValue::isFormClass | ( | DWARFFormValue::FormClass | FC | ) | const |
Definition at line 215 of file DWARFFormValue.cpp.
References DWARF5FormClasses, R600_InstFlag::FC, llvm::makeArrayRef(), 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 147 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 111 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().