The DynamicLoader plug-in instance now lives up in lldb_private::Process where
it should live and the lldb_private::Process takes care of managing the
auto pointer to the dynamic loader instance.
Also, now that the ArchSpec contains the target triple, we are able to
correctly set the Target architecture in DidLaunch/DidAttach in the subclasses,
and then the lldb_private::Process will find the dynamic loader plug-in
by letting the dynamic loader plug-ins inspect the arch/triple in the target.
So now the ProcessGDBRemote plug-in is another step closer to be purely
process/platform agnostic.
I updated the ProcessMacOSX and the ProcessLinux plug-ins accordingly.
git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@125650 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Host/common/Host.cpp b/source/Host/common/Host.cpp
index 64d1235..20709de 100644
--- a/source/Host/common/Host.cpp
+++ b/source/Host/common/Host.cpp
@@ -261,20 +261,20 @@
if (is_64_bit_capable)
{
+#if defined (__i386__) || defined (__x86_64__)
+ if (cpusubtype == CPU_SUBTYPE_486)
+ cpusubtype = CPU_SUBTYPE_I386_ALL;
+#endif
if (cputype & CPU_ARCH_ABI64)
{
// We have a 64 bit kernel on a 64 bit system
- g_host_arch_32.SetMachOArch (CPU_TYPE_I386, CPU_SUBTYPE_386);
+ g_host_arch_32.SetMachOArch (~(CPU_ARCH_MASK) & cputype, cpusubtype);
g_host_arch_64.SetMachOArch (cputype, cpusubtype);
}
else
{
// We have a 32 bit kernel on a 64 bit system
g_host_arch_32.SetMachOArch (cputype, cpusubtype);
-#if defined (__i386__) || defined (__x86_64__)
- if (cpusubtype == CPU_SUBTYPE_486)
- cpusubtype = CPU_SUBTYPE_I386_ALL;
-#endif
cputype |= CPU_ARCH_ABI64;
g_host_arch_64.SetMachOArch (cputype, cpusubtype);
}