class DWARFDataExtractor

Declaration

class DWARFDataExtractor : public DataExtractor { /* full declaration omitted */ };

Description

A DataExtractor (typically for an in-memory copy of an object-file section) plus a relocation map for that section, if there is one.

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFDataExtractor.h:21

Inherits from: DataExtractor

Member Variables

private const llvm::DWARFObject* Obj = nullptr
private const llvm::DWARFSection* Section = nullptr

Method Overview

  • public DWARFDataExtractor(const llvm::DWARFObject & Obj, const llvm::DWARFSection & Section, bool IsLittleEndian, uint8_t AddressSize)
  • public DWARFDataExtractor(llvm::StringRef Data, bool IsLittleEndian, uint8_t AddressSize)
  • public DWARFDataExtractor(ArrayRef<uint8_t> Data, bool IsLittleEndian, uint8_t AddressSize)
  • public DWARFDataExtractor(const llvm::DWARFDataExtractor & Other, size_t Length)
  • public Optional<uint64_t> getEncodedPointer(uint64_t * Offset, uint8_t Encoding, uint64_t AbsPosOffset = 0) const
  • public std::pair<uint64_t, dwarf::DwarfFormat> getInitialLength(uint64_t * Off, llvm::Error * Err = nullptr) const
  • public std::pair<uint64_t, dwarf::DwarfFormat> getInitialLength(llvm::DataExtractor::Cursor & C) const
  • public uint64_t getRelocatedAddress(uint64_t * Off, uint64_t * SecIx = nullptr) const
  • public uint64_t getRelocatedAddress(llvm::DataExtractor::Cursor & C, uint64_t * SecIx = nullptr) const
  • public uint64_t getRelocatedValue(uint32_t Size, uint64_t * Off, uint64_t * SectionIndex = nullptr, llvm::Error * Err = nullptr) const
  • public uint64_t getRelocatedValue(llvm::DataExtractor::Cursor & C, uint32_t Size, uint64_t * SectionIndex = nullptr) const

Inherited from DataExtractor:

Methods

DWARFDataExtractor(
    const llvm::DWARFObject& Obj,
    const llvm::DWARFSection& Section,
    bool IsLittleEndian,
    uint8_t AddressSize)

Description

Constructor for the normal case of extracting data from a DWARF section. The DWARFSection's lifetime must be at least as long as the extractor's.

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

Parameters

const llvm::DWARFObject& Obj
const llvm::DWARFSection& Section
bool IsLittleEndian
uint8_t AddressSize

DWARFDataExtractor(llvm::StringRef Data,
                   bool IsLittleEndian,
                   uint8_t AddressSize)

Description

Constructor for cases when there are no relocations.

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFDataExtractor.h:34

Parameters

llvm::StringRef Data
bool IsLittleEndian
uint8_t AddressSize

DWARFDataExtractor(ArrayRef<uint8_t> Data,
                   bool IsLittleEndian,
                   uint8_t AddressSize)

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFDataExtractor.h:36

Parameters

ArrayRef<uint8_t> Data
bool IsLittleEndian
uint8_t AddressSize

DWARFDataExtractor(
    const llvm::DWARFDataExtractor& Other,
    size_t Length)

Description

Truncating constructor

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFDataExtractor.h:43

Parameters

const llvm::DWARFDataExtractor& Other
size_t Length

Optional<uint64_t> getEncodedPointer(
    uint64_t* Offset,
    uint8_t Encoding,
    uint64_t AbsPosOffset = 0) const

Description

Extracts a DWARF-encoded pointer in \p Offset using \p Encoding. There is a DWARF encoding that uses a PC-relative adjustment. For these values, \p AbsPosOffset is used to fix them, which should reflect the absolute address of this pointer.

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

Parameters

uint64_t* Offset
uint8_t Encoding
uint64_t AbsPosOffset = 0

std::pair<uint64_t, dwarf::DwarfFormat>
getInitialLength(uint64_t* Off,
                 llvm::Error* Err = nullptr) const

Description

Extracts the DWARF "initial length" field, which can either be a 32-bit value smaller than 0xfffffff0, or the value 0xffffffff followed by a 64-bit length. Returns the actual length, and the DWARF format which is encoded in the field. In case of errors, it returns {0, DWARF32} and leaves the offset unchanged.

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFDataExtractor.h:54

Parameters

uint64_t* Off
llvm::Error* Err = nullptr

std::pair<uint64_t, dwarf::DwarfFormat>
getInitialLength(
    llvm::DataExtractor::Cursor& C) const

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFDataExtractor.h:56

Parameters

llvm::DataExtractor::Cursor& C

uint64_t getRelocatedAddress(
    uint64_t* Off,
    uint64_t* SecIx = nullptr) const

Description

Extracts an address-sized value and applies a relocation to the result if one exists for the given offset.

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

Parameters

uint64_t* Off
uint64_t* SecIx = nullptr

uint64_t getRelocatedAddress(
    llvm::DataExtractor::Cursor& C,
    uint64_t* SecIx = nullptr) const

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFDataExtractor.h:75

Parameters

llvm::DataExtractor::Cursor& C
uint64_t* SecIx = nullptr

uint64_t getRelocatedValue(
    uint32_t Size,
    uint64_t* Off,
    uint64_t* SectionIndex = nullptr,
    llvm::Error* Err = nullptr) const

Description

Extracts a value and applies a relocation to the result if one exists for the given offset.

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFDataExtractor.h:62

Parameters

uint32_t Size
uint64_t* Off
uint64_t* SectionIndex = nullptr
llvm::Error* Err = nullptr

uint64_t getRelocatedValue(
    llvm::DataExtractor::Cursor& C,
    uint32_t Size,
    uint64_t* SectionIndex = nullptr) const

Declared at: llvm/include/llvm/DebugInfo/DWARF/DWARFDataExtractor.h:65

Parameters

llvm::DataExtractor::Cursor& C
uint32_t Size
uint64_t* SectionIndex = nullptr