Add UserSettings to Target class, making Target settings
the parent of Process settings;   add 'default-arch' as a
class-wide setting for Target.    Replace            lldb::GetDefaultArchitecture
with Target::GetDefaultArchitecture & Target::SetDefaultArchitecture.

Add 'use-external-editor' as user setting to Debugger class & update
code appropriately.

Add Error parameter to methods that get user settings, for easier
reporting of bad requests.

Fix various other minor related bugs.

Fix test cases to work with new changes.




git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@114352 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/API/SBDebugger.cpp b/source/API/SBDebugger.cpp
index acf98dd..0a48e69 100644
--- a/source/API/SBDebugger.cpp
+++ b/source/API/SBDebugger.cpp
@@ -303,7 +303,8 @@
 {
     if (arch_name && arch_name_len)
     {
-        ArchSpec &default_arch = lldb_private::GetDefaultArchitecture ();
+        ArchSpec default_arch = lldb_private::Target::GetDefaultArchitecture ();
+
         if (default_arch.IsValid())
         {
             ::snprintf (arch_name, arch_name_len, "%s", default_arch.AsCString());
@@ -324,7 +325,7 @@
         ArchSpec arch (arch_name);
         if (arch.IsValid())
         {
-            lldb_private::GetDefaultArchitecture () = arch;
+            lldb_private::Target::SetDefaultArchitecture (arch);
             return true;
         }
     }
@@ -388,7 +389,7 @@
     if (m_opaque_sp)
     {
         FileSpec file (filename);
-        ArchSpec arch = lldb_private::GetDefaultArchitecture();
+        ArchSpec arch = lldb_private::Target::GetDefaultArchitecture ();
         TargetSP target_sp;
         Error error;
 
@@ -431,7 +432,7 @@
     if (m_opaque_sp)
     {
         FileSpec file (filename);
-        ArchSpec arch = lldb_private::GetDefaultArchitecture();
+        ArchSpec arch = lldb_private::Target::GetDefaultArchitecture ();
         TargetSP target_sp;
         Error error;
 
@@ -593,12 +594,22 @@
 {
     SBStringList ret_value;
     lldb::SettableVariableType var_type;
+    lldb_private:Error err;
 
     lldb::UserSettingsControllerSP root_settings_controller = lldb_private::Debugger::GetSettingsController();
 
-    StringList value = root_settings_controller->GetVariable (var_name, var_type, debugger_instance_name);
-    for (unsigned i = 0; i != value.GetSize(); ++i)
-        ret_value.AppendString (value.GetStringAtIndex(i));
+    StringList value = root_settings_controller->GetVariable (var_name, var_type, debugger_instance_name, err);
+    
+    if (err.Success())
+    {
+        for (unsigned i = 0; i != value.GetSize(); ++i)
+            ret_value.AppendString (value.GetStringAtIndex(i));
+    }
+    else
+    {
+        ret_value.AppendString (err.AsCString());
+    }
+
 
     return ret_value;
 }
@@ -662,10 +673,10 @@
 }
 
 bool
-SBDebugger::UseExternalEditor ()
+SBDebugger::GetUseExternalEditor ()
 {
     if (m_opaque_sp)
-        return m_opaque_sp->UseExternalEditor ();
+        return m_opaque_sp->GetUseExternalEditor ();
     else
         return false;
 }