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:20

Inherits from: DataExtractor

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 Optional<uint64_t> getEncodedPointer(uint64_t * Offset, uint8_t Encoding, uint64_t AbsPosOffset = 0) 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

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:27

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:33

Parameters

llvm::StringRef Data
bool IsLittleEndian
uint8_t AddressSize

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:56

Parameters

uint64_t* Offset
uint8_t Encoding
uint64_t AbsPosOffset = 0

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:44

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:47

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:38

Parameters

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