LLVM: include/llvm/DebugInfo/Symbolize/Symbolize.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13#ifndef LLVM_DEBUGINFO_SYMBOLIZE_SYMBOLIZE_H
14#define LLVM_DEBUGINFO_SYMBOLIZE_SYMBOLIZE_H
15
24#include
25#include
26#include
27#include
28#include
29#include
30#include
31
32namespace llvm {
38}
39
41
43
44using namespace object;
45
48
50
52public:
70 sizeof(size_t) == 4
71 ? 512 * 1024 * 1024
72 : static_cast<size_t>(4ULL * 1024 * 1024 * 1024) ;
73 };
74
77
79
80
97
112
119
121
122
123
124
126
129
131 BIDFetcher = std::move(Fetcher);
132 }
133
134
135
136
137
140
141private:
142
143
144 using ObjectPair = std::pair<const ObjectFile *, const ObjectFile *>;
145
146 template
148 symbolizeCodeCommon(const T &ModuleSpecifier,
150 template
152 symbolizeInlinedCodeCommon(const T &ModuleSpecifier,
154 template
157 template
159 symbolizeFrameCommon(const T &ModuleSpecifier,
161 template
164
166
167
168
169
172
174 createModuleInfo(const ObjectFile *Obj, std::unique_ptr Context,
176
177 ObjectFile *lookUpDsymFile(const std::string &Path,
179 const std::string &ArchName);
180 ObjectFile *lookUpDebuglinkObject(const std::string &Path,
182 const std::string &ArchName);
183 ObjectFile *lookUpBuildIDObject(const std::string &Path,
185 const std::string &ArchName);
186 std::string lookUpGsymFile(const std::string &Path);
187
188 bool findDebugBinary(const std::string &OrigPath,
189 const std::string &DebuglinkName, uint32_t CRCHash,
190 std::string &Result);
191
193 std::string &Result);
194
195
197 const std::string &ArchName);
198
199
200
201
203 const std::string &ArchName);
204
205
207
208 std::map<std::string, std::unique_ptr, std::less<>>
209 Modules;
211
212
213 std::map<std::pair<std::string, std::string>, ObjectPair>
214 ObjectPairForPathArch;
215
216
217 std::map<std::string, CachedBinary, std::less<>> BinaryForPath;
218
219
221
223
224
225
226 std::map<std::pair<std::string, std::string>, std::unique_ptr>
227 ObjectForUBPathAndArch;
228
230
231 std::unique_ptr BIDFetcher;
232};
233
234
235
236
238public:
241
244
245
246
248
249
250
252 if (Evictor)
253 Evictor();
254 }
255
256 size_t size() { return Bin.getBinary()->getData().size(); }
257
258private:
260 std::function<void()> Evictor;
261};
262
263}
264}
265
266#endif
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"))
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.
This class is the base class for all object file types.
A simple intrusive list implementation.
Definition Symbolize.h:237
CachedBinary(OwningBinary< Binary > Bin)
Definition Symbolize.h:240
OwningBinary< Binary > * operator->()
Definition Symbolize.h:243
LLVM_ABI void pushEvictor(std::function< void()> Evictor)
void evict()
Definition Symbolize.h:251
OwningBinary< Binary > & operator*()
Definition Symbolize.h:242
size_t size()
Definition Symbolize.h:256
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)
Definition Symbolize.h:130
This file defines the ilist_node class template, which is a convenient base class for creating classe...
SmallVector< uint8_t, 10 > BuildID
A build ID in binary form.
DILineInfoSpecifier::FileLineInfoKind FileLineInfoKind
Definition Symbolize.h:47
DILineInfoSpecifier::FunctionNameKind FunctionNameKind
This is an optimization pass for GlobalISel generic memory operations.
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
Definition Symbolize.h:53
bool RelativeAddresses
Definition Symbolize.h:59
std::vector< std::string > GsymFileDirectory
Definition Symbolize.h:68
std::string DWPName
Definition Symbolize.h:66
std::vector< std::string > DebugFileDirectory
Definition Symbolize.h:67
bool UseSymbolTable
Definition Symbolize.h:57
std::string DefaultArch
Definition Symbolize.h:63
std::vector< std::string > DsymHints
Definition Symbolize.h:64
bool SkipLineZero
Definition Symbolize.h:56
std::string FallbackDebugPath
Definition Symbolize.h:65
bool DisableGsym
Definition Symbolize.h:62
bool UntagAddresses
Definition Symbolize.h:60
FunctionNameKind PrintFunctions
Definition Symbolize.h:54
FileLineInfoKind PathStyle
Definition Symbolize.h:55
bool UseDIA
Definition Symbolize.h:61
bool Demangle
Definition Symbolize.h:58
size_t MaxCacheSize
Definition Symbolize.h:69