13#ifndef LLVM_DEBUGINFO_SYMBOLIZE_SYMBOLIZE_H
14#define LLVM_DEBUGINFO_SYMBOLIZE_SYMBOLIZE_H
46using namespace object;
75 : static_cast<
size_t>(4ULL * 1024 * 1024 * 1024) ;
134 BIDFetcher = std::move(Fetcher);
147 using ObjectPair = std::pair<const ObjectFile *, const ObjectFile *>;
149 template <
typename T>
151 symbolizeCodeCommon(
const T &ModuleSpecifier,
153 template <
typename T>
155 symbolizeInlinedCodeCommon(
const T &ModuleSpecifier,
157 template <
typename T>
160 template <
typename T>
162 symbolizeFrameCommon(
const T &ModuleSpecifier,
164 template <
typename T>
177 createModuleInfo(
const ObjectFile *Obj, std::unique_ptr<DIContext> Context,
180 ObjectFile *lookUpDsymFile(
const std::string &Path,
182 const std::string &ArchName);
183 ObjectFile *lookUpDebuglinkObject(
const std::string &Path,
185 const std::string &ArchName);
186 ObjectFile *lookUpBuildIDObject(
const std::string &Path,
188 const std::string &ArchName);
189 std::string lookUpGsymFile(
const std::string &Path);
191 bool findDebugBinary(
const std::string &OrigPath,
192 const std::string &DebuglinkName,
uint32_t CRCHash,
193 std::string &Result);
196 std::string &Result);
200 const std::string &ArchName);
206 const std::string &DefaultArchName);
218 std::map<std::string, std::unique_ptr<SymbolizableModule>, std::less<>>
223 std::map<std::pair<std::string, std::string>, ObjectPair>
224 ObjectPairForPathArch;
227 std::map<std::string, CachedBinary, std::less<>> BinaryForPath;
237 struct ContainerCacheKey {
239 std::string MemberName;
240 std::string ArchName;
244 return std::tie(Path, MemberName, ArchName) <
252 std::map<ContainerCacheKey, std::unique_ptr<ObjectFile>> ObjectFileCache;
254 Expected<object::Binary *>
255 loadOrGetBinary(
const std::string &ArchivePathKey,
256 std::optional<StringRef> FullPathKey = std::nullopt);
258 Expected<ObjectFile *> findOrCacheObject(
259 const ContainerCacheKey &
Key,
261 const std::string &PathForBinaryCache);
265 std::unique_ptr<BuildIDFetcher> BIDFetcher;
290 size_t size() {
return Bin.getBinary()->getData().size(); }
294 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.
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",...
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