[Lldb-commits] [lldb] r139679 - /lldb/trunk/source/Target/Process.cpp
jingham at apple.com
Tue Sep 13 18:01:48 PDT 2011
Date: Tue Sep 13 20:01:48 2011
New Revision: 139679
If we haven't gotten the architecture of the process we're attaching
to by the time we get to the AttachCompletionHandler, do it before
completing the attach.
--- lldb/trunk/source/Target/Process.cpp (original)
+++ lldb/trunk/source/Target/Process.cpp Tue Sep 13 20:01:48 2011
@@ -2167,6 +2167,25 @@
// lldb_private::Process subclasses must set the process must set
// the new process ID.
assert (m_process->GetID() != LLDB_INVALID_PROCESS_ID);
+ // We just attached, if we haven't gotten a valid architecture at this point we should do so now.
+ Target &target = m_process->GetTarget();
+ if (!target.GetArchitecture().IsValid())
+ // FIXME: We shouldn't be getting the Selected Platform, there should
+ // be a platform for the target, and we should get that.
+ PlatformSP platform_sp (target.GetDebugger().GetPlatformList().GetSelectedPlatform ());
+ if (platform_sp)
+ ProcessInstanceInfo process_info;
+ platform_sp->GetProcessInfo (m_process->GetID(), process_info);
+ const ArchSpec &process_arch = process_info.GetArchitecture();
+ if (process_arch.IsValid())
+ // Set the architecture on the target.
+ target.SetArchitecture (process_arch);
More information about the lldb-commits