summaryrefslogtreecommitdiffstats
path: root/lldb/source/Target/Target.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2012-05-12 00:26:42 +0000
committerGreg Clayton <gclayton@apple.com>2012-05-12 00:26:42 +0000
commit1a362fbb8621ed85c0b4f611c5f1e4aaba6b210b (patch)
tree239a9e017e6def9964f6b649feb82262db657de2 /lldb/source/Target/Target.cpp
parentd918f77ba31a75aac56f5241dcff7b42107387cc (diff)
downloadbcm5719-llvm-1a362fbb8621ed85c0b4f611c5f1e4aaba6b210b.tar.gz
bcm5719-llvm-1a362fbb8621ed85c0b4f611c5f1e4aaba6b210b.zip
<rdar://problem/11439169>
"lldb -a i386" doesn't set the calculator mode correctly if run on a 64 bit system. The previous logic always used the current host architecture, not the default architecture. The default arch gets set into a static varaible in lldb_private::Target when an arch is set from the command line: lldb -a i386 We now use the default arch correctly. llvm-svn: 156680
Diffstat (limited to 'lldb/source/Target/Target.cpp')
-rw-r--r--lldb/source/Target/Target.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/lldb/source/Target/Target.cpp b/lldb/source/Target/Target.cpp
index 18368e6aa42..410d76ff9e6 100644
--- a/lldb/source/Target/Target.cpp
+++ b/lldb/source/Target/Target.cpp
@@ -1512,10 +1512,12 @@ ArchSpec
Target::GetDefaultArchitecture ()
{
lldb::UserSettingsControllerSP settings_controller_sp (GetSettingsController());
-
+ ArchSpec default_arch;
if (settings_controller_sp)
- return static_cast<Target::SettingsController *>(settings_controller_sp.get())->GetArchitecture ();
- return ArchSpec();
+ default_arch = static_cast<Target::SettingsController *>(settings_controller_sp.get())->GetArchitecture ();
+ if (!default_arch.IsValid())
+ default_arch = Host::GetArchitecture ();
+ return default_arch;
}
void
OpenPOWER on IntegriCloud