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"
17#include "lldb/Utility/Status.h"
19#include "lldb/lldb-forward.h"
21#include "lldb/lldb-types.h"
22
23#include "llvm/ADT/DenseSet.h"
24#include "llvm/Support/RWMutex.h"
25
26#include <functional>
27#include <list>
28#include <mutex>
29#include <vector>
30
31#include <cstddef>
32#include <cstdint>
33
34namespace lldb_private {
35class ConstString;
36class FileSpecList;
37class Function;
38class Log;
39class Module;
41class Stream;
42class SymbolContext;
44class SymbolFile;
45class Target;
46class TypeList;
47class UUID;
48class VariableList;
50
52 {
54 "off",
55 "Disable automatically downloading symbols.",
56 },
57 {
59 "background",
60 "Download symbols in the background for images as they appear in the "
61 "backtrace.",
62 },
63 {
65 "foreground",
66 "Download symbols in the foreground for images as they appear in the "
67 "backtrace.",
68 },
69};
70
72 {
74 "host-lldb-memory",
75 "Get binaries from the host lldb in-memory shared cache.",
76 },
77 {
79 "host-shared-cache",
80 "Get binaries from the host shared cache.",
81 },
82 {
84 "host-and-inferior-shared-cache",
85 "Get binaries from the host and inferior's shared caches.",
86 },
87 {
89 "inferior-shared-cache-only",
90 "Get binaries from inferior's shared cache only.",
91 },
92};
93
95 mutable llvm::sys::RWMutex m_symlink_paths_mutex;
97
99
100public:
102
104 bool SetClangModulesCachePath(const FileSpec &path);
105 bool GetEnableExternalLookup() const;
106 bool SetEnableExternalLookup(bool new_value);
108 bool GetEnableLLDBIndexCache() const;
109 bool SetEnableLLDBIndexCache(bool new_value);
111 bool SetEnableLLDBIndexCacheMemoryModules(bool new_value);
116 bool SetLLDBIndexCachePath(const FileSpec &path);
117 bool GetLoadSymbolOnDemand() const;
118 uint64_t GetDemangledNameInfoCacheSize() const;
121};
122
123/// \class ModuleList ModuleList.h "lldb/Core/ModuleList.h"
124/// A collection class for Module objects.
125///
126/// Modules in the module collection class are stored as reference counted
127/// shared pointers to Module objects.
129public:
130 class Notifier {
131 public:
132 virtual ~Notifier() = default;
133
134 virtual void NotifyModuleAdded(const ModuleList &module_list,
135 const lldb::ModuleSP &module_sp) = 0;
136 virtual void NotifyModuleRemoved(const ModuleList &module_list,
137 const lldb::ModuleSP &module_sp) = 0;
138 virtual void NotifyModuleUpdated(const ModuleList &module_list,
139 const lldb::ModuleSP &old_module_sp,
140 const lldb::ModuleSP &new_module_sp) = 0;
141 virtual void NotifyWillClearList(const ModuleList &module_list) = 0;
142
143 virtual void NotifyModulesRemoved(lldb_private::ModuleList &module_list) = 0;
144 };
145
146 /// Default constructor.
147 ///
148 /// Creates an empty list of Module objects.
149 ModuleList();
150
151 /// Copy Constructor.
152 ///
153 /// Creates a new module list object with a copy of the modules from \a rhs.
154 ///
155 /// \param[in] rhs
156 /// Another module list object.
157 ModuleList(const ModuleList &rhs);
158
160
161 /// Destructor.
163
164 /// Assignment operator.
165 ///
166 /// Copies the module list from \a rhs into this list.
167 ///
168 /// \param[in] rhs
169 /// Another module list object.
170 ///
171 /// \return
172 /// A const reference to this object.
173 const ModuleList &operator=(const ModuleList &rhs);
174
175 /// Append a module to the module list.
176 ///
177 /// \param[in] module_sp
178 /// A shared pointer to a module to add to this collection.
179 ///
180 /// \param[in] notify
181 /// If true, and a notifier function is set, the notifier function
182 /// will be called. Defaults to true.
183 ///
184 /// When this ModuleList is the Target's ModuleList, the notifier
185 /// function is Target::ModulesDidLoad -- the call to
186 /// ModulesDidLoad may be deferred when adding multiple Modules
187 /// to the Target, but it must be called at the end,
188 /// before resuming execution.
189 void Append(const lldb::ModuleSP &module_sp, bool notify = true);
190
191 /// Append a module to the module list and remove any equivalent modules.
192 /// Equivalent modules are ones whose file, platform file and architecture
193 /// matches.
194 ///
195 /// Replaces the module to the collection.
196 ///
197 /// \param[in] module_sp
198 /// A shared pointer to a module to replace in this collection.
199 ///
200 /// \param[in] old_modules
201 /// Optional pointer to a vector which, if provided, will have shared
202 /// pointers to the replaced module(s) appended to it.
204 const lldb::ModuleSP &module_sp,
205 llvm::SmallVectorImpl<lldb::ModuleSP> *old_modules = nullptr);
206
207 /// Append a module to the module list, if it is not already there.
208 ///
209 /// \param[in] notify
210 /// If true, and a notifier function is set, the notifier function
211 /// will be called. Defaults to true.
212 ///
213 /// When this ModuleList is the Target's ModuleList, the notifier
214 /// function is Target::ModulesDidLoad -- the call to
215 /// ModulesDidLoad may be deferred when adding multiple Modules
216 /// to the Target, but it must be called at the end,
217 /// before resuming execution.
218 bool AppendIfNeeded(const lldb::ModuleSP &new_module, bool notify = true);
219
220 void Append(const ModuleList &module_list);
221
222 bool AppendIfNeeded(const ModuleList &module_list);
223
224 bool ReplaceModule(const lldb::ModuleSP &old_module_sp,
225 const lldb::ModuleSP &new_module_sp);
226
227 /// Clear the object's state.
228 ///
229 /// Clears the list of modules and releases a reference to each module
230 /// object and if the reference count goes to zero, the module will be
231 /// deleted.
232 void Clear();
233
234 /// Clear the object's state.
235 ///
236 /// Clears the list of modules and releases a reference to each module
237 /// object and if the reference count goes to zero, the module will be
238 /// deleted. Also release all memory that might be held by any collection
239 /// classes (like std::vector)
240 void Destroy();
241
242 /// Dump the description of each module contained in this list.
243 ///
244 /// Dump the description of each module contained in this list to the
245 /// supplied stream \a s.
246 ///
247 /// \param[in] s
248 /// The stream to which to dump the object description.
249 ///
250 /// \see Module::Dump(Stream *) const
251 void Dump(Stream *s) const;
252
253 void LogUUIDAndPaths(Log *log, const char *prefix_cstr);
254
255 std::recursive_mutex &GetMutex() const { return m_modules_mutex; }
256
257 size_t GetIndexForModule(const Module *module) const;
258
259 /// Get the module shared pointer for the module at index \a idx.
260 ///
261 /// \param[in] idx
262 /// An index into this module collection.
263 ///
264 /// \return
265 /// A shared pointer to a Module which can contain NULL if
266 /// \a idx is out of range.
267 ///
268 /// \see ModuleList::GetSize()
269 lldb::ModuleSP GetModuleAtIndex(size_t idx) const;
270
271 /// Get the module shared pointer for the module at index \a idx without
272 /// acquiring the ModuleList mutex. This MUST already have been acquired
273 /// with ModuleList::GetMutex and locked for this call to be safe.
274 ///
275 /// \param[in] idx
276 /// An index into this module collection.
277 ///
278 /// \return
279 /// A shared pointer to a Module which can contain NULL if
280 /// \a idx is out of range.
281 ///
282 /// \see ModuleList::GetSize()
284
285 /// Get the module pointer for the module at index \a idx.
286 ///
287 /// \param[in] idx
288 /// An index into this module collection.
289 ///
290 /// \return
291 /// A pointer to a Module which can by nullptr if \a idx is out
292 /// of range.
293 ///
294 /// \see ModuleList::GetSize()
295 Module *GetModulePointerAtIndex(size_t idx) const;
296
297 /// Find compile units by partial or full path.
298 ///
299 /// Finds all compile units that match \a path in all of the modules and
300 /// returns the results in \a sc_list.
301 ///
302 /// \param[in] path
303 /// The name of the compile unit we are looking for.
304 ///
305 /// \param[out] sc_list
306 /// A symbol context list that gets filled in with all of the
307 /// matches.
308 void FindCompileUnits(const FileSpec &path, SymbolContextList &sc_list) const;
309
310 /// \see Module::FindFunctions ()
311 void FindFunctions(ConstString name, lldb::FunctionNameType name_type_mask,
312 const ModuleFunctionSearchOptions &options,
313 SymbolContextList &sc_list) const;
314
315 /// \see Module::FindFunctionSymbols ()
317 lldb::FunctionNameType name_type_mask,
318 SymbolContextList &sc_list);
319
320 /// \see Module::FindFunctions ()
321 void FindFunctions(const RegularExpression &name,
322 const ModuleFunctionSearchOptions &options,
323 SymbolContextList &sc_list);
324
325 /// Find global and static variables by name.
326 ///
327 /// \param[in] name
328 /// The name of the global or static variable we are looking
329 /// for.
330 ///
331 /// \param[in] max_matches
332 /// Allow the number of matches to be limited to \a
333 /// max_matches. Specify UINT32_MAX to get all possible matches.
334 ///
335 /// \param[in] variable_list
336 /// A list of variables that gets the matches appended to.
337 void FindGlobalVariables(ConstString name, size_t max_matches,
338 VariableList &variable_list) const;
339
340 /// Find global and static variables by regular expression.
341 ///
342 /// \param[in] regex
343 /// A regular expression to use when matching the name.
344 ///
345 /// \param[in] max_matches
346 /// Allow the number of matches to be limited to \a
347 /// max_matches. Specify UINT32_MAX to get all possible matches.
348 ///
349 /// \param[in] variable_list
350 /// A list of variables that gets the matches appended to.
351 void FindGlobalVariables(const RegularExpression &regex, size_t max_matches,
352 VariableList &variable_list) const;
353
354 /// Finds modules whose file specification matches \a module_spec.
355 ///
356 /// \param[in] module_spec
357 /// A file specification object to match against the Module's
358 /// file specifications. If \a module_spec does not have
359 /// directory information, matches will occur by matching only
360 /// the basename of any modules in this list. If this value is
361 /// NULL, then file specifications won't be compared when
362 /// searching for matching modules.
363 ///
364 /// \param[out] matching_module_list
365 /// A module list that gets filled in with any modules that
366 /// match the search criteria.
367 void FindModules(const ModuleSpec &module_spec,
368 ModuleList &matching_module_list) const;
369
370 lldb::ModuleSP FindModule(const Module *module_ptr) const;
371
372 // Find a module by UUID
373 //
374 // The UUID value for a module is extracted from the ObjectFile and is the
375 // MD5 checksum, or a smarter object file equivalent, so finding modules by
376 // UUID values is very efficient and accurate.
377 lldb::ModuleSP FindModule(const UUID &uuid) const;
378
379 /// Find a module by LLDB-specific unique identifier.
380 ///
381 /// \param[in] uid The UID of the module assigned to it on construction.
382 ///
383 /// \returns ModuleSP of module with \c uid. Returns nullptr if no such
384 /// module could be found.
386
387 /// Finds the first module whose file specification matches \a module_spec.
388 lldb::ModuleSP FindFirstModule(const ModuleSpec &module_spec) const;
389
391 lldb::SymbolType symbol_type,
392 SymbolContextList &sc_list) const;
393
395 lldb::SymbolType symbol_type,
396 SymbolContextList &sc_list) const;
397
398 /// Find types using a type-matching object that contains all search
399 /// parameters.
400 ///
401 /// \param[in] search_first
402 /// If non-null, this module will be searched before any other
403 /// modules.
404 ///
405 /// \param[in] query
406 /// A type matching object that contains all of the details of the type
407 /// search.
408 ///
409 /// \param[in] results
410 /// Any matching types will be populated into the \a results object using
411 /// TypeMap::InsertUnique(...).
412 void FindTypes(Module *search_first, const TypeQuery &query,
413 lldb_private::TypeResults &results) const;
414
415 bool FindSourceFile(const FileSpec &orig_spec, FileSpec &new_spec) const;
416
417 /// Find addresses by file/line
418 ///
419 /// \param[in] target_sp
420 /// The target the addresses are desired for.
421 ///
422 /// \param[in] file
423 /// Source file to locate.
424 ///
425 /// \param[in] line
426 /// Source line to locate.
427 ///
428 /// \param[in] function
429 /// Optional filter function. Addresses within this function will be
430 /// added to the 'local' list. All others will be added to the 'extern'
431 /// list.
432 ///
433 /// \param[out] output_local
434 /// All matching addresses within 'function'
435 ///
436 /// \param[out] output_extern
437 /// All matching addresses not within 'function'
438 void FindAddressesForLine(const lldb::TargetSP target_sp,
439 const FileSpec &file, uint32_t line,
440 Function *function,
441 std::vector<Address> &output_local,
442 std::vector<Address> &output_extern);
443
444 /// Remove a module from the module list.
445 ///
446 /// \param[in] module_sp
447 /// A shared pointer to a module to remove from this collection.
448 ///
449 /// \param[in] notify
450 /// If true, and a notifier function is set, the notifier function
451 /// will be called. Defaults to true.
452 ///
453 /// When this ModuleList is the Target's ModuleList, the notifier
454 /// function is Target::ModulesDidUnload -- the call to
455 /// ModulesDidUnload may be deferred when removing multiple Modules
456 /// from the Target, but it must be called at the end,
457 /// before resuming execution.
458 bool Remove(const lldb::ModuleSP &module_sp, bool notify = true);
459
460 size_t Remove(ModuleList &module_list);
461
462 bool RemoveIfOrphaned(const lldb::ModuleWP module_ptr);
463
464 size_t RemoveOrphans(bool mandatory);
465
466 bool ResolveFileAddress(lldb::addr_t vm_addr, Address &so_addr) const;
467
468 /// \copydoc Module::ResolveSymbolContextForAddress (const Address
469 /// &,uint32_t,SymbolContext&)
470 uint32_t ResolveSymbolContextForAddress(const Address &so_addr,
471 lldb::SymbolContextItem resolve_scope,
472 SymbolContext &sc) const;
473
474 /// \copydoc Module::ResolveSymbolContextForFilePath (const char
475 /// *,uint32_t,bool,uint32_t,SymbolContextList&)
477 const char *file_path, uint32_t line, bool check_inlines,
478 lldb::SymbolContextItem resolve_scope, SymbolContextList &sc_list) const;
479
480 /// \copydoc Module::ResolveSymbolContextsForFileSpec (const FileSpec
481 /// &,uint32_t,bool,uint32_t,SymbolContextList&)
483 const FileSpec &file_spec, uint32_t line, bool check_inlines,
484 lldb::SymbolContextItem resolve_scope, SymbolContextList &sc_list) const;
485
486 /// Gets the size of the module list.
487 ///
488 /// \return
489 /// The number of modules in the module list.
490 size_t GetSize() const;
491 bool IsEmpty() const { return !GetSize(); }
492
493 bool LoadScriptingResourcesInTarget(Target *target, std::list<Status> &errors,
494 bool continue_on_error = true);
495
497
498 static bool ModuleIsInCache(const Module *module_ptr);
499
500 static Status
501 GetSharedModule(const ModuleSpec &module_spec, lldb::ModuleSP &module_sp,
503 bool *did_create_ptr, bool invoke_locate_callback = true,
504 bool invoke_symbol_locators = true);
505
506 static bool RemoveSharedModule(lldb::ModuleSP &module_sp);
507
508 static void FindSharedModules(const ModuleSpec &module_spec,
509 ModuleList &matching_module_list);
510
511 static lldb::ModuleSP FindSharedModule(const UUID &uuid);
512
513 static size_t RemoveOrphanSharedModules(bool mandatory);
514
515 static bool RemoveSharedModuleIfOrphaned(const lldb::ModuleWP module_ptr);
516
517 /// Applies 'callback' to each module in this ModuleList.
518 /// If 'callback' returns false, iteration terminates.
519 /// The 'module_sp' passed to 'callback' is guaranteed to
520 /// be non-null.
521 ///
522 /// This function is thread-safe.
523 void
524 ForEach(std::function<IterationAction(const lldb::ModuleSP &module_sp)> const
525 &callback) const;
526
527 /// Returns true if 'callback' returns true for one of the modules
528 /// in this ModuleList.
529 ///
530 /// This function is thread-safe.
531 bool AnyOf(
532 std::function<bool(lldb_private::Module &module)> const &callback) const;
533
534 /// Atomically swaps the contents of this module list with \a other.
535 void Swap(ModuleList &other);
536
537 /// For each module in this ModuleList, preload its symbols.
538 ///
539 /// \param[in] parallelize
540 /// If true, all modules will be preloaded in parallel.
541 void PreloadSymbols(bool parallelize) const;
542
543protected:
544 // Class typedefs.
545 typedef std::vector<lldb::ModuleSP>
546 collection; ///< The module collection type.
547
548 void AppendImpl(const lldb::ModuleSP &module_sp, bool use_notifier = true);
549
550 bool RemoveImpl(const lldb::ModuleSP &module_sp, bool use_notifier = true);
551
552 collection::iterator RemoveImpl(collection::iterator pos,
553 bool use_notifier = true);
554
555 void ClearImpl(bool use_notifier = true);
556
557 // Member variables.
558 collection m_modules; ///< The collection of modules.
559 mutable std::recursive_mutex m_modules_mutex;
560
562
563 /// An orphaned module that lives only in the ModuleList has a count of 1.
564 static constexpr long kUseCountModuleListOrphaned = 1;
565
566private:
568 Target &target,
569 Status &error);
570
571public:
576 }
577
578 typedef llvm::iterator_range<collection::const_iterator>
583};
584
585} // namespace lldb_private
586
587#endif // LLDB_CORE_MODULELIST_H
static llvm::raw_ostream & error(Stream &strm)
A section + offset based address class.
Definition Address.h:62
A uniqued constant string class.
Definition ConstString.h:40
A file collection class.
A file utility class.
Definition FileSpec.h:56
A class that describes a function.
Definition Function.h:386
bool SetClangModulesCachePath(const FileSpec &path)
lldb::SymbolDownload GetSymbolAutoDownload() const
bool SetLLDBIndexCachePath(const FileSpec &path)
bool SetEnableExternalLookup(bool new_value)
PathMappingList GetSymlinkMappings() const
uint64_t GetDemangledNameInfoCacheSize() const
lldb::SymbolSharedCacheUse GetSharedCacheBinaryLoading() const
FileSpec GetClangModulesCachePath() const
llvm::sys::RWMutex m_symlink_paths_mutex
Definition ModuleList.h:95
bool GetEnableLLDBIndexCacheMemoryModules() const
bool SetEnableLLDBIndexCache(bool new_value)
bool SetEnableLLDBIndexCacheMemoryModules(bool new_value)
virtual void NotifyModuleAdded(const ModuleList &module_list, const lldb::ModuleSP &module_sp)=0
virtual void NotifyModuleUpdated(const ModuleList &module_list, const lldb::ModuleSP &old_module_sp, const lldb::ModuleSP &new_module_sp)=0
virtual void NotifyModuleRemoved(const ModuleList &module_list, const lldb::ModuleSP &module_sp)=0
virtual void NotifyWillClearList(const ModuleList &module_list)=0
virtual void NotifyModulesRemoved(lldb_private::ModuleList &module_list)=0
A collection class for Module objects.
Definition ModuleList.h:128
bool ReplaceModule(const lldb::ModuleSP &old_module_sp, const lldb::ModuleSP &new_module_sp)
std::vector< lldb::ModuleSP > collection
The module collection type.
Definition ModuleList.h:546
collection m_modules
The collection of modules.
Definition ModuleList.h:558
llvm::iterator_range< collection::const_iterator > ModuleIterableNoLocking
Definition ModuleList.h:579
void ClearImpl(bool use_notifier=true)
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&,...
static bool RemoveSharedModule(lldb::ModuleSP &module_sp)
static Status GetSharedModule(const ModuleSpec &module_spec, lldb::ModuleSP &module_sp, llvm::SmallVectorImpl< lldb::ModuleSP > *old_modules, bool *did_create_ptr, bool invoke_locate_callback=true, bool invoke_symbol_locators=true)
void FindFunctions(ConstString name, lldb::FunctionNameType name_type_mask, const ModuleFunctionSearchOptions &options, SymbolContextList &sc_list) const
bool FindSourceFile(const FileSpec &orig_spec, FileSpec &new_spec) const
bool AnyOf(std::function< bool(lldb_private::Module &module)> const &callback) const
Returns true if 'callback' returns true for one of the modules in this ModuleList.
ModuleIterableNoLocking ModulesNoLocking() const
Definition ModuleList.h:580
static constexpr long kUseCountModuleListOrphaned
An orphaned module that lives only in the ModuleList has a count of 1.
Definition ModuleList.h:564
static bool ModuleIsInCache(const Module *module_ptr)
void FindGlobalVariables(ConstString name, size_t max_matches, VariableList &variable_list) const
Find global and static variables by name.
void Swap(ModuleList &other)
Atomically swaps the contents of this module list with other.
size_t GetIndexForModule(const Module *module) const
std::recursive_mutex & GetMutex() const
Definition ModuleList.h:255
bool RemoveImpl(const lldb::ModuleSP &module_sp, bool use_notifier=true)
lldb::ModuleSP FindFirstModule(const ModuleSpec &module_spec) const
Finds the first module whose file specification matches module_spec.
void Clear()
Clear the object's state.
ModuleList()
Default constructor.
void Dump(Stream *s) const
Dump the description of each module contained in this list.
collection::iterator RemoveImpl(collection::iterator pos, bool use_notifier=true)
void FindTypes(Module *search_first, const TypeQuery &query, lldb_private::TypeResults &results) const
Find types using a type-matching object that contains all search parameters.
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*,uint32_t,...
static bool LoadScriptingResourceInTargetForModule(Module &module, Target &target, Status &error)
lldb::ModuleSP GetModuleAtIndexUnlocked(size_t idx) const
Get the module shared pointer for the module at index idx without acquiring the ModuleList mutex.
static bool RemoveSharedModuleIfOrphaned(const lldb::ModuleWP module_ptr)
void FindCompileUnits(const FileSpec &path, SymbolContextList &sc_list) const
Find compile units by partial or full path.
void PreloadSymbols(bool parallelize) const
For each module in this ModuleList, preload its symbols.
const ModuleList & operator=(const ModuleList &rhs)
Assignment operator.
std::recursive_mutex m_modules_mutex
Definition ModuleList.h:559
bool AppendIfNeeded(const lldb::ModuleSP &new_module, bool notify=true)
Append a module to the module list, if it is not already there.
Module * GetModulePointerAtIndex(size_t idx) const
Get the module pointer for the module at index idx.
void FindSymbolsWithNameAndType(ConstString name, lldb::SymbolType symbol_type, SymbolContextList &sc_list) const
static lldb::ModuleSP FindSharedModule(const UUID &uuid)
lldb::ModuleSP FindModule(const Module *module_ptr) const
static ModuleListProperties & GetGlobalModuleListProperties()
void FindModules(const ModuleSpec &module_spec, ModuleList &matching_module_list) const
Finds modules whose file specification matches module_spec.
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.
uint32_t ResolveSymbolContextForAddress(const Address &so_addr, lldb::SymbolContextItem resolve_scope, SymbolContext &sc) const
Resolve the symbol context for the given address. (const Address&,uint32_t,SymbolContext&)
bool Remove(const lldb::ModuleSP &module_sp, bool notify=true)
Remove a module from the module list.
size_t RemoveOrphans(bool mandatory)
lldb::ModuleSP GetModuleAtIndex(size_t idx) const
Get the module shared pointer for the module at index idx.
void Append(const lldb::ModuleSP &module_sp, bool notify=true)
Append a module to the module list.
static size_t RemoveOrphanSharedModules(bool mandatory)
void Destroy()
Clear the object's state.
LockingAdaptedIterable< std::recursive_mutex, collection > ModuleIterable
Definition ModuleList.h:573
void AppendImpl(const lldb::ModuleSP &module_sp, bool use_notifier=true)
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.
void FindFunctionSymbols(ConstString name, lldb::FunctionNameType name_type_mask, SymbolContextList &sc_list)
static void FindSharedModules(const ModuleSpec &module_spec, ModuleList &matching_module_list)
bool LoadScriptingResourcesInTarget(Target *target, std::list< Status > &errors, bool continue_on_error=true)
void FindSymbolsMatchingRegExAndType(const RegularExpression &regex, lldb::SymbolType symbol_type, SymbolContextList &sc_list) const
ModuleIterable Modules() const
Definition ModuleList.h:574
bool ResolveFileAddress(lldb::addr_t vm_addr, Address &so_addr) const
size_t GetSize() const
Gets the size of the module list.
bool RemoveIfOrphaned(const lldb::ModuleWP module_ptr)
void LogUUIDAndPaths(Log *log, const char *prefix_cstr)
void ForEach(std::function< IterationAction(const lldb::ModuleSP &module_sp)> const &callback) const
Applies 'callback' to each module in this ModuleList.
A class that describes an executable image and its associated object and symbol files.
Definition Module.h:91
An error handling class.
Definition Status.h:118
A stream class that can stream formatted output to a file.
Definition Stream.h:28
Defines a list of symbol context objects.
Defines a symbol context baton that can be handed other debug core functions.
Provides public interface for all SymbolFiles.
Definition SymbolFile.h:51
A class that contains all state required for type lookups.
Definition Type.h:104
This class tracks the state and results of a TypeQuery.
Definition Type.h:344
Represents UUID's of various sizes.
Definition UUID.h:27
A class that represents a running process on the host machine.
static constexpr OptionEnumValueElement g_shared_cache_use_enum_values[]
Definition ModuleList.h:71
IterationAction
Useful for callbacks whose return type indicates whether to continue iteration or short-circuit.
static constexpr OptionEnumValueElement g_auto_download_enum_values[]
Definition ModuleList.h:51
std::weak_ptr< lldb_private::Module > ModuleWP
@ eSymbolSharedCacheUseHostSharedCache
@ eSymbolSharedCacheUseInferiorSharedCacheOnly
@ eSymbolSharedCacheUseHostLLDBMemory
@ eSymbolSharedCacheUseHostAndInferiorSharedCache
SymbolType
Symbol types.
uint64_t user_id_t
Definition lldb-types.h:83
uint64_t addr_t
Definition lldb-types.h:80
std::shared_ptr< lldb_private::Target > TargetSP
@ eSymbolDownloadBackground
@ eSymbolDownloadForeground
std::shared_ptr< lldb_private::Module > ModuleSP
Options used by Module::FindFunctions.
Definition Module.h:67