#include "ObjectContainerMachOFileset.h"
#include "lldb/Core/Module.h"
#include "lldb/Core/ModuleSpec.h"
#include "lldb/Core/PluginManager.h"
#include "lldb/Symbol/ObjectFile.h"
#include "lldb/Target/Target.h"
#include "lldb/Utility/ArchSpec.h"
#include "lldb/Utility/DataBuffer.h"
#include "lldb/Utility/Stream.h"
#include <optional>
usingnamespacelldb;
usingnamespacelldb_private;
usingnamespacellvm::MachO;
LLDB_PLUGIN_DEFINE(…)
void ObjectContainerMachOFileset::Initialize() { … }
void ObjectContainerMachOFileset::Terminate() { … }
ObjectContainerMachOFileset::ObjectContainerMachOFileset(
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)
: … { … }
ObjectContainerMachOFileset::ObjectContainerMachOFileset(
const lldb::ModuleSP &module_sp, lldb::WritableDataBufferSP data_sp,
const lldb::ProcessSP &process_sp, lldb::addr_t header_addr)
: … { … }
ObjectContainer *ObjectContainerMachOFileset::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) { … }
ObjectContainer *ObjectContainerMachOFileset::CreateMemoryInstance(
const lldb::ModuleSP &module_sp, lldb::WritableDataBufferSP data_sp,
const lldb::ProcessSP &process_sp, lldb::addr_t header_addr) { … }
ObjectContainerMachOFileset::~ObjectContainerMachOFileset() = default;
static uint32_t MachHeaderSizeFromMagic(uint32_t magic) { … }
static std::optional<mach_header> ParseMachOHeader(DataExtractor &data) { … }
static bool
ParseFileset(DataExtractor &data, mach_header header,
std::vector<ObjectContainerMachOFileset::Entry> &entries,
std::optional<lldb::addr_t> load_addr = std::nullopt) { … }
bool ObjectContainerMachOFileset::ParseHeader(
DataExtractor &data, const lldb_private::FileSpec &file,
lldb::offset_t file_offset, std::vector<Entry> &entries) { … }
bool ObjectContainerMachOFileset::ParseHeader() { … }
size_t ObjectContainerMachOFileset::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) { … }
bool ObjectContainerMachOFileset::MagicBytesMatch(DataBufferSP data_sp,
lldb::addr_t data_offset,
lldb::addr_t data_length) { … }
bool ObjectContainerMachOFileset::MagicBytesMatch(const DataExtractor &data) { … }
ObjectFileSP
ObjectContainerMachOFileset::GetObjectFile(const lldb_private::FileSpec *file) { … }
ObjectContainerMachOFileset::Entry *
ObjectContainerMachOFileset::FindEntry(llvm::StringRef id) { … }