LLDB mainline
ObjectContainerMachOFileset.cpp File Reference

Go to the source code of this file.

Functions

template<typename T>
static bool ReadMachOCommand (DataExtractor &data, lldb::offset_t &offset, T &cmd)
 Read a Mach-O load-command header (cmd + cmdsize) from data at offset into cmd, advancing offset by 8 bytes.
static uint32_t MachHeaderSizeFromMagic (uint32_t magic)
static std::optional< mach_header > ParseMachOHeader (DataExtractor &extractor)
static bool ParseFileset (DataExtractor &extractor, mach_header header, std::vector< ObjectContainerMachOFileset::Entry > &entries, std::optional< lldb::addr_t > load_addr=std::nullopt)

Function Documentation

◆ MachHeaderSizeFromMagic()

◆ ParseFileset()

◆ ParseMachOHeader()

◆ ReadMachOCommand()

template<typename T>
bool ReadMachOCommand ( DataExtractor & data,
lldb::offset_t & offset,
T & cmd )
static

Read a Mach-O load-command header (cmd + cmdsize) from data at offset into cmd, advancing offset by 8 bytes.

T may be llvm::MachO::load_command or any of its richer variants (thread_command, dylib_command, encryption_info_command, ...); only the leading cmd/cmdsize fields are touched by this read. Returns false on EOF or on a cmdsize smaller than sizeof(load_command), in which case callers should break out of their load-command loop to avoid spinning on malformed input.

Definition at line 33 of file ObjectContainerMachOFileset.cpp.

References lldb_private::DataExtractor::GetU32().

Referenced by ObjectFileMachO::CreateSections(), ObjectFileMachO::FindLC_NOTEByName(), ObjectFileMachO::GetAllArchSpecs(), ObjectFileMachO::GetDependentModules(), ObjectFileMachO::GetEncryptedFileRanges(), ObjectFileMachO::GetEntryPointAddress(), ObjectFileMachO::GetIdentifierString(), ObjectFileMachO::GetNumThreadContexts(), ObjectFileMachO::GetUUID(), ObjectFileMachO::GetVersion(), ObjectFileMachO::IsStripped(), ParseFileset(), and ObjectFileMachO::ParseSymtab().