This patch is primarily to ProcessMachCore to correctly load a firmware/standalone main binary in a corefile which is using the "main bin spec" LC_NOTE. There's already support for this for a "kern ver str" LC_NOTE that includes a UUID to load, this patch extends that to the other LC_NOTE and also sets the load address on the binary it locates to 0 (no-slide) as a default loading. I also stopped an unnecessary scan over the corefile looking for user-process dyld or kernel binaries once I'd already gotten one of these two LC_NOTEs.
I also modified ObjectFile::GetCorefileMainBinaryInfo to pass up the type of binary that was specified, which was in the "main bin spec" but not returned previously.
The test case is based on the one I wrote earlier for test/API/macosx/lc-note/kern-ver-str. It adds the ability to write both types of LC_NOTEs (kern ver str, main bin spec) and compiles two binaries (with random UUIDs). It creates a dsym-for-uuid.sh that recognizes the two UUIDs and points to the correct binaries/dSYMs, creates corefiles using the tool it built earlier, and runs lldb against the corefiles to confirm that the binaries are loaded correctly. It only runs on macOS x86_64 systems for now.
I'm not sure there's anyone who's really interested in reviewing this one; ProcessMachCore is my back yard in the codebase :) but I'm open to any comments or suggestions, naturally.
clang-tidy: error: 'lldb/Core/FileSpecList.h' file not found [clang-diagnostic-error]
not useful