9#ifndef LLDB_CORE_MODULESPEC_H
10#define LLDB_CORE_MODULESPEC_H
21#include "llvm/Support/Chrono.h"
155 explicit operator bool()
const {
176 bool dumped_something =
false;
181 dumped_something =
true;
184 if (dumped_something)
189 dumped_something =
true;
192 if (dumped_something)
197 dumped_something =
true;
200 if (dumped_something)
204 dumped_something =
true;
207 if (dumped_something)
211 dumped_something =
true;
214 if (dumped_something)
217 dumped_something =
true;
220 if (dumped_something)
223 dumped_something =
true;
226 if (dumped_something)
229 dumped_something =
true;
232 if (dumped_something)
234 strm.
Format(
"object_mod_time = {0:x+}",
240 bool exact_arch_match)
const {
261 if (exact_arch_match) {
298 std::lock_guard<std::recursive_mutex> lhs_guard(
m_mutex);
299 std::lock_guard<std::recursive_mutex> rhs_guard(rhs.
m_mutex);
308 std::lock_guard<std::recursive_mutex> lhs_guard(
m_mutex, std::adopt_lock);
309 std::lock_guard<std::recursive_mutex> rhs_guard(rhs.
m_mutex,
317 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
322 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
327 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
332 std::lock_guard<std::recursive_mutex> lhs_guard(
m_mutex);
333 std::lock_guard<std::recursive_mutex> rhs_guard(rhs.
m_mutex);
342 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
353 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
354 bool exact_arch_match =
true;
356 if (spec.Matches(module_spec, exact_arch_match)) {
357 match_module_spec = spec;
364 exact_arch_match =
false;
366 if (spec.Matches(module_spec, exact_arch_match)) {
367 match_module_spec = spec;
372 match_module_spec.
Clear();
378 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
379 bool exact_arch_match =
true;
380 const size_t initial_match_count = matching_list.
GetSize();
382 if (spec.Matches(module_spec, exact_arch_match))
383 matching_list.
Append(spec);
389 (initial_match_count == matching_list.
GetSize())) {
390 exact_arch_match =
false;
392 if (spec.Matches(module_spec, exact_arch_match))
393 matching_list.
Append(spec);
399 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
402 strm.
Printf(
"[%u] ", idx);
An architecture specification class.
A uniqued constant string class.
static bool Match(const FileSpec &pattern, const FileSpec &file)
Match FileSpec pattern against FileSpec file.
static FileSystem & Instance()
std::recursive_mutex m_mutex
ModuleSpecList & operator=(const ModuleSpecList &rhs)
collection m_specs
The collection of modules.
std::vector< ModuleSpec > collection
ModuleSpecIterable ModuleSpecs()
~ModuleSpecList()=default
bool GetModuleSpecAtIndex(size_t i, ModuleSpec &module_spec) const
void Append(const ModuleSpec &spec)
bool FindMatchingModuleSpec(const ModuleSpec &module_spec, ModuleSpec &match_module_spec) const
LockingAdaptedIterable< std::recursive_mutex, collection > ModuleSpecIterable
ModuleSpecList(const ModuleSpecList &rhs)
ModuleSpec & GetModuleSpecRefAtIndex(size_t i)
void Append(const ModuleSpecList &rhs)
void FindMatchingModuleSpecs(const ModuleSpec &module_spec, ModuleSpecList &matching_list) const
PathMappingList & GetSourceMappingList() const
const UUID & GetUUID() const
void SetObjectSize(uint64_t object_size)
uint64_t GetObjectOffset() const
void Dump(Stream &strm) const
const ArchSpec * GetArchitecturePtr() const
bool Matches(const ModuleSpec &match_module_spec, bool exact_arch_match) const
ModuleSpec(const FileSpec &file_spec, const ArchSpec &arch)
ConstString & GetObjectName()
std::weak_ptr< Target > m_target_wp
The target used when resolving a module.
FileSpec & GetPlatformFileSpec()
PathMappingList m_source_mappings
const FileSpec * GetSymbolFileSpecPtr() const
FileSpec * GetSymbolFileSpecPtr()
const FileSpec * GetFileSpecPtr() const
const FileSpec & GetPlatformFileSpec() const
const FileSpec * GetPlatformFileSpecPtr() const
FileSpec * GetPlatformFileSpecPtr()
lldb::DataBufferSP GetData() const
ArchSpec & GetArchitecture()
void SetObjectOffset(uint64_t object_offset)
FileSpec * GetFileSpecPtr()
FileSpec & GetSymbolFileSpec()
const FileSpec & GetFileSpec() const
const ArchSpec & GetArchitecture() const
lldb::DataBufferSP m_data
const UUID * GetUUIDPtr() const
llvm::sys::TimePoint & GetObjectModificationTime()
void SetTarget(std::shared_ptr< Target > target)
Set the target to be used when resolving a module.
ArchSpec * GetArchitecturePtr()
ModuleSpec(const FileSpec &file_spec, const UUID &uuid=UUID(), lldb::DataBufferSP data=lldb::DataBufferSP())
If the data argument is passed, its contents will be used as the module contents instead of trying to...
ConstString m_object_name
const FileSpec & GetSymbolFileSpec() const
ConstString GetObjectName() const
llvm::sys::TimePoint m_object_mod_time
const llvm::sys::TimePoint & GetObjectModificationTime() const
uint64_t GetObjectSize() const
lldb::TargetSP GetTargetSP() const
A stream class that can stream formatted output to a file.
void Format(const char *format, Args &&... args)
llvm::raw_ostream & AsRawOstream()
Returns a raw_ostream that forwards the data to this Stream object.
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
size_t PutCString(llvm::StringRef cstr)
Output a C string to the stream.
size_t EOL()
Output and End of Line character to the stream.
Represents UUID's of various sizes.
A class that represents a running process on the host machine.
std::shared_ptr< lldb_private::DataBuffer > DataBufferSP
std::shared_ptr< lldb_private::Target > TargetSP