class LLVMSymbolizer

Declaration

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

Declared at: llvm/include/llvm/DebugInfo/Symbolize/Symbolize.h:50

Member Variables

private std::map<std::string, std::unique_ptr<SymbolizableModule>, std::less<>> Modules
private StringMap<std::string> BuildIDPaths
private std::map<std::pair<std::string, std::string>, ObjectPair> ObjectPairForPathArch
Contains cached results of getOrCreateObjectPair().
private std::map<std::string, CachedBinary> BinaryForPath
Contains parsed binary for each path, or parsing error.
private simple_ilist<llvm::symbolize::CachedBinary> LRUBinaries
A list of cached binaries in LRU order.
private size_t CacheSize = 0
Sum of the sizes of the cached binaries.
private std::map<std::pair<std::string, std::string>, std::unique_ptr<ObjectFile>> ObjectForUBPathAndArch
Parsed object file for path/architecture pair, where "path" refers to Mach-O universal binary.
private llvm::symbolize::LLVMSymbolizer::Options Opts
private SmallVector<std::unique_ptr<DIFetcher>> DIFetchers

Method Overview

  • public static std::string DemangleName(const std::string & Name, const llvm::symbolize::SymbolizableModule * DbiModuleDescriptor)
  • public LLVMSymbolizer(const llvm::symbolize::LLVMSymbolizer::Options & Opts)
  • public LLVMSymbolizer()
  • public void addDIFetcher(std::unique_ptr<DIFetcher> Fetcher)
  • private Expected<llvm::symbolize::SymbolizableModule *> createModuleInfo(const llvm::object::ObjectFile * Obj, std::unique_ptr<DIContext> Context, llvm::StringRef ModuleName)
  • private bool findDebugBinary(const std::string & OrigPath, const std::string & DebuglinkName, uint32_t CRCHash, std::string & Result)
  • public void flush()
  • private Expected<llvm::symbolize::SymbolizableModule *> getOrCreateModuleInfo(ArrayRef<uint8_t> BuildID)
  • private Expected<llvm::symbolize::SymbolizableModule *> getOrCreateModuleInfo(const llvm::object::ObjectFile & Obj)
  • private Expected<llvm::symbolize::SymbolizableModule *> getOrCreateModuleInfo(const std::string & ModuleName)
  • private Expected<llvm::object::ObjectFile *> getOrCreateObject(const std::string & Path, const std::string & ArchName)
  • private Expected<llvm::symbolize::LLVMSymbolizer::ObjectPair> getOrCreateObjectPair(const std::string & Path, const std::string & ArchName)
  • private bool getOrFindDebugBinary(const ArrayRef<uint8_t> BuildID, std::string & Result)
  • private llvm::object::ObjectFile * lookUpBuildIDObject(const std::string & Path, const llvm::object::ELFObjectFileBase * Obj, const std::string & ArchName)
  • private llvm::object::ObjectFile * lookUpDebuglinkObject(const std::string & Path, const llvm::object::ObjectFile * Obj, const std::string & ArchName)
  • private llvm::object::ObjectFile * lookUpDsymFile(const std::string & Path, const llvm::object::MachOObjectFile * ExeObj, const std::string & ArchName)
  • public void pruneCache()
  • private void recordAccess(llvm::symbolize::CachedBinary & Bin)
  • public Expected<llvm::DILineInfo> symbolizeCode(const llvm::object::ObjectFile & Obj, object::SectionedAddress ModuleOffset)
  • public Expected<llvm::DILineInfo> symbolizeCode(ArrayRef<uint8_t> BuildID, object::SectionedAddress ModuleOffset)
  • public Expected<llvm::DILineInfo> symbolizeCode(const std::string & ModuleName, object::SectionedAddress ModuleOffset)
  • private template <typename T>Expected<llvm::DILineInfo> symbolizeCodeCommon(const T & ModuleSpecifier, object::SectionedAddress ModuleOffset)
  • public Expected<llvm::DIGlobal> symbolizeData(ArrayRef<uint8_t> BuildID, object::SectionedAddress ModuleOffset)
  • public Expected<llvm::DIGlobal> symbolizeData(const std::string & ModuleName, object::SectionedAddress ModuleOffset)
  • public Expected<llvm::DIGlobal> symbolizeData(const llvm::object::ObjectFile & Obj, object::SectionedAddress ModuleOffset)
  • private template <typename T>Expected<llvm::DIGlobal> symbolizeDataCommon(const T & ModuleSpecifier, object::SectionedAddress ModuleOffset)
  • public Expected<std::vector<DILocal>> symbolizeFrame(ArrayRef<uint8_t> BuildID, object::SectionedAddress ModuleOffset)
  • public Expected<std::vector<DILocal>> symbolizeFrame(const std::string & ModuleName, object::SectionedAddress ModuleOffset)
  • public Expected<std::vector<DILocal>> symbolizeFrame(const llvm::object::ObjectFile & Obj, object::SectionedAddress ModuleOffset)
  • private template <typename T>Expected<std::vector<DILocal>> symbolizeFrameCommon(const T & ModuleSpecifier, object::SectionedAddress ModuleOffset)
  • public Expected<llvm::DIInliningInfo> symbolizeInlinedCode(ArrayRef<uint8_t> BuildID, object::SectionedAddress ModuleOffset)
  • public Expected<llvm::DIInliningInfo> symbolizeInlinedCode(const std::string & ModuleName, object::SectionedAddress ModuleOffset)
  • public Expected<llvm::DIInliningInfo> symbolizeInlinedCode(const llvm::object::ObjectFile & Obj, object::SectionedAddress ModuleOffset)
  • private template <typename T>Expected<llvm::DIInliningInfo> symbolizeInlinedCodeCommon(const T & ModuleSpecifier, object::SectionedAddress ModuleOffset)
  • public ~LLVMSymbolizer()

