Get the correct process architecture in ProcessKDP::DidAttach().
authorGreg Clayton <gclayton@apple.com>
Fri, 31 Oct 2014 00:06:52 +0000 (00:06 +0000)
committerGreg Clayton <gclayton@apple.com>
Fri, 31 Oct 2014 00:06:52 +0000 (00:06 +0000)
<rdar://problem/18806212>

llvm-svn: 220938

lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp

index 584a62c..691f7cc 100644 (file)
@@ -439,7 +439,12 @@ ProcessKDP::DidAttach (ArchSpec &process_arch)
         log->Printf ("ProcessKDP::DidAttach()");
     if (GetID() != LLDB_INVALID_PROCESS_ID)
     {
-        // TODO: figure out the register context that we will use
+        uint32_t cpu = m_comm.GetCPUType();
+        if (cpu)
+        {
+            uint32_t sub = m_comm.GetCPUSubtype();
+            process_arch.SetArchitecture(eArchTypeMachO, cpu, sub);
+        }
     }
 }