summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2019-08-23 21:28:14 +0000
committerAdrian Prantl <aprantl@apple.com>2019-08-23 21:28:14 +0000
commitf869ec8d4981afb18356d98a6b27c85d4e2affe3 (patch)
treea3305abd96a266e04957b34e25225be0426ec63d /lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h
parentf7ca57468a6bbdc55e4183e492404aee0d000a8c (diff)
downloadbcm5719-llvm-f869ec8d4981afb18356d98a6b27c85d4e2affe3.tar.gz
bcm5719-llvm-f869ec8d4981afb18356d98a6b27c85d4e2affe3.zip
Upstream support for macCatalyst Mach-O binaries.
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. Differential Revision: https://reviews.llvm.org/D66626 llvm-svn: 369814
Diffstat (limited to 'lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h')
-rw-r--r--lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h48
1 files changed, 31 insertions, 17 deletions
diff --git a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h
index 1185e1ec899..eb843298d07 100644
--- a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h
+++ b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h
@@ -146,23 +146,37 @@ protected:
const lldb_private::DataExtractor &data,
lldb::offset_t lc_offset); // Offset to the first load command
- static lldb_private::ArchSpec
- GetArchitecture(const llvm::MachO::mach_header &header,
- const lldb_private::DataExtractor &data,
- lldb::offset_t lc_offset);
-
- // Intended for same-host arm device debugging where lldb needs to
- // detect libraries in the shared cache and augment the nlist entries
- // with an on-disk dyld_shared_cache file. The process will record
- // the shared cache UUID so the on-disk cache can be matched or rejected
- // correctly.
- void GetProcessSharedCacheUUID(lldb_private::Process *, lldb::addr_t &base_addr, lldb_private::UUID &uuid);
-
- // Intended for same-host arm device debugging where lldb will read
- // shared cache libraries out of its own memory instead of the remote
- // process' memory as an optimization. If lldb's shared cache UUID
- // does not match the process' shared cache UUID, this optimization
- // should not be used.
+ static lldb_private::ArchSpec GetArchitecture(
+ lldb::ModuleSP module_sp, const llvm::MachO::mach_header &header,
+ const lldb_private::DataExtractor &data, lldb::offset_t lc_offset);
+
+ /// Enumerate all ArchSpecs supported by this Mach-O file.
+ ///
+ /// 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. In
+ /// contrast to ObjectContainerUniversalMachO, this is the same
+ /// binary that can be loaded into different contexts.
+ static void GetAllArchSpecs(const llvm::MachO::mach_header &header,
+ const lldb_private::DataExtractor &data,
+ lldb::offset_t lc_offset,
+ lldb_private::ModuleSpec &base_spec,
+ lldb_private::ModuleSpecList &all_specs);
+
+ /// Intended for same-host arm device debugging where lldb needs to
+ /// detect libraries in the shared cache and augment the nlist entries
+ /// with an on-disk dyld_shared_cache file. The process will record
+ /// the shared cache UUID so the on-disk cache can be matched or rejected
+ /// correctly.
+ void GetProcessSharedCacheUUID(lldb_private::Process *,
+ lldb::addr_t &base_addr,
+ lldb_private::UUID &uuid);
+
+ /// Intended for same-host arm device debugging where lldb will read
+ /// shared cache libraries out of its own memory instead of the remote
+ /// process' memory as an optimization. If lldb's shared cache UUID
+ /// does not match the process' shared cache UUID, this optimization
+ /// should not be used.
void GetLLDBSharedCacheUUID(lldb::addr_t &base_addir, lldb_private::UUID &uuid);
lldb_private::Section *GetMachHeaderSection();
OpenPOWER on IntegriCloud