Methods

static std::string DemangleName(
    const std::string& Name,
    const llvm::symbolize::SymbolizableModule*
        DbiModuleDescriptor)

Declared at: llvm/include/llvm/DebugInfo/Symbolize/Symbolize.h:115

Parameters

const std::string& Name
const llvm::symbolize::SymbolizableModule* DbiModuleDescriptor

LLVMSymbolizer(const llvm::symbolize::
                   LLVMSymbolizer::Options& Opts)

Declared at: llvm/include/llvm/DebugInfo/Symbolize/Symbolize.h:72

Parameters

const llvm::symbolize::LLVMSymbolizer::Options& Opts

LLVMSymbolizer()

Declared at: llvm/include/llvm/DebugInfo/Symbolize/Symbolize.h:71

void addDIFetcher(
    std::unique_ptr<DIFetcher> Fetcher)

Declared at: llvm/include/llvm/DebugInfo/Symbolize/Symbolize.h:118

Parameters

std::unique_ptr<DIFetcher> Fetcher

Expected<llvm::symbolize::SymbolizableModule*>
createModuleInfo(
    const llvm::object::ObjectFile* Obj,
    std::unique_ptr<DIContext> Context,
    llvm::StringRef ModuleName)

Declared at: llvm/include/llvm/DebugInfo/Symbolize/Symbolize.h:158

Parameters

const llvm::object::ObjectFile* Obj
std::unique_ptr<DIContext> Context
llvm::StringRef ModuleName

bool findDebugBinary(
    const std::string& OrigPath,
    const std::string& DebuglinkName,
    uint32_t CRCHash,
    std::string& Result)

Declared at: llvm/include/llvm/DebugInfo/Symbolize/Symbolize.h:171

Parameters

const std::string& OrigPath
const std::string& DebuglinkName
uint32_t CRCHash
std::string& Result

void flush()

Declared at: llvm/include/llvm/DebugInfo/Symbolize/Symbolize.h:107

Expected<llvm::symbolize::SymbolizableModule*>
getOrCreateModuleInfo(ArrayRef<uint8_t> BuildID)

Description

Returns a SymbolizableModule or an error if loading debug info failed. Unlike the above, errors are reported each time, since they are more likely to be transient.

Declared at: llvm/include/llvm/DebugInfo/Symbolize/Symbolize.h:155

Parameters

ArrayRef<uint8_t> BuildID

Expected<llvm::symbolize::SymbolizableModule*>
getOrCreateModuleInfo(
    const llvm::object::ObjectFile& Obj)

Declared at: llvm/include/llvm/DebugInfo/Symbolize/Symbolize.h:149

Parameters

const llvm::object::ObjectFile& Obj

Expected<llvm::symbolize::SymbolizableModule*>
getOrCreateModuleInfo(
    const std::string& ModuleName)

Description

