mirror of
https://github.com/intel/llvm.git
synced 2026-01-16 13:35:38 +08:00
ObjectFileMachO: split CreateSections mega-function into more manageable chunks
Summary: In an effort to understand the function's operation, I've split it into logical pieces. Parsing of a single segment is moved to a separate function (and the parsing state that is carried from one segment to another is explicitly captured in the SegmentParsingContext object). I've also extracted some pieces of code which were already standalone (validation of the segment load command, determining the section type, determining segment permissions) into separate functions. Parsing of a single section within the segment should probably also be a separate function, but I've left that for a separate patch. This patch is intended to be NFC. Reviewers: clayborg, davide Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D44074 llvm-svn: 326791
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -185,6 +185,18 @@ protected:
|
||||
|
||||
size_t ParseSymtab();
|
||||
|
||||
typedef lldb_private::RangeArray<uint32_t, uint32_t, 8> EncryptedFileRanges;
|
||||
EncryptedFileRanges GetEncryptedFileRanges();
|
||||
|
||||
struct SegmentParsingContext;
|
||||
void ProcessDysymtabCommand(const llvm::MachO::load_command &load_cmd,
|
||||
lldb::offset_t offset);
|
||||
void ProcessSegmentCommand(const llvm::MachO::load_command &load_cmd,
|
||||
lldb::offset_t offset, uint32_t cmd_idx,
|
||||
SegmentParsingContext &context);
|
||||
void SanitizeSegmentCommand(llvm::MachO::segment_command_64 &seg_cmd,
|
||||
uint32_t cmd_idx);
|
||||
|
||||
llvm::MachO::mach_header m_header;
|
||||
static const lldb_private::ConstString &GetSegmentNameTEXT();
|
||||
static const lldb_private::ConstString &GetSegmentNameDATA();
|
||||
|
||||
Reference in New Issue
Block a user