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