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