9#ifndef LLDB_SOURCE_PLUGINS_OBJECTCONTAINER_BSD_ARCHIVE_OBJECTCONTAINERBSDARCHIVE_H
10#define LLDB_SOURCE_PLUGINS_OBJECTCONTAINER_BSD_ARCHIVE_OBJECTCONTAINERBSDARCHIVE_H
18#include "llvm/Object/Archive.h"
19#include "llvm/Support/Chrono.h"
20#include "llvm/Support/Path.h"
47 return "BSD Archive object container reader.";
86 llvm::StringRef stringTable);
111 typedef std::multimap<lldb_private::FileSpec, shared_ptr>
Map;
114 const llvm::sys::TimePoint<> &mod_time,
lldb::offset_t file_offset,
125 const llvm::sys::TimePoint<> &mod_time,
lldb::offset_t file_offset);
129 const llvm::sys::TimePoint<> &mod_time,
lldb::offset_t file_offset,
143 const llvm::sys::TimePoint<> &object_mod_time);
const Object * GetObjectAtIndex(size_t idx)
ArchiveType GetArchiveType()
ObjectNameToIndexMap m_object_name_to_index_map
const lldb_private::ArchSpec & GetArchitecture() const
llvm::sys::TimePoint m_modification_time
Object * FindObject(lldb_private::ConstString object_name, const llvm::sys::TimePoint<> &object_mod_time)
lldb_private::ArchSpec m_arch
lldb_private::UniqueCStringMap< uint32_t > ObjectNameToIndexMap
static std::recursive_mutex & GetArchiveCacheMutex()
lldb::offset_t m_file_offset
ArchiveType m_archive_type
static Archive::shared_ptr ParseAndCacheArchiveForFile(const lldb_private::FileSpec &file, const lldb_private::ArchSpec &arch, const llvm::sys::TimePoint<> &mod_time, lldb::offset_t file_offset, lldb_private::DataExtractor &data, ArchiveType archive_type)
std::multimap< lldb_private::FileSpec, shared_ptr > Map
lldb_private::DataExtractor m_data
The data for this object container so we don't lose data if the .a files gets modified.
std::shared_ptr< Archive > shared_ptr
size_t GetNumObjects() const
static Map & GetArchiveCache()
const llvm::sys::TimePoint & GetModificationTime()
lldb_private::DataExtractor & GetData()
std::vector< Object > m_objects
lldb::offset_t GetFileOffset() const
bool HasNoExternalReferences() const
void SetArchitecture(const lldb_private::ArchSpec &arch)
static Archive::shared_ptr FindCachedArchive(const lldb_private::FileSpec &file, const lldb_private::ArchSpec &arch, const llvm::sys::TimePoint<> &mod_time, lldb::offset_t file_offset)
static lldb_private::ObjectContainer * CreateInstance(const lldb::ModuleSP &module_sp, lldb::DataBufferSP &data_sp, lldb::offset_t data_offset, const lldb_private::FileSpec *file, lldb::offset_t offset, lldb::offset_t length)
size_t GetNumObjects() const override
Get the number of objects within this object file (archives).
llvm::StringRef GetPluginName() override
static llvm::StringRef GetPluginNameStatic()
lldb::ObjectFileSP GetObjectFile(const lldb_private::FileSpec *file) override
Selects an architecture in an object file.
bool ParseHeader() override
Attempts to parse the object header.
static size_t GetModuleSpecifications(const lldb_private::FileSpec &file, lldb::DataBufferSP &data_sp, lldb::offset_t data_offset, lldb::offset_t file_offset, lldb::offset_t length, lldb_private::ModuleSpecList &specs)
static ArchiveType MagicBytesMatch(const lldb_private::DataExtractor &data)
static llvm::StringRef GetPluginDescriptionStatic()
ArchiveType m_archive_type
~ObjectContainerBSDArchive() override
Archive::shared_ptr m_archive_sp
void SetArchive(Archive::shared_ptr &archive_sp)
An architecture specification class.
A uniqued constant string class.
A plug-in interface definition class for object containers.
std::shared_ptr< lldb_private::ObjectFile > ObjectFileSP
std::shared_ptr< lldb_private::DataBuffer > DataBufferSP
std::shared_ptr< lldb_private::Module > ModuleSP
uint32_t size
Object size in bytes in the archive.
uint32_t modification_time
Object modification time in the archive.
lldb_private::ConstString ar_name
Object name in the archive.
lldb::offset_t Extract(const lldb_private::DataExtractor &data, lldb::offset_t offset)
lldb::offset_t ExtractFromThin(const lldb_private::DataExtractor &data, lldb::offset_t offset, llvm::StringRef stringTable)
lldb::offset_t file_size
Length of the object data.
lldb::offset_t file_offset
File offset in bytes from the beginning of the file of the object data.