13#ifndef LLVM_DEBUGINFO_SYMBOLIZE_SYMBOLIZE_H
14#define LLVM_DEBUGINFO_SYMBOLIZE_SYMBOLIZE_H
46using namespace object;
74 : static_cast<size_t>(4ULL * 1024 * 1024 * 1024) ;
133 BIDFetcher = std::move(Fetcher);
146 using ObjectPair = std::pair<const ObjectFile *, const ObjectFile *>;
148 template <
typename T>
150 symbolizeCodeCommon(
const T &ModuleSpecifier,
152 template <
typename T>
154 symbolizeInlinedCodeCommon(
const T &ModuleSpecifier,
156 template <
typename T>
159 template <
typename T>
161 symbolizeFrameCommon(
const T &ModuleSpecifier,
163 template <
typename T>
176 createModuleInfo(
const ObjectFile *Obj, std::unique_ptr<DIContext> Context,
179 ObjectFile *lookUpDsymFile(
const std::string &Path,
181 const std::string &ArchName);
182 ObjectFile *lookUpDebuglinkObject(
const std::string &Path,
184 const std::string &ArchName);
185 ObjectFile *lookUpBuildIDObject(
const std::string &Path,
187 const std::string &ArchName);
188 std::string lookUpGsymFile(
const std::string &Path);
190 bool findDebugBinary(
const std::string &OrigPath,
191 const std::string &DebuglinkName,
uint32_t CRCHash,
192 std::string &Result);
195 std::string &Result);
199 const std::string &ArchName);
205 const std::string &DefaultArchName);
217 std::map<std::string, std::unique_ptr<SymbolizableModule>, std::less<>>
222 std::map<std::pair<std::string, std::string>, ObjectPair>
223 ObjectPairForPathArch;
226 std::map<std::string, CachedBinary, std::less<>> BinaryForPath;
236 struct ContainerCacheKey {
238 std::string MemberName;
239 std::string ArchName;
243 return std::tie(Path, MemberName, ArchName) <
251 std::map<ContainerCacheKey, std::unique_ptr<ObjectFile>> ObjectFileCache;
253 Expected<object::Binary *>
254 loadOrGetBinary(
const std::string &ArchivePathKey,
255 std::optional<StringRef> FullPathKey = std::nullopt);
257 Expected<ObjectFile *> findOrCacheObject(
258 const ContainerCacheKey &
Key,
260 const std::string &PathForBinaryCache);
264 std::unique_ptr<BuildIDFetcher> BIDFetcher;
289 size_t size() {
return Bin.getBinary()->getData().size(); }
293 std::function<void()> Evictor;
This file defines the StringMap class.
This file declares a library for handling Build IDs and using them to find debug info.
static cl::opt< unsigned > CacheSize("cdsort-cache-size", cl::ReallyHidden, cl::desc("The size of a line in the cache"))
This file defines the DenseMap class.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Tagged union holding either a T or a Error.
StringMap - This is an unconventional map that is specialized for handling keys that are "strings",...
StringRef - Represent a constant reference to a string, i.e.
An efficient, type-erasing, non-owning reference to a callable.
This class is the base class for all object file types.
A simple intrusive list implementation.
CachedBinary(OwningBinary< Binary > Bin)
OwningBinary< Binary > * operator->()
LLVM_ABI void pushEvictor(std::function< void()> Evictor)
OwningBinary< Binary > & operator*()
static LLVM_ABI std::string DemangleName(StringRef Name, const SymbolizableModule *DbiModuleDescriptor)
LLVM_ABI void pruneCache()
LLVM_ABI Expected< std::vector< DILineInfo > > findSymbol(const ObjectFile &Obj, StringRef Symbol, uint64_t Offset)
LLVM_ABI Expected< DIInliningInfo > symbolizeInlinedCode(const ObjectFile &Obj, object::SectionedAddress ModuleOffset)
LLVM_ABI LLVMSymbolizer()
LLVM_ABI Expected< DILineInfo > symbolizeCode(const ObjectFile &Obj, object::SectionedAddress ModuleOffset)
LLVM_ABI Expected< DIGlobal > symbolizeData(const ObjectFile &Obj, object::SectionedAddress ModuleOffset)
LLVM_ABI Expected< std::vector< DILocal > > symbolizeFrame(const ObjectFile &Obj, object::SectionedAddress ModuleOffset)
LLVM_ABI Expected< SymbolizableModule * > getOrCreateModuleInfo(StringRef ModuleName)
Returns a SymbolizableModule or an error if loading debug info failed.
LLVM_ABI ~LLVMSymbolizer()
void setBuildIDFetcher(std::unique_ptr< BuildIDFetcher > Fetcher)
This file defines the ilist_node class template, which is a convenient base class for creating classe...
bool operator<(const ELFSymbolRef &A, const ELFSymbolRef &B)
SmallVector< uint8_t, 10 > BuildID
A build ID in binary form.
DILineInfoSpecifier::FileLineInfoKind FileLineInfoKind
DILineInfoSpecifier::FunctionNameKind FunctionNameKind
This is an optimization pass for GlobalISel generic memory operations.
LLVM_ATTRIBUTE_VISIBILITY_DEFAULT AnalysisKey InnerAnalysisManagerProxy< AnalysisManagerT, IRUnitT, ExtraArgTs... >::Key
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
Implement std::hash so that hash_code can be used in STL containers.
DINameKind FunctionNameKind
std::vector< std::string > GsymFileDirectory
std::vector< std::string > DebugFileDirectory
std::vector< std::string > DsymHints
std::string FallbackDebugPath
FunctionNameKind PrintFunctions
FileLineInfoKind PathStyle