<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.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@156680 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Target/Target.cpp b/source/Target/Target.cpp
index 18368e6..410d76f 100644
--- a/source/Target/Target.cpp
+++ b/source/Target/Target.cpp
@@ -1512,10 +1512,12 @@
 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