Go to the documentation of this file.
9 #ifndef LLDB_CORE_MODULESPEC_H
10 #define LLDB_CORE_MODULESPEC_H
20 #include "llvm/Support/Chrono.h"
35 lldb::DataBufferSP data = lldb::DataBufferSP())
142 explicit operator bool()
const {
163 bool dumped_something =
false;
168 dumped_something =
true;
171 if (dumped_something)
176 dumped_something =
true;
179 if (dumped_something)
184 dumped_something =
true;
187 if (dumped_something)
191 dumped_something =
true;
194 if (dumped_something)
198 dumped_something =
true;
201 if (dumped_something)
204 dumped_something =
true;
207 if (dumped_something)
210 dumped_something =
true;
213 if (dumped_something)
216 dumped_something =
true;
219 if (dumped_something)
221 strm.
Format(
"object_mod_time = {0:x+}",
227 bool exact_arch_match)
const {
248 if (exact_arch_match) {
280 std::lock_guard<std::recursive_mutex> lhs_guard(
m_mutex);
281 std::lock_guard<std::recursive_mutex> rhs_guard(rhs.
m_mutex);
290 std::lock_guard<std::recursive_mutex> lhs_guard(
m_mutex, std::adopt_lock);
291 std::lock_guard<std::recursive_mutex> rhs_guard(rhs.
m_mutex,
299 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
304 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
309 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
314 std::lock_guard<std::recursive_mutex> lhs_guard(
m_mutex);
315 std::lock_guard<std::recursive_mutex> rhs_guard(rhs.
m_mutex);
324 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
335 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
336 bool exact_arch_match =
true;
338 if (spec.Matches(module_spec, exact_arch_match)) {
339 match_module_spec = spec;
346 exact_arch_match =
false;
348 if (spec.Matches(module_spec, exact_arch_match)) {
349 match_module_spec = spec;
354 match_module_spec.
Clear();
360 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
361 bool exact_arch_match =
true;
362 const size_t initial_match_count = matching_list.
GetSize();
364 if (spec.Matches(module_spec, exact_arch_match))
365 matching_list.
Append(spec);
371 (initial_match_count == matching_list.
GetSize())) {
372 exact_arch_match =
false;
374 if (spec.Matches(module_spec, exact_arch_match))
375 matching_list.
Append(spec);
381 std::lock_guard<std::recursive_mutex> guard(
m_mutex);
384 strm.
Printf(
"[%u] ", idx);
393 std::recursive_mutex>
407 #endif // LLDB_CORE_MODULESPEC_H
ModuleSpecList & operator=(const ModuleSpecList &rhs)
void Format(const char *format, Args &&... args)
const FileSpec & GetSymbolFileSpec() const
const FileSpec * GetPlatformFileSpecPtr() const
const FileSpec & GetFileSpec() const
FileSpec & GetPlatformFileSpec()
ModuleSpecIterable ModuleSpecs()
void Append(const ModuleSpec &spec)
void Dump(Stream &strm) const
lldb::DataBufferSP m_data
ConstString & GetObjectName()
lldb::DataBufferSP GetData() const
PathMappingList m_source_mappings
E vector_adapter(I &iter)
const ArchSpec * GetArchitecturePtr() const
ConstString m_object_name
std::vector< ModuleSpec > collection
void SetObjectOffset(uint64_t object_offset)
LockingAdaptedIterable< collection, ModuleSpec, vector_adapter, std::recursive_mutex > ModuleSpecIterable
FileSpec * GetFileSpecPtr()
FileSpec & GetSymbolFileSpec()
void DumpTriple(llvm::raw_ostream &s) const
PathMappingList & GetSourceMappingList() const
bool Matches(const ModuleSpec &match_module_spec, bool exact_arch_match) const
const FileSpec * GetSymbolFileSpecPtr() const
llvm::sys::TimePoint & GetObjectModificationTime()
const UUID * GetUUIDPtr() const
static bool Match(const FileSpec &pattern, const FileSpec &file)
Match FileSpec pattern against FileSpec file.
FileSpec * GetSymbolFileSpecPtr()
std::recursive_mutex m_mutex
uint64_t GetByteSize(const FileSpec &file_spec) const
Returns the on-disk size of the given file in bytes.
ModuleSpec & GetModuleSpecRefAtIndex(size_t i)
ModuleSpecList(const ModuleSpecList &rhs)
bool IsValid() const
Tests if this ArchSpec is valid.
bool FindMatchingModuleSpec(const ModuleSpec &module_spec, ModuleSpec &match_module_spec) const
llvm::sys::TimePoint m_object_mod_time
~ModuleSpecList()=default
const UUID & GetUUID() const
void Clear()
Clears the object state.
void Clear()
Clear this object's state.
void Dump(Stream *s) const
void Append(const ModuleSpecList &rhs)
const llvm::sys::TimePoint & GetObjectModificationTime() const
ArchSpec * GetArchitecturePtr()
size_t EOL()
Output and End of Line character to the stream.
llvm::raw_ostream & AsRawOstream()
Returns a raw_ostream that forwards the data to this Stream object.
const FileSpec * GetFileSpecPtr() const
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...
const char * GetCString() const
Get the string value as a C string.
ArchSpec & GetArchitecture()
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
static FileSystem & Instance()
void SetObjectSize(uint64_t object_size)
collection m_specs
The collection of modules.
A class that represents a running process on the host machine.
ModuleSpec(const FileSpec &file_spec, const ArchSpec &arch)
void FindMatchingModuleSpecs(const ModuleSpec &module_spec, ModuleSpecList &matching_list) const
bool GetModuleSpecAtIndex(size_t i, ModuleSpec &module_spec) const
size_t PutCString(llvm::StringRef cstr)
Output a C string to the stream.
const FileSpec & GetPlatformFileSpec() const
ConstString GetObjectName() const
FileSpec * GetPlatformFileSpecPtr()
const ArchSpec & GetArchitecture() const
uint64_t GetObjectOffset() const
void Clear()
Clears the object state.
uint64_t GetObjectSize() const