On macOS one Mach-O slice can contain multiple load commands: One load command for being loaded into a macOS process and one load command for being loaded into a macCatalyst process. This patch adds support for the new load command and makes sure ObjectFileMachO returns the Architecture that matches the Module.
Details
Diff Detail
Event Timeline
lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp | ||
---|---|---|
1111 | 'required' here sounds weird as we're testing against multiple ones. "Matching" maybe? | |
1126 | "all only"? | |
1128 | Is MapFileData guaranteed to succeed? (ie return a valid data_sp) | |
4976 | can this be a const ref to make it clear it's not an output parameter? | |
4977 | Can ModuleSpecList be moved efficiently? If so, could we return it with NRVO rather than using an output param? | |
5060 | Can we merge this loop with the above one? Are there binaries with both LC_VERSION_MIN and LC_BUILD_VERSION? If so merging would give different results. | |
5072–5073 | Does struct build_version_command have exactly the same size on every platform? Even if that's true, it seems like it would be more principled to extract each field in turn. |
This generally looks good. Feel free to address the stylistic bits you find relevant in follow-up patches.
lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp | ||
---|---|---|
4977 | Sorry, NRVO has nothing to do with move semantics. Move semantics could be another way to return it cheaply though... |
'required' here sounds weird as we're testing against multiple ones. "Matching" maybe?