summaryrefslogtreecommitdiffstats
path: root/lldb/source/Target/Process.cpp
diff options
context:
space:
mode:
authorJason Molenda <jmolenda@apple.com>2012-05-03 22:37:30 +0000
committerJason Molenda <jmolenda@apple.com>2012-05-03 22:37:30 +0000
commit16d127cb7bb31e0c38b296ac977280353e6e5c14 (patch)
tree228ad3770579272cc38f2d4d06e259c28f8d4165 /lldb/source/Target/Process.cpp
parent356782f5f6dafe135e252a676ffb3f64e734ace6 (diff)
downloadbcm5719-llvm-16d127cb7bb31e0c38b296ac977280353e6e5c14.tar.gz
bcm5719-llvm-16d127cb7bb31e0c38b296ac977280353e6e5c14.zip
In ProcessGDBRemote::DoConnectRemote(), if the remote system informed
us of its architecture, use that to set the Target's arch if it doesn't already have one set. In Process::CompleteAttach(), if the Target has a valid arch make sure that the Platform we pick up is compatible with that arch; if not, find a Platform that is compatible. Don't let the the default platform override the Target's arch. <rdar://problem/11185420> llvm-svn: 156116
Diffstat (limited to 'lldb/source/Target/Process.cpp')
-rw-r--r--lldb/source/Target/Process.cpp22
1 files changed, 17 insertions, 5 deletions
diff --git a/lldb/source/Target/Process.cpp b/lldb/source/Target/Process.cpp
index 2a02bd52d17..deb657c2664 100644
--- a/lldb/source/Target/Process.cpp
+++ b/lldb/source/Target/Process.cpp
@@ -2741,11 +2741,23 @@ Process::CompleteAttach ()
assert (platform_sp.get());
if (platform_sp)
{
- ProcessInstanceInfo process_info;
- platform_sp->GetProcessInfo (GetID(), process_info);
- const ArchSpec &process_arch = process_info.GetArchitecture();
- if (process_arch.IsValid() && m_target.GetArchitecture() != process_arch)
- m_target.SetArchitecture (process_arch);
+ const ArchSpec &target_arch = m_target.GetArchitecture();
+ if (target_arch.IsValid() && !platform_sp->IsCompatibleWithArchitecture (target_arch))
+ {
+ platform_sp = platform_sp->GetPlatformForArchitecture (target_arch);
+ if (platform_sp)
+ {
+ m_target.SetPlatform (platform_sp);
+ }
+ }
+ else
+ {
+ ProcessInstanceInfo process_info;
+ platform_sp->GetProcessInfo (GetID(), process_info);
+ const ArchSpec &process_arch = process_info.GetArchitecture();
+ if (process_arch.IsValid() && m_target.GetArchitecture() != process_arch)
+ m_target.SetArchitecture (process_arch);
+ }
}
// We have completed the attach, now it is time to find the dynamic loader
OpenPOWER on IntegriCloud