LLVM
13.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 92 of file DWARFFormValue.cpp.
|
static |
Definition at line 88 of file DWARFFormValue.cpp.
References F.
Referenced by llvm::DWARFDebugLine::LineTable::parse().
|
static |
Definition at line 80 of file DWARFFormValue.cpp.
References F.
Referenced by llvm::DWARFAbbreviationDeclaration::getAttributeValue().
|
static |
Definition at line 100 of file DWARFFormValue.cpp.
References extractValue(), F, llvm::DWARFUnit::getDebugInfoExtractor(), and llvm::DWARFUnit::getFormParams().
|
static |
Definition at line 84 of file DWARFFormValue.cpp.
References F.
void DWARFFormValue::dump | ( | raw_ostream & | OS, |
DIDumpOptions | DumpOpts = DIDumpOptions() |
||
) | const |
Definition at line 401 of file DWARFFormValue.cpp.
References llvm::Address, llvm::format(), llvm::WithColor::get(), llvm::dwarf::getDwarfOffsetByteSize(), llvm::None, llvm::nulls(), Offset, llvm::DIDumpOptions::ShowAddresses, llvm::DIDumpOptions::Verbose, and llvm::raw_ostream::write_escaped().
Referenced by llvm::DWARFDebugLine::Prologue::dump(), and dumpLocation().
void llvm::DWARFFormValue::dumpAddress | ( | raw_ostream & | OS, |
uint64_t | Address | ||
) | const |
|
static |
Definition at line 372 of file DWARFFormValue.cpp.
References llvm::Address, and llvm::format().
|
static |
Definition at line 386 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 378 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 243 of file DWARFFormValue.cpp.
Referenced by createFromUnit(), extractValue(), llvm::DWARFAbbreviationDeclaration::getAttributeValue(), and llvm::AppleAcceleratorTable::readAtoms().
|
inline |
Definition at line 100 of file DWARFFormValue.h.
References llvm::Data, and extractValue().
Optional< uint64_t > DWARFFormValue::getAsAddress | ( | ) | const |
Definition at line 657 of file DWARFFormValue.cpp.
References llvm::None.
Definition at line 742 of file DWARFFormValue.cpp.
References llvm::makeArrayRef(), and llvm::None.
Referenced by dumpLocation().
Definition at line 620 of file DWARFFormValue.cpp.
References llvm::None, and Offset.
Optional< uint64_t > DWARFFormValue::getAsCStringOffset | ( | ) | const |
Definition at line 749 of file DWARFFormValue.cpp.
References llvm::None.
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 683 of file DWARFFormValue.cpp.
References llvm::None.
Optional< uint64_t > DWARFFormValue::getAsReferenceUVal | ( | ) | const |
Definition at line 755 of file DWARFFormValue.cpp.
References llvm::None.
Optional< DWARFFormValue::UnitOffset > DWARFFormValue::getAsRelativeReference | ( | ) | const |
Definition at line 689 of file DWARFFormValue.cpp.
References llvm::None.
Optional< object::SectionedAddress > DWARFFormValue::getAsSectionedAddress | ( | ) | const |
Definition at line 664 of file DWARFFormValue.cpp.
References llvm::object::SectionedAddress::Address, if(), and llvm::None.
Optional< uint64_t > DWARFFormValue::getAsSectionOffset | ( | ) | const |
Definition at line 710 of file DWARFFormValue.cpp.
References llvm::None.
Referenced by dumpLocation().
Optional< int64_t > DWARFFormValue::getAsSignedConstant | ( | ) | const |
Definition at line 723 of file DWARFFormValue.cpp.
References llvm::max(), and llvm::None.
Optional< uint64_t > DWARFFormValue::getAsUnsignedConstant | ( | ) | const |
Definition at line 716 of file DWARFFormValue.cpp.
References llvm::None.
Referenced by llvm::AppleAcceleratorTable::readAtoms().
|
inline |
Definition at line 77 of file DWARFFormValue.h.
Referenced by dumpLocation(), 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 211 of file DWARFFormValue.cpp.
References DWARF5FormClasses, R600_InstFlag::FC, llvm::makeArrayRef(), and llvm::size().
Referenced by dumpLocation(), llvm::shouldSkipAttribute(), and llvm::AppleAcceleratorTable::validateForms().
|
inline |
Definition at line 105 of file DWARFFormValue.h.
|
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 136 of file DWARFFormValue.h.
Referenced by llvm::DWARFDebugInfoEntry::extractFast(), and llvm::DWARFAbbreviationDeclaration::getAttributeValue().
|
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 108 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().