Returns a SymbolizableModule or an error if loading debug info failed. Only one attempt is made to load a module, and errors during loading are only reported once. Subsequent calls to get module info for a module that failed to load will return nullptr.

Declared at: llvm/include/llvm/DebugInfo/Symbolize/Symbolize.h:148

Parameters

const std::string& ModuleName

Expected<llvm::object::ObjectFile*>
getOrCreateObject(const std::string& Path,
                  const std::string& ArchName)

Description

Return a pointer to object file at specified path, for a specified architecture (e.g. if path refers to a Mach-O universal binary, only one object file from it will be returned).

Declared at: llvm/include/llvm/DebugInfo/Symbolize/Symbolize.h:185

Parameters

const std::string& Path
const std::string& ArchName

Expected<
    llvm::symbolize::LLVMSymbolizer::ObjectPair>
getOrCreateObjectPair(const std::string& Path,
                      const std::string& ArchName)

Description

Returns pair of pointers to object and debug object.

Declared at: llvm/include/llvm/DebugInfo/Symbolize/Symbolize.h:179

Parameters

const std::string& Path
const std::string& ArchName

bool getOrFindDebugBinary(
    const ArrayRef<uint8_t> BuildID,
    std::string& Result)

Declared at: llvm/include/llvm/DebugInfo/Symbolize/Symbolize.h:175

Parameters

const ArrayRef<uint8_t> BuildID
std::string& Result

llvm::object::ObjectFile* lookUpBuildIDObject(
    const std::string& Path,
    const llvm::object::ELFObjectFileBase* Obj,
    const std::string& ArchName)

Declared at: llvm/include/llvm/DebugInfo/Symbolize/Symbolize.h:167

Parameters

const std::string& Path
const llvm::object::ELFObjectFileBase* Obj
const std::string& ArchName

llvm::object::ObjectFile* lookUpDebuglinkObject(
    const std::string& Path,
    const llvm::object::ObjectFile* Obj,
    const std::string& ArchName)

Declared at: llvm/include/llvm/DebugInfo/Symbolize/Symbolize.h:164

Parameters

const std::string& Path
const llvm::object::ObjectFile* Obj
const std::string& ArchName

llvm::object::ObjectFile* lookUpDsymFile(
    const std::string& Path,
    const llvm::object::MachOObjectFile* ExeObj,
    const std::string& ArchName)

Declared at: llvm/include/llvm/DebugInfo/Symbolize/Symbolize.h:161

Parameters

const std::string& Path
const llvm::object::MachOObjectFile* ExeObj
const std::string& ArchName

void pruneCache()

Declared at: llvm/include/llvm/DebugInfo/Symbolize/Symbolize.h:112

void recordAccess(
    llvm::symbolize::CachedBinary& Bin)

Description

Update the LRU cache order when a binary is accessed.

Declared at: llvm/include/llvm/DebugInfo/Symbolize/Symbolize.h:189

Parameters

llvm::symbolize::CachedBinary& Bin

Expected<llvm::DILineInfo> symbolizeCode(
    const llvm::object::ObjectFile& Obj,
    object::SectionedAddress ModuleOffset)

Declared at: llvm/include/llvm/DebugInfo/Symbolize/Symbolize.h:77

Parameters

const llvm::object::ObjectFile& Obj
object::SectionedAddress ModuleOffset

Expected<llvm::DILineInfo> symbolizeCode(
    ArrayRef<uint8_t> BuildID,
    object::SectionedAddress ModuleOffset)

Declared at: llvm/include/llvm/DebugInfo/Symbolize/Symbolize.h:81

Parameters

ArrayRef<uint8_t> BuildID
object::SectionedAddress ModuleOffset

Expected<llvm::DILineInfo> symbolizeCode(
    const std::string& ModuleName,
    object::SectionedAddress ModuleOffset)

Declared at: llvm/include/llvm/DebugInfo/Symbolize/Symbolize.h:79

Parameters

const std::string& ModuleName
object::SectionedAddress ModuleOffset

template <typename T>
Expected<llvm::DILineInfo> symbolizeCodeCommon(
    const T& ModuleSpecifier,
    object::SectionedAddress ModuleOffset)

Declared at: llvm/include/llvm/DebugInfo/Symbolize/Symbolize.h:129

Templates

T

Parameters

const T& ModuleSpecifier
object::SectionedAddress ModuleOffset

