LLDB  mainline
SymbolFile.h
Go to the documentation of this file.
1 //===-- SymbolFile.h --------------------------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef LLDB_SYMBOL_SYMBOLFILE_H
10 #define LLDB_SYMBOL_SYMBOLFILE_H
11 
12 #include "lldb/Core/Module.h"
13 #include "lldb/Core/ModuleList.h"
19 #include "lldb/Symbol/Function.h"
21 #include "lldb/Symbol/Type.h"
22 #include "lldb/Symbol/TypeList.h"
23 #include "lldb/Symbol/TypeSystem.h"
24 #include "lldb/Target/Statistics.h"
25 #include "lldb/Utility/XcodeSDK.h"
26 #include "lldb/lldb-private.h"
27 #include "llvm/ADT/DenseSet.h"
28 #include "llvm/Support/Errc.h"
29 
30 #include <mutex>
31 
32 #if defined(LLDB_CONFIGURATION_DEBUG)
33 #define ASSERT_MODULE_LOCK(expr) (expr->AssertModuleLock())
34 #else
35 #define ASSERT_MODULE_LOCK(expr) ((void)0)
36 #endif
37 
38 namespace lldb_private {
39 
40 /// Provides public interface for all SymbolFiles. Any protected
41 /// virtual members should go into SymbolFileCommon; most SymbolFile
42 /// implementations should inherit from SymbolFileCommon to override
43 /// the behaviors except SymbolFileOnDemand which inherits
44 /// public interfaces from SymbolFile and forward to underlying concrete
45 /// SymbolFile implementation.
46 class SymbolFile : public PluginInterface {
47  /// LLVM RTTI support.
48  static char ID;
49 
50 public:
51  /// LLVM RTTI support.
52  /// \{
53  virtual bool isA(const void *ClassID) const { return ClassID == &ID; }
54  static bool classof(const SymbolFile *obj) { return obj->isA(&ID); }
55  /// \}
56 
57  // Symbol file ability bits.
58  //
59  // Each symbol file can claim to support one or more symbol file abilities.
60  // These get returned from SymbolFile::GetAbilities(). These help us to
61  // determine which plug-in will be best to load the debug information found
62  // in files.
63  enum Abilities {
64  CompileUnits = (1u << 0),
65  LineTables = (1u << 1),
66  Functions = (1u << 2),
67  Blocks = (1u << 3),
68  GlobalVariables = (1u << 4),
69  LocalVariables = (1u << 5),
70  VariableTypes = (1u << 6),
71  kAllAbilities = ((1u << 7) - 1u)
72  };
73 
74  static SymbolFile *FindPlugin(lldb::ObjectFileSP objfile_sp);
75 
76  // Constructors and Destructors
77  SymbolFile() = default;
78 
79  ~SymbolFile() override = default;
80 
81  /// SymbolFileOnDemand class overrides this to return the underlying
82  /// backing SymbolFile implementation that loads on-demand.
83  virtual SymbolFile *GetBackingSymbolFile() { return this; }
84 
85  /// Get a mask of what this symbol file supports for the object file
86  /// that it was constructed with.
87  ///
88  /// Each symbol file gets to respond with a mask of abilities that
89  /// it supports for each object file. This happens when we are
90  /// trying to figure out which symbol file plug-in will get used
91  /// for a given object file. The plug-in that responds with the
92  /// best mix of "SymbolFile::Abilities" bits set, will get chosen to
93  /// be the symbol file parser. This allows each plug-in to check for
94  /// sections that contain data a symbol file plug-in would need. For
95  /// example the DWARF plug-in requires DWARF sections in a file that
96  /// contain debug information. If the DWARF plug-in doesn't find
97  /// these sections, it won't respond with many ability bits set, and
98  /// we will probably fall back to the symbol table SymbolFile plug-in
99  /// which uses any information in the symbol table. Also, plug-ins
100  /// might check for some specific symbols in a symbol table in the
101  /// case where the symbol table contains debug information (STABS
102  /// and COFF). Not a lot of work should happen in these functions
103  /// as the plug-in might not get selected due to another plug-in
104  /// having more abilities. Any initialization work should be saved
105  /// for "void SymbolFile::InitializeObject()" which will get called
106  /// on the SymbolFile object with the best set of abilities.
107  ///
108  /// \return
109  /// A uint32_t mask containing bits from the SymbolFile::Abilities
110  /// enumeration. Any bits that are set represent an ability that
111  /// this symbol plug-in can parse from the object file.
112  virtual uint32_t GetAbilities() = 0;
113  virtual uint32_t CalculateAbilities() = 0;
114 
115  /// Symbols file subclasses should override this to return the Module that
116  /// owns the TypeSystem that this symbol file modifies type information in.
117  virtual std::recursive_mutex &GetModuleMutex() const;
118 
119  /// Initialize the SymbolFile object.
120  ///
121  /// The SymbolFile object with the best set of abilities (detected
122  /// in "uint32_t SymbolFile::GetAbilities()) will have this function
123  /// called if it is chosen to parse an object file. More complete
124  /// initialization can happen in this function which will get called
125  /// prior to any other functions in the SymbolFile protocol.
126  virtual void InitializeObject() {}
127 
128  /// Whether debug info will be loaded or not.
129  ///
130  /// It will be true for most implementations except SymbolFileOnDemand.
131  virtual bool GetLoadDebugInfoEnabled() { return true; }
132 
133  /// Specify debug info should be loaded.
134  ///
135  /// It will be no-op for most implementations except SymbolFileOnDemand.
136  virtual void SetLoadDebugInfoEnabled() {}
137 
138  // Compile Unit function calls
139  // Approach 1 - iterator
140  virtual uint32_t GetNumCompileUnits() = 0;
141  virtual lldb::CompUnitSP GetCompileUnitAtIndex(uint32_t idx) = 0;
142 
143  virtual Symtab *GetSymtab() = 0;
144 
145  virtual lldb::LanguageType ParseLanguage(CompileUnit &comp_unit) = 0;
146  /// Return the Xcode SDK comp_unit was compiled against.
147  virtual XcodeSDK ParseXcodeSDK(CompileUnit &comp_unit) { return {}; }
148  virtual size_t ParseFunctions(CompileUnit &comp_unit) = 0;
149  virtual bool ParseLineTable(CompileUnit &comp_unit) = 0;
150  virtual bool ParseDebugMacros(CompileUnit &comp_unit) = 0;
151 
152  /// Apply a lambda to each external lldb::Module referenced by this
153  /// \p comp_unit. Recursively also descends into the referenced external
154  /// modules of any encountered compilation unit.
155  ///
156  /// This function can be used to traverse Clang -gmodules debug
157  /// information, which is stored in DWARF files separate from the
158  /// object files.
159  ///
160  /// \param comp_unit
161  /// When this SymbolFile consists of multiple auxilliary
162  /// SymbolFiles, for example, a Darwin debug map that references
163  /// multiple .o files, comp_unit helps choose the auxilliary
164  /// file. In most other cases comp_unit's symbol file is
165  /// identical with *this.
166  ///
167  /// \param[in] lambda
168  /// The lambda that should be applied to every function. The lambda can
169  /// return true if the iteration should be aborted earlier.
170  ///
171  /// \param visited_symbol_files
172  /// A set of SymbolFiles that were already visited to avoid
173  /// visiting one file more than once.
174  ///
175  /// \return
176  /// If the lambda early-exited, this function returns true to
177  /// propagate the early exit.
178  virtual bool ForEachExternalModule(
179  lldb_private::CompileUnit &comp_unit,
180  llvm::DenseSet<lldb_private::SymbolFile *> &visited_symbol_files,
181  llvm::function_ref<bool(Module &)> lambda) {
182  return false;
183  }
184  virtual bool ParseSupportFiles(CompileUnit &comp_unit,
185  FileSpecList &support_files) = 0;
186  virtual size_t ParseTypes(CompileUnit &comp_unit) = 0;
187  virtual bool ParseIsOptimized(CompileUnit &comp_unit) { return false; }
188 
189  virtual bool
191  std::vector<SourceModule> &imported_modules) = 0;
192  virtual size_t ParseBlocksRecursive(Function &func) = 0;
193  virtual size_t ParseVariablesForContext(const SymbolContext &sc) = 0;
194  virtual Type *ResolveTypeUID(lldb::user_id_t type_uid) = 0;
195 
196  /// The characteristics of an array type.
197  struct ArrayInfo {
198  int64_t first_index = 0;
199  llvm::SmallVector<uint64_t, 1> element_orders;
202  };
203  /// If \c type_uid points to an array type, return its characteristics.
204  /// To support variable-length array types, this function takes an
205  /// optional \p ExecutionContext. If \c exe_ctx is non-null, the
206  /// dynamic characteristics for that context are returned.
207  virtual llvm::Optional<ArrayInfo>
209  const lldb_private::ExecutionContext *exe_ctx) = 0;
210 
211  virtual bool CompleteType(CompilerType &compiler_type) = 0;
212  virtual void ParseDeclsForContext(CompilerDeclContext decl_ctx) {}
214  return CompilerDecl();
215  }
217  return CompilerDeclContext();
218  }
220  return CompilerDeclContext();
221  }
222  virtual uint32_t ResolveSymbolContext(const Address &so_addr,
223  lldb::SymbolContextItem resolve_scope,
224  SymbolContext &sc) = 0;
225 
226  /// Get an error that describes why variables might be missing for a given
227  /// symbol context.
228  ///
229  /// If there is an error in the debug information that prevents variables from
230  /// being fetched, this error will get filled in. If there is no debug
231  /// informaiton, no error should be returned. But if there is debug
232  /// information and something prevents the variables from being available a
233  /// valid error should be returned. Valid cases include:
234  /// - compiler option that removes variables (-gline-tables-only)
235  /// - missing external files
236  /// - .dwo files in fission are not accessible or missing
237  /// - .o files on darwin when not using dSYM files that are not accessible
238  /// or missing
239  /// - mismatched exteral files
240  /// - .dwo files in fission where the DWO ID doesn't match
241  /// - .o files on darwin when modification timestamp doesn't match
242  /// - corrupted debug info
243  ///
244  /// \param[in] frame
245  /// The stack frame to use as a basis for the context to check. The frame
246  /// address can be used if there is not debug info due to it not being able
247  /// to be loaded, or if there is a debug info context, like a compile unit,
248  /// or function, it can be used to track down more information on why
249  /// variables are missing.
250  ///
251  /// \returns
252  /// An error specifying why there should have been debug info with variable
253  /// information but the variables were not able to be resolved.
255  Status err = CalculateFrameVariableError(frame);
256  if (err.Fail())
258  return err;
259  }
260 
261  /// Subclasses will override this function to for GetFrameVariableError().
262  ///
263  /// This allows GetFrameVariableError() to set the member variable
264  /// m_debug_info_had_variable_errors correctly without users having to do it
265  /// manually which is error prone.
267  return Status();
268  }
269  virtual uint32_t
270  ResolveSymbolContext(const SourceLocationSpec &src_location_spec,
271  lldb::SymbolContextItem resolve_scope,
272  SymbolContextList &sc_list);
273 
274  virtual void DumpClangAST(Stream &s) {}
275  virtual void FindGlobalVariables(ConstString name,
276  const CompilerDeclContext &parent_decl_ctx,
277  uint32_t max_matches,
278  VariableList &variables);
279  virtual void FindGlobalVariables(const RegularExpression &regex,
280  uint32_t max_matches,
281  VariableList &variables);
282  virtual void FindFunctions(const Module::LookupInfo &lookup_info,
283  const CompilerDeclContext &parent_decl_ctx,
284  bool include_inlines, SymbolContextList &sc_list);
285  virtual void FindFunctions(const RegularExpression &regex,
286  bool include_inlines, SymbolContextList &sc_list);
287  virtual void
288  FindTypes(ConstString name, const CompilerDeclContext &parent_decl_ctx,
289  uint32_t max_matches,
290  llvm::DenseSet<lldb_private::SymbolFile *> &searched_symbol_files,
291  TypeMap &types);
292 
293  /// Find types specified by a CompilerContextPattern.
294  /// \param languages
295  /// Only return results in these languages.
296  /// \param searched_symbol_files
297  /// Prevents one file from being visited multiple times.
298  virtual void
299  FindTypes(llvm::ArrayRef<CompilerContext> pattern, LanguageSet languages,
300  llvm::DenseSet<lldb_private::SymbolFile *> &searched_symbol_files,
301  TypeMap &types);
302 
303  virtual void
304  GetMangledNamesForFunction(const std::string &scope_qualified_name,
305  std::vector<ConstString> &mangled_names);
306 
307  virtual void GetTypes(lldb_private::SymbolContextScope *sc_scope,
308  lldb::TypeClass type_mask,
309  lldb_private::TypeList &type_list) = 0;
310 
311  virtual void PreloadSymbols();
312 
313  virtual llvm::Expected<lldb_private::TypeSystem &>
315 
316  virtual CompilerDeclContext
317  FindNamespace(ConstString name, const CompilerDeclContext &parent_decl_ctx) {
318  return CompilerDeclContext();
319  }
320 
321  virtual ObjectFile *GetObjectFile() = 0;
322  virtual const ObjectFile *GetObjectFile() const = 0;
323  virtual ObjectFile *GetMainObjectFile() = 0;
324 
325  virtual std::vector<std::unique_ptr<CallEdge>>
327  return {};
328  }
329 
330  virtual void AddSymbols(Symtab &symtab) {}
331 
332  /// Notify the SymbolFile that the file addresses in the Sections
333  /// for this module have been changed.
334  virtual void SectionFileAddressesChanged() = 0;
335 
337  virtual ~RegisterInfoResolver(); // anchor
338 
339  virtual const RegisterInfo *ResolveName(llvm::StringRef name) const = 0;
340  virtual const RegisterInfo *ResolveNumber(lldb::RegisterKind kind,
341  uint32_t number) const = 0;
342  };
343  virtual lldb::UnwindPlanSP
344  GetUnwindPlan(const Address &address, const RegisterInfoResolver &resolver) {
345  return nullptr;
346  }
347 
348  /// Return the number of stack bytes taken up by the parameters to this
349  /// function.
350  virtual llvm::Expected<lldb::addr_t> GetParameterStackSize(Symbol &symbol) {
351  return llvm::createStringError(make_error_code(llvm::errc::not_supported),
352  "Operation not supported.");
353  }
354 
355  virtual void Dump(Stream &s) = 0;
356 
357  /// Metrics gathering functions
358 
359  /// Return the size in bytes of all debug information in the symbol file.
360  ///
361  /// If the debug information is contained in sections of an ObjectFile, then
362  /// this call should add the size of all sections that contain debug
363  /// information. Symbols the symbol tables are not considered debug
364  /// information for this call to make it easy and quick for this number to be
365  /// calculated. If the symbol file is all debug information, the size of the
366  /// entire file should be returned. The default implementation of this
367  /// function will iterate over all sections in a module and add up their
368  /// debug info only section byte sizes.
369  virtual uint64_t GetDebugInfoSize() = 0;
370 
371  /// Return the time taken to parse the debug information.
372  ///
373  /// \returns 0.0 if no information has been parsed or if there is
374  /// no computational cost to parsing the debug information.
376 
377  /// Return the time it took to index the debug information in the object
378  /// file.
379  ///
380  /// \returns 0.0 if the file doesn't need to be indexed or if it
381  /// hasn't been indexed yet, or a valid duration if it has.
383 
384  /// Get the additional modules that this symbol file uses to parse debug info.
385  ///
386  /// Some debug info is stored in stand alone object files that are represented
387  /// by unique modules that will show up in the statistics module list. Return
388  /// a list of modules that are not in the target module list that this symbol
389  /// file is currently using so that they can be tracked and assoicated with
390  /// the module in the statistics.
391  virtual ModuleList GetDebugInfoModules() { return ModuleList(); }
392 
393  /// Accessors for the bool that indicates if the debug info index was loaded
394  /// from, or saved to the module index cache.
395  ///
396  /// In statistics it is handy to know if a module's debug info was loaded from
397  /// or saved to the cache. When the debug info index is loaded from the cache
398  /// startup times can be faster. When the cache is enabled and the debug info
399  /// index is saved to the cache, debug sessions can be slower. These accessors
400  /// can be accessed by the statistics and emitted to help track these costs.
401  /// \{
402  virtual bool GetDebugInfoIndexWasLoadedFromCache() const = 0;
403  virtual void SetDebugInfoIndexWasLoadedFromCache() = 0;
404  virtual bool GetDebugInfoIndexWasSavedToCache() const = 0;
405  virtual void SetDebugInfoIndexWasSavedToCache() = 0;
406  /// \}
407 
408  /// Accessors for the bool that indicates if there was debug info, but errors
409  /// stopped variables from being able to be displayed correctly. See
410  /// GetFrameVariableError() for details on what are considered errors.
411  virtual bool GetDebugInfoHadFrameVariableErrors() const = 0;
412  virtual void SetDebugInfoHadFrameVariableErrors() = 0;
413 
414 protected:
415  void AssertModuleLock();
416 
417 private:
418  SymbolFile(const SymbolFile &) = delete;
419  const SymbolFile &operator=(const SymbolFile &) = delete;
420 };
421 
422 /// Containing protected virtual methods for child classes to override.
423 /// Most actual SymbolFile implementations should inherit from this class.
424 class SymbolFileCommon : public SymbolFile {
425  /// LLVM RTTI support.
426  static char ID;
427 
428 public:
429  /// LLVM RTTI support.
430  /// \{
431  bool isA(const void *ClassID) const override {
432  return ClassID == &ID || SymbolFile::isA(ClassID);
433  }
434  static bool classof(const SymbolFileCommon *obj) { return obj->isA(&ID); }
435  /// \}
436 
437  // Constructors and Destructors
438  SymbolFileCommon(lldb::ObjectFileSP objfile_sp)
439  : m_objfile_sp(std::move(objfile_sp)) {}
440 
441  ~SymbolFileCommon() override = default;
442 
443  uint32_t GetAbilities() override {
444  if (!m_calculated_abilities) {
446  m_calculated_abilities = true;
447  }
448  return m_abilities;
449  }
450 
451  Symtab *GetSymtab() override;
452 
453  ObjectFile *GetObjectFile() override { return m_objfile_sp.get(); }
454  const ObjectFile *GetObjectFile() const override {
455  return m_objfile_sp.get();
456  }
457  ObjectFile *GetMainObjectFile() override;
458 
459  /// Notify the SymbolFile that the file addresses in the Sections
460  /// for this module have been changed.
461  void SectionFileAddressesChanged() override;
462 
463  // Compile Unit function calls
464  // Approach 1 - iterator
465  uint32_t GetNumCompileUnits() override;
466  lldb::CompUnitSP GetCompileUnitAtIndex(uint32_t idx) override;
467 
468  llvm::Expected<lldb_private::TypeSystem &>
469  GetTypeSystemForLanguage(lldb::LanguageType language) override;
470 
471  void Dump(Stream &s) override;
472 
473  uint64_t GetDebugInfoSize() override;
474 
475  bool GetDebugInfoIndexWasLoadedFromCache() const override {
477  }
480  }
481  bool GetDebugInfoIndexWasSavedToCache() const override {
483  }
486  }
487  bool GetDebugInfoHadFrameVariableErrors() const override {
489  }
492  }
493 
494 protected:
495  virtual uint32_t CalculateNumCompileUnits() = 0;
496  virtual lldb::CompUnitSP ParseCompileUnitAtIndex(uint32_t idx) = 0;
497  virtual TypeList &GetTypeList() { return m_type_list; }
498  void SetCompileUnitAtIndex(uint32_t idx, const lldb::CompUnitSP &cu_sp);
499 
500  lldb::ObjectFileSP m_objfile_sp; // Keep a reference to the object file in
501  // case it isn't the same as the module
502  // object file (debug symbols in a separate
503  // file)
504  llvm::Optional<std::vector<lldb::CompUnitSP>> m_compile_units;
506  Symtab *m_symtab = nullptr;
511  /// Set to true if any variable feteching errors have been found when calling
512  /// GetFrameVariableError(). This will be emitted in the "statistics dump"
513  /// information for a module.
515 
516 private:
517  SymbolFileCommon(const SymbolFileCommon &) = delete;
518  const SymbolFileCommon &operator=(const SymbolFileCommon &) = delete;
519 };
520 
521 } // namespace lldb_private
522 
523 #endif // LLDB_SYMBOL_SYMBOLFILE_H
lldb_private::SymbolFile::SetDebugInfoIndexWasSavedToCache
virtual void SetDebugInfoIndexWasSavedToCache()=0
lldb_private::SymbolFile::SymbolFile
SymbolFile()=default
lldb_private::SymbolFile::FindPlugin
static SymbolFile * FindPlugin(lldb::ObjectFileSP objfile_sp)
Definition: SymbolFile.cpp:39
lldb_private::SymbolFileCommon::SetDebugInfoIndexWasLoadedFromCache
void SetDebugInfoIndexWasLoadedFromCache() override
Definition: SymbolFile.h:478
lldb_private::SymbolFile
Provides public interface for all SymbolFiles.
Definition: SymbolFile.h:46
lldb_private::SymbolFile::GetDeclForUID
virtual CompilerDecl GetDeclForUID(lldb::user_id_t uid)
Definition: SymbolFile.h:213
lldb_private::ExecutionContext
Definition: ExecutionContext.h:292
lldb_private::SymbolFile::ParseCallEdgesInFunction
virtual std::vector< std::unique_ptr< CallEdge > > ParseCallEdgesInFunction(UserID func_id)
Definition: SymbolFile.h:326
lldb_private::SymbolFile::FindTypes
virtual void FindTypes(ConstString name, const CompilerDeclContext &parent_decl_ctx, uint32_t max_matches, llvm::DenseSet< lldb_private::SymbolFile * > &searched_symbol_files, TypeMap &types)
Definition: SymbolFile.cpp:136
lldb_private::RegularExpression
Definition: RegularExpression.h:18
lldb_private::SymbolFileCommon::GetSymtab
Symtab * GetSymtab() override
Definition: SymbolFile.cpp:165
lldb_private::SymbolFileCommon::classof
static bool classof(const SymbolFileCommon *obj)
Definition: SymbolFile.h:434
lldb_private::SymbolFile::CalculateFrameVariableError
virtual Status CalculateFrameVariableError(StackFrame &frame)
Subclasses will override this function to for GetFrameVariableError().
Definition: SymbolFile.h:266
lldb_private::SymbolFileCommon::m_type_list
TypeList m_type_list
Definition: SymbolFile.h:505
CompilerDecl.h
lldb_private::SymbolFile::GetDebugInfoIndexTime
virtual StatsDuration::Duration GetDebugInfoIndexTime()
Return the time it took to index the debug information in the object file.
Definition: SymbolFile.h:382
lldb_private::SymbolFileCommon::GetAbilities
uint32_t GetAbilities() override
Get a mask of what this symbol file supports for the object file that it was constructed with.
Definition: SymbolFile.h:443
lldb_private::Symbol
Definition: Symbol.h:20
lldb_private::SymbolFileCommon::m_compile_units
llvm::Optional< std::vector< lldb::CompUnitSP > > m_compile_units
Definition: SymbolFile.h:504
lldb_private::SourceLocationSpec
Definition: SourceLocationSpec.h:27
lldb_private::SymbolFile::VariableTypes
@ VariableTypes
Definition: SymbolFile.h:70
lldb_private::SymbolFile::ParseDeclsForContext
virtual void ParseDeclsForContext(CompilerDeclContext decl_ctx)
Definition: SymbolFile.h:212
lldb_private::PluginInterface
Definition: PluginInterface.h:16
lldb_private::SymbolFileCommon::CalculateNumCompileUnits
virtual uint32_t CalculateNumCompileUnits()=0
lldb_private::UserID
Definition: UserID.h:31
lldb_private::SymbolFile::ArrayInfo::byte_stride
uint32_t byte_stride
Definition: SymbolFile.h:200
lldb_private::SymbolFile::GetMainObjectFile
virtual ObjectFile * GetMainObjectFile()=0
lldb_private::StatsDuration::Duration
std::chrono::duration< double > Duration
Definition: Statistics.h:29
lldb_private::SymbolFile::GetModuleMutex
virtual std::recursive_mutex & GetModuleMutex() const
Symbols file subclasses should override this to return the Module that owns the TypeSystem that this ...
Definition: SymbolFile.cpp:35
lldb_private::SymbolFile::GetAbilities
virtual uint32_t GetAbilities()=0
Get a mask of what this symbol file supports for the object file that it was constructed with.
lldb_private::SymbolFile::ParseFunctions
virtual size_t ParseFunctions(CompileUnit &comp_unit)=0
lldb_private::SymbolFile::ParseBlocksRecursive
virtual size_t ParseBlocksRecursive(Function &func)=0
Module.h
lldb_private::SymbolFileCommon::m_index_was_loaded_from_cache
bool m_index_was_loaded_from_cache
Definition: SymbolFile.h:509
lldb_private::XcodeSDK
An abstraction for Xcode-style SDKs that works like ArchSpec.
Definition: XcodeSDK.h:24
lldb_private::SymbolFile::SectionFileAddressesChanged
virtual void SectionFileAddressesChanged()=0
Notify the SymbolFile that the file addresses in the Sections for this module have been changed.
lldb::LanguageType
LanguageType
Programming language type.
Definition: lldb-enumerations.h:436
lldb_private::SymbolFile::CalculateAbilities
virtual uint32_t CalculateAbilities()=0
lldb_private::SymbolContextList
Definition: SymbolContext.h:379
lldb_private::CompilerDecl
Represents a generic declaration such as a function declaration.
Definition: CompilerDecl.h:28
lldb_private::Module
Definition: Module.h:85
lldb_private::SymbolFile::GetTypeSystemForLanguage
virtual llvm::Expected< lldb_private::TypeSystem & > GetTypeSystemForLanguage(lldb::LanguageType language)=0
lldb_private::SymbolFile::CompileUnits
@ CompileUnits
Definition: SymbolFile.h:64
lldb_private::Stream
Definition: Stream.h:28
lldb_private::SymbolFileCommon
Containing protected virtual methods for child classes to override.
Definition: SymbolFile.h:424
lldb_private::SymbolContext
Definition: SymbolContext.h:33
lldb_private::SymbolFile::ParseIsOptimized
virtual bool ParseIsOptimized(CompileUnit &comp_unit)
Definition: SymbolFile.h:187
lldb_private::SymbolFile::Abilities
Abilities
Definition: SymbolFile.h:63
lldb_private::SymbolFile::GetUnwindPlan
virtual lldb::UnwindPlanSP GetUnwindPlan(const Address &address, const RegisterInfoResolver &resolver)
Definition: SymbolFile.h:344
lldb_private::SymbolFile::Functions
@ Functions
Definition: SymbolFile.h:66
lldb_private::VariableList
Definition: VariableList.h:18
XcodeSDK.h
lldb_private::SymbolFileCommon::GetDebugInfoIndexWasSavedToCache
bool GetDebugInfoIndexWasSavedToCache() const override
Definition: SymbolFile.h:481
lldb_private::SymbolFileCommon::m_debug_info_had_variable_errors
bool m_debug_info_had_variable_errors
Set to true if any variable feteching errors have been found when calling GetFrameVariableError().
Definition: SymbolFile.h:514
lldb_private::CompileUnit
Definition: CompileUnit.h:38
lldb_private::SymbolFile::FindFunctions
virtual void FindFunctions(const Module::LookupInfo &lookup_info, const CompilerDeclContext &parent_decl_ctx, bool include_inlines, SymbolContextList &sc_list)
Definition: SymbolFile.cpp:123
lldb_private::Module::LookupInfo
Definition: Module.h:931
lldb_private::SymbolFileCommon::SectionFileAddressesChanged
void SectionFileAddressesChanged() override
Notify the SymbolFile that the file addresses in the Sections for this module have been changed.
Definition: SymbolFile.cpp:184
lldb_private::SymbolFileCommon::m_objfile_sp
lldb::ObjectFileSP m_objfile_sp
Definition: SymbolFile.h:500
lldb_private::Function
Definition: Function.h:409
lldb_private::SymbolFile::AssertModuleLock
void AssertModuleLock()
Definition: SymbolFile.cpp:147
ModuleList.h
lldb_private::SymbolFileCommon::GetTypeList
virtual TypeList & GetTypeList()
Definition: SymbolFile.h:497
lldb_private::SymbolFile::ResolveTypeUID
virtual Type * ResolveTypeUID(lldb::user_id_t type_uid)=0
lldb_private::ModuleList
Definition: ModuleList.h:82
SourceLocationSpec.h
lldb_private::SymbolFile::LocalVariables
@ LocalVariables
Definition: SymbolFile.h:69
lldb_private::SymbolFileCommon::Dump
void Dump(Stream &s) override
Definition: SymbolFile.cpp:252
lldb_private::SymbolFile::ParseLineTable
virtual bool ParseLineTable(CompileUnit &comp_unit)=0
lldb_private::SymbolFile::ID
static char ID
LLVM RTTI support.
Definition: SymbolFile.h:48
lldb_private::Status::Fail
bool Fail() const
Test for error condition.
Definition: Status.cpp:181
lldb_private::SymbolFile::GetDynamicArrayInfoForUID
virtual llvm::Optional< ArrayInfo > GetDynamicArrayInfoForUID(lldb::user_id_t type_uid, const lldb_private::ExecutionContext *exe_ctx)=0
If type_uid points to an array type, return its characteristics.
lldb_private::SymbolFileCommon::ID
static char ID
LLVM RTTI support.
Definition: SymbolFile.h:426
SourceModule.h
lldb_private::SymbolFile::ParseTypes
virtual size_t ParseTypes(CompileUnit &comp_unit)=0
lldb_private::SymbolFile::Dump
virtual void Dump(Stream &s)=0
Type.h
lldb_private::ConstString
Definition: ConstString.h:39
lldb_private::SymbolFile::RegisterInfoResolver::ResolveNumber
virtual const RegisterInfo * ResolveNumber(lldb::RegisterKind kind, uint32_t number) const =0
lldb_private::SymbolFileCommon::GetTypeSystemForLanguage
llvm::Expected< lldb_private::TypeSystem & > GetTypeSystemForLanguage(lldb::LanguageType language) override
Definition: SymbolFile.cpp:231
lldb_private::SymbolFile::SetDebugInfoHadFrameVariableErrors
virtual void SetDebugInfoHadFrameVariableErrors()=0
lldb_private::SymbolFile::isA
virtual bool isA(const void *ClassID) const
LLVM RTTI support.
Definition: SymbolFile.h:53
lldb_private::SymbolFile::InitializeObject
virtual void InitializeObject()
Initialize the SymbolFile object.
Definition: SymbolFile.h:126
lldb_private::SymbolFileCommon::m_abilities
uint32_t m_abilities
Definition: SymbolFile.h:507
PluginInterface.h
lldb_private::SymbolFile::FindNamespace
virtual CompilerDeclContext FindNamespace(ConstString name, const CompilerDeclContext &parent_decl_ctx)
Definition: SymbolFile.h:317
lldb_private::SymbolFile::kAllAbilities
@ kAllAbilities
Definition: SymbolFile.h:71
lldb_private::SymbolFile::ParseImportedModules
virtual bool ParseImportedModules(const SymbolContext &sc, std::vector< SourceModule > &imported_modules)=0
lldb_private::SymbolFile::ForEachExternalModule
virtual bool ForEachExternalModule(lldb_private::CompileUnit &comp_unit, llvm::DenseSet< lldb_private::SymbolFile * > &visited_symbol_files, llvm::function_ref< bool(Module &)> lambda)
Apply a lambda to each external lldb::Module referenced by this comp_unit.
Definition: SymbolFile.h:178
lldb_private::SymbolFile::GetLoadDebugInfoEnabled
virtual bool GetLoadDebugInfoEnabled()
Whether debug info will be loaded or not.
Definition: SymbolFile.h:131
lldb_private::SymbolFile::RegisterInfoResolver
Definition: SymbolFile.h:336
lldb_private::SymbolFileCommon::GetNumCompileUnits
uint32_t GetNumCompileUnits() override
Definition: SymbolFile.cpp:193
string
string(SUBSTRING ${p} 10 -1 pStripped) if($
Definition: Plugins/CMakeLists.txt:40
lldb_private::SymbolFile::RegisterInfoResolver::ResolveName
virtual const RegisterInfo * ResolveName(llvm::StringRef name) const =0
TypeSystem.h
lldb_private::SymbolFile::GetDebugInfoSize
virtual uint64_t GetDebugInfoSize()=0
Metrics gathering functions.
CompilerType.h
lldb_private::TypeMap
Definition: TypeMap.h:20
lldb_private::CompilerDeclContext
Represents a generic declaration context in a program.
Definition: CompilerDeclContext.h:30
lldb_private::SymbolFileCommon::m_index_was_saved_to_cache
bool m_index_was_saved_to_cache
Definition: SymbolFile.h:510
lldb_private::SymbolContextScope
Definition: SymbolContextScope.h:64
lldb_private::SymbolFile::ParseSupportFiles
virtual bool ParseSupportFiles(CompileUnit &comp_unit, FileSpecList &support_files)=0
lldb::RegisterKind
RegisterKind
Register numbering types.
Definition: lldb-enumerations.h:227
lldb-private.h
lldb_private::SymbolFile::PreloadSymbols
virtual void PreloadSymbols()
Definition: SymbolFile.cpp:31
lldb_private::SymbolFile::GetFrameVariableError
Status GetFrameVariableError(StackFrame &frame)
Get an error that describes why variables might be missing for a given symbol context.
Definition: SymbolFile.h:254
TypeList.h
lldb_private::SymbolFile::CompleteType
virtual bool CompleteType(CompilerType &compiler_type)=0
lldb_private::SymbolFileCommon::SetDebugInfoIndexWasSavedToCache
void SetDebugInfoIndexWasSavedToCache() override
Definition: SymbolFile.h:484
lldb_private::SymbolFile::classof
static bool classof(const SymbolFile *obj)
Definition: SymbolFile.h:54
lldb_private::Status
Definition: Status.h:44
lldb_private::SymbolFileCommon::GetMainObjectFile
ObjectFile * GetMainObjectFile() override
Definition: SymbolFile.cpp:180
lldb_private::Symtab
Definition: Symtab.h:22
lldb_private::SymbolFile::GetDebugInfoIndexWasSavedToCache
virtual bool GetDebugInfoIndexWasSavedToCache() const =0
uint32_t
lldb_private::SymbolFile::ParseXcodeSDK
virtual XcodeSDK ParseXcodeSDK(CompileUnit &comp_unit)
Return the Xcode SDK comp_unit was compiled against.
Definition: SymbolFile.h:147
lldb_private::SymbolFile::GetDebugInfoParseTime
virtual StatsDuration::Duration GetDebugInfoParseTime()
Return the time taken to parse the debug information.
Definition: SymbolFile.h:375
lldb_private::SymbolFileCommon::~SymbolFileCommon
~SymbolFileCommon() override=default
lldb_private::SymbolFile::GetDeclContextForUID
virtual CompilerDeclContext GetDeclContextForUID(lldb::user_id_t uid)
Definition: SymbolFile.h:216
lldb_private::SymbolFileCommon::SetDebugInfoHadFrameVariableErrors
void SetDebugInfoHadFrameVariableErrors() override
Definition: SymbolFile.h:490
lldb_private::SymbolFile::GetDeclContextContainingUID
virtual CompilerDeclContext GetDeclContextContainingUID(lldb::user_id_t uid)
Definition: SymbolFile.h:219
lldb_private::Address
Definition: Address.h:59
lldb_private::SymbolFile::SetLoadDebugInfoEnabled
virtual void SetLoadDebugInfoEnabled()
Specify debug info should be loaded.
Definition: SymbolFile.h:136
lldb_private::Type
Definition: Type.h:66
lldb_private::SymbolFile::GetBackingSymbolFile
virtual SymbolFile * GetBackingSymbolFile()
SymbolFileOnDemand class overrides this to return the underlying backing SymbolFile implementation th...
Definition: SymbolFile.h:83
lldb_private::SymbolFileCommon::ParseCompileUnitAtIndex
virtual lldb::CompUnitSP ParseCompileUnitAtIndex(uint32_t idx)=0
lldb_private::SymbolFile::AddSymbols
virtual void AddSymbols(Symtab &symtab)
Definition: SymbolFile.h:330
lldb_private::SymbolFile::ParseLanguage
virtual lldb::LanguageType ParseLanguage(CompileUnit &comp_unit)=0
lldb_private::SymbolFile::~SymbolFile
~SymbolFile() override=default
lldb_private::SymbolFile::GetParameterStackSize
virtual llvm::Expected< lldb::addr_t > GetParameterStackSize(Symbol &symbol)
Return the number of stack bytes taken up by the parameters to this function.
Definition: SymbolFile.h:350
lldb_private::CompilerType
Generic representation of a type in a programming language.
Definition: CompilerType.h:33
Function.h
lldb_private::SymbolFile::ArrayInfo::element_orders
llvm::SmallVector< uint64_t, 1 > element_orders
Definition: SymbolFile.h:199
lldb_private::SymbolFileCommon::GetCompileUnitAtIndex
lldb::CompUnitSP GetCompileUnitAtIndex(uint32_t idx) override
Definition: SymbolFile.cpp:203
Statistics.h
lldb_private::SymbolFile::GetDebugInfoHadFrameVariableErrors
virtual bool GetDebugInfoHadFrameVariableErrors() const =0
Accessors for the bool that indicates if there was debug info, but errors stopped variables from bein...
lldb_private::SymbolFileCommon::GetObjectFile
ObjectFile * GetObjectFile() override
Definition: SymbolFile.h:453
lldb::user_id_t
uint64_t user_id_t
Definition: lldb-types.h:84
lldb_private::SymbolFile::GetCompileUnitAtIndex
virtual lldb::CompUnitSP GetCompileUnitAtIndex(uint32_t idx)=0
CompilerDeclContext.h
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb_private::SymbolFile::ResolveSymbolContext
virtual uint32_t ResolveSymbolContext(const Address &so_addr, lldb::SymbolContextItem resolve_scope, SymbolContext &sc)=0
lldb_private::SymbolFileCommon::operator=
const SymbolFileCommon & operator=(const SymbolFileCommon &)=delete
lldb_private::SymbolFileCommon::GetDebugInfoHadFrameVariableErrors
bool GetDebugInfoHadFrameVariableErrors() const override
Accessors for the bool that indicates if there was debug info, but errors stopped variables from bein...
Definition: SymbolFile.h:487
lldb_private::SymbolFileCommon::m_calculated_abilities
bool m_calculated_abilities
Definition: SymbolFile.h:508
lldb_private::SymbolFile::GetSymtab
virtual Symtab * GetSymtab()=0
lldb_private::TypeList
Definition: TypeList.h:20
lldb_private::SymbolFile::ArrayInfo
The characteristics of an array type.
Definition: SymbolFile.h:197
lldb_private::SymbolFile::RegisterInfoResolver::~RegisterInfoResolver
virtual ~RegisterInfoResolver()
lldb_private::SymbolFile::ParseDebugMacros
virtual bool ParseDebugMacros(CompileUnit &comp_unit)=0
lldb_private::SymbolFile::GetNumCompileUnits
virtual uint32_t GetNumCompileUnits()=0
lldb_private::SymbolFileCommon::GetDebugInfoIndexWasLoadedFromCache
bool GetDebugInfoIndexWasLoadedFromCache() const override
Accessors for the bool that indicates if the debug info index was loaded from, or saved to the module...
Definition: SymbolFile.h:475
lldb_private::LanguageSet
A SmallBitVector that represents a set of source languages (lldb::LanguageType).
Definition: TypeSystem.h:43
lldb_private::SymbolFile::GetTypes
virtual void GetTypes(lldb_private::SymbolContextScope *sc_scope, lldb::TypeClass type_mask, lldb_private::TypeList &type_list)=0
lldb_private::SymbolFile::Blocks
@ Blocks
Definition: SymbolFile.h:67
lldb_private::SymbolFile::GlobalVariables
@ GlobalVariables
Definition: SymbolFile.h:68
lldb_private::SymbolFile::GetDebugInfoModules
virtual ModuleList GetDebugInfoModules()
Get the additional modules that this symbol file uses to parse debug info.
Definition: SymbolFile.h:391
lldb_private::SymbolFile::operator=
const SymbolFile & operator=(const SymbolFile &)=delete
lldb_private::SymbolFile::GetObjectFile
virtual ObjectFile * GetObjectFile()=0
lldb_private::SymbolFileCommon::GetDebugInfoSize
uint64_t GetDebugInfoSize() override
Metrics gathering functions.
Definition: SymbolFile.cpp:240
lldb_private::SymbolFile::GetMangledNamesForFunction
virtual void GetMangledNamesForFunction(const std::string &scope_qualified_name, std::vector< ConstString > &mangled_names)
Definition: SymbolFile.cpp:132
lldb_private::StackFrame
Definition: StackFrame.h:40
lldb_private::SymbolFileCommon::isA
bool isA(const void *ClassID) const override
LLVM RTTI support.
Definition: SymbolFile.h:431
lldb_private::SymbolFile::ArrayInfo::bit_stride
uint32_t bit_stride
Definition: SymbolFile.h:201
lldb_private::SymbolFile::ArrayInfo::first_index
int64_t first_index
Definition: SymbolFile.h:198
lldb_private::SymbolFile::FindGlobalVariables
virtual void FindGlobalVariables(ConstString name, const CompilerDeclContext &parent_decl_ctx, uint32_t max_matches, VariableList &variables)
Definition: SymbolFile.cpp:114
lldb_private::SymbolFile::LineTables
@ LineTables
Definition: SymbolFile.h:65
lldb_private::SymbolFileCommon::SymbolFileCommon
SymbolFileCommon(lldb::ObjectFileSP objfile_sp)
Definition: SymbolFile.h:438
lldb_private::SymbolFile::GetDebugInfoIndexWasLoadedFromCache
virtual bool GetDebugInfoIndexWasLoadedFromCache() const =0
Accessors for the bool that indicates if the debug info index was loaded from, or saved to the module...
lldb_private::SymbolFileCommon::GetObjectFile
const ObjectFile * GetObjectFile() const override
Definition: SymbolFile.h:454
lldb_private::ObjectFile
Definition: ObjectFile.h:60
lldb_private::SymbolFileCommon::SetCompileUnitAtIndex
void SetCompileUnitAtIndex(uint32_t idx, const lldb::CompUnitSP &cu_sp)
Definition: SymbolFile.cpp:214
lldb_private::SymbolFile::ParseVariablesForContext
virtual size_t ParseVariablesForContext(const SymbolContext &sc)=0
lldb_private::SymbolFileCommon::m_symtab
Symtab * m_symtab
Definition: SymbolFile.h:506
lldb_private::SymbolFile::DumpClangAST
virtual void DumpClangAST(Stream &s)
Definition: SymbolFile.h:274
lldb_private::SymbolFile::SetDebugInfoIndexWasLoadedFromCache
virtual void SetDebugInfoIndexWasLoadedFromCache()=0