[Lldb-commits] [lldb] r113245 - in /lldb/trunk/source: Commands/CommandObjectSettings.cpp Core/Debugger.cpp Core/UserSettingsController.cpp Target/Process.cpp

Caroline Tice ctice at apple.com
Tue Sep 7 11:35:40 PDT 2010


Author: ctice
Date: Tue Sep  7 13:35:40 2010
New Revision: 113245

URL: http://llvm.org/viewvc/llvm-project?rev=113245&view=rev
Log:
Fix various minor bugs in the Settings stuff.


Modified:
    lldb/trunk/source/Commands/CommandObjectSettings.cpp
    lldb/trunk/source/Core/Debugger.cpp
    lldb/trunk/source/Core/UserSettingsController.cpp
    lldb/trunk/source/Target/Process.cpp

Modified: lldb/trunk/source/Commands/CommandObjectSettings.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectSettings.cpp?rev=113245&r1=113244&r2=113245&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectSettings.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectSettings.cpp Tue Sep  7 13:35:40 2010
@@ -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);

Modified: lldb/trunk/source/Core/Debugger.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Debugger.cpp?rev=113245&r1=113244&r2=113245&view=diff
==============================================================================
--- lldb/trunk/source/Core/Debugger.cpp (original)
+++ lldb/trunk/source/Core/Debugger.cpp Tue Sep  7 13:35:40 2010
@@ -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;
 }

Modified: lldb/trunk/source/Core/UserSettingsController.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/UserSettingsController.cpp?rev=113245&r1=113244&r2=113245&view=diff
==============================================================================
--- lldb/trunk/source/Core/UserSettingsController.cpp (original)
+++ lldb/trunk/source/Core/UserSettingsController.cpp Tue Sep  7 13:35:40 2010
@@ -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());

Modified: lldb/trunk/source/Target/Process.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Process.cpp?rev=113245&r1=113244&r2=113245&view=diff
==============================================================================
--- lldb/trunk/source/Target/Process.cpp (original)
+++ lldb/trunk/source/Target/Process.cpp Tue Sep  7 13:35:40 2010
@@ -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;
 }





More information about the lldb-commits mailing list