Expected<llvm::DIGlobal> symbolizeData(
    ArrayRef<uint8_t> BuildID,
    object::SectionedAddress ModuleOffset)

Declared at: llvm/include/llvm/DebugInfo/Symbolize/Symbolize.h:97

Parameters

ArrayRef<uint8_t> BuildID
object::SectionedAddress ModuleOffset

Expected<llvm::DIGlobal> symbolizeData(
    const std::string& ModuleName,
    object::SectionedAddress ModuleOffset)

Declared at: llvm/include/llvm/DebugInfo/Symbolize/Symbolize.h:95

Parameters

const std::string& ModuleName
object::SectionedAddress ModuleOffset

Expected<llvm::DIGlobal> symbolizeData(
    const llvm::object::ObjectFile& Obj,
    object::SectionedAddress ModuleOffset)

Declared at: llvm/include/llvm/DebugInfo/Symbolize/Symbolize.h:93

Parameters

const llvm::object::ObjectFile& Obj
object::SectionedAddress ModuleOffset

template <typename T>
Expected<llvm::DIGlobal> symbolizeDataCommon(
    const T& ModuleSpecifier,
    object::SectionedAddress ModuleOffset)

Declared at: llvm/include/llvm/DebugInfo/Symbolize/Symbolize.h:136

Templates

T

Parameters

const T& ModuleSpecifier
object::SectionedAddress ModuleOffset

Expected<std::vector<DILocal>> symbolizeFrame(
    ArrayRef<uint8_t> BuildID,
    object::SectionedAddress ModuleOffset)

Declared at: llvm/include/llvm/DebugInfo/Symbolize/Symbolize.h:105

Parameters

ArrayRef<uint8_t> BuildID
object::SectionedAddress ModuleOffset

Expected<std::vector<DILocal>> symbolizeFrame(
    const std::string& ModuleName,
    object::SectionedAddress ModuleOffset)

Declared at: llvm/include/llvm/DebugInfo/Symbolize/Symbolize.h:102

Parameters

const std::string& ModuleName
object::SectionedAddress ModuleOffset

Expected<std::vector<DILocal>> symbolizeFrame(
    const llvm::object::ObjectFile& Obj,
    object::SectionedAddress ModuleOffset)

Declared at: llvm/include/llvm/DebugInfo/Symbolize/Symbolize.h:100

Parameters

const llvm::object::ObjectFile& Obj
object::SectionedAddress ModuleOffset

template <typename T>
Expected<std::vector<DILocal>>
symbolizeFrameCommon(
    const T& ModuleSpecifier,
    object::SectionedAddress ModuleOffset)

Declared at: llvm/include/llvm/DebugInfo/Symbolize/Symbolize.h:140

Templates

T

Parameters

const T& ModuleSpecifier
object::SectionedAddress ModuleOffset

Expected<llvm::DIInliningInfo>
symbolizeInlinedCode(
    ArrayRef<uint8_t> BuildID,
    object::SectionedAddress ModuleOffset)

Declared at: llvm/include/llvm/DebugInfo/Symbolize/Symbolize.h:90

Parameters

ArrayRef<uint8_t> BuildID
object::SectionedAddress ModuleOffset

Expected<llvm::DIInliningInfo>
symbolizeInlinedCode(
    const std::string& ModuleName,
    object::SectionedAddress ModuleOffset)

Declared at: llvm/include/llvm/DebugInfo/Symbolize/Symbolize.h:87

Parameters

const std::string& ModuleName
object::SectionedAddress ModuleOffset

Expected<llvm::DIInliningInfo>
symbolizeInlinedCode(
    const llvm::object::ObjectFile& Obj,
    object::SectionedAddress ModuleOffset)

Declared at: llvm/include/llvm/DebugInfo/Symbolize/Symbolize.h:84

Parameters

const llvm::object::ObjectFile& Obj
object::SectionedAddress ModuleOffset

template <typename T>
Expected<llvm::DIInliningInfo>
symbolizeInlinedCodeCommon(
    const T& ModuleSpecifier,
    object::SectionedAddress ModuleOffset)

Declared at: llvm/include/llvm/DebugInfo/Symbolize/Symbolize.h:133

Templates

T

Parameters

const T& ModuleSpecifier
object::SectionedAddress ModuleOffset

~LLVMSymbolizer()

Declared at: llvm/include/llvm/DebugInfo/Symbolize/Symbolize.h:74