class DWARFFormValue

Declaration

class DWARFFormValue { /* full declaration omitted */ };

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFFormValue.h:28

Member Variables

private dwarf::Form Form
private dwarf::DwarfFormat Format = dwarf::DWARF32
Form for this value.
private llvm::DWARFFormValue::ValueType Value
Remember the DWARF format at extract time.
private const llvm::DWARFUnit* U = nullptr
Contains all data for the form.
private const llvm::DWARFContext* C = nullptr
Remember the DWARFUnit at extract time.

Method Overview

  • public DWARFFormValue(dwarf::Form F = llvm::dwarf::Form(0))
  • private DWARFFormValue(dwarf::Form F, llvm::DWARFFormValue::ValueType V)
  • public static llvm::DWARFFormValue createFromBlockValue(dwarf::Form F, ArrayRef<uint8_t> D)
  • public static llvm::DWARFFormValue createFromPValue(dwarf::Form F, const char * V)
  • public static llvm::DWARFFormValue createFromSValue(dwarf::Form F, int64_t V)
  • public static llvm::DWARFFormValue createFromUValue(dwarf::Form F, uint64_t V)
  • public static llvm::DWARFFormValue createFromUnit(dwarf::Form F, const llvm::DWARFUnit * Unit, uint64_t * OffsetPtr)
  • public void dump(llvm::raw_ostream & OS, llvm::DIDumpOptions DumpOpts = llvm::DIDumpOptions()) const
  • public static void dumpAddress(llvm::raw_ostream & OS, uint8_t AddressSize, uint64_t Address)
  • public void dumpAddress(llvm::raw_ostream & OS, uint64_t Address) const
  • public static void dumpAddressSection(const llvm::DWARFObject & Obj, llvm::raw_ostream & OS, llvm::DIDumpOptions DumpOpts, uint64_t SectionIndex)
  • public void dumpSectionedAddress(llvm::raw_ostream & OS, llvm::DIDumpOptions DumpOpts, object::SectionedAddress SA) const
  • private void dumpString(llvm::raw_ostream & OS) const
  • public bool extractValue(const llvm::DWARFDataExtractor & Data, uint64_t * OffsetPtr, dwarf::FormParams FormParams, const llvm::DWARFContext * Context = nullptr, const llvm::DWARFUnit * Unit = nullptr)
  • public bool extractValue(const llvm::DWARFDataExtractor & Data, uint64_t * OffsetPtr, dwarf::FormParams FormParams, const llvm::DWARFUnit * U)
  • public Optional<uint64_t> getAsAddress() const
  • public Optional<ArrayRef<uint8_t>> getAsBlock() const
  • public Expected<const char *> getAsCString() const
  • public Optional<uint64_t> getAsCStringOffset() const
  • public Optional<std::string> getAsFile(DILineInfoSpecifier::FileLineInfoKind Kind) const
  • public Optional<uint64_t> getAsReference() const
  • public Optional<uint64_t> getAsReferenceUVal() const
  • public Optional<llvm::DWARFFormValue::UnitOffset> getAsRelativeReference() const
  • public Optional<uint64_t> getAsSectionOffset() const
  • public Optional<object::SectionedAddress> getAsSectionedAddress() const
  • public Optional<int64_t> getAsSignedConstant() const
  • public Optional<uint64_t> getAsUnsignedConstant() const
  • public dwarf::Form getForm() const
  • public uint64_t getRawUValue() const
  • public const llvm::DWARFUnit * getUnit() const
  • public bool isFormClass(llvm::DWARFFormValue::FormClass FC) const
  • public bool skipValue(llvm::DataExtractor DebugInfoData, uint64_t * OffsetPtr, const dwarf::FormParams Params) const
  • public static bool skipValue(dwarf::Form Form, llvm::DataExtractor DebugInfoData, uint64_t * OffsetPtr, const dwarf::FormParams FormParams)

Methods

DWARFFormValue(
    dwarf::Form F = llvm::dwarf::Form(0))

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFFormValue.h:69

Parameters

dwarf::Form F = llvm::dwarf::Form(0)

DWARFFormValue(dwarf::Form F,
               llvm::DWARFFormValue::ValueType V)

Description

Context for extract time.

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFFormValue.h:66

Parameters

dwarf::Form F
llvm::DWARFFormValue::ValueType V

static llvm::DWARFFormValue createFromBlockValue(
    dwarf::Form F,
    ArrayRef<uint8_t> D)

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFFormValue.h:74

Parameters

dwarf::Form F
ArrayRef<uint8_t> D

static llvm::DWARFFormValue createFromPValue(
    dwarf::Form F,
    const char* V)

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFFormValue.h:73

Parameters

dwarf::Form F
const char* V

static llvm::DWARFFormValue createFromSValue(
    dwarf::Form F,
    int64_t V)

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFFormValue.h:71

Parameters

dwarf::Form F
int64_t V

static llvm::DWARFFormValue createFromUValue(
    dwarf::Form F,
    uint64_t V)

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFFormValue.h:72

Parameters

dwarf::Form F
uint64_t V

static llvm::DWARFFormValue createFromUnit(
    dwarf::Form F,
    const llvm::DWARFUnit* Unit,
    uint64_t* OffsetPtr)

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFFormValue.h:76

Parameters

dwarf::Form F
const llvm::DWARFUnit* Unit
uint64_t* OffsetPtr

void dump(llvm::raw_ostream& OS,
          llvm::DIDumpOptions DumpOpts =
              llvm::DIDumpOptions()) const

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFFormValue.h:84

Parameters

