LLDB  mainline
ModuleList.h
Go to the documentation of this file.
1 //===-- ModuleList.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_CORE_MODULELIST_H
10 #define LLDB_CORE_MODULELIST_H
11 
12 #include "lldb/Core/Address.h"
13 #include "lldb/Core/ModuleSpec.h"
15 #include "lldb/Utility/FileSpec.h"
16 #include "lldb/Utility/Iterable.h"
17 #include "lldb/Utility/Status.h"
18 #include "lldb/lldb-enumerations.h"
19 #include "lldb/lldb-forward.h"
20 #include "lldb/lldb-types.h"
21 
22 #include "llvm/ADT/DenseSet.h"
23 #include "llvm/Support/RWMutex.h"
24 
25 #include <functional>
26 #include <list>
27 #include <mutex>
28 #include <vector>
29 
30 #include <cstddef>
31 #include <cstdint>
32 
33 namespace lldb_private {
34 class ConstString;
35 class FileSpecList;
36 class Function;
37 class Log;
38 class Module;
39 class RegularExpression;
40 class Stream;
41 class SymbolContext;
42 class SymbolContextList;
43 class SymbolFile;
44 class Target;
45 class TypeList;
46 class UUID;
47 class VariableList;
48 struct ModuleFunctionSearchOptions;
49 
51  mutable llvm::sys::RWMutex m_symlink_paths_mutex;
53 
54  void UpdateSymlinkMappings();
55 
56 public:
58 
60  bool SetClangModulesCachePath(const FileSpec &path);
61  bool GetEnableExternalLookup() const;
62  bool SetEnableExternalLookup(bool new_value);
63 
65 };
66 
67 /// \class ModuleList ModuleList.h "lldb/Core/ModuleList.h"
68 /// A collection class for Module objects.
69 ///
70 /// Modules in the module collection class are stored as reference counted
71 /// shared pointers to Module objects.
72 class ModuleList {
73 public:
74  class Notifier {
75  public:
76  virtual ~Notifier() = default;
77 
78  virtual void NotifyModuleAdded(const ModuleList &module_list,
79  const lldb::ModuleSP &module_sp) = 0;
80  virtual void NotifyModuleRemoved(const ModuleList &module_list,
81  const lldb::ModuleSP &module_sp) = 0;
82  virtual void NotifyModuleUpdated(const ModuleList &module_list,
83  const lldb::ModuleSP &old_module_sp,
84  const lldb::ModuleSP &new_module_sp) = 0;
85  virtual void NotifyWillClearList(const ModuleList &module_list) = 0;
86 
87  virtual void NotifyModulesRemoved(lldb_private::ModuleList &module_list) = 0;
88  };
89 
90  /// Default constructor.
91  ///
92  /// Creates an empty list of Module objects.
93  ModuleList();
94 
95  /// Copy Constructor.
96  ///
97  /// Creates a new module list object with a copy of the modules from \a rhs.
98  ///
99  /// \param[in] rhs
100  /// Another module list object.
101  ModuleList(const ModuleList &rhs);
102 
103  ModuleList(ModuleList::Notifier *notifier);
104 
105  /// Destructor.
106  ~ModuleList();
107 
108  /// Assignment operator.
109  ///
110  /// Copies the module list from \a rhs into this list.
111  ///
112  /// \param[in] rhs
113  /// Another module list object.
114  ///
115  /// \return
116  /// A const reference to this object.
117  const ModuleList &operator=(const ModuleList &rhs);
118 
119  /// Append a module to the module list.
120  ///
121  /// \param[in] module_sp
122  /// A shared pointer to a module to add to this collection.
123  ///
124  /// \param[in] notify
125  /// If true, and a notifier function is set, the notifier function
126  /// will be called. Defaults to true.
127  ///
128  /// When this ModuleList is the Target's ModuleList, the notifier
129  /// function is Target::ModulesDidLoad -- the call to
130  /// ModulesDidLoad may be deferred when adding multiple Modules
131  /// to the Target, but it must be called at the end,
132  /// before resuming execution.
133  void Append(const lldb::ModuleSP &module_sp, bool notify = true);
134 
135  /// Append a module to the module list and remove any equivalent modules.
136  /// Equivalent modules are ones whose file, platform file and architecture
137  /// matches.
138  ///
139  /// Replaces the module to the collection.
140  ///
141  /// \param[in] module_sp
142  /// A shared pointer to a module to replace in this collection.
143  ///
144  /// \param[in] old_modules
145  /// Optional pointer to a vector which, if provided, will have shared
146  /// pointers to the replaced module(s) appended to it.
147  void ReplaceEquivalent(
148  const lldb::ModuleSP &module_sp,
149  llvm::SmallVectorImpl<lldb::ModuleSP> *old_modules = nullptr);
150 
151  /// Append a module to the module list, if it is not already there.
152  ///
153  /// \param[in] notify
154  /// If true, and a notifier function is set, the notifier function
155  /// will be called. Defaults to true.
156  ///
157  /// When this ModuleList is the Target's ModuleList, the notifier
158  /// function is Target::ModulesDidLoad -- the call to
159  /// ModulesDidLoad may be deferred when adding multiple Modules
160  /// to the Target, but it must be called at the end,
161  /// before resuming execution.
162  bool AppendIfNeeded(const lldb::ModuleSP &new_module, bool notify = true);
163 
164  void Append(const ModuleList &module_list);
165 
166  bool AppendIfNeeded(const ModuleList &module_list);
167 
168  bool ReplaceModule(const lldb::ModuleSP &old_module_sp,
169  const lldb::ModuleSP &new_module_sp);
170 
171  /// Clear the object's state.
172  ///
173  /// Clears the list of modules and releases a reference to each module
174  /// object and if the reference count goes to zero, the module will be
175  /// deleted.
176  void Clear();
177 
178  /// Clear the object's state.
179  ///
180  /// Clears the list of modules and releases a reference to each module
181  /// object and if the reference count goes to zero, the module will be
182  /// deleted. Also release all memory that might be held by any collection
183  /// classes (like std::vector)
184  void Destroy();
185 
186  /// Dump the description of each module contained in this list.
187  ///
188  /// Dump the description of each module contained in this list to the
189  /// supplied stream \a s.
190  ///
191  /// \param[in] s
192  /// The stream to which to dump the object description.
193  ///
194  /// \see Module::Dump(Stream *) const
195  void Dump(Stream *s) const;
196 
197  void LogUUIDAndPaths(Log *log, const char *prefix_cstr);
198 
199  std::recursive_mutex &GetMutex() const { return m_modules_mutex; }
200 
201  size_t GetIndexForModule(const Module *module) const;
202 
203  /// Get the module shared pointer for the module at index \a idx.
204  ///
205  /// \param[in] idx
206  /// An index into this module collection.
207  ///
208  /// \return
209  /// A shared pointer to a Module which can contain NULL if
210  /// \a idx is out of range.
211  ///
212  /// \see ModuleList::GetSize()
213  lldb::ModuleSP GetModuleAtIndex(size_t idx) const;
214 
215  /// Get the module shared pointer for the module at index \a idx without
216  /// acquiring the ModuleList mutex. This MUST already have been acquired
217  /// with ModuleList::GetMutex and locked for this call to be safe.
218  ///
219  /// \param[in] idx
220  /// An index into this module collection.
221  ///
222  /// \return
223  /// A shared pointer to a Module which can contain NULL if
224  /// \a idx is out of range.
225  ///
226  /// \see ModuleList::GetSize()
227  lldb::ModuleSP GetModuleAtIndexUnlocked(size_t idx) const;
228 
229  /// Get the module pointer for the module at index \a idx.
230  ///
231  /// \param[in] idx
232  /// An index into this module collection.
233  ///
234  /// \return
235  /// A pointer to a Module which can by nullptr if \a idx is out
236  /// of range.
237  ///
238  /// \see ModuleList::GetSize()
239  Module *GetModulePointerAtIndex(size_t idx) const;
240 
241  /// Find compile units by partial or full path.
242  ///
243  /// Finds all compile units that match \a path in all of the modules and
244  /// returns the results in \a sc_list.
245  ///
246  /// \param[in] path
247  /// The name of the compile unit we are looking for.
248  ///
249  /// \param[out] sc_list
250  /// A symbol context list that gets filled in with all of the
251  /// matches.
252  void FindCompileUnits(const FileSpec &path, SymbolContextList &sc_list) const;
253 
254  /// \see Module::FindFunctions ()
255  void FindFunctions(ConstString name, lldb::FunctionNameType name_type_mask,
256  const ModuleFunctionSearchOptions &options,
257  SymbolContextList &sc_list) const;
258 
259  /// \see Module::FindFunctionSymbols ()
261  lldb::FunctionNameType name_type_mask,
262  SymbolContextList &sc_list);
263 
264  /// \see Module::FindFunctions ()
265  void FindFunctions(const RegularExpression &name,
266  const ModuleFunctionSearchOptions &options,
267  SymbolContextList &sc_list);
268 
269  /// Find global and static variables by name.
270  ///
271  /// \param[in] name
272  /// The name of the global or static variable we are looking
273  /// for.
274  ///
275  /// \param[in] max_matches
276  /// Allow the number of matches to be limited to \a
277  /// max_matches. Specify UINT32_MAX to get all possible matches.
278  ///
279  /// \param[in] variable_list
280  /// A list of variables that gets the matches appended to.
281  void FindGlobalVariables(ConstString name, size_t max_matches,
282  VariableList &variable_list) const;
283 
284  /// Find global and static variables by regular expression.
285  ///
286  /// \param[in] regex
287  /// A regular expression to use when matching the name.
288  ///
289  /// \param[in] max_matches
290  /// Allow the number of matches to be limited to \a
291  /// max_matches. Specify UINT32_MAX to get all possible matches.
292  ///
293  /// \param[in] variable_list
294  /// A list of variables that gets the matches appended to.
295  void FindGlobalVariables(const RegularExpression &regex, size_t max_matches,
296  VariableList &variable_list) const;
297 
298  /// Finds the first module whose file specification matches \a file_spec.
299  ///
300  /// \param[in] module_spec
301  /// A file specification object to match against the Module's
302  /// file specifications. If \a file_spec does not have
303  /// directory information, matches will occur by matching only
304  /// the basename of any modules in this list. If this value is
305  /// NULL, then file specifications won't be compared when
306  /// searching for matching modules.
307  ///
308  /// \param[out] matching_module_list
309  /// A module list that gets filled in with any modules that
310  /// match the search criteria.
311  void FindModules(const ModuleSpec &module_spec,
312  ModuleList &matching_module_list) const;
313 
314  lldb::ModuleSP FindModule(const Module *module_ptr) const;
315 
316  // Find a module by UUID
317  //
318  // The UUID value for a module is extracted from the ObjectFile and is the
319  // MD5 checksum, or a smarter object file equivalent, so finding modules by
320  // UUID values is very efficient and accurate.
321  lldb::ModuleSP FindModule(const UUID &uuid) const;
322 
323  lldb::ModuleSP FindFirstModule(const ModuleSpec &module_spec) const;
324 
326  lldb::SymbolType symbol_type,
327  SymbolContextList &sc_list) const;
328 
330  lldb::SymbolType symbol_type,
331  SymbolContextList &sc_list) const;
332 
333  /// Find types by name.
334  ///
335  /// \param[in] search_first
336  /// If non-null, this module will be searched before any other
337  /// modules.
338  ///
339  /// \param[in] name
340  /// The name of the type we are looking for.
341  ///
342  /// \param[in] max_matches
343  /// Allow the number of matches to be limited to \a
344  /// max_matches. Specify UINT32_MAX to get all possible matches.
345  ///
346  /// \param[out] types
347  /// A type list gets populated with any matches.
348  ///
349  void FindTypes(Module *search_first, ConstString name,
350  bool name_is_fully_qualified, size_t max_matches,
351  llvm::DenseSet<SymbolFile *> &searched_symbol_files,
352  TypeList &types) const;
353 
354  bool FindSourceFile(const FileSpec &orig_spec, FileSpec &new_spec) const;
355 
356  /// Find addresses by file/line
357  ///
358  /// \param[in] target_sp
359  /// The target the addresses are desired for.
360  ///
361  /// \param[in] file
362  /// Source file to locate.
363  ///
364  /// \param[in] line
365  /// Source line to locate.
366  ///
367  /// \param[in] function
368  /// Optional filter function. Addresses within this function will be
369  /// added to the 'local' list. All others will be added to the 'extern'
370  /// list.
371  ///
372  /// \param[out] output_local
373  /// All matching addresses within 'function'
374  ///
375  /// \param[out] output_extern
376  /// All matching addresses not within 'function'
377  void FindAddressesForLine(const lldb::TargetSP target_sp,
378  const FileSpec &file, uint32_t line,
379  Function *function,
380  std::vector<Address> &output_local,
381  std::vector<Address> &output_extern);
382 
383  /// Remove a module from the module list.
384  ///
385  /// \param[in] module_sp
386  /// A shared pointer to a module to remove from this collection.
387  ///
388  /// \param[in] notify
389  /// If true, and a notifier function is set, the notifier function
390  /// will be called. Defaults to true.
391  ///
392  /// When this ModuleList is the Target's ModuleList, the notifier
393  /// function is Target::ModulesDidUnload -- the call to
394  /// ModulesDidUnload may be deferred when removing multiple Modules
395  /// from the Target, but it must be called at the end,
396  /// before resuming execution.
397  bool Remove(const lldb::ModuleSP &module_sp, bool notify = true);
398 
399  size_t Remove(ModuleList &module_list);
400 
401  bool RemoveIfOrphaned(const Module *module_ptr);
402 
403  size_t RemoveOrphans(bool mandatory);
404 
405  bool ResolveFileAddress(lldb::addr_t vm_addr, Address &so_addr) const;
406 
407  /// \copydoc Module::ResolveSymbolContextForAddress (const Address
408  /// &,uint32_t,SymbolContext&)
410  lldb::SymbolContextItem resolve_scope,
411  SymbolContext &sc) const;
412 
413  /// \copydoc Module::ResolveSymbolContextForFilePath (const char
414  /// *,uint32_t,bool,uint32_t,SymbolContextList&)
416  const char *file_path, uint32_t line, bool check_inlines,
417  lldb::SymbolContextItem resolve_scope, SymbolContextList &sc_list) const;
418 
419  /// \copydoc Module::ResolveSymbolContextsForFileSpec (const FileSpec
420  /// &,uint32_t,bool,uint32_t,SymbolContextList&)
422  const FileSpec &file_spec, uint32_t line, bool check_inlines,
423  lldb::SymbolContextItem resolve_scope, SymbolContextList &sc_list) const;
424 
425  /// Gets the size of the module list.
426  ///
427  /// \return
428  /// The number of modules in the module list.
429  size_t GetSize() const;
430  bool IsEmpty() const { return !GetSize(); }
431 
432  bool LoadScriptingResourcesInTarget(Target *target, std::list<Status> &errors,
433  Stream *feedback_stream = nullptr,
434  bool continue_on_error = true);
435 
437 
438  static bool ModuleIsInCache(const Module *module_ptr);
439 
440  static Status
441  GetSharedModule(const ModuleSpec &module_spec, lldb::ModuleSP &module_sp,
442  const FileSpecList *module_search_paths_ptr,
444  bool *did_create_ptr, bool always_create = false);
445 
446  static bool RemoveSharedModule(lldb::ModuleSP &module_sp);
447 
448  static void FindSharedModules(const ModuleSpec &module_spec,
449  ModuleList &matching_module_list);
450 
451  static size_t RemoveOrphanSharedModules(bool mandatory);
452 
453  static bool RemoveSharedModuleIfOrphaned(const Module *module_ptr);
454 
455  void ForEach(std::function<bool(const lldb::ModuleSP &module_sp)> const
456  &callback) const;
457 
458 protected:
459  // Class typedefs.
460  typedef std::vector<lldb::ModuleSP>
461  collection; ///< The module collection type.
462 
463  void AppendImpl(const lldb::ModuleSP &module_sp, bool use_notifier = true);
464 
465  bool RemoveImpl(const lldb::ModuleSP &module_sp, bool use_notifier = true);
466 
467  collection::iterator RemoveImpl(collection::iterator pos,
468  bool use_notifier = true);
469 
470  void ClearImpl(bool use_notifier = true);
471 
472  // Member variables.
473  collection m_modules; ///< The collection of modules.
474  mutable std::recursive_mutex m_modules_mutex;
475 
476  Notifier *m_notifier = nullptr;
477 
478 public:
479  typedef LockingAdaptedIterable<collection, lldb::ModuleSP, vector_adapter,
480  std::recursive_mutex>
483  return ModuleIterable(m_modules, GetMutex());
484  }
485 
490  }
491 };
492 
493 } // namespace lldb_private
494 
495 #endif // LLDB_CORE_MODULELIST_H
lldb_private::ModuleList::Notifier::~Notifier
virtual ~Notifier()=default
lldb_private::ModuleList::LoadScriptingResourcesInTarget
bool LoadScriptingResourcesInTarget(Target *target, std::list< Status > &errors, Stream *feedback_stream=nullptr, bool continue_on_error=true)
Definition: ModuleList.cpp:974
lldb_private::UUID
Definition: UUID.h:23
lldb_private::ModuleList::GetGlobalModuleListProperties
static ModuleListProperties & GetGlobalModuleListProperties()
Definition: ModuleList.cpp:701
lldb_private::RegularExpression
Definition: RegularExpression.h:18
lldb_private::ModuleList::RemoveOrphans
size_t RemoveOrphans(bool mandatory)
Definition: ModuleList.cpp:287
lldb_private::ModuleList::Modules
ModuleIterable Modules() const
Definition: ModuleList.h:482
lldb_private::ModuleListProperties::GetSymlinkMappings
PathMappingList GetSymlinkMappings() const
Definition: ModuleList.cpp:129
ModuleSpec.h
lldb_private::ModuleList::m_notifier
Notifier * m_notifier
Definition: ModuleList.h:476
lldb_private::ModuleList::GetIndexForModule
size_t GetIndexForModule(const Module *module) const
Definition: ModuleList.cpp:663
lldb_private::ModuleList::GetModuleAtIndexUnlocked
lldb::ModuleSP GetModuleAtIndexUnlocked(size_t idx) const
Get the module shared pointer for the module at index idx without acquiring the ModuleList mutex.
Definition: ModuleList.cpp:356
lldb_private::ModuleList::GetModulePointerAtIndex
Module * GetModulePointerAtIndex(size_t idx) const
Get the module pointer for the module at index idx.
Definition: ModuleList.cpp:344
lldb_private::ModuleList::GetMutex
std::recursive_mutex & GetMutex() const
Definition: ModuleList.h:199
lldb_private::vector_adapter
E vector_adapter(I &iter)
Definition: Iterable.h:21
lldb_private::ModuleList::FindSharedModules
static void FindSharedModules(const ModuleSpec &module_spec, ModuleList &matching_module_list)
Definition: ModuleList.cpp:713
lldb_private::SymbolContextList
Definition: SymbolContext.h:379
lldb_private::Module
Definition: Module.h:85
lldb_private::CompilerContextKind::Module
@ Module
lldb_private::ModuleListProperties::ModuleListProperties
ModuleListProperties()
Definition: ModuleList.cpp:77
lldb_private::AdaptedIterable
Definition: Iterable.h:153
lldb_private::ModuleList::ResolveSymbolContextsForFileSpec
uint32_t ResolveSymbolContextsForFileSpec(const FileSpec &file_spec, uint32_t line, bool check_inlines, lldb::SymbolContextItem resolve_scope, SymbolContextList &sc_list) const
Resolve items in the symbol context for a given file and line. (const FileSpec
Definition: ModuleList.cpp:651
lldb_private::Stream
Definition: Stream.h:28
lldb::addr_t
uint64_t addr_t
Definition: lldb-types.h:83
lldb_private::SymbolContext
Definition: SymbolContext.h:33
lldb_private::Target
Definition: Target.h:451
lldb_private::ModuleList::Clear
void Clear()
Clear the object's state.
Definition: ModuleList.cpp:333
lldb_private::VariableList
Definition: VariableList.h:18
lldb_private::ModuleList::FindGlobalVariables
void FindGlobalVariables(ConstString name, size_t max_matches, VariableList &variable_list) const
Find global and static variables by name.
Definition: ModuleList.cpp:433
lldb_private::ModuleList::RemoveSharedModuleIfOrphaned
static bool RemoveSharedModuleIfOrphaned(const Module *module_ptr)
Definition: ModuleList.cpp:970
lldb_private::ModuleList::FindSymbolsWithNameAndType
void FindSymbolsWithNameAndType(ConstString name, lldb::SymbolType symbol_type, SymbolContextList &sc_list) const
Definition: ModuleList.cpp:450
lldb_private::ModuleList::~ModuleList
~ModuleList()
Destructor.
lldb_private::Properties
Definition: UserSettingsController.h:33
lldb_private::ModuleListProperties::SetEnableExternalLookup
bool SetEnableExternalLookup(bool new_value)
Definition: ModuleList.cpp:96
lldb_private::LockingAdaptedIterable
Definition: Iterable.h:171
lldb_private::FileSpec
Definition: FileSpec.h:56
lldb_private::ModuleList::FindSymbolsMatchingRegExAndType
void FindSymbolsMatchingRegExAndType(const RegularExpression &regex, lldb::SymbolType symbol_type, SymbolContextList &sc_list) const
Definition: ModuleList.cpp:458
lldb_private::ModuleListProperties
Definition: ModuleList.h:50
lldb_private::ModuleList::GetSize
size_t GetSize() const
Gets the size of the module list.
Definition: ModuleList.cpp:576
lldb_private::Function
Definition: Function.h:413
lldb_private::ModuleList::Remove
bool Remove(const lldb::ModuleSP &module_sp, bool notify=true)
Remove a module from the module list.
lldb_private::ModuleList
Definition: ModuleList.h:72
lldb_private::ModuleList::operator=
const ModuleList & operator=(const ModuleList &rhs)
Assignment operator.
Definition: ModuleList.cpp:146
lldb_private::ModuleList::ModulesNoLocking
ModuleIterableNoLocking ModulesNoLocking() const
Definition: ModuleList.h:488
lldb_private::ModuleList::ResolveSymbolContextForFilePath
uint32_t ResolveSymbolContextForFilePath(const char *file_path, uint32_t line, bool check_inlines, lldb::SymbolContextItem resolve_scope, SymbolContextList &sc_list) const
Resolve items in the symbol context for a given file and line. (const char
Definition: ModuleList.cpp:643
lldb_private::ModuleList::ModuleIsInCache
static bool ModuleIsInCache(const Module *module_ptr)
Definition: ModuleList.cpp:705
lldb_private::NameMatch::RegularExpression
@ RegularExpression
lldb_private::ConstString
Definition: ConstString.h:40
lldb-enumerations.h
lldb_private::ModuleList::FindFirstModule
lldb::ModuleSP FindFirstModule(const ModuleSpec &module_spec) const
Definition: ModuleList.cpp:564
lldb_private::ModuleList::RemoveOrphanSharedModules
static size_t RemoveOrphanSharedModules(bool mandatory)
Definition: ModuleList.cpp:718
lldb_private::ModuleList::ReplaceModule
bool ReplaceModule(const lldb::ModuleSP &old_module_sp, const lldb::ModuleSP &new_module_sp)
Definition: ModuleList.cpp:260
lldb_private::ModuleList::ForEach
void ForEach(std::function< bool(const lldb::ModuleSP &module_sp)> const &callback) const
Definition: ModuleList.cpp:1004
lldb_private::ModuleList::ResolveFileAddress
bool ResolveFileAddress(lldb::addr_t vm_addr, Address &so_addr) const
Definition: ModuleList.cpp:608
lldb_private::ModuleList::RemoveImpl
bool RemoveImpl(const lldb::ModuleSP &module_sp, bool use_notifier=true)
lldb_private::ModuleList::ResolveSymbolContextForAddress
uint32_t ResolveSymbolContextForAddress(const Address &so_addr, lldb::SymbolContextItem resolve_scope, SymbolContext &sc) const
Resolve the symbol context for the given address. (const Address
Definition: ModuleList.cpp:620
lldb::SymbolType
SymbolType
Symbol types.
Definition: lldb-enumerations.h:612
Address.h
lldb_private::ModuleList::RemoveIfOrphaned
bool RemoveIfOrphaned(const Module *module_ptr)
Definition: ModuleList.cpp:270
lldb_private::ModuleFunctionSearchOptions
Options used by Module::FindFunctions.
Definition: Module.h:63
lldb_private::ModuleList::m_modules_mutex
std::recursive_mutex m_modules_mutex
Definition: ModuleList.h:474
lldb_private::ModuleList::ModuleList
ModuleList()
Default constructor.
Definition: ModuleList.cpp:134
lldb-types.h
lldb_private::ModuleList::RemoveSharedModule
static bool RemoveSharedModule(lldb::ModuleSP &module_sp)
Definition: ModuleList.cpp:966
lldb_private::ModuleList::FindModule
lldb::ModuleSP FindModule(const Module *module_ptr) const
Definition: ModuleList.cpp:475
Iterable.h
lldb_private::ModuleList::FindCompileUnits
void FindCompileUnits(const FileSpec &path, SymbolContextList &sc_list) const
Find compile units by partial or full path.
Definition: ModuleList.cpp:426
lldb_private::ModuleList::Notifier::NotifyModuleAdded
virtual void NotifyModuleAdded(const ModuleList &module_list, const lldb::ModuleSP &module_sp)=0
lldb_private::ModuleSpec
Definition: ModuleSpec.h:26
lldb_private::Status
Definition: Status.h:44
lldb_private::ModuleList::m_modules
collection m_modules
The collection of modules.
Definition: ModuleList.h:473
uint32_t
lldb_private::PathMappingList
Definition: PathMappingList.h:19
UserSettingsController.h
lldb_private::ModuleListProperties::UpdateSymlinkMappings
void UpdateSymlinkMappings()
Definition: ModuleList.cpp:113
lldb_private::Address
Definition: Address.h:59
lldb_private::ModuleList::collection
std::vector< lldb::ModuleSP > collection
The module collection type.
Definition: ModuleList.h:461
lldb_private::ModuleList::AppendIfNeeded
bool AppendIfNeeded(const lldb::ModuleSP &new_module, bool notify=true)
Append a module to the module list, if it is not already there.
lldb_private::ModuleListProperties::m_symlink_paths
PathMappingList m_symlink_paths
Definition: ModuleList.h:52
lldb_private::ModuleList::FindAddressesForLine
void FindAddressesForLine(const lldb::TargetSP target_sp, const FileSpec &file, uint32_t line, Function *function, std::vector< Address > &output_local, std::vector< Address > &output_extern)
Find addresses by file/line.
Definition: ModuleList.cpp:552
lldb_private::ModuleList::AppendImpl
void AppendImpl(const lldb::ModuleSP &module_sp, bool use_notifier=true)
Definition: ModuleList.cpp:160
lldb_private::ModuleList::ModuleIterable
LockingAdaptedIterable< collection, lldb::ModuleSP, vector_adapter, std::recursive_mutex > ModuleIterable
Definition: ModuleList.h:481
lldb_private::ModuleList::LogUUIDAndPaths
void LogUUIDAndPaths(Log *log, const char *prefix_cstr)
Definition: ModuleList.cpp:591
lldb_private::ModuleListProperties::m_symlink_paths_mutex
llvm::sys::RWMutex m_symlink_paths_mutex
Definition: ModuleList.h:51
lldb-forward.h
lldb_private::ModuleList::FindFunctions
void FindFunctions(ConstString name, lldb::FunctionNameType name_type_mask, const ModuleFunctionSearchOptions &options, SymbolContextList &sc_list) const
Status.h
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb_private::ModuleList::Destroy
void Destroy()
Clear the object's state.
Definition: ModuleList.cpp:335
lldb_private::ModuleList::Notifier::NotifyModuleRemoved
virtual void NotifyModuleRemoved(const ModuleList &module_list, const lldb::ModuleSP &module_sp)=0
lldb_private::ModuleList::Dump
void Dump(Stream *s) const
Dump the description of each module contained in this list.
Definition: ModuleList.cpp:585
lldb_private::TypeList
Definition: TypeList.h:20
lldb_private::ModuleList::GetModuleAtIndex
lldb::ModuleSP GetModuleAtIndex(size_t idx) const
Get the module shared pointer for the module at index idx.
Definition: ModuleList.cpp:351
FileSpec.h
lldb_private::ModuleList::FindModules
void FindModules(const ModuleSpec &module_spec, ModuleList &matching_module_list) const
Finds the first module whose file specification matches file_spec.
Definition: ModuleList.cpp:466
lldb_private::ModuleList::FindFunctionSymbols
void FindFunctionSymbols(ConstString name, lldb::FunctionNameType name_type_mask, SymbolContextList &sc_list)
Definition: ModuleList.cpp:392
lldb_private::ModuleListProperties::GetEnableExternalLookup
bool GetEnableExternalLookup() const
Definition: ModuleList.cpp:90
lldb_private::Log
Definition: Log.h:49
lldb_private::ModuleList::FindTypes
void FindTypes(Module *search_first, ConstString name, bool name_is_fully_qualified, size_t max_matches, llvm::DenseSet< SymbolFile * > &searched_symbol_files, TypeList &types) const
Find types by name.
Definition: ModuleList.cpp:510
lldb_private::ModuleList::Notifier::NotifyWillClearList
virtual void NotifyWillClearList(const ModuleList &module_list)=0
llvm::SmallVectorImpl
Definition: Disassembler.h:42
lldb_private::ModuleList::ReplaceEquivalent
void ReplaceEquivalent(const lldb::ModuleSP &module_sp, llvm::SmallVectorImpl< lldb::ModuleSP > *old_modules=nullptr)
Append a module to the module list and remove any equivalent modules.
Definition: ModuleList.cpp:173
lldb_private::ModuleList::Notifier::NotifyModuleUpdated
virtual void NotifyModuleUpdated(const ModuleList &module_list, const lldb::ModuleSP &old_module_sp, const lldb::ModuleSP &new_module_sp)=0
lldb_private::ModuleList::ClearImpl
void ClearImpl(bool use_notifier=true)
Definition: ModuleList.cpp:337
lldb_private::ModuleList::GetSharedModule
static Status GetSharedModule(const ModuleSpec &module_spec, lldb::ModuleSP &module_sp, const FileSpecList *module_search_paths_ptr, llvm::SmallVectorImpl< lldb::ModuleSP > *old_modules, bool *did_create_ptr, bool always_create=false)
Definition: ModuleList.cpp:723
lldb_private::ModuleList::IsEmpty
bool IsEmpty() const
Definition: ModuleList.h:430
lldb_private::ModuleList::ModuleIterableNoLocking
AdaptedIterable< collection, lldb::ModuleSP, vector_adapter > ModuleIterableNoLocking
Definition: ModuleList.h:487
lldb_private::ModuleList::Append
void Append(const lldb::ModuleSP &module_sp, bool notify=true)
Append a module to the module list.
lldb_private::CompilerContextKind::Function
@ Function
lldb_private::ModuleListProperties::SetClangModulesCachePath
bool SetClangModulesCachePath(const FileSpec &path)
Definition: ModuleList.cpp:108
lldb_private::ModuleList::Notifier
Definition: ModuleList.h:74
lldb_private::ModuleList::Notifier::NotifyModulesRemoved
virtual void NotifyModulesRemoved(lldb_private::ModuleList &module_list)=0
lldb_private::ModuleList::FindSourceFile
bool FindSourceFile(const FileSpec &orig_spec, FileSpec &new_spec) const
Definition: ModuleList.cpp:542
lldb_private::ModuleListProperties::GetClangModulesCachePath
FileSpec GetClangModulesCachePath() const
Definition: ModuleList.cpp:101