Loading universal mach-o executables

When using a universal mach-o executable it fails in lld on loading the ObjectFile (and resets the module to null, thus failing to load with a nice memory access error). I did see that there's an ObjectContainer for universal mach-o executables but that's not triggered during ModuleList.GetSharedModule (Which is used by ResolveExecutable). What can I do to get this working? I load the file first then connect to a remote server for debugging purposes.

It does work on the Mac. Make sure your platform is set and also do specify an architecture so the ObjectContainer can extract the right arch. Make sure the universal object container is loaded and in the plug-in list. To verify, step through the code in ObjectFile::FindPlugin().

Op 6-11-2012 18:53, Greg Clayton schreef:

When using a universal mach-o executable it fails in lld on loading the ObjectFile (and resets the module to null, thus failing to load with a nice memory access error). I did see that there's an ObjectContainer for universal mach-o executables but that's not triggered during ModuleList.GetSharedModule (Which is used by ResolveExecutable). What can I do to get this working? I load the file first then connect to a remote server for debugging purposes.

It does work on the Mac. Make sure your platform is set and also do
specify an architecture so the ObjectContainer can extract the right
arch. Make sure the universal object container is loaded and in the
plug-in list. To verify, step through the code in
ObjectFile::FindPlugin().

Problem is that at the time I load it, I don't know the architecture yet. The remote server knows, but I need an SBTarget to connect to the remote server, and creating a target (SBDebugger::CreateTarget) requires the filename and architecture (at which point it fails to load).

Op 7-11-2012 15:17, Carlo Kok schreef:

Op 6-11-2012 18:53, Greg Clayton schreef:

When using a universal mach-o executable it fails in lld on loading
the ObjectFile (and resets the module to null, thus failing to load
with a nice memory access error). I did see that there's an
ObjectContainer for universal mach-o executables but that's not
triggered during ModuleList.GetSharedModule (Which is used by
ResolveExecutable). What can I do to get this working? I load the
file first then connect to a remote server for debugging purposes.

It does work on the Mac. Make sure your platform is set and also do
specify an architecture so the ObjectContainer can extract the right
arch. Make sure the universal object container is loaded and in the
plug-in list. To verify, step through the code in
ObjectFile::FindPlugin().

Problem is that at the time I load it, I don't know the architecture
yet. The remote server knows, but I need an SBTarget to connect to the
remote server, and creating a target (SBDebugger::CreateTarget) requires
the filename and architecture (at which point it fails to load).

Nevermind this. I solved it completely different.

Carlo Kok