#include "ObjectContainerBSDArchive.h"
#if defined(_WIN32) || defined(__ANDROID__)
#define SARMAG …
#define ARFMAG …
typedef struct ar_hdr {
char ar_name[16];
char ar_date[12];
char ar_uid[6], ar_gid[6];
char ar_mode[8];
char ar_size[10];
char ar_fmag[2];
} ar_hdr;
#else
#include <ar.h>
#endif
#include "lldb/Core/Module.h"
#include "lldb/Core/ModuleSpec.h"
#include "lldb/Core/PluginManager.h"
#include "lldb/Host/FileSystem.h"
#include "lldb/Symbol/ObjectFile.h"
#include "lldb/Utility/ArchSpec.h"
#include "lldb/Utility/LLDBLog.h"
#include "lldb/Utility/Stream.h"
#include "lldb/Utility/Timer.h"
#include "llvm/Object/Archive.h"
#include "llvm/Support/MemoryBuffer.h"
usingnamespacelldb;
usingnamespacelldb_private;
usingnamespacellvm::object;
LLDB_PLUGIN_DEFINE(…)
ObjectContainerBSDArchive::Object::Object() : … { … }
void ObjectContainerBSDArchive::Object::Clear() { … }
void ObjectContainerBSDArchive::Object::Dump() const { … }
ObjectContainerBSDArchive::Archive::Archive(const lldb_private::ArchSpec &arch,
const llvm::sys::TimePoint<> &time,
lldb::offset_t file_offset,
lldb_private::DataExtractor &data,
ArchiveType archive_type)
: … { … }
Log *l = …;
ObjectContainerBSDArchive::Archive::~Archive() = default;
size_t ObjectContainerBSDArchive::Archive::ParseObjects() { … }
ObjectContainerBSDArchive::Object *
ObjectContainerBSDArchive::Archive::FindObject(
ConstString object_name, const llvm::sys::TimePoint<> &object_mod_time) { … }
ObjectContainerBSDArchive::Archive::shared_ptr
ObjectContainerBSDArchive::Archive::FindCachedArchive(
const FileSpec &file, const ArchSpec &arch,
const llvm::sys::TimePoint<> &time, lldb::offset_t file_offset) { … }
ObjectContainerBSDArchive::Archive::shared_ptr
ObjectContainerBSDArchive::Archive::ParseAndCacheArchiveForFile(
const FileSpec &file, const ArchSpec &arch,
const llvm::sys::TimePoint<> &time, lldb::offset_t file_offset,
DataExtractor &data, ArchiveType archive_type) { … }
ObjectContainerBSDArchive::Archive::Map &
ObjectContainerBSDArchive::Archive::GetArchiveCache() { … }
std::recursive_mutex &
ObjectContainerBSDArchive::Archive::GetArchiveCacheMutex() { … }
void ObjectContainerBSDArchive::Initialize() { … }
void ObjectContainerBSDArchive::Terminate() { … }
ObjectContainer *ObjectContainerBSDArchive::CreateInstance(
const lldb::ModuleSP &module_sp, DataBufferSP &data_sp,
lldb::offset_t data_offset, const FileSpec *file,
lldb::offset_t file_offset, lldb::offset_t length) { … }
ArchiveType
ObjectContainerBSDArchive::MagicBytesMatch(const DataExtractor &data) { … }
ObjectContainerBSDArchive::ObjectContainerBSDArchive(
const lldb::ModuleSP &module_sp, DataBufferSP &data_sp,
lldb::offset_t data_offset, const lldb_private::FileSpec *file,
lldb::offset_t file_offset, lldb::offset_t size, ArchiveType archive_type)
: … { … }
void ObjectContainerBSDArchive::SetArchive(Archive::shared_ptr &archive_sp) { … }
ObjectContainerBSDArchive::~ObjectContainerBSDArchive() = default;
bool ObjectContainerBSDArchive::ParseHeader() { … }
FileSpec GetChildFileSpecificationsFromThin(llvm::StringRef childPath,
const FileSpec &parentFileSpec) { … }
ObjectFileSP ObjectContainerBSDArchive::GetObjectFile(const FileSpec *file) { … }
size_t ObjectContainerBSDArchive::GetModuleSpecifications(
const lldb_private::FileSpec &file, lldb::DataBufferSP &data_sp,
lldb::offset_t data_offset, lldb::offset_t file_offset,
lldb::offset_t file_size, lldb_private::ModuleSpecList &specs) { … }