Fix various minor bugs in the Settings stuff.

llvm-svn: 113245
diff --git a/lldb/source/Commands/CommandObjectSettings.cpp b/lldb/source/Commands/CommandObjectSettings.cpp
index a4a3643..ff06172 100644
--- a/lldb/source/Commands/CommandObjectSettings.cpp
+++ b/lldb/source/Commands/CommandObjectSettings.cpp
@@ -82,7 +82,7 @@
 
     const int argc = command.GetArgumentCount ();
 
-    if (argc < 2)
+    if ((argc < 2) && (!m_options.m_reset))
     {
         result.AppendError ("'settings set' takes more arguments");
         result.SetStatus (eReturnStatusFailed);
diff --git a/lldb/source/Core/Debugger.cpp b/lldb/source/Core/Debugger.cpp
index 9ccd2c1..aa7d08a 100644
--- a/lldb/source/Core/Debugger.cpp
+++ b/lldb/source/Core/Debugger.cpp
@@ -689,7 +689,16 @@
       UserSettingsController::UpdateStringVariable (op, m_prompt, value, err);
         if (!pending)
         {
-            BroadcastPromptChange (instance_name, m_prompt.c_str());
+            // 'instance_name' is actually (probably) in the form '[<instance_name>]';  if so, we need to
+            // strip off the brackets before passing it to BroadcastPromptChange.
+
+            std::string tmp_instance_name (instance_name.AsCString());
+            if ((tmp_instance_name[0] == '[') 
+                && (tmp_instance_name[instance_name.GetLength() - 1] == ']'))
+                tmp_instance_name = tmp_instance_name.substr (1, instance_name.GetLength() - 2);
+            ConstString new_name (tmp_instance_name.c_str());
+
+            BroadcastPromptChange (new_name, m_prompt.c_str());
         }
     }
     else if (var_name == ScriptLangVarName())
@@ -746,7 +755,18 @@
 
     m_prompt = new_debugger_settings->m_prompt;
     if (!pending)
-        BroadcastPromptChange (m_instance_name, m_prompt.c_str());
+    {
+        // 'instance_name' is actually (probably) in the form '[<instance_name>]';  if so, we need to
+        // strip off the brackets before passing it to BroadcastPromptChange.
+
+        std::string tmp_instance_name (m_instance_name.AsCString());
+        if ((tmp_instance_name[0] == '[')
+            && (tmp_instance_name[m_instance_name.GetLength() - 1] == ']'))
+            tmp_instance_name = tmp_instance_name.substr (1, m_instance_name.GetLength() - 2);
+        ConstString new_name (tmp_instance_name.c_str());
+
+        BroadcastPromptChange (new_name, m_prompt.c_str());
+    }
   
     m_script_lang = new_debugger_settings->m_script_lang;
 }
diff --git a/lldb/source/Core/UserSettingsController.cpp b/lldb/source/Core/UserSettingsController.cpp
index 554ea76..9fd0c5c 100644
--- a/lldb/source/Core/UserSettingsController.cpp
+++ b/lldb/source/Core/UserSettingsController.cpp
@@ -1042,13 +1042,14 @@
         StringList value = root->GetVariable (full_var_name.GetData(), var_type);
         description.Clear();
         if (value.GetSize() == 1)   
-            description.Printf ("%s (%s) = %s", full_var_name.GetData(), GetTypeString (entry.var_type),
+            description.Printf ("%s (%s) = '%s'", full_var_name.GetData(), GetTypeString (entry.var_type),
                                 value.GetStringAtIndex (0));
         else
         {
-            description.Printf ("%s (%s) = ", full_var_name.GetData(), GetTypeString (entry.var_type));
+            description.Printf ("%s (%s) = '", full_var_name.GetData(), GetTypeString (entry.var_type));
             for (int j = 0; j < value.GetSize(); ++j)
                 description.Printf ("%s ", value.GetStringAtIndex (j));
+            description.Printf ("'");
         }
 
         result_stream.Printf ("%s\n", description.GetData());
diff --git a/lldb/source/Target/Process.cpp b/lldb/source/Target/Process.cpp
index 4a6e269..19b0d4f 100644
--- a/lldb/source/Target/Process.cpp
+++ b/lldb/source/Target/Process.cpp
@@ -2196,7 +2196,7 @@
 const ConstString &
 ProcessInstanceSettings::OutputPathVarName ()
 {
-    static ConstString output_path_var_name ("output_path");
+    static ConstString output_path_var_name ("output-path");
 
     return output_path_var_name;
 }
@@ -2204,7 +2204,7 @@
 const ConstString &
 ProcessInstanceSettings::ErrorPathVarName ()
 {
-    static ConstString error_path_var_name ("error_path");
+    static ConstString error_path_var_name ("error-path");
 
     return error_path_var_name;
 }