llvm::raw_ostream& OS
llvm::DIDumpOptions DumpOpts = llvm::DIDumpOptions()

static void dumpAddress(llvm::raw_ostream& OS,
                        uint8_t AddressSize,
                        uint64_t Address)

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFFormValue.h:88

Parameters

llvm::raw_ostream& OS
uint8_t AddressSize
uint64_t Address

void dumpAddress(llvm::raw_ostream& OS,
                 uint64_t Address) const

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFFormValue.h:87

Parameters

llvm::raw_ostream& OS
uint64_t Address

static void dumpAddressSection(
    const llvm::DWARFObject& Obj,
    llvm::raw_ostream& OS,
    llvm::DIDumpOptions DumpOpts,
    uint64_t SectionIndex)

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFFormValue.h:90

Parameters

const llvm::DWARFObject& Obj
llvm::raw_ostream& OS
llvm::DIDumpOptions DumpOpts
uint64_t SectionIndex

void dumpSectionedAddress(
    llvm::raw_ostream& OS,
    llvm::DIDumpOptions DumpOpts,
    object::SectionedAddress SA) const

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFFormValue.h:85

Parameters

llvm::raw_ostream& OS
llvm::DIDumpOptions DumpOpts
object::SectionedAddress SA

void dumpString(llvm::raw_ostream& OS) const

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFFormValue.h:167

Parameters

llvm::raw_ostream& OS

bool extractValue(
    const llvm::DWARFDataExtractor& Data,
    uint64_t* OffsetPtr,
    dwarf::FormParams FormParams,
    const llvm::DWARFContext* Context = nullptr,
    const llvm::DWARFUnit* Unit = nullptr)

Description

Extracts a value in \p Data at offset \p *OffsetPtr. The information in \p FormParams is needed to interpret some forms. The optional\p Context and \p Unit allows extracting information if the form refers to other sections (e.g., .debug_str).

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFFormValue.h:97

Parameters

const llvm::DWARFDataExtractor& Data
uint64_t* OffsetPtr
dwarf::FormParams FormParams
const llvm::DWARFContext* Context = nullptr
const llvm::DWARFUnit* Unit = nullptr

bool extractValue(
    const llvm::DWARFDataExtractor& Data,
    uint64_t* OffsetPtr,
    dwarf::FormParams FormParams,
    const llvm::DWARFUnit* U)

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFFormValue.h:102

Parameters

const llvm::DWARFDataExtractor& Data
uint64_t* OffsetPtr
dwarf::FormParams FormParams
const llvm::DWARFUnit* U

Optional<uint64_t> getAsAddress() const

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFFormValue.h:118

Optional<ArrayRef<uint8_t>> getAsBlock() const

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFFormValue.h:121

Expected<const char*> getAsCString() const

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFFormValue.h:117

Optional<uint64_t> getAsCStringOffset() const

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFFormValue.h:122

Optional<std::string> getAsFile(
    DILineInfoSpecifier::FileLineInfoKind Kind)
    const

Description

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.

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFFormValue.h:136

Parameters

DILineInfoSpecifier::FileLineInfoKind Kind
The kind of path to extract.

Returns

A valid string value on success, or llvm::None if the form class is not FC_Constant, or if the file index is not valid.

Optional<uint64_t> getAsReference() const

Description

getAsFoo functions below return the extracted value as Foo if only DWARFFormValue has form class is suitable for representing Foo.

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFFormValue.h:109

Optional<uint64_t> getAsReferenceUVal() const

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFFormValue.h:123

Optional<llvm::DWARFFormValue::UnitOffset>
getAsRelativeReference() const

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFFormValue.h:114

Optional<uint64_t> getAsSectionOffset() const

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFFormValue.h:120

Optional<object::SectionedAddress>
getAsSectionedAddress() const

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFFormValue.h:119

Optional<int64_t> getAsSignedConstant() const

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFFormValue.h:116

Optional<uint64_t> getAsUnsignedConstant() const

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFFormValue.h:115

dwarf::Form getForm() const

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFFormValue.h:79

uint64_t getRawUValue() const

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFFormValue.h:80

const llvm::DWARFUnit* getUnit() const

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFFormValue.h:83

bool isFormClass(
    llvm::DWARFFormValue::FormClass FC) const

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFFormValue.h:82

Parameters

llvm::DWARFFormValue::FormClass FC

bool skipValue(
    llvm::DataExtractor DebugInfoData,
    uint64_t* OffsetPtr,
    const dwarf::FormParams Params) const

Description

Skip a form's value in \p DebugInfoData at the offset specified by\p OffsetPtr. Skips the bytes for the current form and updates the offset.

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFFormValue.h:147

Parameters

llvm::DataExtractor DebugInfoData
The data where we want to skip the value.
uint64_t* OffsetPtr
A reference to the offset that will be updated.
const dwarf::FormParams Params
DWARF parameters to help interpret forms.

Returns

true on success, false if the form was not skipped.

static bool skipValue(
    dwarf::Form Form,
    llvm::DataExtractor DebugInfoData,
    uint64_t* OffsetPtr,
    const dwarf::FormParams FormParams)

Description

Skip a form's value in \p DebugInfoData at the offset specified by\p OffsetPtr. Skips the bytes for the specified form and updates the offset.

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFFormValue.h:162

Parameters

dwarf::Form Form
The DW_FORM enumeration that indicates the form to skip.
llvm::DataExtractor DebugInfoData
The data where we want to skip the value.
uint64_t* OffsetPtr
A reference to the offset that will be updated.
const dwarf::FormParams FormParams
DWARF parameters to help interpret forms.

Returns

true on success, false if the form was not skipped.