llvm::gsym::decodeRange

Decode an AddressRange from a binary data stream.

Synopsis

Declared in <llvm/DebugInfo/GSYM/ExtractRanges.h>

AddressRange
decodeRange(
    GsymDataExtractor& Data,
    uint64_t BaseAddr,
    uint64_t& Offset);

Description

AddressRange objects are encoded and decoded to be relative to a base address. This will be the FunctionInfo's start address if the AddressRange is directly contained in a FunctionInfo, or a base address of the containing parent AddressRange or AddressRanges. This allows address ranges to be efficiently encoded using ULEB128 encodings as we encode the offset and size of each range instead of full addresses. This also makes encoded addresses easy to relocate as we just need to relocate one base address.

Return Value

The decoded address range.

Parameters

NameDescription
DataThe binary stream to read the data from.
BaseAddrThe base address used to reconstruct absolute addresses.
OffsetThe byte offset within Data.