[Lldb-commits] [lldb] r162366 - in /lldb/trunk: include/lldb/ include/lldb/Core/ include/lldb/Interpreter/ include/lldb/Target/ lldb.xcodeproj/ source/API/ source/Commands/ source/Core/ source/Host/common/ source/Interpreter/ source/Plugins/Instruction/ARM/ source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/ source/Plugins/Platform/MacOSX/ source/Target/ test/functionalities/abbreviation/ test/functionalities/completion/ test/functionalities/stop-hook/ test/functionalities/watchpoint/watchpoint_commands/ test/help/ t...

Greg Clayton gclayton at apple.com
Wed Aug 22 10:17:10 PDT 2012


Author: gclayton
Date: Wed Aug 22 12:17:09 2012
New Revision: 162366

URL: http://llvm.org/viewvc/llvm-project?rev=162366&view=rev
Log:
Reimplemented the code that backed the "settings" in lldb. There were many issues with the previous implementation:
- no setting auto completion
- very manual and error prone way of getting/setting variables
- tons of code duplication
- useless instance names for processes, threads

Now settings can easily be defined like option values. The new settings makes use of the "OptionValue" classes so we can re-use the option value code that we use to set settings in command options. No more instances, just "does the right thing".


Added:
    lldb/trunk/include/lldb/Interpreter/OptionValue.h
      - copied, changed from r161327, lldb/trunk/include/lldb/Interpreter/NamedOptionValue.h
    lldb/trunk/include/lldb/Interpreter/OptionValueArch.h
    lldb/trunk/include/lldb/Interpreter/OptionValueArgs.h
    lldb/trunk/include/lldb/Interpreter/OptionValueArray.h
    lldb/trunk/include/lldb/Interpreter/OptionValueBoolean.h
    lldb/trunk/include/lldb/Interpreter/OptionValueDictionary.h
    lldb/trunk/include/lldb/Interpreter/OptionValueEnumeration.h
    lldb/trunk/include/lldb/Interpreter/OptionValueFileSpec.h
    lldb/trunk/include/lldb/Interpreter/OptionValueFileSpecList.h
    lldb/trunk/include/lldb/Interpreter/OptionValueFormat.h
    lldb/trunk/include/lldb/Interpreter/OptionValuePathMappings.h
    lldb/trunk/include/lldb/Interpreter/OptionValueProperties.h
    lldb/trunk/include/lldb/Interpreter/OptionValueRegex.h
    lldb/trunk/include/lldb/Interpreter/OptionValueSInt64.h
    lldb/trunk/include/lldb/Interpreter/OptionValueString.h
    lldb/trunk/include/lldb/Interpreter/OptionValueUInt64.h
    lldb/trunk/include/lldb/Interpreter/OptionValueUUID.h
    lldb/trunk/include/lldb/Interpreter/OptionValues.h
    lldb/trunk/include/lldb/Interpreter/Property.h
    lldb/trunk/source/Interpreter/OptionValue.cpp
      - copied, changed from r161327, lldb/trunk/source/Interpreter/NamedOptionValue.cpp
    lldb/trunk/source/Interpreter/OptionValueArch.cpp
    lldb/trunk/source/Interpreter/OptionValueArgs.cpp
    lldb/trunk/source/Interpreter/OptionValueArray.cpp
    lldb/trunk/source/Interpreter/OptionValueBoolean.cpp
    lldb/trunk/source/Interpreter/OptionValueDictionary.cpp
    lldb/trunk/source/Interpreter/OptionValueEnumeration.cpp
    lldb/trunk/source/Interpreter/OptionValueFileSpec.cpp
    lldb/trunk/source/Interpreter/OptionValueFileSpecLIst.cpp
    lldb/trunk/source/Interpreter/OptionValueFormat.cpp
    lldb/trunk/source/Interpreter/OptionValuePathMappings.cpp
    lldb/trunk/source/Interpreter/OptionValueProperties.cpp
    lldb/trunk/source/Interpreter/OptionValueRegex.cpp
    lldb/trunk/source/Interpreter/OptionValueSInt64.cpp
    lldb/trunk/source/Interpreter/OptionValueString.cpp
    lldb/trunk/source/Interpreter/OptionValueUInt64.cpp
    lldb/trunk/source/Interpreter/OptionValueUUID.cpp
    lldb/trunk/source/Interpreter/Property.cpp
Removed:
    lldb/trunk/include/lldb/Interpreter/NamedOptionValue.h
    lldb/trunk/source/Interpreter/NamedOptionValue.cpp
Modified:
    lldb/trunk/include/lldb/Core/ConstString.h
    lldb/trunk/include/lldb/Core/Debugger.h
    lldb/trunk/include/lldb/Core/Disassembler.h
    lldb/trunk/include/lldb/Core/EmulateInstruction.h
    lldb/trunk/include/lldb/Core/FileSpecList.h
    lldb/trunk/include/lldb/Core/RegularExpression.h
    lldb/trunk/include/lldb/Core/StringList.h
    lldb/trunk/include/lldb/Core/UniqueCStringMap.h
    lldb/trunk/include/lldb/Core/UserSettingsController.h
    lldb/trunk/include/lldb/Interpreter/CommandCompletions.h
    lldb/trunk/include/lldb/Interpreter/OptionGroupBoolean.h
    lldb/trunk/include/lldb/Interpreter/OptionGroupFile.h
    lldb/trunk/include/lldb/Interpreter/OptionGroupFormat.h
    lldb/trunk/include/lldb/Interpreter/OptionGroupOutputFile.h
    lldb/trunk/include/lldb/Interpreter/OptionGroupUInt64.h
    lldb/trunk/include/lldb/Interpreter/OptionGroupUUID.h
    lldb/trunk/include/lldb/Interpreter/OptionGroupVariable.h
    lldb/trunk/include/lldb/Target/PathMappingList.h
    lldb/trunk/include/lldb/Target/Platform.h
    lldb/trunk/include/lldb/Target/Process.h
    lldb/trunk/include/lldb/Target/Target.h
    lldb/trunk/include/lldb/Target/Thread.h
    lldb/trunk/include/lldb/lldb-forward.h
    lldb/trunk/include/lldb/lldb-private-enumerations.h
    lldb/trunk/include/lldb/lldb-private-types.h
    lldb/trunk/lldb.xcodeproj/project.pbxproj
    lldb/trunk/source/API/SBDebugger.cpp
    lldb/trunk/source/Commands/CommandCompletions.cpp
    lldb/trunk/source/Commands/CommandObjectApropos.cpp
    lldb/trunk/source/Commands/CommandObjectMemory.cpp
    lldb/trunk/source/Commands/CommandObjectPlatform.cpp
    lldb/trunk/source/Commands/CommandObjectProcess.cpp
    lldb/trunk/source/Commands/CommandObjectRegister.cpp
    lldb/trunk/source/Commands/CommandObjectSettings.cpp
    lldb/trunk/source/Core/ConstString.cpp
    lldb/trunk/source/Core/Debugger.cpp
    lldb/trunk/source/Core/Disassembler.cpp
    lldb/trunk/source/Core/FileSpecList.cpp
    lldb/trunk/source/Core/RegularExpression.cpp
    lldb/trunk/source/Core/StringList.cpp
    lldb/trunk/source/Core/UserSettingsController.cpp
    lldb/trunk/source/Host/common/FileSpec.cpp
    lldb/trunk/source/Interpreter/CommandInterpreter.cpp
    lldb/trunk/source/Interpreter/OptionGroupValueObjectDisplay.cpp
    lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp
    lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.h
    lldb/trunk/source/Plugins/Instruction/ARM/EmulationStateARM.cpp
    lldb/trunk/source/Plugins/Instruction/ARM/EmulationStateARM.h
    lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp
    lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
    lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.h
    lldb/trunk/source/Target/PathMappingList.cpp
    lldb/trunk/source/Target/Platform.cpp
    lldb/trunk/source/Target/Process.cpp
    lldb/trunk/source/Target/StackFrame.cpp
    lldb/trunk/source/Target/Target.cpp
    lldb/trunk/source/Target/TargetList.cpp
    lldb/trunk/source/Target/Thread.cpp
    lldb/trunk/source/Target/ThreadPlanStepInRange.cpp
    lldb/trunk/test/functionalities/abbreviation/TestAbbreviations.py
    lldb/trunk/test/functionalities/completion/TestCompletion.py
    lldb/trunk/test/functionalities/stop-hook/TestStopHookCmd.py
    lldb/trunk/test/functionalities/watchpoint/watchpoint_commands/TestWatchpointCommands.py
    lldb/trunk/test/help/TestHelp.py
    lldb/trunk/test/settings/TestSettings.py

Modified: lldb/trunk/include/lldb/Core/ConstString.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ConstString.h?rev=162366&r1=162365&r2=162366&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/ConstString.h (original)
+++ lldb/trunk/include/lldb/Core/ConstString.h Wed Aug 22 12:17:09 2012
@@ -60,6 +60,8 @@
     {
     }
 
+    explicit ConstString (const llvm::StringRef &s);
+
     //------------------------------------------------------------------
     /// Construct with C String value
     ///
@@ -375,6 +377,9 @@
     void
     SetCString (const char *cstr);
 
+    void
+    SetString (const llvm::StringRef &s);
+
     //------------------------------------------------------------------
     /// Set the C string value and its mangled counterpart.
     ///

Modified: lldb/trunk/include/lldb/Core/Debugger.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Debugger.h?rev=162366&r1=162365&r2=162366&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/Debugger.h (original)
+++ lldb/trunk/include/lldb/Core/Debugger.h Wed Aug 22 12:17:09 2012
@@ -27,6 +27,7 @@
 #include "lldb/Core/SourceManager.h"
 #include "lldb/Core/UserID.h"
 #include "lldb/Core/UserSettingsController.h"
+#include "lldb/Interpreter/OptionValueProperties.h"
 #include "lldb/Target/ExecutionContext.h"
 #include "lldb/Target/Platform.h"
 #include "lldb/Target/TargetList.h"
@@ -39,267 +40,18 @@
 ///
 /// Provides a global root objects for the debugger core.
 //----------------------------------------------------------------------
-    
-
-class DebuggerInstanceSettings : public InstanceSettings
-{
-public:
-    
-    enum StopDisassemblyType
-    {
-        eStopDisassemblyTypeNever = 0,
-        eStopDisassemblyTypeNoSource,
-        eStopDisassemblyTypeAlways
-    };
-    
-
-    DebuggerInstanceSettings (const lldb::UserSettingsControllerSP &m_owner_sp, bool live_instance = true, const char *name = NULL);
-
-    DebuggerInstanceSettings (const DebuggerInstanceSettings &rhs);
-
-    virtual
-    ~DebuggerInstanceSettings ();
-
-    DebuggerInstanceSettings&
-    operator= (const DebuggerInstanceSettings &rhs);
-
-    void
-    UpdateInstanceSettingsVariable (const ConstString &var_name,
-                                    const char *index_value,
-                                    const char *value,
-                                    const ConstString &instance_name,
-                                    const SettingEntry &entry,
-                                    VarSetOperationType op,
-                                    Error &err,
-                                    bool pending);
-
-    bool
-    GetInstanceSettingsValue (const SettingEntry &entry,
-                              const ConstString &var_name,
-                              StringList &value,
-                              Error *err);
-
-    uint32_t
-    GetTerminalWidth () const
-    {
-        return m_term_width;
-    }
-
-    void
-    SetTerminalWidth (uint32_t term_width)
-    {
-        Error err;
-        if (ValidTermWidthValue(term_width, err))
-            m_term_width = term_width;
-    }
-
-    uint32_t
-    GetStopSourceLineCount (bool before) const
-    {
-        if (before)
-            return m_stop_source_before_count;
-        else
-            return m_stop_source_after_count;
-    }
-
-    
-    void
-    SetStopSourceLineCount (bool before, uint32_t n)
-    {
-        if (before)
-            m_stop_source_before_count = n;
-        else
-            m_stop_source_after_count = n;
-    }
-
-    StopDisassemblyType
-    GetStopDisassemblyDisplay () const
-    {
-        return m_stop_disassembly_display;
-    }
-    
-
-    uint32_t
-    GetDisassemblyLineCount () const
-    {
-        return m_stop_disassembly_count;
-    }
-    
-    void
-    SetDisassemblyLineCount (uint32_t n)
-    {
-        m_stop_disassembly_count = n;
-    }
-    
-    const char *
-    GetPrompt() const
-    {
-        return m_prompt.c_str();
-    }
-
-    void
-    SetPrompt(const char *p)
-    {
-        if (p)
-            m_prompt.assign (p);
-        else
-            m_prompt.assign ("(lldb) ");
-        BroadcastPromptChange (m_instance_name, m_prompt.c_str());
-    }
-    
-    bool
-    GetNotifyVoid() const
-    {
-        return m_notify_void;
-    }
-
-    const char *
-    GetFrameFormat() const
-    {
-        return m_frame_format.c_str();
-    }
-
-    bool
-    SetFrameFormat(const char *frame_format)
-    {
-        if (frame_format && frame_format[0])
-        {
-            m_frame_format.assign (frame_format);
-            return true;
-        }
-        return false;
-    }
-
-    const char *
-    GetThreadFormat() const
-    {
-        return m_thread_format.c_str();
-    }
-
-    bool
-    SetThreadFormat(const char *thread_format)
-    {
-        if (thread_format && thread_format[0])
-        {
-            m_thread_format.assign (thread_format);
-            return true;
-        }
-        return false;
-    }
-
-    lldb::ScriptLanguage 
-    GetScriptLanguage() const
-    {
-        return m_script_lang;
-    }
-
-    void
-    SetScriptLanguage (lldb::ScriptLanguage script_lang)
-    {
-        m_script_lang = script_lang;
-    }
-
-    bool
-    GetUseExternalEditor () const
-    {
-        return m_use_external_editor;
-    }
-
-    bool
-    SetUseExternalEditor (bool use_external_editor_p)
-    {
-        bool old_value = m_use_external_editor;
-        m_use_external_editor = use_external_editor_p;
-        return old_value;
-    }
-    
-    bool 
-    GetAutoConfirm () const
-    {
-        return m_auto_confirm_on;
-    }
-    
-    void
-    SetAutoConfirm (bool auto_confirm_on) 
-    {
-        m_auto_confirm_on = auto_confirm_on;
-    }
-    
-protected:
-
-    void
-    CopyInstanceSettings (const lldb::InstanceSettingsSP &new_settings,
-                          bool pending);
-
-    bool
-    BroadcastPromptChange (const ConstString &instance_name, const char *new_prompt);
-
-    bool
-    ValidTermWidthValue (const char *value, Error err);
-
-    bool
-    ValidTermWidthValue (uint32_t value, Error err);
-
-    const ConstString
-    CreateInstanceName ();
-
-    static OptionEnumValueElement g_show_disassembly_enum_values[];
-
-private:
-
-    uint32_t m_term_width;
-    uint32_t m_stop_source_before_count;
-    uint32_t m_stop_source_after_count;
-    uint32_t m_stop_disassembly_count;
-    StopDisassemblyType m_stop_disassembly_display;
-    std::string m_prompt;
-    bool m_notify_void;
-    std::string m_frame_format;
-    std::string m_thread_format;
-    lldb::ScriptLanguage m_script_lang;
-    bool m_use_external_editor;
-    bool m_auto_confirm_on;
-};
-
 
 
 class Debugger :
     public STD_ENABLE_SHARED_FROM_THIS(Debugger),
     public UserID,
-    public DebuggerInstanceSettings,
+    public Properties,
     public BroadcasterManager
 {
 friend class SourceManager;  // For GetSourceFileCache.
 
 public:
 
-    class SettingsController : public UserSettingsController
-    {
-    public:
-
-        SettingsController ();
-
-        virtual
-        ~SettingsController ();
-
-        static SettingEntry global_settings_table[];
-        static SettingEntry instance_settings_table[];
-
-    protected:
-
-        lldb::InstanceSettingsSP
-        CreateInstanceSettings (const char *instance_name);
-
-    private:
-
-        // Class-wide settings.
-
-        DISALLOW_COPY_AND_ASSIGN (SettingsController);
-    };
-
-    static lldb::UserSettingsControllerSP &
-    GetSettingsController ();
-
     static lldb::DebuggerSP
     CreateInstance (lldb::LogOutputCallback log_callback = NULL, void *baton = NULL);
 
@@ -499,6 +251,69 @@
     void
     SetLoggingCallback (lldb::LogOutputCallback log_callback, void *baton);
     
+
+    //----------------------------------------------------------------------
+    // Properties Functions
+    //----------------------------------------------------------------------
+    enum StopDisassemblyType
+    {
+        eStopDisassemblyTypeNever = 0,
+        eStopDisassemblyTypeNoSource,
+        eStopDisassemblyTypeAlways
+    };
+    
+    bool
+    GetAutoConfirm () const;
+    
+    const char *
+    GetFrameFormat() const;
+    
+    const char *
+    GetThreadFormat() const;
+    
+    lldb::ScriptLanguage
+    GetScriptLanguage() const;
+    
+    bool
+    SetScriptLanguage (lldb::ScriptLanguage script_lang);
+    
+    uint32_t
+    GetTerminalWidth () const;
+    
+    bool
+    SetTerminalWidth (uint32_t term_width);
+    
+    const char *
+    GetPrompt() const;
+    
+    void
+    SetPrompt(const char *p);
+    
+    bool
+    GetUseExternalEditor () const;
+    
+    bool
+    SetUseExternalEditor (bool use_external_editor_p);
+    
+    uint32_t
+    GetStopSourceLineCount (bool before) const;
+    
+    StopDisassemblyType
+    GetStopDisassemblyDisplay () const;
+    
+    uint32_t
+    GetDisassemblyLineCount () const;
+    
+    bool
+    GetNotifyVoid () const;
+
+    
+    const ConstString &
+    GetInstanceName()
+    {
+        return m_instance_name;
+    }
+
 protected:
 
     static void
@@ -518,7 +333,6 @@
     {
         return m_source_file_cache;
     }
-
     Communication m_input_comm;
     StreamFile m_input_file;
     StreamFile m_output_file;
@@ -536,6 +350,7 @@
     typedef std::map<std::string, lldb::StreamSP> LogStreamMap;
     LogStreamMap m_log_streams;
     lldb::StreamSP m_log_callback_stream_sp;
+    ConstString m_instance_name;
 
 private:
 

Modified: lldb/trunk/include/lldb/Core/Disassembler.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Disassembler.h?rev=162366&r1=162365&r2=162366&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/Disassembler.h (original)
+++ lldb/trunk/include/lldb/Core/Disassembler.h Wed Aug 22 12:17:09 2012
@@ -22,7 +22,7 @@
 #include "lldb/Core/EmulateInstruction.h"
 #include "lldb/Core/Opcode.h"
 #include "lldb/Core/PluginInterface.h"
-#include "lldb/Interpreter/NamedOptionValue.h"
+#include "lldb/Interpreter/OptionValue.h"
 
 namespace lldb_private {
 

Modified: lldb/trunk/include/lldb/Core/EmulateInstruction.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/EmulateInstruction.h?rev=162366&r1=162365&r2=162366&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/EmulateInstruction.h (original)
+++ lldb/trunk/include/lldb/Core/EmulateInstruction.h Wed Aug 22 12:17:09 2012
@@ -18,7 +18,6 @@
 #include "lldb/Core/PluginInterface.h"
 #include "lldb/Core/Opcode.h"
 #include "lldb/Core/RegisterValue.h"
-#include "lldb/Interpreter/NamedOptionValue.h"
 
 //----------------------------------------------------------------------
 /// @class EmulateInstruction EmulateInstruction.h "lldb/Core/EmulateInstruction.h"

Modified: lldb/trunk/include/lldb/Core/FileSpecList.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/FileSpecList.h?rev=162366&r1=162365&r2=162366&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/FileSpecList.h (original)
+++ lldb/trunk/include/lldb/Core/FileSpecList.h Wed Aug 22 12:17:09 2012
@@ -185,6 +185,44 @@
     uint32_t
     GetSize () const;
 
+    bool
+    Insert (uint32_t idx, const FileSpec &file)
+    {
+        if (idx < m_files.size())
+        {
+            m_files.insert(m_files.begin() + idx, file);
+            return true;
+        }
+        else if (idx == m_files.size())
+        {
+            m_files.push_back(file);
+            return true;
+        }
+        return false;
+    }
+
+    bool
+    Replace (uint32_t idx, const FileSpec &file)
+    {
+        if (idx < m_files.size())
+        {
+            m_files[idx] = file;
+            return true;
+        }
+        return false;
+    }
+
+    bool
+    Remove (uint32_t idx)
+    {
+        if (idx < m_files.size())
+        {
+            m_files.erase(m_files.begin() + idx);
+            return true;
+        }
+        return false;
+    }
+
     static size_t GetFilesMatchingPartialPath (const char *path, bool dir_okay, FileSpecList &matches);
 
 protected:

Modified: lldb/trunk/include/lldb/Core/RegularExpression.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/RegularExpression.h?rev=162366&r1=162365&r2=162366&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/RegularExpression.h (original)
+++ lldb/trunk/include/lldb/Core/RegularExpression.h Wed Aug 22 12:17:09 2012
@@ -168,6 +168,21 @@
     bool
     IsValid () const;
     
+    void
+    Clear ()
+    {
+        Free();
+        m_re.clear();
+        m_compile_flags = 0;
+        m_comp_err = 1;
+    }
+    
+    int
+    GetErrorCode() const
+    {
+        return m_comp_err;
+    }
+
     bool
     operator < (const RegularExpression& rhs) const;
 

Modified: lldb/trunk/include/lldb/Core/StringList.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/StringList.h?rev=162366&r1=162365&r2=162366&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/StringList.h (original)
+++ lldb/trunk/include/lldb/Core/StringList.h Wed Aug 22 12:17:09 2012
@@ -31,6 +31,9 @@
     ~StringList ();
 
     void
+    AppendString (const std::string &s);
+    
+    void
     AppendString (const char *str);
 
     void
@@ -81,7 +84,19 @@
 
     StringList&
     operator << (StringList strings);
-        
+    
+    // This string list contains a list of valid auto completion
+    // strings, and the "s" is passed in. "matches" is filled in
+    // with zero or more string values that start with "s", and
+    // the first string to exactly match one of the string
+    // values in this collection, will have "exact_matches_idx"
+    // filled in to match the index, or "exact_matches_idx" will
+    // have SIZE_MAX
+    size_t
+    AutoComplete (const char *s,
+                  StringList &matches,
+                  size_t &exact_matches_idx) const;
+
 private:
 
     STLStringArray m_strings;

Modified: lldb/trunk/include/lldb/Core/UniqueCStringMap.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/UniqueCStringMap.h?rev=162366&r1=162365&r2=162366&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/UniqueCStringMap.h (original)
+++ lldb/trunk/include/lldb/Core/UniqueCStringMap.h Wed Aug 22 12:17:09 2012
@@ -146,6 +146,27 @@
     }
 
     //------------------------------------------------------------------
+    // Find the value for the unique string in the map.
+    //
+    // Return the value for \a unique_cstr if one is found, return
+    // \a fail_value otherwise. This method works well for simple type
+    // T values and only if there is a sensible failure value that can
+    // be returned and that won't match any existing values.
+    //------------------------------------------------------------------
+    T
+    Find (const char *unique_cstr, T fail_value) const
+    {
+        Entry search_entry (unique_cstr);
+        const_iterator end = m_map.end();
+        const_iterator pos = std::lower_bound (m_map.begin(), end, search_entry);
+        if (pos != end)
+        {
+            if (pos->cstring == unique_cstr)
+                return pos->value;
+        }
+        return fail_value;
+    }
+    //------------------------------------------------------------------
     // Get a pointer to the first entry that matches "name". NULL will
     // be returned if there is no entry that matches "name".
     //

Modified: lldb/trunk/include/lldb/Core/UserSettingsController.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/UserSettingsController.h?rev=162366&r1=162365&r2=162366&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/UserSettingsController.h (original)
+++ lldb/trunk/include/lldb/Core/UserSettingsController.h Wed Aug 22 12:17:09 2012
@@ -25,436 +25,487 @@
 #include "lldb/Core/Stream.h"
 #include "lldb/Core/StreamString.h"
 #include "lldb/Host/Mutex.h"
-#include "lldb/Interpreter/NamedOptionValue.h"
+#include "lldb/Interpreter/OptionValue.h"
 
 namespace lldb_private {
 
-typedef struct
-{
-    const char *var_name;
-    SettableVariableType var_type;
-    const char *default_value;
-    OptionEnumValueElement *enum_values;
-    bool initialized;
-    bool hidden;
-    const char *description;   //help text
-} SettingEntry;
-
 
-typedef struct
-{
-    lldb::UserSettingsControllerSP parent;
-    ConstString level_name;
-    std::vector<SettingEntry> global_settings;
-    std::vector<SettingEntry> instance_settings;
-} UserSettingDefinition;
+//typedef struct
+//{
+//    lldb::UserSettingsControllerSP parent;
+//    ConstString level_name;
+//    std::vector<SettingEntry> global_settings;
+//    std::vector<SettingEntry> instance_settings;
+//} UserSettingDefinition;
+//
 
-class UserSettingsController : 
-    public STD_ENABLE_SHARED_FROM_THIS(UserSettingsController)
+class Properties
 {
 public:
-
-    UserSettingsController (const char *level_name, 
-                            const lldb::UserSettingsControllerSP &parent);
-
-    virtual
-    ~UserSettingsController ();
-
-    // Pure virtual functions, which all sub-classes must implement.
-    virtual lldb::InstanceSettingsSP
-    CreateInstanceSettings (const char *instance_name) = 0;
-
-    // Virtual functions that you can override if you have global settings
-    // (not instance specific).
-    virtual bool
-    SetGlobalVariable (const ConstString &var_name,
-                       const char *index_value,
-                       const char *value,
-                       const SettingEntry &entry,
-                       const VarSetOperationType op,
-                       Error &err);
-
-    virtual bool
-    GetGlobalVariable (const ConstString &var_name, 
-                       StringList &value,
-                       Error &err);
-    
-    // End of pure virtual functions.
-    StringList
-    GetVariable (const char *full_dot_name, 
-                 SettableVariableType &var_type,
-                 const char *debugger_instance_name,
-                 Error &err);
-
-    Error
-    SetVariable (const char *full_dot_name, 
-                 const char *value, 
-                 const VarSetOperationType op,
-                 const bool override,
-                 const char *debugger_instance_name,
-                 const char *index_value = NULL);
-
-    const lldb::UserSettingsControllerSP &
-    GetParent ();
-
-    const ConstString &
-    GetLevelName ();
-
-    void
-    RegisterChild (const lldb::UserSettingsControllerSP &child);
-
-    void
-    RemoveChild (const lldb::UserSettingsControllerSP &child);
-
-    void
-    CreateSettingsVector (const SettingEntry *table,
-                          const bool global);
-
-    void
-    CreateDefaultInstanceSettings ();
-
-    void
-    InitializeGlobalVariables ();
-
-    const lldb::InstanceSettingsSP &
-    FindPendingSettings (const ConstString &instance_name);
-
-    void
-    RemovePendingSettings (const ConstString &instance_name);
-  
-    void
-    RegisterInstanceSettings (InstanceSettings *instance_settings);
-
-    void
-    UnregisterInstanceSettings (InstanceSettings *instance_settings);
-
-    void
-    RenameInstanceSettings (const char *old_name, const char *new_name);
-
-    void
-    SetDefaultInstanceSettings (const lldb::InstanceSettingsSP &instance_settings_sp)
+    Properties () :
+        m_collection_sp ()
     {
-        m_default_settings = instance_settings_sp;
     }
-    // -------------------------------------------------------------------------
-    // Public static methods
-    // -------------------------------------------------------------------------
-
-    static void
-    FindAllSettingsDescriptions (CommandInterpreter &interpreter,
-                                 const lldb::UserSettingsControllerSP& usc_sp, 
-                                 const char *current_prefix, 
-                                 Stream &result_stream,
-                                 Error &err);
-
-    static void
-    FindSettingsDescriptions (CommandInterpreter &interpreter,
-                              const lldb::UserSettingsControllerSP& usc_sp, 
-                              const char *current_prefix, 
-                              const char *search_name,
-                              Stream &result_stream,
-                              Error &err);
-    
-    static void
-    SearchAllSettingsDescriptions (CommandInterpreter &interpreter,
-                                   const lldb::UserSettingsControllerSP& usc_sp,
-                                   const char *current_prefix,
-                                   const char *search_word,
-                                   Stream &result_stream);
-
-    static void
-    GetAllVariableValues (CommandInterpreter &interpreter,
-                          const lldb::UserSettingsControllerSP& usc_sp,
-                          const char *current_prefix, 
-                          Stream &result_stream,
-                          Error &err);
-
-    static bool
-    DumpValue (CommandInterpreter &interpreter, 
-               const lldb::UserSettingsControllerSP& usc_sp,
-               const char *variable_dot_name,
-               Stream &strm);
-    
-    static bool
-    DumpValue (const char *variable_dot_name,
-               SettableVariableType var_type,
-               const StringList &variable_value,
-               Stream &strm);
-
-    static int
-    CompleteSettingsNames (const lldb::UserSettingsControllerSP& usc_sp,
-                           Args &partial_setting_name_pieces,
-                           bool &word_complete,
-                           StringList &matches);
-
-    static int
-    CompleteSettingsValue (const lldb::UserSettingsControllerSP& usc_sp,
-                           const char *full_dot_name,
-                           const char *partial_value,
-                           bool &word_complete,
-                           StringList &matches);
-
-    static Args
-    BreakNameIntoPieces (const char *full_dot_name);
-
-    static const char *
-    GetTypeString (SettableVariableType var_type);
-
-
-    static const char *
-    EnumToString (const OptionEnumValueElement *enum_values, int value);
-
-    static void
-    UpdateStringVariable (VarSetOperationType op, 
-                          std::string &string_var, 
-                          const char *new_value,
-                          Error &err);
-
-
-    static void
-    UpdateBooleanVariable (VarSetOperationType op,
-                           bool &bool_var,
-                           const char *new_value,
-                           bool clear_value, // Used for op == eVarSetOperationClear
-                           Error &err);
-
-    static void
-    UpdateStringArrayVariable (VarSetOperationType op, 
-                               const char *index_value, 
-                               Args &array_var, 
-                               const char *new_value,
-                               Error &err);
-  
-    static void
-    UpdateDictionaryVariable (VarSetOperationType op,
-                              const char *index_value,
-                              std::map<std::string, std::string> &dictionary,
-                              const char *new_value,
-                              Error &err);
-
-    static void
-    UpdateEnumVariable (OptionEnumValueElement *enum_values,
-                        int *enum_var,
-                        const char *new_value,
-                        Error &err);
-
-    static Error
-    UpdateStringOptionValue (const char *new_value_cstr,
-                             VarSetOperationType op, 
-                             OptionValueString &option_value);
-    
-    static Error
-    UpdateBooleanOptionValue (const char *new_value_cstr,
-                              VarSetOperationType op,
-                              OptionValueBoolean &option_value);
-
-    static Error
-    UpdateFileSpecOptionValue (const char *new_value_cstr,
-                               VarSetOperationType op, 
-                               OptionValueFileSpec &option_value);
-
-    static bool
-    InitializeSettingsController (lldb::UserSettingsControllerSP &controller_sp,
-                                  SettingEntry *global_settings,
-                                  SettingEntry *instance_settings);
 
-    static void
-    FinalizeSettingsController (lldb::UserSettingsControllerSP &controller_sp);
-
-
-    lldb::InstanceSettingsSP
-    GetDefaultInstanceSettings ()
+    Properties (const lldb::OptionValuePropertiesSP &collection_sp) :
+        m_collection_sp (collection_sp)
     {
-        return m_default_settings;
     }
-
-protected:
-
-    // -------------------------------------------------------------------------
-    // Protected methods are declared below here.
-    // -------------------------------------------------------------------------
-
-    bool
-    IsLiveInstance (const std::string &instance_name);
-
-    int
-    GlobalVariableMatches (const char *partial_name,
-                           const std::string &complete_prefix,
-                           StringList &matches);
-
-    int
-    InstanceVariableMatches (const char *partial_name,
-                             const std::string &complete_prefix,
-                             const char *instance_name,
-                             StringList &matches);
-
-    int
-    LiveInstanceMatches (const char *partial_name,
-                         const std::string &complete_prefix,
-                         bool &word_complete,
-                         StringList &matches);
-
-    int
-    ChildMatches (const char *partial_name,
-                  const std::string &complete_prefix,
-                  bool &word_complete,
-                  StringList &matches);
-
-
-    size_t
-    GetNumChildren ();
-
-    const lldb::UserSettingsControllerSP
-    GetChildAtIndex (size_t index);
-
-
-    const SettingEntry *
-    GetGlobalEntry (const ConstString &var_name);
-
-    const SettingEntry *
-    GetInstanceEntry (const ConstString &var_name);
-
-    void
-    BuildParentPrefix (std::string &parent_prefix);
-
-
-    void
-    CopyDefaultSettings (const lldb::InstanceSettingsSP &new_settings,
-                         const ConstString &instance_name,
-                         bool pending);
-
-    lldb::InstanceSettingsSP
-    PendingSettingsForInstance (const ConstString &instance_name);
-
-    InstanceSettings *
-    FindSettingsForInstance (const ConstString &instance_name);
-
-    void
-    GetAllPendingSettingValues (Stream &result_stream);
-
-    void
-    GetAllDefaultSettingValues (Stream &result_stream);
-
-    void
-    GetAllInstanceVariableValues (CommandInterpreter &interpreter, 
-                                  Stream &result_stream);
-
-    void
-    OverrideAllInstances (const ConstString &var_name, 
-                          const char *value,
-                          VarSetOperationType op, 
-                          const char *index_value, 
-                          Error &err);
-
-    UserSettingDefinition &
-    GetControllerSettings () { return m_settings; }
-
-    // -------------------------------------------------------------------------
-    // Static protected methods are declared below here.
-    // -------------------------------------------------------------------------
-
-    static void
-    PrintEnumValues (const OptionEnumValueElement *enum_values, 
-                     Stream &str);
     
-
-    static int
-    BooleanMatches (const char *partial_value,
-                    bool &word_complete,
-                    StringList &matches);
+    virtual
+    ~Properties()
+    {
+    }
     
-    static int
-    EnumMatches (const char *partial_value,
-                 OptionEnumValueElement *enum_values,
-                 bool &word_complete,
-                 StringList &matches);
-
-    static void
-    VerifyOperationForType (SettableVariableType var_type, 
-                            VarSetOperationType op, 
-                            const ConstString &var_name,
-                            Error &err);
-
-    // This is protected rather than private so that classes that inherit from UserSettingsController can access it.
-
-    lldb::InstanceSettingsSP m_default_settings;
-
-private:
+    virtual lldb::OptionValuePropertiesSP
+    GetValueProperties () const
+    {
+        // This function is virtual in case subclasses want to lazily
+        // implement creating the properties.
+        return m_collection_sp;
+    }
 
-    UserSettingDefinition m_settings;
+    virtual lldb::OptionValueSP
+    GetPropertyValue (const ExecutionContext *exe_ctx,
+                      const char *property_path,
+                      bool will_modify,
+                      Error &error) const;
+
+    virtual Error
+    SetPropertyValue (const ExecutionContext *exe_ctx,
+                      VarSetOperationType op,
+                      const char *property_path,
+                      const char *value);
     
-    typedef std::map<std::string,InstanceSettings*> InstanceSettingsMap;
-
-    std::vector<lldb::UserSettingsControllerSP> m_children;
-    std::map <std::string, lldb::InstanceSettingsSP> m_pending_settings;
-    InstanceSettingsMap m_live_settings;    // live settings should never be NULL (hence 'live')
-    mutable Mutex m_children_mutex;
-    mutable Mutex m_pending_settings_mutex;
-    mutable Mutex m_live_settings_mutex;
-
-    DISALLOW_COPY_AND_ASSIGN (UserSettingsController);
-};
-
-class InstanceSettings 
-{
-public:
-
-    InstanceSettings (const lldb::UserSettingsControllerSP &owner_sp, const char *instance_name, bool live_instance = true);
-
-    InstanceSettings (const InstanceSettings &rhs);
-
-    virtual
-    ~InstanceSettings ();
-
-    InstanceSettings&
-    operator= (const InstanceSettings &rhs);
-
-    // Begin Pure Virtual Functions
+    virtual Error
+    DumpPropertyValue (const ExecutionContext *exe_ctx,
+                       Stream &strm,
+                       const char *property_path,
+                       uint32_t dump_mask);
 
     virtual void
-    UpdateInstanceSettingsVariable (const ConstString &var_name,
-                                    const char *index_value,
-                                    const char *value,
-                                    const ConstString &instance_name,
-                                    const SettingEntry &entry,
-                                    VarSetOperationType op,
-                                    Error &err,
-                                    bool pending) = 0;
-
-    virtual bool
-    GetInstanceSettingsValue (const SettingEntry &entry,
-                              const ConstString &var_name,
-                              StringList &value,
-                              Error *err) = 0;
-
+    DumpAllPropertyValues (const ExecutionContext *exe_ctx,
+                           Stream &strm,
+                           uint32_t dump_mask);
+    
     virtual void
-    CopyInstanceSettings (const lldb::InstanceSettingsSP &new_settings,
-                          bool pending) = 0;
+    DumpAllDescriptions (CommandInterpreter &interpreter,
+                         Stream &strm) const;
 
-    virtual const ConstString
-    CreateInstanceName () = 0;
-
-    // End Pure Virtual Functions
-
-    const ConstString &
-    GetInstanceName () { return m_instance_name; }
-
-
-    void
-    ChangeInstanceName (const std::string &new_instance_name);
-
-    static const ConstString &
-    GetDefaultName ();
-
-    static const ConstString &
-    InvalidName ();
+    size_t
+    Apropos (const char *keyword,
+             std::vector<const Property *> &matching_properties) const;
 
 protected:
-
-    lldb::UserSettingsControllerWP m_owner_wp;
-    ConstString m_instance_name;
+    lldb::OptionValuePropertiesSP m_collection_sp;
 };
 
+//class UserSettingsController :
+//    public STD_ENABLE_SHARED_FROM_THIS(UserSettingsController)
+//{
+//public:
+//
+//    UserSettingsController (const char *level_name, 
+//                            const lldb::UserSettingsControllerSP &parent);
+//
+//    virtual
+//    ~UserSettingsController ();
+//
+//    // Pure virtual functions, which all sub-classes must implement.
+//    virtual lldb::InstanceSettingsSP
+//    CreateInstanceSettings (const char *instance_name) = 0;
+//
+//    // Virtual functions that you can override if you have global settings
+//    // (not instance specific).
+//    virtual bool
+//    SetGlobalVariable (const ConstString &var_name,
+//                       const char *index_value,
+//                       const char *value,
+//                       const SettingEntry &entry,
+//                       const VarSetOperationType op,
+//                       Error &err);
+//
+//    virtual bool
+//    GetGlobalVariable (const ConstString &var_name, 
+//                       StringList &value,
+//                       Error &err);
+//    
+//    // End of pure virtual functions.
+//    StringList
+//    GetVariable (const char *full_dot_name, 
+//                 SettableVariableType &var_type,
+//                 const char *debugger_instance_name,
+//                 Error &err);
+//
+//    Error
+//    SetVariable (const char *full_dot_name, 
+//                 const char *value, 
+//                 const VarSetOperationType op,
+//                 const bool override,
+//                 const char *debugger_instance_name,
+//                 const char *index_value = NULL);
+//
+//    const lldb::UserSettingsControllerSP &
+//    GetParent ();
+//
+//    const ConstString &
+//    GetLevelName ();
+//
+//    void
+//    RegisterChild (const lldb::UserSettingsControllerSP &child);
+//
+//    void
+//    RemoveChild (const lldb::UserSettingsControllerSP &child);
+//
+//    void
+//    CreateSettingsVector (const SettingEntry *table,
+//                          const bool global);
+//
+//    void
+//    CreateDefaultInstanceSettings ();
+//
+//    void
+//    InitializeGlobalVariables ();
+//
+//    const lldb::InstanceSettingsSP &
+//    FindPendingSettings (const ConstString &instance_name);
+//
+//    void
+//    RemovePendingSettings (const ConstString &instance_name);
+//  
+//    void
+//    RegisterInstanceSettings (InstanceSettings *instance_settings);
+//
+//    void
+//    UnregisterInstanceSettings (InstanceSettings *instance_settings);
+//
+//    void
+//    RenameInstanceSettings (const char *old_name, const char *new_name);
+//
+//    void
+//    SetDefaultInstanceSettings (const lldb::InstanceSettingsSP &instance_settings_sp)
+//    {
+//        m_default_settings = instance_settings_sp;
+//    }
+//    // -------------------------------------------------------------------------
+//    // Public static methods
+//    // -------------------------------------------------------------------------
+//
+//    static void
+//    FindAllSettingsDescriptions (CommandInterpreter &interpreter,
+//                                 const lldb::UserSettingsControllerSP& usc_sp, 
+//                                 const char *current_prefix, 
+//                                 Stream &result_stream,
+//                                 Error &err);
+//
+//    static void
+//    FindSettingsDescriptions (CommandInterpreter &interpreter,
+//                              const lldb::UserSettingsControllerSP& usc_sp, 
+//                              const char *current_prefix, 
+//                              const char *search_name,
+//                              Stream &result_stream,
+//                              Error &err);
+//    
+//    static void
+//    SearchAllSettingsDescriptions (CommandInterpreter &interpreter,
+//                                   const lldb::UserSettingsControllerSP& usc_sp,
+//                                   const char *current_prefix,
+//                                   const char *search_word,
+//                                   Stream &result_stream);
+//
+//    static void
+//    GetAllVariableValues (CommandInterpreter &interpreter,
+//                          const lldb::UserSettingsControllerSP& usc_sp,
+//                          const char *current_prefix, 
+//                          Stream &result_stream,
+//                          Error &err);
+//
+//    static bool
+//    DumpValue (CommandInterpreter &interpreter, 
+//               const lldb::UserSettingsControllerSP& usc_sp,
+//               const char *variable_dot_name,
+//               Stream &strm);
+//    
+//    static bool
+//    DumpValue (const char *variable_dot_name,
+//               SettableVariableType var_type,
+//               const StringList &variable_value,
+//               Stream &strm);
+//
+//    static int
+//    CompleteSettingsNames (const lldb::UserSettingsControllerSP& usc_sp,
+//                           Args &partial_setting_name_pieces,
+//                           bool &word_complete,
+//                           StringList &matches);
+//
+//    static int
+//    CompleteSettingsValue (const lldb::UserSettingsControllerSP& usc_sp,
+//                           const char *full_dot_name,
+//                           const char *partial_value,
+//                           bool &word_complete,
+//                           StringList &matches);
+//
+//    static Args
+//    BreakNameIntoPieces (const char *full_dot_name);
+//
+//    static const char *
+//    GetTypeString (SettableVariableType var_type);
+//
+//
+//    static const char *
+//    EnumToString (const OptionEnumValueElement *enum_values, int value);
+//
+//    static void
+//    UpdateStringVariable (VarSetOperationType op, 
+//                          std::string &string_var, 
+//                          const char *new_value,
+//                          Error &err);
+//
+//
+//    static void
+//    UpdateBooleanVariable (VarSetOperationType op,
+//                           bool &bool_var,
+//                           const char *new_value,
+//                           bool clear_value, // Used for op == eVarSetOperationClear
+//                           Error &err);
+//
+//    static void
+//    UpdateStringArrayVariable (VarSetOperationType op, 
+//                               const char *index_value, 
+//                               Args &array_var, 
+//                               const char *new_value,
+//                               Error &err);
+//  
+//    static void
+//    UpdateDictionaryVariable (VarSetOperationType op,
+//                              const char *index_value,
+//                              std::map<std::string, std::string> &dictionary,
+//                              const char *new_value,
+//                              Error &err);
+//
+//    static void
+//    UpdateEnumVariable (OptionEnumValueElement *enum_values,
+//                        int *enum_var,
+//                        const char *new_value,
+//                        Error &err);
+//
+//    static Error
+//    UpdateStringOptionValue (const char *new_value_cstr,
+//                             VarSetOperationType op, 
+//                             OptionValueString &option_value);
+//    
+//    static Error
+//    UpdateBooleanOptionValue (const char *new_value_cstr,
+//                              VarSetOperationType op,
+//                              OptionValueBoolean &option_value);
+//
+//    static Error
+//    UpdateFileSpecOptionValue (const char *new_value_cstr,
+//                               VarSetOperationType op, 
+//                               OptionValueFileSpec &option_value);
+//
+//    static bool
+//    InitializeSettingsController (lldb::UserSettingsControllerSP &controller_sp,
+//                                  SettingEntry *global_settings,
+//                                  SettingEntry *instance_settings);
+//
+//    static void
+//    FinalizeSettingsController (lldb::UserSettingsControllerSP &controller_sp);
+//
+//
+//    lldb::InstanceSettingsSP
+//    GetDefaultInstanceSettings ()
+//    {
+//        return m_default_settings;
+//    }
+//
+//protected:
+//
+//    // -------------------------------------------------------------------------
+//    // Protected methods are declared below here.
+//    // -------------------------------------------------------------------------
+//
+//    bool
+//    IsLiveInstance (const std::string &instance_name);
+//
+//    int
+//    GlobalVariableMatches (const char *partial_name,
+//                           const std::string &complete_prefix,
+//                           StringList &matches);
+//
+//    int
+//    InstanceVariableMatches (const char *partial_name,
+//                             const std::string &complete_prefix,
+//                             const char *instance_name,
+//                             StringList &matches);
+//
+//    int
+//    LiveInstanceMatches (const char *partial_name,
+//                         const std::string &complete_prefix,
+//                         bool &word_complete,
+//                         StringList &matches);
+//
+//    int
+//    ChildMatches (const char *partial_name,
+//                  const std::string &complete_prefix,
+//                  bool &word_complete,
+//                  StringList &matches);
+//
+//
+//    size_t
+//    GetNumChildren ();
+//
+//    const lldb::UserSettingsControllerSP
+//    GetChildAtIndex (size_t index);
+//
+//
+//    const SettingEntry *
+//    GetGlobalEntry (const ConstString &var_name);
+//
+//    const SettingEntry *
+//    GetInstanceEntry (const ConstString &var_name);
+//
+//    void
+//    BuildParentPrefix (std::string &parent_prefix);
+//
+//
+//    void
+//    CopyDefaultSettings (const lldb::InstanceSettingsSP &new_settings,
+//                         const ConstString &instance_name,
+//                         bool pending);
+//
+//    lldb::InstanceSettingsSP
+//    PendingSettingsForInstance (const ConstString &instance_name);
+//
+//    InstanceSettings *
+//    FindSettingsForInstance (const ConstString &instance_name);
+//
+//    void
+//    GetAllPendingSettingValues (Stream &result_stream);
+//
+//    void
+//    GetAllDefaultSettingValues (Stream &result_stream);
+//
+//    void
+//    GetAllInstanceVariableValues (CommandInterpreter &interpreter, 
+//                                  Stream &result_stream);
+//
+//    void
+//    OverrideAllInstances (const ConstString &var_name, 
+//                          const char *value,
+//                          VarSetOperationType op, 
+//                          const char *index_value, 
+//                          Error &err);
+//
+//    UserSettingDefinition &
+//    GetControllerSettings () { return m_settings; }
+//
+//    // -------------------------------------------------------------------------
+//    // Static protected methods are declared below here.
+//    // -------------------------------------------------------------------------
+//
+//    static void
+//    PrintEnumValues (const OptionEnumValueElement *enum_values, 
+//                     Stream &str);
+//    
+//
+//    static int
+//    BooleanMatches (const char *partial_value,
+//                    bool &word_complete,
+//                    StringList &matches);
+//    
+//    static int
+//    EnumMatches (const char *partial_value,
+//                 OptionEnumValueElement *enum_values,
+//                 bool &word_complete,
+//                 StringList &matches);
+//
+//    static void
+//    VerifyOperationForType (SettableVariableType var_type, 
+//                            VarSetOperationType op, 
+//                            const ConstString &var_name,
+//                            Error &err);
+//
+//    // This is protected rather than private so that classes that inherit from UserSettingsController can access it.
+//
+//    lldb::InstanceSettingsSP m_default_settings;
+//
+//private:
+//
+//    UserSettingDefinition m_settings;
+//    
+//    typedef std::map<std::string,InstanceSettings*> InstanceSettingsMap;
+//
+//    std::vector<lldb::UserSettingsControllerSP> m_children;
+//    std::map <std::string, lldb::InstanceSettingsSP> m_pending_settings;
+//    InstanceSettingsMap m_live_settings;    // live settings should never be NULL (hence 'live')
+//    mutable Mutex m_children_mutex;
+//    mutable Mutex m_pending_settings_mutex;
+//    mutable Mutex m_live_settings_mutex;
+//
+//    DISALLOW_COPY_AND_ASSIGN (UserSettingsController);
+//};
+//
+//class InstanceSettings 
+//{
+//public:
+//
+//    InstanceSettings (const lldb::UserSettingsControllerSP &owner_sp, const char *instance_name, bool live_instance = true);
+//
+//    InstanceSettings (const InstanceSettings &rhs);
+//
+//    virtual
+//    ~InstanceSettings ();
+//
+//    InstanceSettings&
+//    operator= (const InstanceSettings &rhs);
+//
+//    // Begin Pure Virtual Functions
+//
+//    virtual void
+//    UpdateInstanceSettingsVariable (const ConstString &var_name,
+//                                    const char *index_value,
+//                                    const char *value,
+//                                    const ConstString &instance_name,
+//                                    const SettingEntry &entry,
+//                                    VarSetOperationType op,
+//                                    Error &err,
+//                                    bool pending) = 0;
+//
+//    virtual bool
+//    GetInstanceSettingsValue (const SettingEntry &entry,
+//                              const ConstString &var_name,
+//                              StringList &value,
+//                              Error *err) = 0;
+//
+//    virtual void
+//    CopyInstanceSettings (const lldb::InstanceSettingsSP &new_settings,
+//                          bool pending) = 0;
+//
+//    virtual const ConstString
+//    CreateInstanceName () = 0;
+//
+//    // End Pure Virtual Functions
+//
+//    const ConstString &
+//    GetInstanceName () { return m_instance_name; }
+//
+//
+//    void
+//    ChangeInstanceName (const std::string &new_instance_name);
+//
+//    static const ConstString &
+//    GetDefaultName ();
+//
+//    static const ConstString &
+//    InvalidName ();
+//
+//protected:
+//
+//    lldb::UserSettingsControllerWP m_owner_wp;
+//    ConstString m_instance_name;
+//};
+//
 
 
 } // namespace lldb_private

Modified: lldb/trunk/include/lldb/Interpreter/CommandCompletions.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/CommandCompletions.h?rev=162366&r1=162365&r2=162366&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Interpreter/CommandCompletions.h (original)
+++ lldb/trunk/include/lldb/Interpreter/CommandCompletions.h Wed Aug 22 12:17:09 2012
@@ -74,20 +74,20 @@
     //----------------------------------------------------------------------
     static int
     DiskFiles (CommandInterpreter &interpreter,
-                 const char *partial_file_name,
-                 int match_start_point,
-                 int max_return_elements,
-                 SearchFilter *searcher,
-                 bool &word_complete,
-                 StringList &matches);
+               const char *partial_file_name,
+               int match_start_point,
+               int max_return_elements,
+               SearchFilter *searcher,
+               bool &word_complete,
+               StringList &matches);
     static int
     DiskDirectories (CommandInterpreter &interpreter,
-                 const char *partial_file_name,
-                 int match_start_point,
-                 int max_return_elements,
-                 SearchFilter *searcher,
-                 bool &word_complete,
-                 StringList &matches);
+                     const char *partial_file_name,
+                     int match_start_point,
+                     int max_return_elements,
+                     SearchFilter *searcher,
+                     bool &word_complete,
+                     StringList &matches);
     
     static int
     SourceFiles (CommandInterpreter &interpreter,

Removed: lldb/trunk/include/lldb/Interpreter/NamedOptionValue.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/NamedOptionValue.h?rev=162365&view=auto
==============================================================================
--- lldb/trunk/include/lldb/Interpreter/NamedOptionValue.h (original)
+++ lldb/trunk/include/lldb/Interpreter/NamedOptionValue.h (removed)
@@ -1,1242 +0,0 @@
-//===-- NamedOptionValue.h --------------------------------------*- C++ -*-===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef liblldb_NamedOptionValue_h_
-#define liblldb_NamedOptionValue_h_
-
-// C Includes
-// C++ Includes
-#include <vector>
-#include <map>
-
-// Other libraries and framework includes
-// Project includes
-#include "lldb/Core/ConstString.h"
-#include "lldb/Core/UUID.h"
-#include "lldb/Core/FileSpecList.h"
-#include "lldb/Host/FileSpec.h"
-
-namespace lldb_private {
-
-    class OptionValueBoolean;
-    class OptionValueSInt64;
-    class OptionValueUInt64;
-    class OptionValueString;
-    class OptionValueFileSpec;
-    class OptionValueFileSpecList;
-    class OptionValueFormat;
-    class OptionValueUUID;
-    class OptionValueArray;
-    class OptionValueDictionary;
-
-    //---------------------------------------------------------------------
-    // OptionValue
-    //---------------------------------------------------------------------
-    class OptionValue
-    {
-    public:
-        typedef enum {
-            eTypeInvalid = 0,
-            eTypeArray,
-            eTypeBoolean,
-            eTypeDictionary,
-            eTypeEnum,
-            eTypeFileSpec,
-            eTypeFileSpecList,
-            eTypeFormat,
-            eTypeSInt64,
-            eTypeUInt64,
-            eTypeUUID,
-            eTypeString
-        } Type;
-        
-        virtual ~OptionValue ()
-        {
-        }
-        //-----------------------------------------------------------------
-        // Subclasses should override these functions
-        //-----------------------------------------------------------------
-        virtual Type
-        GetType () = 0;
-        
-        virtual void
-        DumpValue (Stream &strm) = 0;
-        
-        virtual Error
-        SetValueFromCString (const char *value) = 0;
-        
-        virtual bool
-        Clear () = 0;
-
-        //-----------------------------------------------------------------
-        // Subclasses should NOT override these functions as they use the
-        // above functions to implement functionality
-        //-----------------------------------------------------------------
-        uint32_t
-        GetTypeAsMask ()
-        {
-            return 1u << GetType();
-        }
-        
-        static uint32_t
-        ConvertTypeToMask (OptionValue::Type type)
-        {
-            return 1u << type;
-        }
-
-        // Get this value as a uint64_t value if it is encoded as a boolean,
-        // uint64_t or int64_t. Other types will cause "fail_value" to be 
-        // returned
-        uint64_t
-        GetUInt64Value (uint64_t fail_value, bool *success_ptr);
-
-        OptionValueBoolean *
-        GetAsBoolean ();
-        
-        OptionValueSInt64 *
-        GetAsSInt64 ();
-        
-        OptionValueUInt64 *
-        GetAsUInt64 ();        
-        
-        OptionValueString *
-        GetAsString ();
-        
-        OptionValueFileSpec *
-        GetAsFileSpec ();
-        
-        OptionValueFileSpecList *
-        GetAsFileSpecList ();
-        
-        OptionValueFormat *
-        GetAsFormat ();
-        
-        OptionValueUUID *
-        GetAsUUID ();
-        
-        OptionValueArray *
-        GetAsArray ();
-        
-        OptionValueDictionary *
-        GetAsDictionary ();
-
-        const char *
-        GetStringValue (const char *fail_value = NULL);
-
-        uint64_t
-        GetUInt64Value (uint64_t fail_value = 0);
-                
-        lldb::Format
-        GetFormatValue (lldb::Format fail_value = lldb::eFormatDefault);
-
-        bool
-        OptionWasSet () const
-        {
-            return m_value_was_set;
-        }
-        
-        void
-        SetOptionWasSet ()
-        {
-            m_value_was_set = true;
-        }
-
-    protected:
-        bool m_value_was_set; // This can be used to see if a value has been set
-                              // by a call to SetValueFromCString(). It is often
-                              // handy to know if an option value was set from
-                              // the command line or as a setting, versus if we
-                              // just have the default value that was already
-                              // populated in the option value.
-        
-    };
-    
-    
-
-    //---------------------------------------------------------------------
-    // OptionValueBoolean
-    //---------------------------------------------------------------------
-    class OptionValueBoolean : public OptionValue
-    {
-    public:
-        OptionValueBoolean (bool current_value, 
-                            bool default_value) :
-            m_current_value (current_value),
-            m_default_value (default_value)
-        {
-        }
-        
-        virtual 
-        ~OptionValueBoolean()
-        {
-        }
-        
-        //---------------------------------------------------------------------
-        // Virtual subclass pure virtual overrides
-        //---------------------------------------------------------------------
-        
-        virtual OptionValue::Type
-        GetType ()
-        {
-            return eTypeBoolean;
-        }
-        
-        virtual void
-        DumpValue (Stream &strm);
-        
-        virtual Error
-        SetValueFromCString (const char *value);
-        
-        virtual bool
-        Clear ()
-        {
-            m_current_value = m_default_value;
-            m_value_was_set = false;
-            return true;
-        }
-        
-        //---------------------------------------------------------------------
-        // Subclass specific functions
-        //---------------------------------------------------------------------
-        
-        //------------------------------------------------------------------
-        /// Convert to bool operator.
-        ///
-        /// This allows code to check a OptionValueBoolean in conditions.
-        ///
-        /// @code
-        /// OptionValueBoolean bool_value(...);
-        /// if (bool_value)
-        /// { ...
-        /// @endcode
-        ///
-        /// @return
-        ///     /b True this object contains a valid namespace decl, \b 
-        ///     false otherwise.
-        //------------------------------------------------------------------
-        operator bool() const
-        {
-            return m_current_value;
-        }
-        
-        const bool &
-        operator = (bool b)
-        {
-            m_current_value = b;
-            return m_current_value;
-        }
-
-        bool
-        GetCurrentValue() const
-        {
-            return m_current_value;
-        }
-        
-        bool
-        GetDefaultValue() const
-        {
-            return m_default_value;
-        }
-        
-        void
-        SetCurrentValue (bool value)
-        {
-            m_current_value = value;
-        }
-        
-        void
-        SetDefaultValue (bool value)
-        {
-            m_default_value = value;
-        }
-        
-    protected:
-        bool m_current_value;
-        bool m_default_value;
-    };
-    
-    //---------------------------------------------------------------------
-    // OptionValueSInt64
-    //---------------------------------------------------------------------
-    class OptionValueSInt64 : public OptionValue
-    {
-    public:
-        OptionValueSInt64 () :
-            m_current_value (0),
-            m_default_value (0)
-        {
-        }
-        
-        OptionValueSInt64 (int64_t current_value, 
-                           int64_t default_value) :
-            m_current_value (current_value),
-            m_default_value (default_value)
-        {
-        }
-        
-        virtual 
-        ~OptionValueSInt64()
-        {
-        }
-        
-        //---------------------------------------------------------------------
-        // Virtual subclass pure virtual overrides
-        //---------------------------------------------------------------------
-        
-        virtual OptionValue::Type
-        GetType ()
-        {
-            return eTypeSInt64;
-        }
-        
-        virtual void
-        DumpValue (Stream &strm);
-        
-        virtual Error
-        SetValueFromCString (const char *value);
-        
-        virtual bool
-        Clear ()
-        {
-            m_current_value = m_default_value;
-            m_value_was_set = false;
-            return true;
-        }
-        
-        //---------------------------------------------------------------------
-        // Subclass specific functions
-        //---------------------------------------------------------------------
-        
-        const int64_t &
-        operator = (int64_t value)
-        {
-            m_current_value = value;
-            return m_current_value;
-        }
-
-        int64_t
-        GetCurrentValue() const
-        {
-            return m_current_value;
-        }
-        
-        int64_t
-        GetDefaultValue() const
-        {
-            return m_default_value;
-        }
-        
-        void
-        SetCurrentValue (int64_t value)
-        {
-            m_current_value = value;
-        }
-        
-        void
-        SetDefaultValue (int64_t value)
-        {
-            m_default_value = value;
-        }
-        
-    protected:
-        int64_t m_current_value;
-        int64_t m_default_value;
-    };
-    
-    //---------------------------------------------------------------------
-    // OptionValueUInt64
-    //---------------------------------------------------------------------
-    class OptionValueUInt64 : public OptionValue
-    {
-    public:
-        OptionValueUInt64 () :
-            m_current_value (0),
-            m_default_value (0)
-        {
-        }
-
-        OptionValueUInt64 (uint64_t current_value, 
-                           uint64_t default_value) :
-            m_current_value (current_value),
-            m_default_value (default_value)
-        {
-        }
-        
-        virtual 
-        ~OptionValueUInt64()
-        {
-        }
-        
-        //---------------------------------------------------------------------
-        // Decode a uint64_t from "value_cstr" return a OptionValueUInt64 object
-        // inside of a lldb::OptionValueSP object if all goes well. If the 
-        // string isn't a uint64_t value or any other error occurs, return an 
-        // empty lldb::OptionValueSP and fill error in with the correct stuff.
-        //---------------------------------------------------------------------
-        static lldb::OptionValueSP
-        Create (const char *value_cstr, Error &error);
-        //---------------------------------------------------------------------
-        // Virtual subclass pure virtual overrides
-        //---------------------------------------------------------------------
-        
-        virtual OptionValue::Type
-        GetType ()
-        {
-            return eTypeUInt64;
-        }
-        
-        virtual void
-        DumpValue (Stream &strm);
-        
-        virtual Error
-        SetValueFromCString (const char *value);
-        
-        virtual bool
-        Clear ()
-        {
-            m_current_value = m_default_value;
-            m_value_was_set = false;
-            return true;
-        }
-        
-        //---------------------------------------------------------------------
-        // Subclass specific functions
-        //---------------------------------------------------------------------
-        
-        const uint64_t &
-        operator = (uint64_t value)
-        {
-            m_current_value = value;
-            return m_current_value;
-        }
-
-        operator uint64_t () const
-        {
-            return m_current_value;
-        }
-
-        uint64_t
-        GetCurrentValue() const
-        {
-            return m_current_value;
-        }
-        
-        uint64_t
-        GetDefaultValue() const
-        {
-            return m_default_value;
-        }
-        
-        void
-        SetCurrentValue (uint64_t value)
-        {
-            m_current_value = value;
-        }
-        
-        void
-        SetDefaultValue (uint64_t value)
-        {
-            m_default_value = value;
-        }
-        
-    protected:
-        uint64_t m_current_value;
-        uint64_t m_default_value;
-    };
-
-    //---------------------------------------------------------------------
-    // OptionValueString
-    //---------------------------------------------------------------------
-    class OptionValueString : public OptionValue
-    {
-    public:
-        OptionValueString () :
-            m_current_value (),
-            m_default_value ()
-        {
-        }
-
-        OptionValueString (const char *current_value, 
-                           const char *default_value = NULL) :
-            m_current_value (),
-            m_default_value ()
-        {
-            if  (current_value && current_value[0])
-                m_current_value.assign (current_value);
-            if  (default_value && default_value[0])
-                m_default_value.assign (default_value);
-        }
-        
-        virtual 
-        ~OptionValueString()
-        {
-        }
-        
-        //---------------------------------------------------------------------
-        // Virtual subclass pure virtual overrides
-        //---------------------------------------------------------------------
-        
-        virtual OptionValue::Type
-        GetType ()
-        {
-            return eTypeString;
-        }
-        
-        virtual void
-        DumpValue (Stream &strm);
-        
-        virtual Error
-        SetValueFromCString (const char *value);
-
-        virtual bool
-        Clear ()
-        {
-            m_current_value = m_default_value;
-            m_value_was_set = false;
-            return true;
-        }
-        
-        //---------------------------------------------------------------------
-        // Subclass specific functions
-        //---------------------------------------------------------------------
-        
-        const char *
-        operator = (const char *value)
-        {
-            if (value && value[0])
-                m_current_value.assign (value);
-            else
-                m_current_value.clear();
-            return m_current_value.c_str();
-        }
-
-        const char *
-        GetCurrentValue() const
-        {
-            return m_current_value.c_str();
-        }
-        
-        bool
-        IsCurrentValueEmpty () const
-        {
-            return m_current_value.empty();
-        }
-        
-        const char *
-        GetDefaultValue() const
-        {
-            return m_default_value.c_str();
-        }
-
-        bool
-        IsDefaultValueEmpty () const
-        {
-            return m_default_value.empty();
-        }
-        
-        void
-        SetCurrentValue (const char *value)
-        {
-            if (value && value[0])
-                m_current_value.assign (value);
-            else
-                m_current_value.clear();
-        }
-
-        void
-        AppendToCurrentValue (const char *value)
-        {
-            if (value && value[0])
-                m_current_value.append (value);
-        }
-
-        void
-        SetDefaultValue (const char *value)
-        {
-            if (value && value[0])
-                m_default_value.assign (value);
-            else
-                m_default_value.clear();
-        }
-        
-    protected:
-        std::string m_current_value;
-        std::string m_default_value;
-    };
-
-    //---------------------------------------------------------------------
-    // OptionValueFileSpec
-    //---------------------------------------------------------------------
-    class OptionValueFileSpec : public OptionValue
-    {
-    public:
-        OptionValueFileSpec () :
-            m_current_value (),
-            m_default_value ()
-        {
-        }
-        
-        OptionValueFileSpec (const FileSpec &current_value) :
-            m_current_value (current_value),
-            m_default_value ()
-        {
-        }
-        
-        OptionValueFileSpec (const FileSpec &current_value, 
-                             const FileSpec &default_value) :
-            m_current_value (current_value),
-            m_default_value (default_value)
-        {
-        }
-        
-        virtual 
-        ~OptionValueFileSpec()
-        {
-        }
-        
-        //---------------------------------------------------------------------
-        // Virtual subclass pure virtual overrides
-        //---------------------------------------------------------------------
-        
-        virtual OptionValue::Type
-        GetType ()
-        {
-            return eTypeFileSpec;
-        }
-        
-        virtual void
-        DumpValue (Stream &strm);
-        
-        virtual Error
-        SetValueFromCString (const char *value);
-        
-        virtual bool
-        Clear ()
-        {
-            m_current_value = m_default_value;
-            m_value_was_set = false;
-            return true;
-        }
-        
-        //---------------------------------------------------------------------
-        // Subclass specific functions
-        //---------------------------------------------------------------------
-        
-        FileSpec &
-        GetCurrentValue()
-        {
-            return m_current_value;
-        }
-
-        const FileSpec &
-        GetCurrentValue() const
-        {
-            return m_current_value;
-        }
-
-        const FileSpec &
-        GetDefaultValue() const
-        {
-            return m_default_value;
-        }
-        
-        void
-        SetCurrentValue (const FileSpec &value)
-        {
-            m_current_value = value;
-        }
-        
-        void
-        SetDefaultValue (const FileSpec &value)
-        {
-            m_default_value = value;
-        }
-        
-    protected:
-        FileSpec m_current_value;
-        FileSpec m_default_value;
-    };
-
-    //---------------------------------------------------------------------
-    // OptionValueFileSpecList
-    //---------------------------------------------------------------------
-    class OptionValueFileSpecList : public OptionValue
-    {
-    public:
-        OptionValueFileSpecList () :
-            m_current_value ()
-        {
-        }
-        
-        OptionValueFileSpecList (const FileSpecList &current_value) :
-            m_current_value (current_value)
-        {
-        }
-        
-        
-        virtual 
-        ~OptionValueFileSpecList()
-        {
-        }
-        
-        //---------------------------------------------------------------------
-        // Virtual subclass pure virtual overrides
-        //---------------------------------------------------------------------
-        
-        virtual OptionValue::Type
-        GetType ()
-        {
-            return eTypeFileSpecList;
-        }
-        
-        virtual void
-        DumpValue (Stream &strm);
-        
-        virtual Error
-        SetValueFromCString (const char *value);
-        
-        virtual bool
-        Clear ()
-        {
-            m_current_value.Clear();
-            m_value_was_set = false;
-            return true;
-        }
-        
-        //---------------------------------------------------------------------
-        // Subclass specific functions
-        //---------------------------------------------------------------------
-        
-        FileSpecList &
-        GetCurrentValue()
-        {
-            return m_current_value;
-        }
-        
-        const FileSpecList &
-        GetCurrentValue() const
-        {
-            return m_current_value;
-        }
-        
-        void
-        SetCurrentValue (const FileSpecList &value)
-        {
-            m_current_value = value;
-        }
-        
-    protected:
-        FileSpecList m_current_value;
-    };
-
-    //---------------------------------------------------------------------
-    // OptionValueFormat
-    //---------------------------------------------------------------------
-    class OptionValueFormat : public OptionValue
-    {
-    public:
-        OptionValueFormat (lldb::Format current_value, 
-                           lldb::Format default_value) :
-            m_current_value (current_value),
-            m_default_value (default_value)
-        {
-        }
-        
-        virtual 
-        ~OptionValueFormat()
-        {
-        }
-        
-        //---------------------------------------------------------------------
-        // Virtual subclass pure virtual overrides
-        //---------------------------------------------------------------------
-        
-        virtual OptionValue::Type
-        GetType ()
-        {
-            return eTypeFormat;
-        }
-        
-        virtual void
-        DumpValue (Stream &strm);
-        
-        virtual Error
-        SetValueFromCString (const char *value);
-        
-        virtual bool
-        Clear ()
-        {
-            m_current_value = m_default_value;
-            m_value_was_set = false;
-            return true;
-        }
-        
-        //---------------------------------------------------------------------
-        // Subclass specific functions
-        //---------------------------------------------------------------------
-        
-        lldb::Format
-        GetCurrentValue() const
-        {
-            return m_current_value;
-        }
-        
-        lldb::Format 
-        GetDefaultValue() const
-        {
-            return m_default_value;
-        }
-        
-        void
-        SetCurrentValue (lldb::Format value)
-        {
-            m_current_value = value;
-        }
-        
-        void
-        SetDefaultValue (lldb::Format value)
-        {
-            m_default_value = value;
-        }
-        
-    protected:
-        lldb::Format m_current_value;
-        lldb::Format m_default_value;
-    };
-    
-    
-    
-    //---------------------------------------------------------------------
-    // OptionValueUUID
-    //---------------------------------------------------------------------
-    class OptionValueUUID : public OptionValue
-    {
-    public:
-        OptionValueUUID () :
-            m_uuid ()
-        {
-        }
-        
-        OptionValueUUID (const UUID &uuid) :
-            m_uuid (uuid)
-        {
-        }
-        
-        virtual 
-        ~OptionValueUUID()
-        {
-        }
-        
-        //---------------------------------------------------------------------
-        // Virtual subclass pure virtual overrides
-        //---------------------------------------------------------------------
-        
-        virtual OptionValue::Type
-        GetType ()
-        {
-            return eTypeFileSpec;
-        }
-        
-        virtual void
-        DumpValue (Stream &strm);
-        
-        virtual Error
-        SetValueFromCString (const char *value);
-        
-        virtual bool
-        Clear ()
-        {
-            m_uuid.Clear();
-            m_value_was_set = false;
-            return true;
-        }
-        
-        //---------------------------------------------------------------------
-        // Subclass specific functions
-        //---------------------------------------------------------------------
-        
-        UUID &
-        GetCurrentValue()
-        {
-            return m_uuid;
-        }
-        
-        const UUID &
-        GetCurrentValue() const
-        {
-            return m_uuid;
-        }
-        
-        void
-        SetCurrentValue (const UUID &value)
-        {
-            m_uuid = value;
-        }
-        
-    protected:
-        UUID m_uuid;
-    };
-
-    //---------------------------------------------------------------------
-    // OptionValueArray
-    //---------------------------------------------------------------------
-    class OptionValueArray : public OptionValue
-    {
-    public:
-        OptionValueArray (uint32_t type_mask = UINT32_MAX) :
-            m_type_mask (type_mask),
-            m_values ()
-        {
-        }
-        
-        virtual 
-        ~OptionValueArray()
-        {
-        }
-        
-        //---------------------------------------------------------------------
-        // Virtual subclass pure virtual overrides
-        //---------------------------------------------------------------------
-        
-        virtual OptionValue::Type
-        GetType ()
-        {
-            return eTypeArray;
-        }
-        
-        virtual void
-        DumpValue (Stream &strm);
-        
-        virtual Error
-        SetValueFromCString (const char *value);
-        
-        virtual bool
-        Clear ()
-        {
-            m_values.clear();
-            m_value_was_set = false;
-            return true;
-        }
-        
-        //---------------------------------------------------------------------
-        // Subclass specific functions
-        //---------------------------------------------------------------------
-
-        uint32_t
-        GetSize () const
-        {
-            return m_values.size();
-        }
-
-        lldb::OptionValueSP
-        operator[](uint32_t idx) const
-        {
-            lldb::OptionValueSP value_sp;
-            if (idx < m_values.size())
-                value_sp = m_values[idx];
-            return value_sp;
-        }
-
-        lldb::OptionValueSP
-        GetValueAtIndex (uint32_t idx) const
-        {
-            lldb::OptionValueSP value_sp;
-            if (idx < m_values.size())
-                value_sp = m_values[idx];
-            return value_sp;
-        }
-        
-        bool
-        AppendValue (const lldb::OptionValueSP &value_sp)
-        {
-            // Make sure the value_sp object is allowed to contain
-            // values of the type passed in...
-            if (value_sp && (m_type_mask & value_sp->GetTypeAsMask()))
-            {
-                m_values.push_back(value_sp);
-                return true;
-            }
-            return false;
-        }
-        
-        bool
-        InsertValue (uint32_t idx, const lldb::OptionValueSP &value_sp)
-        {
-            // Make sure the value_sp object is allowed to contain
-            // values of the type passed in...
-            if (value_sp && (m_type_mask & value_sp->GetTypeAsMask()))
-            {
-                if (idx < m_values.size())
-                    m_values.insert(m_values.begin() + idx, value_sp);
-                else
-                    m_values.push_back(value_sp);
-                return true;
-            }
-            return false;
-        }
-
-        bool
-        ReplaceValue (uint32_t idx, const lldb::OptionValueSP &value_sp)
-        {
-            // Make sure the value_sp object is allowed to contain
-            // values of the type passed in...
-            if (value_sp && (m_type_mask & value_sp->GetTypeAsMask()))
-            {
-                if (idx < m_values.size())
-                {
-                    m_values[idx] = value_sp;
-                    return true;
-                }
-            }
-            return false;
-        }
-
-        bool
-        DeleteValue (uint32_t idx)
-        {
-            if (idx < m_values.size())
-            {
-                m_values.erase (m_values.begin() + idx);
-                return true;
-            }
-            return false;
-        }
-        
-    protected:
-        typedef std::vector<lldb::OptionValueSP> collection;
-                
-        uint32_t m_type_mask;
-        collection m_values;
-    };
-
-    
-    
-    //---------------------------------------------------------------------
-    // OptionValueDictionary
-    //---------------------------------------------------------------------
-    class OptionValueDictionary : public OptionValue
-    {
-    public:
-        OptionValueDictionary (uint32_t type_mask = UINT32_MAX) :
-            m_type_mask (type_mask),
-            m_values ()
-        {
-        }
-        
-        virtual 
-        ~OptionValueDictionary()
-        {
-        }
-        
-        //---------------------------------------------------------------------
-        // Virtual subclass pure virtual overrides
-        //---------------------------------------------------------------------
-        
-        virtual OptionValue::Type
-        GetType ()
-        {
-            return eTypeDictionary;
-        }
-        
-        virtual void
-        DumpValue (Stream &strm);
-        
-        virtual Error
-        SetValueFromCString (const char *value);
-        
-        virtual bool
-        Clear ()
-        {
-            m_values.clear();
-            m_value_was_set = false;
-            return true;
-        }
-        
-        //---------------------------------------------------------------------
-        // Subclass specific functions
-        //---------------------------------------------------------------------
-        
-        uint32_t
-        GetNumValues() const
-        {
-            return m_values.size();
-        }
-        
-        lldb::OptionValueSP
-        GetValueForKey (const ConstString &key) const;
-        
-        //---------------------------------------------------------------------
-        // String value getters and setters
-        //---------------------------------------------------------------------
-        const char *
-        GetStringValueForKey (const ConstString &key);
-
-        bool
-        SetStringValueForKey (const ConstString &key, 
-                              const char *value,
-                              bool can_replace = true);
-
-        
-        bool
-        SetValueForKey (const ConstString &key, 
-                        const lldb::OptionValueSP &value_sp, 
-                        bool can_replace = true);
-        
-        bool
-        DeleteValueForKey (const ConstString &key);
-        
-    protected:
-        typedef std::map<ConstString, lldb::OptionValueSP> collection;
-        uint32_t m_type_mask;
-        collection m_values;
-    };
-    
-
-    
-    //---------------------------------------------------------------------
-    // OptionValueCollection
-    //
-    // The option value collection is a class that must be subclassed in
-    // order to provide a collection of named OptionValue objects. The
-    // collection is immutable (use OptionValueDictionary for mutable key
-    // value pair collection). This allows classes to have some member
-    // variables that are OptionValue subclasses, and still provide access
-    // to setting and modifying these values from textual commands:
-    //
-    //    
-    //    class Car : public OptionValueCollection 
-    //    {
-    //    public:
-    //        
-    //        Car () : OptionValueCollection (NULL, "car"),
-    //             m_is_running_name ("running"),
-    //             m_license_number_name ("license"),
-    //             m_is_running (false, false),
-    //             m_license_number ()
-    //        {
-    //        }
-    //        
-    //        
-    //        bool
-    //        GetIsRunning () const
-    //        {
-    //            return m_is_running.GetCurrentValue();
-    //        }
-    //        
-    //        const char *
-    //        GetLicense () const
-    //        {
-    //            return m_license_number.GetCurrentValue();
-    //        }
-    //        
-    //        virtual uint32_t
-    //        GetNumValues() const
-    //        {
-    //            return 2;
-    //        }
-    //        
-    //        virtual ConstString
-    //        GetKeyAtIndex (uint32_t idx) const
-    //        {
-    //            switch (idx)
-    //            {
-    //                case 0: return m_is_running_name;
-    //                case 1: return m_license_number_name;
-    //            }
-    //            return ConstString();
-    //        }
-    //        
-    //        virtual OptionValue*
-    //        GetValueForKey (const ConstString &key)
-    //        {
-    //            if (key == m_is_running_name)
-    //                return &m_is_running;
-    //            else if (key == m_license_number_name)
-    //                return &m_license_number;
-    //            return NULL;
-    //        }
-    //        
-    //    protected:
-    //        ConstString m_is_running_name;
-    //        ConstString m_license_number_name;
-    //        OptionValueBoolean m_is_running;
-    //        OptionValueString m_license_number;
-    //        
-    //    };
-    //
-    // As we can see above, this allows the Car class to have direct access
-    // to its member variables settings m_is_running and m_license_number,
-    // yet it allows them to also be available by name to our command
-    // interpreter.
-    //---------------------------------------------------------------------
-    class OptionValueCollection
-    {
-    public:
-        OptionValueCollection (OptionValueCollection *parent, const ConstString &name) :
-            m_parent (parent),
-            m_name (name)
-        {
-        }
-
-        OptionValueCollection (OptionValueCollection *parent, const char *name) :
-            m_parent (parent),
-            m_name (name)
-        {
-        }
-
-        virtual 
-        ~OptionValueCollection()
-        {
-        }
-        
-        
-        OptionValueCollection *
-        GetParent ()
-        {
-            return m_parent;
-        }
-        
-        const OptionValueCollection *
-        GetParent () const
-        {
-            return m_parent;
-        }
-        
-        const ConstString &
-        GetName () const
-        {
-            return m_name;
-        }
-
-        void
-        GetQualifiedName (Stream &strm);
-
-        //---------------------------------------------------------------------
-        // Subclass specific functions
-        //---------------------------------------------------------------------
-        
-        virtual uint32_t
-        GetNumValues() const = 0;
-        
-        virtual ConstString
-        GetKeyAtIndex (uint32_t idx) const = 0;
-
-        virtual OptionValue*
-        GetValueForKey (const ConstString &key) = 0;
-
-    protected:
-        OptionValueCollection *m_parent;    // NULL if this is a root object
-        ConstString m_name;                 // Name for this collection setting (if any)
-    };
-    
-    
-
-} // namespace lldb_private
-
-#endif  // liblldb_NamedOptionValue_h_

Modified: lldb/trunk/include/lldb/Interpreter/OptionGroupBoolean.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/OptionGroupBoolean.h?rev=162366&r1=162365&r2=162366&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Interpreter/OptionGroupBoolean.h (original)
+++ lldb/trunk/include/lldb/Interpreter/OptionGroupBoolean.h Wed Aug 22 12:17:09 2012
@@ -15,7 +15,7 @@
 // Other libraries and framework includes
 // Project includes
 #include "lldb/Interpreter/Options.h"
-#include "lldb/Interpreter/NamedOptionValue.h"
+#include "lldb/Interpreter/OptionValueBoolean.h"
 
 namespace lldb_private {
     //-------------------------------------------------------------------------

Modified: lldb/trunk/include/lldb/Interpreter/OptionGroupFile.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/OptionGroupFile.h?rev=162366&r1=162365&r2=162366&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Interpreter/OptionGroupFile.h (original)
+++ lldb/trunk/include/lldb/Interpreter/OptionGroupFile.h Wed Aug 22 12:17:09 2012
@@ -15,7 +15,8 @@
 // Other libraries and framework includes
 // Project includes
 #include "lldb/Interpreter/Options.h"
-#include "lldb/Interpreter/NamedOptionValue.h"
+#include "lldb/Interpreter/OptionValueFileSpec.h"
+#include "lldb/Interpreter/OptionValueFileSpecList.h"
 
 namespace lldb_private {
 

Modified: lldb/trunk/include/lldb/Interpreter/OptionGroupFormat.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/OptionGroupFormat.h?rev=162366&r1=162365&r2=162366&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Interpreter/OptionGroupFormat.h (original)
+++ lldb/trunk/include/lldb/Interpreter/OptionGroupFormat.h Wed Aug 22 12:17:09 2012
@@ -15,7 +15,9 @@
 // Other libraries and framework includes
 // Project includes
 #include "lldb/Interpreter/Options.h"
-#include "lldb/Interpreter/NamedOptionValue.h"
+#include "lldb/Interpreter/OptionValueFormat.h"
+#include "lldb/Interpreter/OptionValueSInt64.h"
+#include "lldb/Interpreter/OptionValueUInt64.h"
 
 namespace lldb_private {
 

Modified: lldb/trunk/include/lldb/Interpreter/OptionGroupOutputFile.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/OptionGroupOutputFile.h?rev=162366&r1=162365&r2=162366&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Interpreter/OptionGroupOutputFile.h (original)
+++ lldb/trunk/include/lldb/Interpreter/OptionGroupOutputFile.h Wed Aug 22 12:17:09 2012
@@ -15,7 +15,8 @@
 // Other libraries and framework includes
 // Project includes
 #include "lldb/Interpreter/Options.h"
-#include "lldb/Interpreter/NamedOptionValue.h"
+#include "lldb/Interpreter/OptionValueBoolean.h"
+#include "lldb/Interpreter/OptionValueFileSpec.h"
 
 namespace lldb_private {
 //-------------------------------------------------------------------------

Modified: lldb/trunk/include/lldb/Interpreter/OptionGroupUInt64.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/OptionGroupUInt64.h?rev=162366&r1=162365&r2=162366&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Interpreter/OptionGroupUInt64.h (original)
+++ lldb/trunk/include/lldb/Interpreter/OptionGroupUInt64.h Wed Aug 22 12:17:09 2012
@@ -15,7 +15,7 @@
 // Other libraries and framework includes
 // Project includes
 #include "lldb/Interpreter/Options.h"
-#include "lldb/Interpreter/NamedOptionValue.h"
+#include "lldb/Interpreter/OptionValueUInt64.h"
 
 namespace lldb_private {
     //-------------------------------------------------------------------------

Modified: lldb/trunk/include/lldb/Interpreter/OptionGroupUUID.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/OptionGroupUUID.h?rev=162366&r1=162365&r2=162366&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Interpreter/OptionGroupUUID.h (original)
+++ lldb/trunk/include/lldb/Interpreter/OptionGroupUUID.h Wed Aug 22 12:17:09 2012
@@ -15,7 +15,7 @@
 // Other libraries and framework includes
 // Project includes
 #include "lldb/Interpreter/Options.h"
-#include "lldb/Interpreter/NamedOptionValue.h"
+#include "lldb/Interpreter/OptionValueUUID.h"
 
 namespace lldb_private {
 //-------------------------------------------------------------------------

Modified: lldb/trunk/include/lldb/Interpreter/OptionGroupVariable.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/OptionGroupVariable.h?rev=162366&r1=162365&r2=162366&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Interpreter/OptionGroupVariable.h (original)
+++ lldb/trunk/include/lldb/Interpreter/OptionGroupVariable.h Wed Aug 22 12:17:09 2012
@@ -14,7 +14,7 @@
 // C++ Includes
 // Other libraries and framework includes
 // Project includes
-#include "lldb/Interpreter/NamedOptionValue.h"
+#include "lldb/Interpreter/OptionValueString.h"
 #include "lldb/Interpreter/Options.h"
 
 namespace lldb_private {

Copied: lldb/trunk/include/lldb/Interpreter/OptionValue.h (from r161327, lldb/trunk/include/lldb/Interpreter/NamedOptionValue.h)
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/OptionValue.h?p2=lldb/trunk/include/lldb/Interpreter/OptionValue.h&p1=lldb/trunk/include/lldb/Interpreter/NamedOptionValue.h&r1=161327&r2=162366&rev=162366&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Interpreter/NamedOptionValue.h (original)
+++ lldb/trunk/include/lldb/Interpreter/OptionValue.h Wed Aug 22 12:17:09 2012
@@ -1,4 +1,4 @@
-//===-- NamedOptionValue.h --------------------------------------*- C++ -*-===//
+//===-- OptionValue.h --------------------------------------*- C++ -*-===//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -7,34 +7,19 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef liblldb_NamedOptionValue_h_
-#define liblldb_NamedOptionValue_h_
+#ifndef liblldb_OptionValue_h_
+#define liblldb_OptionValue_h_
 
 // C Includes
 // C++ Includes
-#include <vector>
-#include <map>
-
 // Other libraries and framework includes
 // Project includes
+#include "lldb/lldb-defines.h"
 #include "lldb/Core/ConstString.h"
-#include "lldb/Core/UUID.h"
-#include "lldb/Core/FileSpecList.h"
-#include "lldb/Host/FileSpec.h"
+#include "lldb/Core/Error.h"
 
 namespace lldb_private {
 
-    class OptionValueBoolean;
-    class OptionValueSInt64;
-    class OptionValueUInt64;
-    class OptionValueString;
-    class OptionValueFileSpec;
-    class OptionValueFileSpecList;
-    class OptionValueFormat;
-    class OptionValueUUID;
-    class OptionValueArray;
-    class OptionValueDictionary;
-
     //---------------------------------------------------------------------
     // OptionValue
     //---------------------------------------------------------------------
@@ -43,6 +28,8 @@
     public:
         typedef enum {
             eTypeInvalid = 0,
+            eTypeArch,
+            eTypeArgs,
             eTypeArray,
             eTypeBoolean,
             eTypeDictionary,
@@ -50,12 +37,36 @@
             eTypeFileSpec,
             eTypeFileSpecList,
             eTypeFormat,
+            eTypePathMap,
+            eTypeProperties,
+            eTypeRegex,
             eTypeSInt64,
+            eTypeString, 
             eTypeUInt64,
-            eTypeUUID,
-            eTypeString
+            eTypeUUID
         } Type;
         
+        enum {
+            eDumpOptionName         = (1u << 0),
+            eDumpOptionType         = (1u << 1),
+            eDumpOptionValue        = (1u << 2),
+            eDumpOptionDescription  = (1u << 3),
+            eDumpOptionRaw          = (1u << 4),
+            eDumpGroupValue         = (eDumpOptionName | eDumpOptionType | eDumpOptionValue),
+            eDumpGroupHelp          = (eDumpOptionName | eDumpOptionType | eDumpOptionDescription)
+        };
+
+        
+        OptionValue () :
+            m_value_was_set (false)
+        {
+        }
+        
+        OptionValue (const OptionValue &rhs) :
+            m_value_was_set (rhs.m_value_was_set)
+        {
+        }
+
         virtual ~OptionValue ()
         {
         }
@@ -63,17 +74,79 @@
         // Subclasses should override these functions
         //-----------------------------------------------------------------
         virtual Type
-        GetType () = 0;
+        GetType () const = 0;
+        
+        // If this value is always hidden, the avoid showing any info on this
+        // value, just show the info for the child values.
+        virtual bool
+        ValueIsTransparent () const
+        {
+            return GetType() == eTypeProperties;
+        }
+
+        virtual const char *
+        GetTypeAsCString () const
+        {
+            return GetBuiltinTypeAsCString(GetType());
+        }
+
         
+        static const char *
+        GetBuiltinTypeAsCString (Type t);
+    
         virtual void
-        DumpValue (Stream &strm) = 0;
+        DumpValue (const ExecutionContext *exe_ctx, Stream &strm, uint32_t dump_mask) = 0;
         
         virtual Error
-        SetValueFromCString (const char *value) = 0;
+        SetValueFromCString (const char *value, VarSetOperationType op = eVarSetOperationAssign);
         
         virtual bool
         Clear () = 0;
 
+        virtual lldb::OptionValueSP
+        DeepCopy () const = 0;
+
+        virtual size_t
+        AutoComplete (CommandInterpreter &interpreter,
+                      const char *s,
+                      int match_start_point,
+                      int max_return_elements,
+                      bool &word_complete,
+                      StringList &matches);
+
+        //-----------------------------------------------------------------
+        // Subclasses can override these functions
+        //-----------------------------------------------------------------
+        virtual lldb::OptionValueSP
+        GetSubValue (const ExecutionContext *exe_ctx,
+                     const char *name,
+                     bool will_modify,
+                     Error &error) const
+        {
+            error.SetErrorStringWithFormat("'%s' is not a value subvalue", name);
+            return lldb::OptionValueSP();
+        }
+
+        virtual Error
+        SetSubValue (const ExecutionContext *exe_ctx,
+                     VarSetOperationType op,
+                     const char *name,
+                     const char *value);
+
+        virtual bool
+        IsAggregateValue () const
+        {
+            return false;
+        }
+        
+        virtual ConstString
+        GetName() const
+        {
+            return ConstString();
+        }
+        
+        virtual bool
+        DumpQualifiedName (Stream &strm) const;
         //-----------------------------------------------------------------
         // Subclasses should NOT override these functions as they use the
         // above functions to implement functionality
@@ -90,1141 +163,222 @@
             return 1u << type;
         }
 
+        static OptionValue::Type
+        ConvertTypeMaskToType (uint32_t type_mask)
+        {
+            // If only one bit is set, then return an appropriate enumeration
+            switch (type_mask)
+            {
+                case 1u << eTypeArch:           return eTypeArch;
+                case 1u << eTypeArgs:           return eTypeArgs;
+                case 1u << eTypeArray:          return eTypeArray;
+                case 1u << eTypeBoolean:        return eTypeBoolean;
+                case 1u << eTypeDictionary:     return eTypeDictionary;
+                case 1u << eTypeEnum:           return eTypeEnum;
+                case 1u << eTypeFileSpec:       return eTypeFileSpec;
+                case 1u << eTypeFileSpecList:   return eTypeFileSpecList;
+                case 1u << eTypeFormat:         return eTypeFormat;
+                case 1u << eTypePathMap:        return eTypePathMap;
+                case 1u << eTypeProperties:     return eTypeProperties;
+                case 1u << eTypeRegex:          return eTypeRegex;
+                case 1u << eTypeSInt64:         return eTypeSInt64;
+                case 1u << eTypeString:         return eTypeString;
+                case 1u << eTypeUInt64:         return eTypeUInt64;
+                case 1u << eTypeUUID:           return eTypeUUID;
+            }
+            // Else return invalid
+            return eTypeInvalid;
+        }
+
+        static lldb::OptionValueSP
+        CreateValueFromCStringForTypeMask (const char *value_cstr,
+                                           uint32_t type_mask,
+                                           Error &error);
+
         // Get this value as a uint64_t value if it is encoded as a boolean,
         // uint64_t or int64_t. Other types will cause "fail_value" to be 
         // returned
         uint64_t
         GetUInt64Value (uint64_t fail_value, bool *success_ptr);
 
-        OptionValueBoolean *
-        GetAsBoolean ();
-        
-        OptionValueSInt64 *
-        GetAsSInt64 ();
+        OptionValueArch *
+        GetAsArch ();
         
-        OptionValueUInt64 *
-        GetAsUInt64 ();        
+        const OptionValueArch *
+        GetAsArch () const;
         
-        OptionValueString *
-        GetAsString ();
+        OptionValueArray *
+        GetAsArray ();
         
-        OptionValueFileSpec *
-        GetAsFileSpec ();
+        const OptionValueArray *
+        GetAsArray () const;
         
-        OptionValueFileSpecList *
-        GetAsFileSpecList ();
+        OptionValueArgs *
+        GetAsArgs ();
         
-        OptionValueFormat *
-        GetAsFormat ();
+        const OptionValueArgs *
+        GetAsArgs () const;
         
-        OptionValueUUID *
-        GetAsUUID ();
+        OptionValueBoolean *
+        GetAsBoolean ();
         
-        OptionValueArray *
-        GetAsArray ();
+        const OptionValueBoolean *
+        GetAsBoolean () const;
         
         OptionValueDictionary *
         GetAsDictionary ();
-
-        const char *
-        GetStringValue (const char *fail_value = NULL);
-
-        uint64_t
-        GetUInt64Value (uint64_t fail_value = 0);
-                
-        lldb::Format
-        GetFormatValue (lldb::Format fail_value = lldb::eFormatDefault);
-
-        bool
-        OptionWasSet () const
-        {
-            return m_value_was_set;
-        }
-        
-        void
-        SetOptionWasSet ()
-        {
-            m_value_was_set = true;
-        }
-
-    protected:
-        bool m_value_was_set; // This can be used to see if a value has been set
-                              // by a call to SetValueFromCString(). It is often
-                              // handy to know if an option value was set from
-                              // the command line or as a setting, versus if we
-                              // just have the default value that was already
-                              // populated in the option value.
         
-    };
-    
-    
-
-    //---------------------------------------------------------------------
-    // OptionValueBoolean
-    //---------------------------------------------------------------------
-    class OptionValueBoolean : public OptionValue
-    {
-    public:
-        OptionValueBoolean (bool current_value, 
-                            bool default_value) :
-            m_current_value (current_value),
-            m_default_value (default_value)
-        {
-        }
+        const OptionValueDictionary *
+        GetAsDictionary () const;
         
-        virtual 
-        ~OptionValueBoolean()
-        {
-        }
+        OptionValueEnumeration *
+        GetAsEnumeration ();
         
-        //---------------------------------------------------------------------
-        // Virtual subclass pure virtual overrides
-        //---------------------------------------------------------------------
+        const OptionValueEnumeration *
+        GetAsEnumeration () const;
         
-        virtual OptionValue::Type
-        GetType ()
-        {
-            return eTypeBoolean;
-        }
+        OptionValueFileSpec *
+        GetAsFileSpec ();
         
-        virtual void
-        DumpValue (Stream &strm);
+        const OptionValueFileSpec *
+        GetAsFileSpec () const;
         
-        virtual Error
-        SetValueFromCString (const char *value);
+        OptionValueFileSpecList *
+        GetAsFileSpecList ();
         
-        virtual bool
-        Clear ()
-        {
-            m_current_value = m_default_value;
-            m_value_was_set = false;
-            return true;
-        }
+        const OptionValueFileSpecList *
+        GetAsFileSpecList () const;
         
-        //---------------------------------------------------------------------
-        // Subclass specific functions
-        //---------------------------------------------------------------------
-        
-        //------------------------------------------------------------------
-        /// Convert to bool operator.
-        ///
-        /// This allows code to check a OptionValueBoolean in conditions.
-        ///
-        /// @code
-        /// OptionValueBoolean bool_value(...);
-        /// if (bool_value)
-        /// { ...
-        /// @endcode
-        ///
-        /// @return
-        ///     /b True this object contains a valid namespace decl, \b 
-        ///     false otherwise.
-        //------------------------------------------------------------------
-        operator bool() const
-        {
-            return m_current_value;
-        }
+        OptionValueFormat *
+        GetAsFormat ();
         
-        const bool &
-        operator = (bool b)
-        {
-            m_current_value = b;
-            return m_current_value;
-        }
-
-        bool
-        GetCurrentValue() const
-        {
-            return m_current_value;
-        }
+        const OptionValueFormat *
+        GetAsFormat () const;
         
-        bool
-        GetDefaultValue() const
-        {
-            return m_default_value;
-        }
+        OptionValuePathMappings *
+        GetAsPathMappings ();
         
-        void
-        SetCurrentValue (bool value)
-        {
-            m_current_value = value;
-        }
+        const OptionValuePathMappings *
+        GetAsPathMappings () const;
         
-        void
-        SetDefaultValue (bool value)
-        {
-            m_default_value = value;
-        }
+        OptionValueProperties *
+        GetAsProperties ();
         
-    protected:
-        bool m_current_value;
-        bool m_default_value;
-    };
-    
-    //---------------------------------------------------------------------
-    // OptionValueSInt64
-    //---------------------------------------------------------------------
-    class OptionValueSInt64 : public OptionValue
-    {
-    public:
-        OptionValueSInt64 () :
-            m_current_value (0),
-            m_default_value (0)
-        {
-        }
+        const OptionValueProperties *
+        GetAsProperties () const;
         
-        OptionValueSInt64 (int64_t current_value, 
-                           int64_t default_value) :
-            m_current_value (current_value),
-            m_default_value (default_value)
-        {
-        }
+        OptionValueRegex *
+        GetAsRegex ();
         
-        virtual 
-        ~OptionValueSInt64()
-        {
-        }
+        const OptionValueRegex *
+        GetAsRegex () const;
         
-        //---------------------------------------------------------------------
-        // Virtual subclass pure virtual overrides
-        //---------------------------------------------------------------------
+        OptionValueSInt64 *
+        GetAsSInt64 ();
         
-        virtual OptionValue::Type
-        GetType ()
-        {
-            return eTypeSInt64;
-        }
+        const OptionValueSInt64 *
+        GetAsSInt64 () const;
         
-        virtual void
-        DumpValue (Stream &strm);
+        OptionValueString *
+        GetAsString ();
         
-        virtual Error
-        SetValueFromCString (const char *value);
+        const OptionValueString *
+        GetAsString () const;
         
-        virtual bool
-        Clear ()
-        {
-            m_current_value = m_default_value;
-            m_value_was_set = false;
-            return true;
-        }
+        OptionValueUInt64 *
+        GetAsUInt64 ();
         
-        //---------------------------------------------------------------------
-        // Subclass specific functions
-        //---------------------------------------------------------------------
+        const OptionValueUInt64 *
+        GetAsUInt64 () const;
         
-        const int64_t &
-        operator = (int64_t value)
-        {
-            m_current_value = value;
-            return m_current_value;
-        }
-
-        int64_t
-        GetCurrentValue() const
-        {
-            return m_current_value;
-        }
+        OptionValueUUID *
+        GetAsUUID ();
         
-        int64_t
-        GetDefaultValue() const
-        {
-            return m_default_value;
-        }
+        const OptionValueUUID *
+        GetAsUUID () const;
         
-        void
-        SetCurrentValue (int64_t value)
-        {
-            m_current_value = value;
-        }
+        bool
+        GetBooleanValue (bool fail_value = false) const;
         
-        void
-        SetDefaultValue (int64_t value)
-        {
-            m_default_value = value;
-        }
+        bool
+        SetBooleanValue (bool new_value);
         
-    protected:
-        int64_t m_current_value;
-        int64_t m_default_value;
-    };
-    
-    //---------------------------------------------------------------------
-    // OptionValueUInt64
-    //---------------------------------------------------------------------
-    class OptionValueUInt64 : public OptionValue
-    {
-    public:
-        OptionValueUInt64 () :
-            m_current_value (0),
-            m_default_value (0)
-        {
-        }
+        int64_t
+        GetEnumerationValue (int64_t fail_value = -1) const;
 
-        OptionValueUInt64 (uint64_t current_value, 
-                           uint64_t default_value) :
-            m_current_value (current_value),
-            m_default_value (default_value)
-        {
-        }
-        
-        virtual 
-        ~OptionValueUInt64()
-        {
-        }
-        
-        //---------------------------------------------------------------------
-        // Decode a uint64_t from "value_cstr" return a OptionValueUInt64 object
-        // inside of a lldb::OptionValueSP object if all goes well. If the 
-        // string isn't a uint64_t value or any other error occurs, return an 
-        // empty lldb::OptionValueSP and fill error in with the correct stuff.
-        //---------------------------------------------------------------------
-        static lldb::OptionValueSP
-        Create (const char *value_cstr, Error &error);
-        //---------------------------------------------------------------------
-        // Virtual subclass pure virtual overrides
-        //---------------------------------------------------------------------
-        
-        virtual OptionValue::Type
-        GetType ()
-        {
-            return eTypeUInt64;
-        }
-        
-        virtual void
-        DumpValue (Stream &strm);
-        
-        virtual Error
-        SetValueFromCString (const char *value);
-        
-        virtual bool
-        Clear ()
-        {
-            m_current_value = m_default_value;
-            m_value_was_set = false;
-            return true;
-        }
+        bool
+        SetEnumerationValue (int64_t value);
+
+        FileSpec
+        GetFileSpecValue () const;
         
-        //---------------------------------------------------------------------
-        // Subclass specific functions
-        //---------------------------------------------------------------------
+        bool
+        SetFileSpecValue (const FileSpec &file_spec);
+
+        FileSpecList
+        GetFileSpecListValue () const;
         
-        const uint64_t &
-        operator = (uint64_t value)
-        {
-            m_current_value = value;
-            return m_current_value;
-        }
+        lldb::Format
+        GetFormatValue (lldb::Format fail_value = lldb::eFormatDefault) const;
 
-        operator uint64_t () const
-        {
-            return m_current_value;
-        }
+        bool
+        SetFormatValue (lldb::Format new_value);
+
+        const RegularExpression *
+        GetRegexValue () const;
+
+        int64_t
+        GetSInt64Value (int64_t fail_value = 0) const;
+
+        bool
+        SetSInt64Value (int64_t new_value);
+
+        const char *
+        GetStringValue (const char *fail_value = NULL) const;
+
+        bool
+        SetStringValue (const char *new_value);
 
         uint64_t
-        GetCurrentValue() const
-        {
-            return m_current_value;
-        }
+        GetUInt64Value (uint64_t fail_value = 0) const;
         
-        uint64_t
-        GetDefaultValue() const
+        bool
+        SetUInt64Value (uint64_t new_value);
+        
+        UUID
+        GetUUIDValue () const;
+
+        bool
+        SetUUIDValue (const UUID &uuid);
+        
+        bool
+        OptionWasSet () const
         {
-            return m_default_value;
+            return m_value_was_set;
         }
         
         void
-        SetCurrentValue (uint64_t value)
+        SetOptionWasSet ()
         {
-            m_current_value = value;
+            m_value_was_set = true;
         }
-        
+
         void
-        SetDefaultValue (uint64_t value)
+        SetParent (const lldb::OptionValueSP &parent_sp)
         {
-            m_default_value = value;
+            m_parent_wp = parent_sp;
         }
-        
     protected:
-        uint64_t m_current_value;
-        uint64_t m_default_value;
+        lldb::OptionValueWP m_parent_wp;
+        bool m_value_was_set; // This can be used to see if a value has been set
+                              // by a call to SetValueFromCString(). It is often
+                              // handy to know if an option value was set from
+                              // the command line or as a setting, versus if we
+                              // just have the default value that was already
+                              // populated in the option value.
+        
     };
 
-    //---------------------------------------------------------------------
-    // OptionValueString
-    //---------------------------------------------------------------------
-    class OptionValueString : public OptionValue
-    {
-    public:
-        OptionValueString () :
-            m_current_value (),
-            m_default_value ()
-        {
-        }
-
-        OptionValueString (const char *current_value, 
-                           const char *default_value = NULL) :
-            m_current_value (),
-            m_default_value ()
-        {
-            if  (current_value && current_value[0])
-                m_current_value.assign (current_value);
-            if  (default_value && default_value[0])
-                m_default_value.assign (default_value);
-        }
-        
-        virtual 
-        ~OptionValueString()
-        {
-        }
-        
-        //---------------------------------------------------------------------
-        // Virtual subclass pure virtual overrides
-        //---------------------------------------------------------------------
-        
-        virtual OptionValue::Type
-        GetType ()
-        {
-            return eTypeString;
-        }
-        
-        virtual void
-        DumpValue (Stream &strm);
-        
-        virtual Error
-        SetValueFromCString (const char *value);
-
-        virtual bool
-        Clear ()
-        {
-            m_current_value = m_default_value;
-            m_value_was_set = false;
-            return true;
-        }
-        
-        //---------------------------------------------------------------------
-        // Subclass specific functions
-        //---------------------------------------------------------------------
-        
-        const char *
-        operator = (const char *value)
-        {
-            if (value && value[0])
-                m_current_value.assign (value);
-            else
-                m_current_value.clear();
-            return m_current_value.c_str();
-        }
-
-        const char *
-        GetCurrentValue() const
-        {
-            return m_current_value.c_str();
-        }
-        
-        const char *
-        GetDefaultValue() const
-        {
-            return m_default_value.c_str();
-        }
-        
-        void
-        SetCurrentValue (const char *value)
-        {
-            if (value && value[0])
-                m_current_value.assign (value);
-            else
-                m_current_value.clear();
-        }
-
-        void
-        AppendToCurrentValue (const char *value)
-        {
-            if (value && value[0])
-                m_current_value.append (value);
-        }
-
-        void
-        SetDefaultValue (const char *value)
-        {
-            if (value && value[0])
-                m_default_value.assign (value);
-            else
-                m_default_value.clear();
-        }
-        
-    protected:
-        std::string m_current_value;
-        std::string m_default_value;
-    };
-
-    //---------------------------------------------------------------------
-    // OptionValueFileSpec
-    //---------------------------------------------------------------------
-    class OptionValueFileSpec : public OptionValue
-    {
-    public:
-        OptionValueFileSpec () :
-            m_current_value (),
-            m_default_value ()
-        {
-        }
-        
-        OptionValueFileSpec (const FileSpec &current_value) :
-            m_current_value (current_value),
-            m_default_value ()
-        {
-        }
-        
-        OptionValueFileSpec (const FileSpec &current_value, 
-                             const FileSpec &default_value) :
-            m_current_value (current_value),
-            m_default_value (default_value)
-        {
-        }
-        
-        virtual 
-        ~OptionValueFileSpec()
-        {
-        }
-        
-        //---------------------------------------------------------------------
-        // Virtual subclass pure virtual overrides
-        //---------------------------------------------------------------------
-        
-        virtual OptionValue::Type
-        GetType ()
-        {
-            return eTypeFileSpec;
-        }
-        
-        virtual void
-        DumpValue (Stream &strm);
-        
-        virtual Error
-        SetValueFromCString (const char *value);
-        
-        virtual bool
-        Clear ()
-        {
-            m_current_value = m_default_value;
-            m_value_was_set = false;
-            return true;
-        }
-        
-        //---------------------------------------------------------------------
-        // Subclass specific functions
-        //---------------------------------------------------------------------
-        
-        FileSpec &
-        GetCurrentValue()
-        {
-            return m_current_value;
-        }
-
-        const FileSpec &
-        GetCurrentValue() const
-        {
-            return m_current_value;
-        }
-
-        const FileSpec &
-        GetDefaultValue() const
-        {
-            return m_default_value;
-        }
-        
-        void
-        SetCurrentValue (const FileSpec &value)
-        {
-            m_current_value = value;
-        }
-        
-        void
-        SetDefaultValue (const FileSpec &value)
-        {
-            m_default_value = value;
-        }
-        
-    protected:
-        FileSpec m_current_value;
-        FileSpec m_default_value;
-    };
-
-    //---------------------------------------------------------------------
-    // OptionValueFileSpecList
-    //---------------------------------------------------------------------
-    class OptionValueFileSpecList : public OptionValue
-    {
-    public:
-        OptionValueFileSpecList () :
-            m_current_value ()
-        {
-        }
-        
-        OptionValueFileSpecList (const FileSpecList &current_value) :
-            m_current_value (current_value)
-        {
-        }
-        
-        
-        virtual 
-        ~OptionValueFileSpecList()
-        {
-        }
-        
-        //---------------------------------------------------------------------
-        // Virtual subclass pure virtual overrides
-        //---------------------------------------------------------------------
-        
-        virtual OptionValue::Type
-        GetType ()
-        {
-            return eTypeFileSpecList;
-        }
-        
-        virtual void
-        DumpValue (Stream &strm);
-        
-        virtual Error
-        SetValueFromCString (const char *value);
-        
-        virtual bool
-        Clear ()
-        {
-            m_current_value.Clear();
-            m_value_was_set = false;
-            return true;
-        }
-        
-        //---------------------------------------------------------------------
-        // Subclass specific functions
-        //---------------------------------------------------------------------
-        
-        FileSpecList &
-        GetCurrentValue()
-        {
-            return m_current_value;
-        }
-        
-        const FileSpecList &
-        GetCurrentValue() const
-        {
-            return m_current_value;
-        }
-        
-        void
-        SetCurrentValue (const FileSpecList &value)
-        {
-            m_current_value = value;
-        }
-        
-    protected:
-        FileSpecList m_current_value;
-    };
-
-    //---------------------------------------------------------------------
-    // OptionValueFormat
-    //---------------------------------------------------------------------
-    class OptionValueFormat : public OptionValue
-    {
-    public:
-        OptionValueFormat (lldb::Format current_value, 
-                           lldb::Format default_value) :
-            m_current_value (current_value),
-            m_default_value (default_value)
-        {
-        }
-        
-        virtual 
-        ~OptionValueFormat()
-        {
-        }
-        
-        //---------------------------------------------------------------------
-        // Virtual subclass pure virtual overrides
-        //---------------------------------------------------------------------
-        
-        virtual OptionValue::Type
-        GetType ()
-        {
-            return eTypeFormat;
-        }
-        
-        virtual void
-        DumpValue (Stream &strm);
-        
-        virtual Error
-        SetValueFromCString (const char *value);
-        
-        virtual bool
-        Clear ()
-        {
-            m_current_value = m_default_value;
-            m_value_was_set = false;
-            return true;
-        }
-        
-        //---------------------------------------------------------------------
-        // Subclass specific functions
-        //---------------------------------------------------------------------
-        
-        lldb::Format
-        GetCurrentValue() const
-        {
-            return m_current_value;
-        }
-        
-        lldb::Format 
-        GetDefaultValue() const
-        {
-            return m_default_value;
-        }
-        
-        void
-        SetCurrentValue (lldb::Format value)
-        {
-            m_current_value = value;
-        }
-        
-        void
-        SetDefaultValue (lldb::Format value)
-        {
-            m_default_value = value;
-        }
-        
-    protected:
-        lldb::Format m_current_value;
-        lldb::Format m_default_value;
-    };
-    
-    
-    
-    //---------------------------------------------------------------------
-    // OptionValueUUID
-    //---------------------------------------------------------------------
-    class OptionValueUUID : public OptionValue
-    {
-    public:
-        OptionValueUUID () :
-            m_uuid ()
-        {
-        }
-        
-        OptionValueUUID (const UUID &uuid) :
-            m_uuid (uuid)
-        {
-        }
-        
-        virtual 
-        ~OptionValueUUID()
-        {
-        }
-        
-        //---------------------------------------------------------------------
-        // Virtual subclass pure virtual overrides
-        //---------------------------------------------------------------------
-        
-        virtual OptionValue::Type
-        GetType ()
-        {
-            return eTypeFileSpec;
-        }
-        
-        virtual void
-        DumpValue (Stream &strm);
-        
-        virtual Error
-        SetValueFromCString (const char *value);
-        
-        virtual bool
-        Clear ()
-        {
-            m_uuid.Clear();
-            m_value_was_set = false;
-            return true;
-        }
-        
-        //---------------------------------------------------------------------
-        // Subclass specific functions
-        //---------------------------------------------------------------------
-        
-        UUID &
-        GetCurrentValue()
-        {
-            return m_uuid;
-        }
-        
-        const UUID &
-        GetCurrentValue() const
-        {
-            return m_uuid;
-        }
-        
-        void
-        SetCurrentValue (const UUID &value)
-        {
-            m_uuid = value;
-        }
-        
-    protected:
-        UUID m_uuid;
-    };
-
-    //---------------------------------------------------------------------
-    // OptionValueArray
-    //---------------------------------------------------------------------
-    class OptionValueArray : public OptionValue
-    {
-    public:
-        OptionValueArray (uint32_t type_mask = UINT32_MAX) :
-            m_type_mask (type_mask),
-            m_values ()
-        {
-        }
-        
-        virtual 
-        ~OptionValueArray()
-        {
-        }
-        
-        //---------------------------------------------------------------------
-        // Virtual subclass pure virtual overrides
-        //---------------------------------------------------------------------
-        
-        virtual OptionValue::Type
-        GetType ()
-        {
-            return eTypeArray;
-        }
-        
-        virtual void
-        DumpValue (Stream &strm);
-        
-        virtual Error
-        SetValueFromCString (const char *value);
-        
-        virtual bool
-        Clear ()
-        {
-            m_values.clear();
-            m_value_was_set = false;
-            return true;
-        }
-        
-        //---------------------------------------------------------------------
-        // Subclass specific functions
-        //---------------------------------------------------------------------
-
-        uint32_t
-        GetSize () const
-        {
-            return m_values.size();
-        }
-
-        lldb::OptionValueSP
-        operator[](uint32_t idx) const
-        {
-            lldb::OptionValueSP value_sp;
-            if (idx < m_values.size())
-                value_sp = m_values[idx];
-            return value_sp;
-        }
-
-        lldb::OptionValueSP
-        GetValueAtIndex (uint32_t idx) const
-        {
-            lldb::OptionValueSP value_sp;
-            if (idx < m_values.size())
-                value_sp = m_values[idx];
-            return value_sp;
-        }
-        
-        bool
-        AppendValue (const lldb::OptionValueSP &value_sp)
-        {
-            // Make sure the value_sp object is allowed to contain
-            // values of the type passed in...
-            if (value_sp && (m_type_mask & value_sp->GetTypeAsMask()))
-            {
-                m_values.push_back(value_sp);
-                return true;
-            }
-            return false;
-        }
-        
-        bool
-        InsertValue (uint32_t idx, const lldb::OptionValueSP &value_sp)
-        {
-            // Make sure the value_sp object is allowed to contain
-            // values of the type passed in...
-            if (value_sp && (m_type_mask & value_sp->GetTypeAsMask()))
-            {
-                if (idx < m_values.size())
-                    m_values.insert(m_values.begin() + idx, value_sp);
-                else
-                    m_values.push_back(value_sp);
-                return true;
-            }
-            return false;
-        }
-
-        bool
-        ReplaceValue (uint32_t idx, const lldb::OptionValueSP &value_sp)
-        {
-            // Make sure the value_sp object is allowed to contain
-            // values of the type passed in...
-            if (value_sp && (m_type_mask & value_sp->GetTypeAsMask()))
-            {
-                if (idx < m_values.size())
-                {
-                    m_values[idx] = value_sp;
-                    return true;
-                }
-            }
-            return false;
-        }
-
-        bool
-        DeleteValue (uint32_t idx)
-        {
-            if (idx < m_values.size())
-            {
-                m_values.erase (m_values.begin() + idx);
-                return true;
-            }
-            return false;
-        }
-        
-    protected:
-        typedef std::vector<lldb::OptionValueSP> collection;
-                
-        uint32_t m_type_mask;
-        collection m_values;
-    };
-
-    
-    
-    //---------------------------------------------------------------------
-    // OptionValueDictionary
-    //---------------------------------------------------------------------
-    class OptionValueDictionary : public OptionValue
-    {
-    public:
-        OptionValueDictionary (uint32_t type_mask = UINT32_MAX) :
-            m_type_mask (type_mask),
-            m_values ()
-        {
-        }
-        
-        virtual 
-        ~OptionValueDictionary()
-        {
-        }
-        
-        //---------------------------------------------------------------------
-        // Virtual subclass pure virtual overrides
-        //---------------------------------------------------------------------
-        
-        virtual OptionValue::Type
-        GetType ()
-        {
-            return eTypeDictionary;
-        }
-        
-        virtual void
-        DumpValue (Stream &strm);
-        
-        virtual Error
-        SetValueFromCString (const char *value);
-        
-        virtual bool
-        Clear ()
-        {
-            m_values.clear();
-            m_value_was_set = false;
-            return true;
-        }
-        
-        //---------------------------------------------------------------------
-        // Subclass specific functions
-        //---------------------------------------------------------------------
-        
-        uint32_t
-        GetNumValues() const
-        {
-            return m_values.size();
-        }
-        
-        lldb::OptionValueSP
-        GetValueForKey (const ConstString &key) const;
-        
-        //---------------------------------------------------------------------
-        // String value getters and setters
-        //---------------------------------------------------------------------
-        const char *
-        GetStringValueForKey (const ConstString &key);
-
-        bool
-        SetStringValueForKey (const ConstString &key, 
-                              const char *value,
-                              bool can_replace = true);
-
-        
-        bool
-        SetValueForKey (const ConstString &key, 
-                        const lldb::OptionValueSP &value_sp, 
-                        bool can_replace = true);
-        
-        bool
-        DeleteValueForKey (const ConstString &key);
-        
-    protected:
-        typedef std::map<ConstString, lldb::OptionValueSP> collection;
-        uint32_t m_type_mask;
-        collection m_values;
-    };
-    
-
-    
-    //---------------------------------------------------------------------
-    // OptionValueCollection
-    //
-    // The option value collection is a class that must be subclassed in
-    // order to provide a collection of named OptionValue objects. The
-    // collection is immutable (use OptionValueDictionary for mutable key
-    // value pair collection). This allows classes to have some member
-    // variables that are OptionValue subclasses, and still provide access
-    // to setting and modifying these values from textual commands:
-    //
-    //    
-    //    class Car : public OptionValueCollection 
-    //    {
-    //    public:
-    //        
-    //        Car () : OptionValueCollection (NULL, "car"),
-    //             m_is_running_name ("running"),
-    //             m_license_number_name ("license"),
-    //             m_is_running (false, false),
-    //             m_license_number ()
-    //        {
-    //        }
-    //        
-    //        
-    //        bool
-    //        GetIsRunning () const
-    //        {
-    //            return m_is_running.GetCurrentValue();
-    //        }
-    //        
-    //        const char *
-    //        GetLicense () const
-    //        {
-    //            return m_license_number.GetCurrentValue();
-    //        }
-    //        
-    //        virtual uint32_t
-    //        GetNumValues() const
-    //        {
-    //            return 2;
-    //        }
-    //        
-    //        virtual ConstString
-    //        GetKeyAtIndex (uint32_t idx) const
-    //        {
-    //            switch (idx)
-    //            {
-    //                case 0: return m_is_running_name;
-    //                case 1: return m_license_number_name;
-    //            }
-    //            return ConstString();
-    //        }
-    //        
-    //        virtual OptionValue*
-    //        GetValueForKey (const ConstString &key)
-    //        {
-    //            if (key == m_is_running_name)
-    //                return &m_is_running;
-    //            else if (key == m_license_number_name)
-    //                return &m_license_number;
-    //            return NULL;
-    //        }
-    //        
-    //    protected:
-    //        ConstString m_is_running_name;
-    //        ConstString m_license_number_name;
-    //        OptionValueBoolean m_is_running;
-    //        OptionValueString m_license_number;
-    //        
-    //    };
-    //
-    // As we can see above, this allows the Car class to have direct access
-    // to its member variables settings m_is_running and m_license_number,
-    // yet it allows them to also be available by name to our command
-    // interpreter.
-    //---------------------------------------------------------------------
-    class OptionValueCollection
-    {
-    public:
-        OptionValueCollection (OptionValueCollection *parent, const ConstString &name) :
-            m_parent (parent),
-            m_name (name)
-        {
-        }
-
-        OptionValueCollection (OptionValueCollection *parent, const char *name) :
-            m_parent (parent),
-            m_name (name)
-        {
-        }
-
-        virtual 
-        ~OptionValueCollection()
-        {
-        }
-        
-        
-        OptionValueCollection *
-        GetParent ()
-        {
-            return m_parent;
-        }
-        
-        const OptionValueCollection *
-        GetParent () const
-        {
-            return m_parent;
-        }
-        
-        const ConstString &
-        GetName () const
-        {
-            return m_name;
-        }
-
-        void
-        GetQualifiedName (Stream &strm);
-
-        //---------------------------------------------------------------------
-        // Subclass specific functions
-        //---------------------------------------------------------------------
-        
-        virtual uint32_t
-        GetNumValues() const = 0;
-        
-        virtual ConstString
-        GetKeyAtIndex (uint32_t idx) const = 0;
-
-        virtual OptionValue*
-        GetValueForKey (const ConstString &key) = 0;
-
-    protected:
-        OptionValueCollection *m_parent;    // NULL if this is a root object
-        ConstString m_name;                 // Name for this collection setting (if any)
-    };
-    
-    
-
 } // namespace lldb_private
 
-#endif  // liblldb_NamedOptionValue_h_
+#endif  // liblldb_OptionValue_h_

Added: lldb/trunk/include/lldb/Interpreter/OptionValueArch.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/OptionValueArch.h?rev=162366&view=auto
==============================================================================
--- lldb/trunk/include/lldb/Interpreter/OptionValueArch.h (added)
+++ lldb/trunk/include/lldb/Interpreter/OptionValueArch.h Wed Aug 22 12:17:09 2012
@@ -0,0 +1,139 @@
+//===-- OptionValueArch.h -----------------------------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_OptionValueArch_h_
+#define liblldb_OptionValueArch_h_
+
+// C Includes
+// C++ Includes
+// Other libraries and framework includes
+// Project includes
+#include "lldb/Core/ArchSpec.h"
+#include "lldb/Interpreter/OptionValue.h"
+
+namespace lldb_private {
+
+class OptionValueArch : public OptionValue
+{
+public:
+    OptionValueArch () :
+        OptionValue(),
+        m_current_value (),
+        m_default_value ()
+    {
+    }
+
+    OptionValueArch (const char *triple) :
+        OptionValue(),
+        m_current_value (triple),
+        m_default_value ()
+    {
+        m_default_value = m_current_value;
+    }
+
+    OptionValueArch (const ArchSpec &value) :
+        OptionValue(),
+        m_current_value (value),
+        m_default_value (value)
+    {
+    }
+    
+    OptionValueArch (const ArchSpec &current_value,
+                     const ArchSpec &default_value) :
+        OptionValue(),
+        m_current_value (current_value),
+        m_default_value (default_value)
+    {
+    }
+    
+    virtual 
+    ~OptionValueArch()
+    {
+    }
+    
+    //---------------------------------------------------------------------
+    // Virtual subclass pure virtual overrides
+    //---------------------------------------------------------------------
+    
+    virtual OptionValue::Type
+    GetType () const
+    {
+        return eTypeArch;
+    }
+    
+    virtual void
+    DumpValue (const ExecutionContext *exe_ctx, Stream &strm, uint32_t dump_mask);
+    
+    virtual Error
+    SetValueFromCString (const char *value,
+                         VarSetOperationType op = eVarSetOperationAssign);
+    
+    virtual bool
+    Clear ()
+    {
+        m_current_value = m_default_value;
+        m_value_was_set = false;
+        return true;
+    }
+    
+    virtual lldb::OptionValueSP
+    DeepCopy () const;
+
+    virtual size_t
+    AutoComplete (CommandInterpreter &interpreter,
+                  const char *s,
+                  int match_start_point,
+                  int max_return_elements,
+                  bool &word_complete,
+                  StringList &matches);
+    
+    //---------------------------------------------------------------------
+    // Subclass specific functions
+    //---------------------------------------------------------------------
+    
+    ArchSpec &
+    GetCurrentValue()
+    {
+        return m_current_value;
+    }
+
+    const ArchSpec &
+    GetCurrentValue() const
+    {
+        return m_current_value;
+    }
+
+    const ArchSpec &
+    GetDefaultValue() const
+    {
+        return m_default_value;
+    }
+    
+    void
+    SetCurrentValue (const ArchSpec &value, bool set_value_was_set)
+    {
+        m_current_value = value;
+        if (set_value_was_set)
+            m_value_was_set = true;
+    }
+    
+    void
+    SetDefaultValue (const ArchSpec &value)
+    {
+        m_default_value = value;
+    }
+    
+protected:
+    ArchSpec m_current_value;
+    ArchSpec m_default_value;
+};
+
+} // namespace lldb_private
+
+#endif  // liblldb_OptionValueArch_h_

Added: lldb/trunk/include/lldb/Interpreter/OptionValueArgs.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/OptionValueArgs.h?rev=162366&view=auto
==============================================================================
--- lldb/trunk/include/lldb/Interpreter/OptionValueArgs.h (added)
+++ lldb/trunk/include/lldb/Interpreter/OptionValueArgs.h Wed Aug 22 12:17:09 2012
@@ -0,0 +1,46 @@
+//===-- OptionValueArgs.h --------------------------------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_OptionValueArgs_h_
+#define liblldb_OptionValueArgs_h_
+
+// C Includes
+// C++ Includes
+// Other libraries and framework includes
+// Project includes
+#include "lldb/Interpreter/OptionValueArray.h"
+
+namespace lldb_private {
+
+class OptionValueArgs : public OptionValueArray
+{
+public:
+    OptionValueArgs () :
+        OptionValueArray (OptionValue::ConvertTypeToMask (OptionValue::eTypeString))
+    {
+    }
+    
+    virtual
+    ~OptionValueArgs()
+    {
+    }
+    
+    size_t
+    GetArgs (Args &args);
+    
+    virtual Type
+    GetType() const
+    {
+        return eTypeArgs;
+    }
+};
+
+} // namespace lldb_private
+
+#endif  // liblldb_OptionValueArgs_h_

Added: lldb/trunk/include/lldb/Interpreter/OptionValueArray.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/OptionValueArray.h?rev=162366&view=auto
==============================================================================
--- lldb/trunk/include/lldb/Interpreter/OptionValueArray.h (added)
+++ lldb/trunk/include/lldb/Interpreter/OptionValueArray.h Wed Aug 22 12:17:09 2012
@@ -0,0 +1,178 @@
+//===-- OptionValueArray.h --------------------------------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_OptionValueArray_h_
+#define liblldb_OptionValueArray_h_
+
+// C Includes
+// C++ Includes
+#include <vector>
+
+// Other libraries and framework includes
+// Project includes
+#include "lldb/Interpreter/OptionValue.h"
+
+namespace lldb_private {
+
+class OptionValueArray : public OptionValue
+{
+public:
+    OptionValueArray (uint32_t type_mask = UINT32_MAX, bool raw_value_dump = false) :
+        m_type_mask (type_mask),
+        m_values (),
+        m_raw_value_dump(raw_value_dump)
+    {
+    }
+    
+    virtual 
+    ~OptionValueArray()
+    {
+    }
+    
+    //---------------------------------------------------------------------
+    // Virtual subclass pure virtual overrides
+    //---------------------------------------------------------------------
+    
+    virtual OptionValue::Type
+    GetType () const
+    {
+        return eTypeArray;
+    }
+    
+    virtual void
+    DumpValue (const ExecutionContext *exe_ctx, Stream &strm, uint32_t dump_mask);
+    
+    virtual Error
+    SetValueFromCString (const char *value,
+                         VarSetOperationType op = eVarSetOperationAssign);
+    
+    virtual bool
+    Clear ()
+    {
+        m_values.clear();
+        m_value_was_set = false;
+        return true;
+    }
+    
+    virtual lldb::OptionValueSP
+    DeepCopy () const;
+    
+    virtual bool
+    IsAggregateValue () const
+    {
+        return true;
+    }
+    
+    virtual lldb::OptionValueSP
+    GetSubValue (const ExecutionContext *exe_ctx,
+                 const char *name,
+                 bool will_modify,
+                 Error &error) const;
+    
+    //---------------------------------------------------------------------
+    // Subclass specific functions
+    //---------------------------------------------------------------------
+
+    uint32_t
+    GetSize () const
+    {
+        return m_values.size();
+    }
+
+    lldb::OptionValueSP
+    operator[](uint32_t idx) const
+    {
+        lldb::OptionValueSP value_sp;
+        if (idx < m_values.size())
+            value_sp = m_values[idx];
+        return value_sp;
+    }
+
+    lldb::OptionValueSP
+    GetValueAtIndex (uint32_t idx) const
+    {
+        lldb::OptionValueSP value_sp;
+        if (idx < m_values.size())
+            value_sp = m_values[idx];
+        return value_sp;
+    }
+    
+    bool
+    AppendValue (const lldb::OptionValueSP &value_sp)
+    {
+        // Make sure the value_sp object is allowed to contain
+        // values of the type passed in...
+        if (value_sp && (m_type_mask & value_sp->GetTypeAsMask()))
+        {
+            m_values.push_back(value_sp);
+            return true;
+        }
+        return false;
+    }
+    
+    bool
+    InsertValue (uint32_t idx, const lldb::OptionValueSP &value_sp)
+    {
+        // Make sure the value_sp object is allowed to contain
+        // values of the type passed in...
+        if (value_sp && (m_type_mask & value_sp->GetTypeAsMask()))
+        {
+            if (idx < m_values.size())
+                m_values.insert(m_values.begin() + idx, value_sp);
+            else
+                m_values.push_back(value_sp);
+            return true;
+        }
+        return false;
+    }
+
+    bool
+    ReplaceValue (uint32_t idx, const lldb::OptionValueSP &value_sp)
+    {
+        // Make sure the value_sp object is allowed to contain
+        // values of the type passed in...
+        if (value_sp && (m_type_mask & value_sp->GetTypeAsMask()))
+        {
+            if (idx < m_values.size())
+            {
+                m_values[idx] = value_sp;
+                return true;
+            }
+        }
+        return false;
+    }
+
+    bool
+    DeleteValue (uint32_t idx)
+    {
+        if (idx < m_values.size())
+        {
+            m_values.erase (m_values.begin() + idx);
+            return true;
+        }
+        return false;
+    }
+    
+    size_t
+    GetArgs (Args &args) const;
+    
+    Error
+    SetArgs (const Args &args, VarSetOperationType op);
+    
+protected:
+    typedef std::vector<lldb::OptionValueSP> collection;
+            
+    uint32_t m_type_mask;
+    collection m_values;
+    bool m_raw_value_dump;
+};
+
+} // namespace lldb_private
+
+#endif  // liblldb_OptionValueArray_h_

Added: lldb/trunk/include/lldb/Interpreter/OptionValueBoolean.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/OptionValueBoolean.h?rev=162366&view=auto
==============================================================================
--- lldb/trunk/include/lldb/Interpreter/OptionValueBoolean.h (added)
+++ lldb/trunk/include/lldb/Interpreter/OptionValueBoolean.h Wed Aug 22 12:17:09 2012
@@ -0,0 +1,133 @@
+//===-- OptionValueBoolean.h ------------------------------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_OptionValueBoolean_h_
+#define liblldb_OptionValueBoolean_h_
+
+// C Includes
+// C++ Includes
+// Other libraries and framework includes
+// Project includes
+#include "lldb/Interpreter/OptionValue.h"
+
+namespace lldb_private {
+
+class OptionValueBoolean : public OptionValue
+{
+public:
+    OptionValueBoolean (bool value) :
+        OptionValue(),
+        m_current_value (value),
+        m_default_value (value)
+    {
+    }
+    OptionValueBoolean (bool current_value,
+                        bool default_value) :
+        OptionValue(),
+        m_current_value (current_value),
+        m_default_value (default_value)
+    {
+    }
+    
+    virtual 
+    ~OptionValueBoolean()
+    {
+    }
+    
+    //---------------------------------------------------------------------
+    // Virtual subclass pure virtual overrides
+    //---------------------------------------------------------------------
+    
+    virtual OptionValue::Type
+    GetType () const
+    {
+        return eTypeBoolean;
+    }
+    
+    virtual void
+    DumpValue (const ExecutionContext *exe_ctx, Stream &strm, uint32_t dump_mask);
+    
+    virtual Error
+    SetValueFromCString (const char *value,
+                         VarSetOperationType op = eVarSetOperationAssign);
+    
+    virtual bool
+    Clear ()
+    {
+        m_current_value = m_default_value;
+        m_value_was_set = false;
+        return true;
+    }
+    
+    //---------------------------------------------------------------------
+    // Subclass specific functions
+    //---------------------------------------------------------------------
+    
+    //------------------------------------------------------------------
+    /// Convert to bool operator.
+    ///
+    /// This allows code to check a OptionValueBoolean in conditions.
+    ///
+    /// @code
+    /// OptionValueBoolean bool_value(...);
+    /// if (bool_value)
+    /// { ...
+    /// @endcode
+    ///
+    /// @return
+    ///     /b True this object contains a valid namespace decl, \b 
+    ///     false otherwise.
+    //------------------------------------------------------------------
+    operator bool() const
+    {
+        return m_current_value;
+    }
+    
+    const bool &
+    operator = (bool b)
+    {
+        m_current_value = b;
+        return m_current_value;
+    }
+
+    bool
+    GetCurrentValue() const
+    {
+        return m_current_value;
+    }
+    
+    bool
+    GetDefaultValue() const
+    {
+        return m_default_value;
+    }
+    
+    void
+    SetCurrentValue (bool value)
+    {
+        m_current_value = value;
+    }
+    
+    void
+    SetDefaultValue (bool value)
+    {
+        m_default_value = value;
+    }
+    
+    virtual lldb::OptionValueSP
+    DeepCopy () const;
+
+protected:
+    bool m_current_value;
+    bool m_default_value;
+};
+
+} // namespace lldb_private
+
+#endif  // liblldb_OptionValueBoolean_h_

Added: lldb/trunk/include/lldb/Interpreter/OptionValueDictionary.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/OptionValueDictionary.h?rev=162366&view=auto
==============================================================================
--- lldb/trunk/include/lldb/Interpreter/OptionValueDictionary.h (added)
+++ lldb/trunk/include/lldb/Interpreter/OptionValueDictionary.h Wed Aug 22 12:17:09 2012
@@ -0,0 +1,139 @@
+//===-- OptionValueDictionary.h ---------------------------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_OptionValueDictionary_h_
+#define liblldb_OptionValueDictionary_h_
+
+// C Includes
+// C++ Includes
+#include <map>
+
+// Other libraries and framework includes
+// Project includes
+#include "lldb/Interpreter/OptionValue.h"
+
+namespace lldb_private {
+    
+class OptionValueDictionary : public OptionValue
+{
+public:
+    OptionValueDictionary (uint32_t type_mask = UINT32_MAX, bool raw_value_dump = true) :
+        OptionValue(),
+        m_type_mask (type_mask),
+        m_values (),
+        m_raw_value_dump (raw_value_dump)
+    {
+    }
+    
+    virtual 
+    ~OptionValueDictionary()
+    {
+    }
+    
+    //---------------------------------------------------------------------
+    // Virtual subclass pure virtual overrides
+    //---------------------------------------------------------------------
+    
+    virtual OptionValue::Type
+    GetType () const
+    {
+        return eTypeDictionary;
+    }
+    
+    virtual void
+    DumpValue (const ExecutionContext *exe_ctx, Stream &strm, uint32_t dump_mask);
+    
+    virtual Error
+    SetValueFromCString (const char *value,
+                         VarSetOperationType op = eVarSetOperationAssign);
+    
+    virtual bool
+    Clear ()
+    {
+        m_values.clear();
+        m_value_was_set = false;
+        return true;
+    }
+    
+    virtual lldb::OptionValueSP
+    DeepCopy () const;
+    
+    virtual bool
+    IsAggregateValue () const
+    {
+        return true;
+    }
+
+    bool
+    IsHomogenous() const
+    {
+        return ConvertTypeMaskToType (m_type_mask) != eTypeInvalid;
+    }
+
+    //---------------------------------------------------------------------
+    // Subclass specific functions
+    //---------------------------------------------------------------------
+    
+    uint32_t
+    GetNumValues() const
+    {
+        return m_values.size();
+    }
+    
+    lldb::OptionValueSP
+    GetValueForKey (const ConstString &key) const;
+    
+    virtual lldb::OptionValueSP
+    GetSubValue (const ExecutionContext *exe_ctx,
+                 const char *name,
+                 bool will_modify,
+                 Error &error) const;
+    
+    virtual Error
+    SetSubValue (const ExecutionContext *exe_ctx,
+                 VarSetOperationType op,
+                 const char *name,
+                 const char *value);
+
+    //---------------------------------------------------------------------
+    // String value getters and setters
+    //---------------------------------------------------------------------
+    const char *
+    GetStringValueForKey (const ConstString &key);
+
+    bool
+    SetStringValueForKey (const ConstString &key, 
+                          const char *value,
+                          bool can_replace = true);
+
+    
+    bool
+    SetValueForKey (const ConstString &key, 
+                    const lldb::OptionValueSP &value_sp, 
+                    bool can_replace = true);
+    
+    bool
+    DeleteValueForKey (const ConstString &key);
+    
+    size_t
+    GetArgs (Args &args) const;
+    
+    Error
+    SetArgs (const Args &args, VarSetOperationType op);
+    
+protected:
+    typedef std::map<ConstString, lldb::OptionValueSP> collection;
+    uint32_t m_type_mask;
+    collection m_values;
+    bool m_raw_value_dump;
+};
+    
+} // namespace lldb_private
+
+#endif  // liblldb_OptionValueDictionary_h_

Added: lldb/trunk/include/lldb/Interpreter/OptionValueEnumeration.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/OptionValueEnumeration.h?rev=162366&view=auto
==============================================================================
--- lldb/trunk/include/lldb/Interpreter/OptionValueEnumeration.h (added)
+++ lldb/trunk/include/lldb/Interpreter/OptionValueEnumeration.h Wed Aug 22 12:17:09 2012
@@ -0,0 +1,118 @@
+//===-- OptionValueEnumeration.h --------------------------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_OptionValueEnumeration_h_
+#define liblldb_OptionValueEnumeration_h_
+
+// C Includes
+// C++ Includes
+// Other libraries and framework includes
+// Project includes
+#include "lldb/Core/ConstString.h"
+#include "lldb/Core/Error.h"
+#include "lldb/Core/Stream.h"
+#include "lldb/Core/StreamString.h"
+#include "lldb/Core/UniqueCStringMap.h"
+#include "lldb/Interpreter/OptionValue.h"
+
+namespace lldb_private {
+
+
+class OptionValueEnumeration : public OptionValue
+{
+public:
+    typedef int64_t enum_type;
+    struct EnumeratorInfo
+    {
+        enum_type value;
+        const char *description;
+    };
+    typedef UniqueCStringMap<EnumeratorInfo> EnumerationMap;
+    typedef typename EnumerationMap::Entry EnumerationMapEntry;
+
+    OptionValueEnumeration (const OptionEnumValueElement *enumerators, enum_type value);
+    
+    virtual
+    ~OptionValueEnumeration();
+    
+    //---------------------------------------------------------------------
+    // Virtual subclass pure virtual overrides
+    //---------------------------------------------------------------------
+    
+    virtual OptionValue::Type
+    GetType () const
+    {
+        return eTypeEnum;
+    }
+    
+    virtual void
+    DumpValue (const ExecutionContext *exe_ctx, Stream &strm, uint32_t dump_mask);
+    
+    virtual Error
+    SetValueFromCString (const char *value,
+                         VarSetOperationType op = eVarSetOperationAssign);
+    
+    virtual bool
+    Clear ()
+    {
+        m_current_value = m_default_value;
+        m_value_was_set = false;
+        return true;
+    }
+    
+    virtual lldb::OptionValueSP
+    DeepCopy () const;
+    
+    //---------------------------------------------------------------------
+    // Subclass specific functions
+    //---------------------------------------------------------------------
+    
+    enum_type
+    operator = (enum_type value)
+    {
+        m_current_value = value;
+        return m_current_value;
+    }
+    
+    enum_type
+    GetCurrentValue() const
+    {
+        return m_current_value;
+    }
+    
+    enum_type
+    GetDefaultValue() const
+    {
+        return m_default_value;
+    }
+    
+    void
+    SetCurrentValue (enum_type value)
+    {
+        m_current_value = value;
+    }
+    
+    void
+    SetDefaultValue (enum_type value)
+    {
+        m_default_value = value;
+    }
+    
+protected:
+    void
+    SetEnumerations (const OptionEnumValueElement *enumerators);
+
+    enum_type m_current_value;
+    enum_type m_default_value;
+    EnumerationMap m_enumerations;
+};
+
+} // namespace lldb_private
+
+#endif  // liblldb_OptionValueEnumeration_h_

Added: lldb/trunk/include/lldb/Interpreter/OptionValueFileSpec.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/OptionValueFileSpec.h?rev=162366&view=auto
==============================================================================
--- lldb/trunk/include/lldb/Interpreter/OptionValueFileSpec.h (added)
+++ lldb/trunk/include/lldb/Interpreter/OptionValueFileSpec.h Wed Aug 22 12:17:09 2012
@@ -0,0 +1,129 @@
+//===-- OptionValueFileSpec.h -----------------------------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_OptionValueFileSpec_h_
+#define liblldb_OptionValueFileSpec_h_
+
+// C Includes
+// C++ Includes
+// Other libraries and framework includes
+// Project includes
+#include "lldb/Host/FileSpec.h"
+#include "lldb/Interpreter/OptionValue.h"
+
+namespace lldb_private {
+
+class OptionValueFileSpec : public OptionValue
+{
+public:
+    OptionValueFileSpec () :
+        OptionValue(),
+        m_current_value (),
+        m_default_value ()
+    {
+    }
+    
+    OptionValueFileSpec (const FileSpec &value) :
+        OptionValue(),
+        m_current_value (value),
+        m_default_value (value)
+    {
+    }
+    
+    OptionValueFileSpec (const FileSpec &current_value, 
+                         const FileSpec &default_value) :
+        OptionValue(),
+        m_current_value (current_value),
+        m_default_value (default_value)
+    {
+    }
+    
+    virtual 
+    ~OptionValueFileSpec()
+    {
+    }
+    
+    //---------------------------------------------------------------------
+    // Virtual subclass pure virtual overrides
+    //---------------------------------------------------------------------
+    
+    virtual OptionValue::Type
+    GetType () const
+    {
+        return eTypeFileSpec;
+    }
+    
+    virtual void
+    DumpValue (const ExecutionContext *exe_ctx, Stream &strm, uint32_t dump_mask);
+    
+    virtual Error
+    SetValueFromCString (const char *value,
+                         VarSetOperationType op = eVarSetOperationAssign);
+    
+    virtual bool
+    Clear ()
+    {
+        m_current_value = m_default_value;
+        m_value_was_set = false;
+        return true;
+    }
+    
+    virtual lldb::OptionValueSP
+    DeepCopy () const;
+
+    virtual size_t
+    AutoComplete (CommandInterpreter &interpreter,
+                  const char *s,
+                  int match_start_point,
+                  int max_return_elements,
+                  bool &word_complete,
+                  StringList &matches);
+    
+    //---------------------------------------------------------------------
+    // Subclass specific functions
+    //---------------------------------------------------------------------
+    
+    FileSpec &
+    GetCurrentValue()
+    {
+        return m_current_value;
+    }
+
+    const FileSpec &
+    GetCurrentValue() const
+    {
+        return m_current_value;
+    }
+
+    const FileSpec &
+    GetDefaultValue() const
+    {
+        return m_default_value;
+    }
+    
+    void
+    SetCurrentValue (const FileSpec &value)
+    {
+        m_current_value = value;
+    }
+    
+    void
+    SetDefaultValue (const FileSpec &value)
+    {
+        m_default_value = value;
+    }
+    
+protected:
+    FileSpec m_current_value;
+    FileSpec m_default_value;
+};
+
+} // namespace lldb_private
+
+#endif  // liblldb_OptionValueFileSpec_h_

Added: lldb/trunk/include/lldb/Interpreter/OptionValueFileSpecList.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/OptionValueFileSpecList.h?rev=162366&view=auto
==============================================================================
--- lldb/trunk/include/lldb/Interpreter/OptionValueFileSpecList.h (added)
+++ lldb/trunk/include/lldb/Interpreter/OptionValueFileSpecList.h Wed Aug 22 12:17:09 2012
@@ -0,0 +1,105 @@
+//===-- OptionValueFileSpecList.h -------------------------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_OptionValueFileSpecList_h_
+#define liblldb_OptionValueFileSpecList_h_
+
+// C Includes
+// C++ Includes
+// Other libraries and framework includes
+// Project includes
+#include "lldb/Core/FileSpecList.h"
+#include "lldb/Interpreter/OptionValue.h"
+
+namespace lldb_private {
+
+class OptionValueFileSpecList : public OptionValue
+{
+public:
+    OptionValueFileSpecList () :
+        OptionValue(),
+        m_current_value ()
+    {
+    }
+    
+    OptionValueFileSpecList (const FileSpecList &current_value) :
+        OptionValue(),
+        m_current_value (current_value)
+    {
+    }
+    
+    
+    virtual 
+    ~OptionValueFileSpecList()
+    {
+    }
+    
+    //---------------------------------------------------------------------
+    // Virtual subclass pure virtual overrides
+    //---------------------------------------------------------------------
+    
+    virtual OptionValue::Type
+    GetType () const
+    {
+        return eTypeFileSpecList;
+    }
+    
+    virtual void
+    DumpValue (const ExecutionContext *exe_ctx, Stream &strm, uint32_t dump_mask);
+    
+    virtual Error
+    SetValueFromCString (const char *value,
+                         VarSetOperationType op = eVarSetOperationAssign);
+    
+    virtual bool
+    Clear ()
+    {
+        m_current_value.Clear();
+        m_value_was_set = false;
+        return true;
+    }
+    
+    virtual lldb::OptionValueSP
+    DeepCopy () const;
+    
+    virtual bool
+    IsAggregateValue () const
+    {
+        return true;
+    }
+
+    //---------------------------------------------------------------------
+    // Subclass specific functions
+    //---------------------------------------------------------------------
+    
+    FileSpecList &
+    GetCurrentValue()
+    {
+        return m_current_value;
+    }
+    
+    const FileSpecList &
+    GetCurrentValue() const
+    {
+        return m_current_value;
+    }
+    
+    void
+    SetCurrentValue (const FileSpecList &value)
+    {
+        m_current_value = value;
+    }
+    
+protected:
+    FileSpecList m_current_value;
+};
+
+} // namespace lldb_private
+
+#endif  // liblldb_OptionValueFileSpecList_h_

Added: lldb/trunk/include/lldb/Interpreter/OptionValueFormat.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/OptionValueFormat.h?rev=162366&view=auto
==============================================================================
--- lldb/trunk/include/lldb/Interpreter/OptionValueFormat.h (added)
+++ lldb/trunk/include/lldb/Interpreter/OptionValueFormat.h Wed Aug 22 12:17:09 2012
@@ -0,0 +1,107 @@
+//===-- OptionValueFormat.h -------------------------------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_OptionValueFormat_h_
+#define liblldb_OptionValueFormat_h_
+
+// C Includes
+// C++ Includes
+// Other libraries and framework includes
+// Project includes
+#include "lldb/Interpreter/OptionValue.h"
+
+namespace lldb_private {
+
+class OptionValueFormat : public OptionValue
+{
+public:
+    OptionValueFormat (lldb::Format value) :
+        OptionValue(),
+        m_current_value (value),
+        m_default_value (value)
+    {
+    }
+
+    OptionValueFormat (lldb::Format current_value,
+                       lldb::Format default_value) :
+        OptionValue(),
+        m_current_value (current_value),
+        m_default_value (default_value)
+    {
+    }
+    
+    virtual 
+    ~OptionValueFormat()
+    {
+    }
+    
+    //---------------------------------------------------------------------
+    // Virtual subclass pure virtual overrides
+    //---------------------------------------------------------------------
+    
+    virtual OptionValue::Type
+    GetType () const
+    {
+        return eTypeFormat;
+    }
+    
+    virtual void
+    DumpValue (const ExecutionContext *exe_ctx, Stream &strm, uint32_t dump_mask);
+    
+    virtual Error
+    SetValueFromCString (const char *value,
+                         VarSetOperationType op = eVarSetOperationAssign);
+    
+    virtual bool
+    Clear ()
+    {
+        m_current_value = m_default_value;
+        m_value_was_set = false;
+        return true;
+    }
+
+    virtual lldb::OptionValueSP
+    DeepCopy () const;
+    
+    //---------------------------------------------------------------------
+    // Subclass specific functions
+    //---------------------------------------------------------------------
+    
+    lldb::Format
+    GetCurrentValue() const
+    {
+        return m_current_value;
+    }
+    
+    lldb::Format 
+    GetDefaultValue() const
+    {
+        return m_default_value;
+    }
+    
+    void
+    SetCurrentValue (lldb::Format value)
+    {
+        m_current_value = value;
+    }
+    
+    void
+    SetDefaultValue (lldb::Format value)
+    {
+        m_default_value = value;
+    }
+    
+protected:
+    lldb::Format m_current_value;
+    lldb::Format m_default_value;
+};
+
+} // namespace lldb_private
+
+#endif  // liblldb_OptionValueFormat_h_

Added: lldb/trunk/include/lldb/Interpreter/OptionValuePathMappings.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/OptionValuePathMappings.h?rev=162366&view=auto
==============================================================================
--- lldb/trunk/include/lldb/Interpreter/OptionValuePathMappings.h (added)
+++ lldb/trunk/include/lldb/Interpreter/OptionValuePathMappings.h Wed Aug 22 12:17:09 2012
@@ -0,0 +1,94 @@
+//===-- OptionValuePathMappings.h -------------------------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_OptionValuePathMappings_h_
+#define liblldb_OptionValuePathMappings_h_
+
+// C Includes
+// C++ Includes
+// Other libraries and framework includes
+// Project includes
+#include "lldb/Target/PathMappingList.h"
+#include "lldb/Interpreter/OptionValue.h"
+
+namespace lldb_private {
+
+class OptionValuePathMappings : public OptionValue
+{
+public:
+    OptionValuePathMappings (bool notify_changes) :
+        OptionValue(),
+        m_path_mappings (),
+        m_notify_changes (notify_changes)
+    {
+    }
+    
+    virtual 
+    ~OptionValuePathMappings()
+    {
+    }
+    
+    //---------------------------------------------------------------------
+    // Virtual subclass pure virtual overrides
+    //---------------------------------------------------------------------
+    
+    virtual OptionValue::Type
+    GetType () const
+    {
+        return eTypePathMap;
+    }
+    
+    virtual void
+    DumpValue (const ExecutionContext *exe_ctx, Stream &strm, uint32_t dump_mask);
+    
+    virtual Error
+    SetValueFromCString (const char *value,
+                         VarSetOperationType op = eVarSetOperationAssign);
+    
+    virtual bool
+    Clear ()
+    {
+        m_path_mappings.Clear(m_notify_changes);
+        m_value_was_set = false;
+        return true;
+    }
+    
+    virtual lldb::OptionValueSP
+    DeepCopy () const;
+    
+    virtual bool
+    IsAggregateValue () const
+    {
+        return true;
+    }
+
+    //---------------------------------------------------------------------
+    // Subclass specific functions
+    //---------------------------------------------------------------------
+    
+    PathMappingList &
+    GetCurrentValue()
+    {
+        return m_path_mappings;
+    }
+    
+    const PathMappingList &
+    GetCurrentValue() const
+    {
+        return m_path_mappings;
+    }
+    
+protected:
+    PathMappingList m_path_mappings;
+    bool m_notify_changes;
+};
+
+} // namespace lldb_private
+
+#endif  // liblldb_OptionValuePathMappings_h_

Added: lldb/trunk/include/lldb/Interpreter/OptionValueProperties.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/OptionValueProperties.h?rev=162366&view=auto
==============================================================================
--- lldb/trunk/include/lldb/Interpreter/OptionValueProperties.h (added)
+++ lldb/trunk/include/lldb/Interpreter/OptionValueProperties.h Wed Aug 22 12:17:09 2012
@@ -0,0 +1,252 @@
+//===-- OptionValueProperties.h --------------------------------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_OptionValueProperties_h_
+#define liblldb_OptionValueProperties_h_
+
+// C Includes
+// C++ Includes
+// Other libraries and framework includes
+// Project includes
+#include "lldb/Core/ConstString.h"
+#include "lldb/Core/UniqueCStringMap.h"
+#include "lldb/Interpreter/OptionValue.h"
+#include "lldb/Interpreter/Property.h"
+
+namespace lldb_private {
+
+class OptionValueProperties : public OptionValue, public STD_ENABLE_SHARED_FROM_THIS(OptionValueProperties)
+{
+public:
+
+    //---------------------------------------------------------------------
+    // OptionValueProperties
+    //---------------------------------------------------------------------
+    OptionValueProperties () :
+        OptionValue(),
+        m_name ()
+    {
+    }
+
+    OptionValueProperties (const ConstString &name);
+
+    OptionValueProperties (const OptionValueProperties &global_properties);
+    
+    virtual
+    ~OptionValueProperties()
+    {
+    }
+    
+    virtual Type
+    GetType () const
+    {
+        return eTypeProperties;
+    }
+    
+    virtual bool
+    Clear ();
+
+    virtual lldb::OptionValueSP
+    DeepCopy () const;
+    
+    virtual Error
+    SetValueFromCString (const char *value, VarSetOperationType op = eVarSetOperationAssign);
+
+    virtual void
+    DumpValue (const ExecutionContext *exe_ctx,
+               Stream &strm,
+               uint32_t dump_mask);
+
+    virtual ConstString
+    GetName () const
+    {
+        return m_name;
+    }
+    
+    virtual Error
+    DumpPropertyValue (const ExecutionContext *exe_ctx,
+                       Stream &strm,
+                       const char *property_path,
+                       uint32_t dump_mask);
+
+    virtual void
+    DumpAllDescriptions (CommandInterpreter &interpreter,
+                         Stream &strm) const;
+
+    void
+    Apropos (const char *keyword,
+             std::vector<const Property *> &matching_properties) const;
+    
+    void
+    Initialize (const PropertyDefinition *setting_definitions);
+
+//    bool
+//    GetQualifiedName (Stream &strm);
+
+    //---------------------------------------------------------------------
+    // Subclass specific functions
+    //---------------------------------------------------------------------
+    
+    virtual size_t
+    GetNumProperties() const;
+    
+    virtual ConstString
+    GetPropertyNameAtIndex (uint32_t idx) const;
+
+    virtual const char *
+    GetPropertyDescriptionAtIndex (uint32_t idx) const;
+    
+    //---------------------------------------------------------------------
+    // Get the index of a property given its exact name in this property
+    // collection, "name" can't be a path to a property path that refers
+    // to a property within a property
+    //---------------------------------------------------------------------
+    virtual uint32_t
+    GetPropertyIndex (const ConstString &name) const;
+
+    //---------------------------------------------------------------------
+    // Get a property by exact name exists in this property collection, name
+    // can not be a path to a property path that refers to a property within
+    // a property
+    //---------------------------------------------------------------------
+    virtual const Property *
+    GetProperty (const ExecutionContext *exe_ctx,
+                 bool will_modify,
+                 const ConstString &name) const;
+    
+    virtual const Property *
+    GetPropertyAtIndex (const ExecutionContext *exe_ctx,
+                        bool will_modify,
+                        uint32_t idx) const;
+
+    //---------------------------------------------------------------------
+    // Property can be be a property path like "target.process.extra-startup-command"
+    //---------------------------------------------------------------------
+    virtual const Property *
+    GetPropertyAtPath (const ExecutionContext *exe_ctx,
+                       bool will_modify,
+                       const char *property_path) const;
+
+    virtual lldb::OptionValueSP
+    GetPropertyValueAtIndex (const ExecutionContext *exe_ctx,
+                             bool will_modify,
+                             uint32_t idx) const;
+    
+    virtual lldb::OptionValueSP
+    GetValueForKey  (const ExecutionContext *exe_ctx,
+                     const ConstString &key,
+                     bool value_will_be_modified) const;
+
+    lldb::OptionValueSP
+    GetSubValue (const ExecutionContext *exe_ctx,
+                 const char *name,
+                 bool value_will_be_modified,
+                 Error &error) const;
+
+    virtual Error
+    SetSubValue (const ExecutionContext *exe_ctx,
+                 VarSetOperationType op,
+                 const char *path,
+                 const char *value);
+
+    virtual bool
+    PredicateMatches (const ExecutionContext *exe_ctx,
+                      const char *predicate) const
+    {
+        return false;
+    }
+
+
+    OptionValueArch *
+    GetPropertyAtIndexAsOptionValueArch (const ExecutionContext *exe_ctx, uint32_t idx) const;
+
+    bool
+    GetPropertyAtIndexAsArgs (const ExecutionContext *exe_ctx, uint32_t idx, Args &args) const;
+
+    bool
+    SetPropertyAtIndexFromArgs (const ExecutionContext *exe_ctx, uint32_t idx, const Args &args);
+    
+    bool
+    GetPropertyAtIndexAsBoolean (const ExecutionContext *exe_ctx, uint32_t idx, bool fail_value) const;
+    
+    bool
+    SetPropertyAtIndexAsBoolean (const ExecutionContext *exe_ctx, uint32_t idx, bool new_value);
+    
+    OptionValueDictionary *
+    GetPropertyAtIndexAsOptionValueDictionary (const ExecutionContext *exe_ctx, uint32_t idx) const;
+
+    int64_t
+    GetPropertyAtIndexAsEnumeration (const ExecutionContext *exe_ctx, uint32_t idx, int64_t fail_value) const;
+    
+    bool
+    SetPropertyAtIndexAsEnumeration (const ExecutionContext *exe_ctx, uint32_t idx, int64_t new_value);
+    
+    const RegularExpression *
+    GetPropertyAtIndexAsOptionValueRegex (const ExecutionContext *exe_ctx, uint32_t idx) const;
+
+    OptionValueSInt64 *
+    GetPropertyAtIndexAsOptionValueSInt64 (const ExecutionContext *exe_ctx, uint32_t idx) const;
+
+    int64_t
+    GetPropertyAtIndexAsSInt64 (const ExecutionContext *exe_ctx, uint32_t idx, int64_t fail_value) const;
+
+    bool
+    SetPropertyAtIndexAsSInt64 (const ExecutionContext *exe_ctx, uint32_t idx, int64_t new_value);
+
+    uint64_t
+    GetPropertyAtIndexAsUInt64 (const ExecutionContext *exe_ctx, uint32_t idx, uint64_t fail_value) const;
+    
+    bool
+    SetPropertyAtIndexAsUInt64 (const ExecutionContext *exe_ctx, uint32_t idx, uint64_t new_value);
+    
+    const char *
+    GetPropertyAtIndexAsString (const ExecutionContext *exe_ctx, uint32_t idx, const char *fail_value) const;
+
+    bool
+    SetPropertyAtIndexAsString (const ExecutionContext *exe_ctx, uint32_t idx, const char *new_value);
+    
+    FileSpec
+    GetPropertyAtIndexAsFileSpec (const ExecutionContext *exe_ctx, uint32_t idx) const;
+    
+    bool
+    SetPropertyAtIndexAsFileSpec (const ExecutionContext *exe_ctx, uint32_t idx, const FileSpec &file_spec);
+
+    OptionValuePathMappings *
+    GetPropertyAtIndexAsOptionValuePathMappings (const ExecutionContext *exe_ctx, bool will_modify, uint32_t idx) const;
+
+    OptionValueFileSpecList *
+    GetPropertyAtIndexAsOptionValueFileSpecList (const ExecutionContext *exe_ctx, bool will_modify, uint32_t idx) const;
+
+    void
+    AppendProperty(const ConstString &name,
+                   const ConstString &desc,
+                   bool is_global,
+                   const lldb::OptionValueSP &value_sp);
+
+    
+protected:
+    
+    const Property *
+    ProtectedGetPropertyAtIndex (uint32_t idx) const
+    {
+        if (idx < m_properties.size())
+            return &m_properties[idx];
+        return NULL;
+    }
+
+    typedef UniqueCStringMap<size_t> NameToIndex;
+
+    ConstString m_name;
+    std::vector<Property> m_properties;
+    NameToIndex m_name_to_index;
+};
+
+} // namespace lldb_private
+
+#endif  // liblldb_OptionValueProperties_h_

Added: lldb/trunk/include/lldb/Interpreter/OptionValueRegex.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/OptionValueRegex.h?rev=162366&view=auto
==============================================================================
--- lldb/trunk/include/lldb/Interpreter/OptionValueRegex.h (added)
+++ lldb/trunk/include/lldb/Interpreter/OptionValueRegex.h Wed Aug 22 12:17:09 2012
@@ -0,0 +1,98 @@
+//===-- OptionValueRegex.h --------------------------------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_OptionValueRegex_h_
+#define liblldb_OptionValueRegex_h_
+
+// C Includes
+// C++ Includes
+#include <string>
+
+// Other libraries and framework includes
+// Project includes
+#include "lldb/Core/RegularExpression.h"
+#include "lldb/Interpreter/OptionValue.h"
+
+namespace lldb_private {
+
+class OptionValueRegex : public OptionValue
+{
+public:
+    OptionValueRegex (const char *value = NULL, uint32_t regex_flags = 0) :
+        OptionValue(),
+        m_regex (value, regex_flags)
+    {
+    }
+
+    virtual 
+    ~OptionValueRegex()
+    {
+    }
+    
+    //---------------------------------------------------------------------
+    // Virtual subclass pure virtual overrides
+    //---------------------------------------------------------------------
+    
+    virtual OptionValue::Type
+    GetType () const
+    {
+        return eTypeRegex;
+    }
+    
+    virtual void
+    DumpValue (const ExecutionContext *exe_ctx, Stream &strm, uint32_t dump_mask);
+    
+    virtual Error
+    SetValueFromCString (const char *value,
+                         VarSetOperationType op = eVarSetOperationAssign);
+
+    virtual bool
+    Clear ()
+    {
+        m_regex.Clear();
+        m_value_was_set = false;
+        return true;
+    }
+
+    virtual lldb::OptionValueSP
+    DeepCopy () const;
+
+    //---------------------------------------------------------------------
+    // Subclass specific functions
+    //---------------------------------------------------------------------
+    const RegularExpression *
+    GetCurrentValue() const
+    {
+        if (m_regex.IsValid())
+            return &m_regex;
+        return NULL;
+    }
+    
+    void
+    SetCurrentValue (const char *value, uint32_t regex_flags)
+    {
+        if (value && value[0])
+            m_regex.Compile (value, regex_flags);
+        else
+            m_regex.Clear();
+    }
+
+    bool
+    IsValid () const
+    {
+        return m_regex.IsValid();
+    }
+    
+protected:
+    RegularExpression m_regex;
+};
+
+} // namespace lldb_private
+
+#endif  // liblldb_OptionValueRegex_h_

Added: lldb/trunk/include/lldb/Interpreter/OptionValueSInt64.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/OptionValueSInt64.h?rev=162366&view=auto
==============================================================================
--- lldb/trunk/include/lldb/Interpreter/OptionValueSInt64.h (added)
+++ lldb/trunk/include/lldb/Interpreter/OptionValueSInt64.h Wed Aug 22 12:17:09 2012
@@ -0,0 +1,172 @@
+//===-- OptionValueSInt64.h --------------------------------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_OptionValueSInt64_h_
+#define liblldb_OptionValueSInt64_h_
+
+// C Includes
+// C++ Includes
+// Other libraries and framework includes
+// Project includes
+#include "lldb/Interpreter/OptionValue.h"
+
+namespace lldb_private {
+
+class OptionValueSInt64 : public OptionValue
+{
+public:
+    OptionValueSInt64 () :
+        OptionValue(),
+        m_current_value (0),
+        m_default_value (0),
+        m_min_value (INT64_MIN),
+        m_max_value (INT64_MAX)
+    {
+    }
+
+    OptionValueSInt64 (int64_t value) :
+        OptionValue(),
+        m_current_value (value),
+        m_default_value (value),
+        m_min_value (INT64_MIN),
+        m_max_value (INT64_MAX)
+    {
+    }
+
+    OptionValueSInt64 (int64_t current_value,
+                       int64_t default_value) :
+        OptionValue(),
+        m_current_value (current_value),
+        m_default_value (default_value),
+        m_min_value (INT64_MIN),
+        m_max_value (INT64_MAX)
+    {
+    }
+    
+    OptionValueSInt64 (const OptionValueSInt64 &rhs) :
+        OptionValue(rhs),
+        m_current_value (rhs.m_current_value),
+        m_default_value (rhs.m_default_value),
+        m_min_value (rhs.m_min_value),
+        m_max_value (rhs.m_max_value)
+    {
+    }
+
+    virtual
+    ~OptionValueSInt64()
+    {
+    }
+    
+    //---------------------------------------------------------------------
+    // Virtual subclass pure virtual overrides
+    //---------------------------------------------------------------------
+    
+    virtual OptionValue::Type
+    GetType () const
+    {
+        return eTypeSInt64;
+    }
+    
+    virtual void
+    DumpValue (const ExecutionContext *exe_ctx, Stream &strm, uint32_t dump_mask);
+    
+    virtual Error
+    SetValueFromCString (const char *value,
+                         VarSetOperationType op = eVarSetOperationAssign);
+    
+    virtual bool
+    Clear ()
+    {
+        m_current_value = m_default_value;
+        m_value_was_set = false;
+        return true;
+    }
+    
+    virtual lldb::OptionValueSP
+    DeepCopy () const;
+    
+    //---------------------------------------------------------------------
+    // Subclass specific functions
+    //---------------------------------------------------------------------
+    
+    const int64_t &
+    operator = (int64_t value)
+    {
+        m_current_value = value;
+        return m_current_value;
+    }
+
+    int64_t
+    GetCurrentValue() const
+    {
+        return m_current_value;
+    }
+    
+    int64_t
+    GetDefaultValue() const
+    {
+        return m_default_value;
+    }
+    
+    bool
+    SetCurrentValue (int64_t value)
+    {
+        if (value >= m_min_value && value <= m_max_value)
+        {
+            m_current_value = value;
+            return true;
+        }
+        return false;
+    }
+    
+    bool
+    SetDefaultValue (int64_t value)
+    {
+        if (value >= m_min_value && value <= m_max_value)
+        {
+            m_default_value = value;
+            return true;
+        }
+        return false;
+    }
+    
+    void
+    SetMinimumValue (int64_t v)
+    {
+        m_min_value = v;
+    }
+
+    int64_t
+    GetMinimumValue () const
+    {
+        return m_min_value;
+    }
+    
+    void
+    SetMaximumValue (int64_t v)
+    {
+        m_max_value = v;
+    }
+
+    int64_t
+    GetMaximumValue () const
+    {
+        return m_max_value;
+    }
+
+protected:
+    int64_t m_current_value;
+    int64_t m_default_value;
+    int64_t m_min_value;
+    int64_t m_max_value;
+};
+
+} // namespace lldb_private
+
+#endif  // liblldb_OptionValueSInt64_h_

Added: lldb/trunk/include/lldb/Interpreter/OptionValueString.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/OptionValueString.h?rev=162366&view=auto
==============================================================================
--- lldb/trunk/include/lldb/Interpreter/OptionValueString.h (added)
+++ lldb/trunk/include/lldb/Interpreter/OptionValueString.h Wed Aug 22 12:17:09 2012
@@ -0,0 +1,161 @@
+//===-- OptionValueString.h --------------------------------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_OptionValueString_h_
+#define liblldb_OptionValueString_h_
+
+// C Includes
+// C++ Includes
+#include <string>
+
+// Other libraries and framework includes
+// Project includes
+#include "lldb/Interpreter/OptionValue.h"
+
+namespace lldb_private {
+
+class OptionValueString : public OptionValue
+{
+public:
+    OptionValueString () :
+        OptionValue(),
+        m_current_value (),
+        m_default_value ()
+    {
+    }
+
+    OptionValueString (const char *value) :
+        OptionValue(),
+        m_current_value (),
+        m_default_value ()
+    {
+        if  (value && value[0])
+        {
+            m_current_value.assign (value);
+            m_default_value.assign (value);
+        }
+    }
+
+    OptionValueString (const char *current_value,
+                       const char *default_value) :
+        OptionValue(),
+        m_current_value (),
+        m_default_value ()
+    {
+        if  (current_value && current_value[0])
+            m_current_value.assign (current_value);
+        if  (default_value && default_value[0])
+            m_default_value.assign (default_value);
+    }
+    
+    virtual 
+    ~OptionValueString()
+    {
+    }
+    
+    //---------------------------------------------------------------------
+    // Virtual subclass pure virtual overrides
+    //---------------------------------------------------------------------
+    
+    virtual OptionValue::Type
+    GetType () const
+    {
+        return eTypeString;
+    }
+    
+    virtual void
+    DumpValue (const ExecutionContext *exe_ctx, Stream &strm, uint32_t dump_mask);
+    
+    virtual Error
+    SetValueFromCString (const char *value,
+                         VarSetOperationType op = eVarSetOperationAssign);
+
+    virtual bool
+    Clear ()
+    {
+        m_current_value = m_default_value;
+        m_value_was_set = false;
+        return true;
+    }
+
+    virtual lldb::OptionValueSP
+    DeepCopy () const;
+
+    //---------------------------------------------------------------------
+    // Subclass specific functions
+    //---------------------------------------------------------------------
+    
+    const char *
+    operator = (const char *value)
+    {
+        if (value && value[0])
+            m_current_value.assign (value);
+        else
+            m_current_value.clear();
+        return m_current_value.c_str();
+    }
+
+    const char *
+    GetCurrentValue() const
+    {
+        return m_current_value.c_str();
+    }
+    
+    const char *
+    GetDefaultValue() const
+    {
+        return m_default_value.c_str();
+    }
+    
+    void
+    SetCurrentValue (const char *value)
+    {
+        if (value && value[0])
+            m_current_value.assign (value);
+        else
+            m_current_value.clear();
+    }
+
+    void
+    AppendToCurrentValue (const char *value)
+    {
+        if (value && value[0])
+            m_current_value.append (value);
+    }
+
+    void
+    SetDefaultValue (const char *value)
+    {
+        if (value && value[0])
+            m_default_value.assign (value);
+        else
+            m_default_value.clear();
+    }
+
+    bool
+    IsCurrentValueEmpty () const
+    {
+        return m_current_value.empty();
+    }
+
+    bool
+    IsDefaultValueEmpty () const
+    {
+        return m_default_value.empty();
+    }
+
+    
+protected:
+    std::string m_current_value;
+    std::string m_default_value;
+};
+
+} // namespace lldb_private
+
+#endif  // liblldb_OptionValueString_h_

Added: lldb/trunk/include/lldb/Interpreter/OptionValueUInt64.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/OptionValueUInt64.h?rev=162366&view=auto
==============================================================================
--- lldb/trunk/include/lldb/Interpreter/OptionValueUInt64.h (added)
+++ lldb/trunk/include/lldb/Interpreter/OptionValueUInt64.h Wed Aug 22 12:17:09 2012
@@ -0,0 +1,134 @@
+//===-- OptionValueUInt64.h --------------------------------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_OptionValueUInt64_h_
+#define liblldb_OptionValueUInt64_h_
+
+// C Includes
+// C++ Includes
+// Other libraries and framework includes
+// Project includes
+#include "lldb/Interpreter/OptionValue.h"
+
+namespace lldb_private {
+    
+class OptionValueUInt64 : public OptionValue
+{
+public:
+    OptionValueUInt64 () :
+        OptionValue(),
+        m_current_value (0),
+        m_default_value (0)
+    {
+    }
+
+    OptionValueUInt64 (uint64_t value) :
+        OptionValue(),
+        m_current_value (value),
+        m_default_value (value)
+    {
+    }
+
+    OptionValueUInt64 (uint64_t current_value,
+                       uint64_t default_value) :
+        OptionValue(),
+        m_current_value (current_value),
+        m_default_value (default_value)
+    {
+    }
+    
+    virtual 
+    ~OptionValueUInt64()
+    {
+    }
+    
+    //---------------------------------------------------------------------
+    // Decode a uint64_t from "value_cstr" return a OptionValueUInt64 object
+    // inside of a lldb::OptionValueSP object if all goes well. If the 
+    // string isn't a uint64_t value or any other error occurs, return an 
+    // empty lldb::OptionValueSP and fill error in with the correct stuff.
+    //---------------------------------------------------------------------
+    static lldb::OptionValueSP
+    Create (const char *value_cstr, Error &error);
+    //---------------------------------------------------------------------
+    // Virtual subclass pure virtual overrides
+    //---------------------------------------------------------------------
+    
+    virtual OptionValue::Type
+    GetType () const
+    {
+        return eTypeUInt64;
+    }
+    
+    virtual void
+    DumpValue (const ExecutionContext *exe_ctx, Stream &strm, uint32_t dump_mask);
+    
+    virtual Error
+    SetValueFromCString (const char *value,
+                         VarSetOperationType op = eVarSetOperationAssign);
+    
+    virtual bool
+    Clear ()
+    {
+        m_current_value = m_default_value;
+        m_value_was_set = false;
+        return true;
+    }
+    
+    virtual lldb::OptionValueSP
+    DeepCopy () const;
+    
+    //---------------------------------------------------------------------
+    // Subclass specific functions
+    //---------------------------------------------------------------------
+    
+    const uint64_t &
+    operator = (uint64_t value)
+    {
+        m_current_value = value;
+        return m_current_value;
+    }
+
+    operator uint64_t () const
+    {
+        return m_current_value;
+    }
+
+    uint64_t
+    GetCurrentValue() const
+    {
+        return m_current_value;
+    }
+    
+    uint64_t
+    GetDefaultValue() const
+    {
+        return m_default_value;
+    }
+    
+    void
+    SetCurrentValue (uint64_t value)
+    {
+        m_current_value = value;
+    }
+    
+    void
+    SetDefaultValue (uint64_t value)
+    {
+        m_default_value = value;
+    }
+    
+protected:
+    uint64_t m_current_value;
+    uint64_t m_default_value;
+};
+
+} // namespace lldb_private
+
+#endif  // liblldb_OptionValueUInt64_h_

Added: lldb/trunk/include/lldb/Interpreter/OptionValueUUID.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/OptionValueUUID.h?rev=162366&view=auto
==============================================================================
--- lldb/trunk/include/lldb/Interpreter/OptionValueUUID.h (added)
+++ lldb/trunk/include/lldb/Interpreter/OptionValueUUID.h Wed Aug 22 12:17:09 2012
@@ -0,0 +1,98 @@
+//===-- OptionValueUUID.h --------------------------------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_OptionValueUUID_h_
+#define liblldb_OptionValueUUID_h_
+
+// C Includes
+// C++ Includes
+// Other libraries and framework includes
+// Project includes
+#include "lldb/Core/UUID.h"
+#include "lldb/Interpreter/OptionValue.h"
+
+namespace lldb_private {
+
+class OptionValueUUID : public OptionValue
+{
+public:
+    OptionValueUUID () :
+        OptionValue(),
+        m_uuid ()
+    {
+    }
+    
+    OptionValueUUID (const UUID &uuid) :
+        OptionValue(),
+        m_uuid (uuid)
+    {
+    }
+    
+    virtual 
+    ~OptionValueUUID()
+    {
+    }
+    
+    //---------------------------------------------------------------------
+    // Virtual subclass pure virtual overrides
+    //---------------------------------------------------------------------
+    
+    virtual OptionValue::Type
+    GetType () const
+    {
+        return eTypeUUID;
+    }
+    
+    virtual void
+    DumpValue (const ExecutionContext *exe_ctx, Stream &strm, uint32_t dump_mask);
+    
+    virtual Error
+    SetValueFromCString (const char *value,
+                         VarSetOperationType op = eVarSetOperationAssign);
+    
+    virtual bool
+    Clear ()
+    {
+        m_uuid.Clear();
+        m_value_was_set = false;
+        return true;
+    }
+    
+    virtual lldb::OptionValueSP
+    DeepCopy () const;
+    
+    //---------------------------------------------------------------------
+    // Subclass specific functions
+    //---------------------------------------------------------------------
+    
+    UUID &
+    GetCurrentValue()
+    {
+        return m_uuid;
+    }
+    
+    const UUID &
+    GetCurrentValue() const
+    {
+        return m_uuid;
+    }
+    
+    void
+    SetCurrentValue (const UUID &value)
+    {
+        m_uuid = value;
+    }
+    
+protected:
+    UUID m_uuid;
+};
+
+} // namespace lldb_private
+
+#endif  // liblldb_OptionValueUUID_h_

Added: lldb/trunk/include/lldb/Interpreter/OptionValues.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/OptionValues.h?rev=162366&view=auto
==============================================================================
--- lldb/trunk/include/lldb/Interpreter/OptionValues.h (added)
+++ lldb/trunk/include/lldb/Interpreter/OptionValues.h Wed Aug 22 12:17:09 2012
@@ -0,0 +1,31 @@
+//===-- OptionValues.h ------------------------------------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_OptionValues_h_
+#define liblldb_OptionValues_h_
+
+#include "lldb/Interpreter/OptionValue.h"
+#include "lldb/Interpreter/OptionValueArch.h"
+#include "lldb/Interpreter/OptionValueArgs.h"
+#include "lldb/Interpreter/OptionValueArray.h"
+#include "lldb/Interpreter/OptionValueBoolean.h"
+#include "lldb/Interpreter/OptionValueDictionary.h"
+#include "lldb/Interpreter/OptionValueEnumeration.h"
+#include "lldb/Interpreter/OptionValueFileSpec.h"
+#include "lldb/Interpreter/OptionValueFileSpecList.h"
+#include "lldb/Interpreter/OptionValueFormat.h"
+#include "lldb/Interpreter/OptionValuePathMappings.h"
+#include "lldb/Interpreter/OptionValueProperties.h"
+#include "lldb/Interpreter/OptionValueRegex.h"
+#include "lldb/Interpreter/OptionValueSInt64.h"
+#include "lldb/Interpreter/OptionValueString.h"
+#include "lldb/Interpreter/OptionValueUInt64.h"
+#include "lldb/Interpreter/OptionValueUUID.h"
+
+#endif  // liblldb_OptionValues_h_

Added: lldb/trunk/include/lldb/Interpreter/Property.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/Property.h?rev=162366&view=auto
==============================================================================
--- lldb/trunk/include/lldb/Interpreter/Property.h (added)
+++ lldb/trunk/include/lldb/Interpreter/Property.h Wed Aug 22 12:17:09 2012
@@ -0,0 +1,109 @@
+//===-- Property.h ----------------------------------------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_Property_h_
+#define liblldb_Property_h_
+
+// C Includes
+// C++ Includes
+#include <string>
+
+// Other libraries and framework includes
+// Project includes
+#include "lldb/lldb-defines.h"
+#include "lldb/Core/ConstString.h"
+#include "lldb/Core/Flags.h"
+#include "lldb/Interpreter/OptionValue.h"
+
+namespace lldb_private {
+
+    // A structure that can be used to create a global table for all properties.
+    // Property class instances can be constructed using one of these.
+    struct PropertyDefinition
+    {
+        const char *name;
+        OptionValue::Type type;
+        bool global;
+        uintptr_t default_uint_value;
+        const char *default_cstr_value;
+        OptionEnumValueElement *enum_values;
+        const char *description;
+    };
+    
+    class Property
+    {
+    public:
+        Property (const PropertyDefinition &definition);
+        
+        Property (const ConstString &name,
+                  const ConstString &desc,
+                  bool is_global,
+                  const lldb::OptionValueSP &value_sp);
+        
+        const ConstString &
+        GetName() const
+        {
+            return m_name;
+        }
+        
+        const char *
+        GetDescription () const
+        {
+            return m_description.GetCString();
+        }
+        
+        const lldb::OptionValueSP &
+        GetValue() const
+        {
+            return m_value_sp;
+        }
+        
+        void
+        SetOptionValue (const lldb::OptionValueSP &value_sp)
+        {
+            m_value_sp = value_sp;
+        }
+        
+        
+        bool
+        IsValid() const
+        {
+            return (bool)m_value_sp;
+        }
+        
+        bool
+        IsGlobal () const
+        {
+            return m_is_global;
+        }
+        
+        void
+        Dump (const ExecutionContext *exe_ctx,
+              Stream &strm,
+              uint32_t dump_mask) const;
+        
+        bool
+        DumpQualifiedName(Stream &strm) const;
+
+        void
+        DumpDescription (CommandInterpreter &interpreter,
+                         Stream &strm,
+                         uint32_t output_width,
+                         bool display_qualified_name) const;
+
+    protected:
+        ConstString m_name;
+        ConstString m_description;
+        lldb::OptionValueSP m_value_sp;
+        bool m_is_global;
+    };
+
+} // namespace lldb_private
+
+#endif  // liblldb_Property_h_

Modified: lldb/trunk/include/lldb/Target/PathMappingList.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/PathMappingList.h?rev=162366&r1=162365&r2=162366&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/PathMappingList.h (original)
+++ lldb/trunk/include/lldb/Target/PathMappingList.h Wed Aug 22 12:17:09 2012
@@ -86,9 +86,14 @@
 
     bool
     Replace (const ConstString &path, 
-             const ConstString &new_path, 
+             const ConstString &replacement, 
+             bool notify);
+
+    bool
+    Replace (const ConstString &path,
+             const ConstString &replacement,
+             uint32_t index,
              bool notify);
-    
     bool
     RemapPath (const ConstString &path, ConstString &new_path) const;
 

Modified: lldb/trunk/include/lldb/Target/Platform.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Platform.h?rev=162366&r1=162365&r2=162366&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/Platform.h (original)
+++ lldb/trunk/include/lldb/Target/Platform.h Wed Aug 22 12:17:09 2012
@@ -459,7 +459,10 @@
         {
             return false;
         }
-                
+        
+        virtual size_t
+        GetEnvironment (StringList &environment);
+        
     protected:
         bool m_is_host;
         // Set to true when we are able to actually set the OS version while 

Modified: lldb/trunk/include/lldb/Target/Process.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Process.h?rev=162366&r1=162365&r2=162366&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/Process.h (original)
+++ lldb/trunk/include/lldb/Target/Process.h Wed Aug 22 12:17:09 2012
@@ -48,74 +48,92 @@
 
 namespace lldb_private {
 
-//----------------------------------------------------------------------
-// ProcessInstanceSettings
-//----------------------------------------------------------------------
-class ProcessInstanceSettings : public InstanceSettings
-{
-public:
-
-    ProcessInstanceSettings (const lldb::UserSettingsControllerSP &owner_sp, bool live_instance = true, const char *name = NULL);
-  
-    ProcessInstanceSettings (const ProcessInstanceSettings &rhs);
-
-    virtual
-    ~ProcessInstanceSettings ();
-  
-    ProcessInstanceSettings&
-    operator= (const ProcessInstanceSettings &rhs);
-  
-
-    void
-    UpdateInstanceSettingsVariable (const ConstString &var_name,
-                                    const char *index_value,
-                                    const char *value,
-                                    const ConstString &instance_name,
-                                    const SettingEntry &entry,
-                                    VarSetOperationType op,
-                                    Error &err,
-                                    bool pending);
-
-    bool
-    GetInstanceSettingsValue (const SettingEntry &entry,
-                              const ConstString &var_name,
-                              StringList &value,
-                              Error *err);
-
-    bool GetDisableMemoryCache() const
+    class ProcessProperties : public Properties
     {
-        return m_disable_memory_cache;
-    }
-    
-    const Args &
-    GetExtraStartupCommands () const
-    {
-        return m_extra_startup_commands;
-    }
-    
-    void
-    SetExtraStartupCommands (const Args &args)
-    {
-        m_extra_startup_commands = args;
-    }
-    
-protected:
-    const ConstString &
-    GetDisableMemoryCacheVarName () const;
-    
-    const ConstString &
-    GetExtraStartupCommandVarName () const;
+    public:
+        ProcessProperties(bool is_global);
 
-    void
-    CopyInstanceSettings (const lldb::InstanceSettingsSP &new_settings,
-                          bool pending);
+        virtual
+        ~ProcessProperties();
+        
+        bool GetDisableMemoryCache() const;
 
-    const ConstString
-    CreateInstanceName ();
+        Args //&
+        GetExtraStartupCommands () const;
+
+        void
+        SetExtraStartupCommands (const Args &args);
+    };
     
-    bool        m_disable_memory_cache;
-    Args        m_extra_startup_commands;
-};
+    typedef STD_SHARED_PTR(ProcessProperties) ProcessPropertiesSP;
+////----------------------------------------------------------------------
+//// ProcessInstanceSettings
+////----------------------------------------------------------------------
+//class ProcessInstanceSettings : public InstanceSettings
+//{
+//public:
+//
+//    ProcessInstanceSettings (const lldb::UserSettingsControllerSP &owner_sp, bool live_instance = true, const char *name = NULL);
+//  
+//    ProcessInstanceSettings (const ProcessInstanceSettings &rhs);
+//
+//    virtual
+//    ~ProcessInstanceSettings ();
+//  
+//    ProcessInstanceSettings&
+//    operator= (const ProcessInstanceSettings &rhs);
+//  
+//
+//    void
+//    UpdateInstanceSettingsVariable (const ConstString &var_name,
+//                                    const char *index_value,
+//                                    const char *value,
+//                                    const ConstString &instance_name,
+//                                    const SettingEntry &entry,
+//                                    VarSetOperationType op,
+//                                    Error &err,
+//                                    bool pending);
+//
+//    bool
+//    GetInstanceSettingsValue (const SettingEntry &entry,
+//                              const ConstString &var_name,
+//                              StringList &value,
+//                              Error *err);
+//
+//    bool GetDisableMemoryCache() const
+//    {
+//        return m_disable_memory_cache;
+//    }
+//    
+//    const Args &
+//    GetExtraStartupCommands () const
+//    {
+//        return m_extra_startup_commands;
+//    }
+//    
+//    void
+//    SetExtraStartupCommands (const Args &args)
+//    {
+//        m_extra_startup_commands = args;
+//    }
+//    
+//protected:
+//    const ConstString &
+//    GetDisableMemoryCacheVarName () const;
+//    
+//    const ConstString &
+//    GetExtraStartupCommandVarName () const;
+//
+//    void
+//    CopyInstanceSettings (const lldb::InstanceSettingsSP &new_settings,
+//                          bool pending);
+//
+//    const ConstString
+//    CreateInstanceName ();
+//    
+//    bool        m_disable_memory_cache;
+//    Args        m_extra_startup_commands;
+//};
 
 //----------------------------------------------------------------------
 // ProcessInfo
@@ -1344,11 +1362,11 @@
 //----------------------------------------------------------------------
 class Process :
     public STD_ENABLE_SHARED_FROM_THIS(Process),
+    public ProcessProperties,
     public UserID,
     public Broadcaster,
     public ExecutionContextScope,
-    public PluginInterface,
-    public ProcessInstanceSettings
+    public PluginInterface
 {
 friend class ThreadList;
 friend class ClangFunction; // For WaitForStateChangeEventsPrivate
@@ -1507,29 +1525,29 @@
 
     };
 
-    class SettingsController : public UserSettingsController
-    {
-    public:
-        
-        SettingsController ();
-
-        virtual
-        ~SettingsController ();
-
-        static SettingEntry global_settings_table[];
-        static SettingEntry instance_settings_table[];
-
-    protected:
-
-        lldb::InstanceSettingsSP
-        CreateInstanceSettings (const char *instance_name);
-
-    private:
-
-        // Class-wide settings.
-
-        DISALLOW_COPY_AND_ASSIGN (SettingsController);
-    };
+//    class SettingsController : public UserSettingsController
+//    {
+//    public:
+//        
+//        SettingsController ();
+//
+//        virtual
+//        ~SettingsController ();
+//
+//        static SettingEntry global_settings_table[];
+//        static SettingEntry instance_settings_table[];
+//
+//    protected:
+//
+//        lldb::InstanceSettingsSP
+//        CreateInstanceSettings (const char *instance_name);
+//
+//    private:
+//
+//        // Class-wide settings.
+//
+//        DISALLOW_COPY_AND_ASSIGN (SettingsController);
+//    };
 
 
 #endif
@@ -1539,14 +1557,30 @@
 
     static void
     SettingsTerminate ();
+    
+    static const ProcessPropertiesSP &
+    GetGlobalProperties();
 
-    static lldb::UserSettingsControllerSP &
-    GetSettingsController ();
-
+    const Args //&
+    GetExtraStartupCommands () const
+    {
+        // TODO: SETTINGS
+        return Args();
+    }
+    
     void
-    UpdateInstanceName ();
+    SetExtraStartupCommands (const Args &args)
+    {
+        // TODO: SETTINGS
+    }
+
+    bool
+    GetDisableMemoryCache() const
+    {
+        // TODO: SETTINGS
+        return false;
+    }
 
-    
     //------------------------------------------------------------------
     /// Construct with a shared pointer to a target, and the Process listener.
     //------------------------------------------------------------------

Modified: lldb/trunk/include/lldb/Target/Target.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Target.h?rev=162366&r1=162365&r2=162366&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/Target.h (original)
+++ lldb/trunk/include/lldb/Target/Target.h Wed Aug 22 12:17:09 2012
@@ -26,7 +26,9 @@
 #include "lldb/Core/SourceManager.h"
 #include "lldb/Expression/ClangPersistentVariables.h"
 #include "lldb/Interpreter/Args.h"
-#include "lldb/Interpreter/NamedOptionValue.h"
+#include "lldb/Interpreter/OptionValueBoolean.h"
+#include "lldb/Interpreter/OptionValueEnumeration.h"
+#include "lldb/Interpreter/OptionValueFileSpec.h"
 #include "lldb/Symbol/SymbolContext.h"
 #include "lldb/Target/ABI.h"
 #include "lldb/Target/ExecutionContextScope.h"
@@ -38,244 +40,331 @@
 //----------------------------------------------------------------------
 // TargetInstanceSettings
 //----------------------------------------------------------------------
-class TargetInstanceSettings : public InstanceSettings
-{
-public:
-    static OptionEnumValueElement g_dynamic_value_types[];
-
-    TargetInstanceSettings (const lldb::UserSettingsControllerSP &owner_sp, bool live_instance = true, const char *name = NULL);
-
-    TargetInstanceSettings (const TargetInstanceSettings &rhs);
-
-    virtual
-    ~TargetInstanceSettings ();
-
-    TargetInstanceSettings&
-    operator= (const TargetInstanceSettings &rhs);
-
-    void
-    UpdateInstanceSettingsVariable (const ConstString &var_name,
-                                    const char *index_value,
-                                    const char *value,
-                                    const ConstString &instance_name,
-                                    const SettingEntry &entry,
-                                    VarSetOperationType op,
-                                    Error &err,
-                                    bool pending);
-
-    bool
-    GetInstanceSettingsValue (const SettingEntry &entry,
-                              const ConstString &var_name,
-                              StringList &value,
-                              Error *err);
-
-    lldb::DynamicValueType
-    GetPreferDynamicValue()
-    {
-        return (lldb::DynamicValueType) g_dynamic_value_types[m_prefer_dynamic_value].value;
-    }
-    
-    bool
-    GetEnableSyntheticValue ()
-    {
-        return m_enable_synthetic_value;
-    }
-
-    void
-    SetEnableSyntheticValue (bool b)
-    {
-        m_enable_synthetic_value = b;
-    }
-    
-    bool
-    GetSkipPrologue()
-    {
-        return m_skip_prologue;
-    }
-
-    PathMappingList &
-    GetSourcePathMap ()
-    {
-        return m_source_map;
-    }
-    
-    FileSpecList &
-    GetExecutableSearchPaths ()
-    {
-        return m_exe_search_paths;
-    }
+extern OptionEnumValueElement g_dynamic_value_types[];
+//class TargetInstanceSettings : public InstanceSettings
+//{
+//public:
+//    static OptionEnumValueElement g_dynamic_value_types[];
+//
+//    TargetInstanceSettings (const lldb::UserSettingsControllerSP &owner_sp, bool live_instance = true, const char *name = NULL);
+//
+//    TargetInstanceSettings (const TargetInstanceSettings &rhs);
+//
+//    virtual
+//    ~TargetInstanceSettings ();
+//
+//    TargetInstanceSettings&
+//    operator= (const TargetInstanceSettings &rhs);
+//
+//    void
+//    UpdateInstanceSettingsVariable (const ConstString &var_name,
+//                                    const char *index_value,
+//                                    const char *value,
+//                                    const ConstString &instance_name,
+//                                    const SettingEntry &entry,
+//                                    VarSetOperationType op,
+//                                    Error &err,
+//                                    bool pending);
+//
+//    bool
+//    GetInstanceSettingsValue (const SettingEntry &entry,
+//                              const ConstString &var_name,
+//                              StringList &value,
+//                              Error *err);
+//
+//    lldb::DynamicValueType
+//    GetPreferDynamicValue()
+//    {
+//        return (lldb::DynamicValueType) g_dynamic_value_types[m_prefer_dynamic_value].value;
+//    }
+//    
+//    bool
+//    GetEnableSyntheticValue ()
+//    {
+//        return m_enable_synthetic_value;
+//    }
+//
+//    void
+//    SetEnableSyntheticValue (bool b)
+//    {
+//        m_enable_synthetic_value = b;
+//    }
+//    
+//    bool
+//    GetSkipPrologue()
+//    {
+//        return m_skip_prologue;
+//    }
+//
+//    PathMappingList &
+//    GetSourcePathMap ()
+//    {
+//        return m_source_map;
+//    }
+//    
+//    FileSpecList &
+//    GetExecutableSearchPaths ()
+//    {
+//        return m_exe_search_paths;
+//    }
+//
+//    const FileSpecList &
+//    GetExecutableSearchPaths () const
+//    {
+//        return m_exe_search_paths;
+//    }
+//
+//    
+//    uint32_t
+//    GetMaximumNumberOfChildrenToDisplay()
+//    {
+//        return m_max_children_display;
+//    }
+//    uint32_t
+//    GetMaximumSizeOfStringSummary()
+//    {
+//        return m_max_strlen_length;
+//    }
+//    
+//    bool
+//    GetBreakpointsConsultPlatformAvoidList ()
+//    {
+//        return m_breakpoints_use_platform_avoid;
+//    }
+//        
+//    const Args &
+//    GetRunArguments () const
+//    {
+//        return m_run_args;
+//    }
+//    
+//    void
+//    SetRunArguments (const Args &args)
+//    {
+//        m_run_args = args;
+//    }
+//    
+//    void
+//    GetHostEnvironmentIfNeeded ();
+//    
+//    size_t
+//    GetEnvironmentAsArgs (Args &env);
+//    
+//    const char *
+//    GetStandardInputPath () const
+//    {
+//        if (m_input_path.empty())
+//            return NULL;
+//        return m_input_path.c_str();
+//    }
+//    
+//    void
+//    SetStandardInputPath (const char *path)
+//    {
+//        if (path && path[0])
+//            m_input_path.assign (path);
+//        else
+//        {
+//            // Make sure we deallocate memory in string...
+//            std::string tmp;
+//            tmp.swap (m_input_path);
+//        }
+//    }
+//    
+//    const char *
+//    GetStandardOutputPath () const
+//    {
+//        if (m_output_path.empty())
+//            return NULL;
+//        return m_output_path.c_str();
+//    }
+//    
+//    void
+//    SetStandardOutputPath (const char *path)
+//    {
+//        if (path && path[0])
+//            m_output_path.assign (path);
+//        else
+//        {
+//            // Make sure we deallocate memory in string...
+//            std::string tmp;
+//            tmp.swap (m_output_path);
+//        }
+//    }
+//    
+//    const char *
+//    GetStandardErrorPath () const
+//    {
+//        if (m_error_path.empty())
+//            return NULL;
+//        return m_error_path.c_str();
+//    }
+//    
+//    void
+//    SetStandardErrorPath (const char *path)
+//    {
+//        if (path && path[0])
+//            m_error_path.assign (path);
+//        else
+//        {
+//            // Make sure we deallocate memory in string...
+//            std::string tmp;
+//            tmp.swap (m_error_path);
+//        }
+//    }
+//    
+//    bool
+//    GetDisableASLR () const
+//    {
+//        return m_disable_aslr;
+//    }
+//    
+//    void
+//    SetDisableASLR (bool b)
+//    {
+//        m_disable_aslr = b;
+//    }
+//    
+//    bool
+//    GetDisableSTDIO () const
+//    {
+//        return m_disable_stdio;
+//    }
+//    
+//    void
+//    SetDisableSTDIO (bool b)
+//    {
+//        m_disable_stdio = b;
+//    }
+//
+//
+//protected:
+//
+//    void
+//    CopyInstanceSettings (const lldb::InstanceSettingsSP &new_settings,
+//                          bool pending);
+//
+//    const ConstString
+//    CreateInstanceName ();
+//    
+//    OptionValueFileSpec m_expr_prefix_file;
+//    std::string m_expr_prefix_contents;
+//    int m_prefer_dynamic_value;
+//    OptionValueBoolean m_enable_synthetic_value;
+//    OptionValueBoolean m_skip_prologue;
+//    PathMappingList m_source_map;
+//    FileSpecList m_exe_search_paths;
+//    uint32_t m_max_children_display;
+//    uint32_t m_max_strlen_length;
+//    OptionValueBoolean m_breakpoints_use_platform_avoid;
+//    typedef std::map<std::string, std::string> dictionary;
+//    Args m_run_args;
+//    dictionary m_env_vars;
+//    std::string m_input_path;
+//    std::string m_output_path;
+//    std::string m_error_path;
+//    bool m_disable_aslr;
+//    bool m_disable_stdio;
+//    bool m_inherit_host_env;
+//    bool m_got_host_env;
+//
+//
+//};
+    class TargetProperties;
+    typedef STD_SHARED_PTR(TargetProperties) TargetPropertiesSP;
 
-    const FileSpecList &
-    GetExecutableSearchPaths () const
+    class TargetProperties : public Properties
     {
-        return m_exe_search_paths;
-    }
+    public:
+        TargetProperties(Target *target);
 
-    
-    uint32_t
-    GetMaximumNumberOfChildrenToDisplay()
-    {
-        return m_max_children_display;
-    }
-    uint32_t
-    GetMaximumSizeOfStringSummary()
-    {
-        return m_max_strlen_length;
-    }
-    
-    bool
-    GetBreakpointsConsultPlatformAvoidList ()
-    {
-        return m_breakpoints_use_platform_avoid;
-    }
+        virtual
+        ~TargetProperties();
         
-    const Args &
-    GetRunArguments () const
-    {
-        return m_run_args;
-    }
-    
-    void
-    SetRunArguments (const Args &args)
-    {
-        m_run_args = args;
-    }
-    
-    void
-    GetHostEnvironmentIfNeeded ();
-    
-    size_t
-    GetEnvironmentAsArgs (Args &env);
-    
-    const char *
-    GetStandardInputPath () const
-    {
-        if (m_input_path.empty())
-            return NULL;
-        return m_input_path.c_str();
-    }
-    
-    void
-    SetStandardInputPath (const char *path)
-    {
-        if (path && path[0])
-            m_input_path.assign (path);
-        else
-        {
-            // Make sure we deallocate memory in string...
-            std::string tmp;
-            tmp.swap (m_input_path);
-        }
-    }
-    
-    const char *
-    GetStandardOutputPath () const
-    {
-        if (m_output_path.empty())
-            return NULL;
-        return m_output_path.c_str();
-    }
-    
-    void
-    SetStandardOutputPath (const char *path)
-    {
-        if (path && path[0])
-            m_output_path.assign (path);
-        else
-        {
-            // Make sure we deallocate memory in string...
-            std::string tmp;
-            tmp.swap (m_output_path);
-        }
-    }
-    
-    const char *
-    GetStandardErrorPath () const
-    {
-        if (m_error_path.empty())
-            return NULL;
-        return m_error_path.c_str();
-    }
-    
-    void
-    SetStandardErrorPath (const char *path)
-    {
-        if (path && path[0])
-            m_error_path.assign (path);
-        else
+        virtual lldb::OptionValuePropertiesSP
+        GetValueProperties () const
         {
-            // Make sure we deallocate memory in string...
-            std::string tmp;
-            tmp.swap (m_error_path);
+            return m_collection_sp;
         }
-    }
-    
-    bool
-    GetDisableASLR () const
-    {
-        return m_disable_aslr;
-    }
-    
-    void
-    SetDisableASLR (bool b)
-    {
-        m_disable_aslr = b;
-    }
-    
-    bool
-    GetDisableSTDIO () const
-    {
-        return m_disable_stdio;
-    }
-    
-    void
-    SetDisableSTDIO (bool b)
-    {
-        m_disable_stdio = b;
-    }
-
-
-protected:
-
-    void
-    CopyInstanceSettings (const lldb::InstanceSettingsSP &new_settings,
-                          bool pending);
-
-    const ConstString
-    CreateInstanceName ();
-    
-    OptionValueFileSpec m_expr_prefix_file;
-    std::string m_expr_prefix_contents;
-    int m_prefer_dynamic_value;
-    OptionValueBoolean m_enable_synthetic_value;
-    OptionValueBoolean m_skip_prologue;
-    PathMappingList m_source_map;
-    FileSpecList m_exe_search_paths;
-    uint32_t m_max_children_display;
-    uint32_t m_max_strlen_length;
-    OptionValueBoolean m_breakpoints_use_platform_avoid;
-    typedef std::map<std::string, std::string> dictionary;
-    Args m_run_args;
-    dictionary m_env_vars;
-    std::string m_input_path;
-    std::string m_output_path;
-    std::string m_error_path;
-    bool m_disable_aslr;
-    bool m_disable_stdio;
-    bool m_inherit_host_env;
-    bool m_got_host_env;
 
+        ArchSpec
+        GetDefaultArchitecture () const;
+        
+        void
+        SetDefaultArchitecture (const ArchSpec& arch);
 
-};
+        lldb::DynamicValueType
+        GetPreferDynamicValue() const;
+        
+        bool
+        GetDisableASLR () const;
+        
+        void
+        SetDisableASLR (bool b);
+        
+        bool
+        GetDisableSTDIO () const;
+        
+        void
+        SetDisableSTDIO (bool b);
+        
+        bool
+        GetRunArguments (Args &args) const;
+        
+        void
+        SetRunArguments (const Args &args);
+        
+        size_t
+        GetEnvironmentAsArgs (Args &env) const;
+        
+        bool
+        GetSkipPrologue() const;
+        
+        PathMappingList &
+        GetSourcePathMap () const;
+        
+        FileSpecList &
+        GetExecutableSearchPaths () const;
+        
+        bool
+        GetEnableSyntheticValue () const;
+        
+        uint32_t
+        GetMaximumNumberOfChildrenToDisplay() const;
+        
+        uint32_t
+        GetMaximumSizeOfStringSummary() const;
+        
+        FileSpec
+        GetStandardInputPath () const;
+        
+        void
+        SetStandardInputPath (const char *path);
+        
+        FileSpec
+        GetStandardOutputPath () const;
+        
+        void
+        SetStandardOutputPath (const char *path);
+        
+        FileSpec
+        GetStandardErrorPath () const;
+        
+        void
+        SetStandardErrorPath (const char *path);
+        
+        bool
+        GetBreakpointsConsultPlatformAvoidList ();
+    };
 
 //----------------------------------------------------------------------
 // Target
 //----------------------------------------------------------------------
 class Target :
     public STD_ENABLE_SHARED_FROM_THIS(Target),
+    public TargetProperties,
     public Broadcaster,
-    public ExecutionContextScope,
-    public TargetInstanceSettings
+    public ExecutionContextScope
 {
 public:
     friend class TargetList;
@@ -342,8 +431,8 @@
     static void
     SettingsTerminate ();
 
-    static lldb::UserSettingsControllerSP &
-    GetSettingsController ();
+//    static lldb::UserSettingsControllerSP &
+//    GetSettingsController ();
 
     static FileSpecList
     GetDefaultExecutableSearchPaths ();
@@ -354,12 +443,21 @@
     static void
     SetDefaultArchitecture (const ArchSpec &arch);
 
-    void
-    UpdateInstanceName ();
+//    void
+//    UpdateInstanceName ();
 
     lldb::ModuleSP
     GetSharedModule (const ModuleSpec &module_spec,
                      Error *error_ptr = NULL);
+
+    //----------------------------------------------------------------------
+    // Settings accessors
+    //----------------------------------------------------------------------
+
+    static const TargetPropertiesSP &
+    GetGlobalProperties();
+
+
 private:
     //------------------------------------------------------------------
     /// Construct with optional file and arch.
@@ -1091,47 +1189,47 @@
     //------------------------------------------------------------------
     // Target::SettingsController
     //------------------------------------------------------------------
-    class SettingsController : public UserSettingsController
-    {
-    public:
-        SettingsController ();
-        
-        virtual
-        ~SettingsController ();
-        
-        bool
-        SetGlobalVariable (const ConstString &var_name,
-                           const char *index_value,
-                           const char *value,
-                           const SettingEntry &entry,
-                           const VarSetOperationType op,
-                           Error&err);
-        
-        bool
-        GetGlobalVariable (const ConstString &var_name,
-                           StringList &value,
-                           Error &err);
-        
-        static SettingEntry global_settings_table[];
-        static SettingEntry instance_settings_table[];
-        
-        ArchSpec &
-        GetArchitecture ()
-        {
-            return m_default_architecture;
-        }
-    protected:
-        
-        lldb::InstanceSettingsSP
-        CreateInstanceSettings (const char *instance_name);
-        
-    private:
-        
-        // Class-wide settings.
-        ArchSpec m_default_architecture;
-        
-        DISALLOW_COPY_AND_ASSIGN (SettingsController);
-    };
+//    class SettingsController : public UserSettingsController
+//    {
+//    public:
+//        SettingsController ();
+//        
+//        virtual
+//        ~SettingsController ();
+//        
+//        bool
+//        SetGlobalVariable (const ConstString &var_name,
+//                           const char *index_value,
+//                           const char *value,
+//                           const SettingEntry &entry,
+//                           const VarSetOperationType op,
+//                           Error&err);
+//        
+//        bool
+//        GetGlobalVariable (const ConstString &var_name,
+//                           StringList &value,
+//                           Error &err);
+//        
+//        static SettingEntry global_settings_table[];
+//        static SettingEntry instance_settings_table[];
+//        
+//        ArchSpec &
+//        GetArchitecture ()
+//        {
+//            return m_default_architecture;
+//        }
+//    protected:
+//        
+//        lldb::InstanceSettingsSP
+//        CreateInstanceSettings (const char *instance_name);
+//        
+//    private:
+//        
+//        // Class-wide settings.
+//        ArchSpec m_default_architecture;
+//        
+//        DISALLOW_COPY_AND_ASSIGN (SettingsController);
+//    };
     
     //------------------------------------------------------------------
     // Methods.
@@ -1145,7 +1243,7 @@
     lldb::SearchFilterSP
     GetSearchFilterForModuleAndCUList (const FileSpecList *containingModules, const FileSpecList *containingSourceFiles);
 
-protected:    
+protected:
     //------------------------------------------------------------------
     // Member variables.
     //------------------------------------------------------------------

Modified: lldb/trunk/include/lldb/Target/Thread.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Thread.h?rev=162366&r1=162365&r2=162366&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/Thread.h (original)
+++ lldb/trunk/include/lldb/Target/Thread.h Wed Aug 22 12:17:09 2012
@@ -21,100 +21,127 @@
 
 namespace lldb_private {
 
-class ThreadInstanceSettings : public InstanceSettings
-{
-public:
-
-    ThreadInstanceSettings (const lldb::UserSettingsControllerSP &owner_sp, bool live_instance = true, const char *name = NULL);
-  
-    ThreadInstanceSettings (const ThreadInstanceSettings &rhs);
-
-    virtual
-    ~ThreadInstanceSettings ();
-  
-    ThreadInstanceSettings&
-    operator= (const ThreadInstanceSettings &rhs);
-  
-
-    void
-    UpdateInstanceSettingsVariable (const ConstString &var_name,
-                                    const char *index_value,
-                                    const char *value,
-                                    const ConstString &instance_name,
-                                    const SettingEntry &entry,
-                                    VarSetOperationType op,
-                                    Error &err,
-                                    bool pending);
-
-    bool
-    GetInstanceSettingsValue (const SettingEntry &entry,
-                              const ConstString &var_name,
-                              StringList &value,
-                              Error *err);
-
-    RegularExpression *
-    GetSymbolsToAvoidRegexp()
+    class ThreadProperties : public Properties
     {
-        return m_avoid_regexp_ap.get();
-    }
-
-    static const ConstString &
-    StepAvoidRegexpVarName ();
+    public:
+        ThreadProperties(bool is_global);
+        
+        virtual
+        ~ThreadProperties();
+        
+        //------------------------------------------------------------------
+        /// The regular expression returned determines symbols that this
+        /// thread won't stop in during "step-in" operations.
+        ///
+        /// @return
+        ///    A pointer to a regular expression to compare against symbols,
+        ///    or NULL if all symbols are allowed.
+        ///
+        //------------------------------------------------------------------
+        const RegularExpression *
+        GetSymbolsToAvoidRegexp();
+        
+        bool
+        GetTraceEnabledState() const;
+    };
     
-    bool
-    GetTraceEnabledState()
-    {
-        return m_trace_enabled;
-    }
-    static const ConstString &
-    GetTraceThreadVarName ();
-
-protected:
-
-    void
-    CopyInstanceSettings (const lldb::InstanceSettingsSP &new_settings,
-                          bool pending);
-
-    const ConstString
-    CreateInstanceName ();
-
-private:
+    typedef STD_SHARED_PTR(ThreadProperties) ThreadPropertiesSP;
 
-    std::auto_ptr<RegularExpression> m_avoid_regexp_ap;
-    bool m_trace_enabled;
-};
+//class ThreadInstanceSettings : public InstanceSettings
+//{
+//public:
+//
+//    ThreadInstanceSettings (const lldb::UserSettingsControllerSP &owner_sp, bool live_instance = true, const char *name = NULL);
+//  
+//    ThreadInstanceSettings (const ThreadInstanceSettings &rhs);
+//
+//    virtual
+//    ~ThreadInstanceSettings ();
+//  
+//    ThreadInstanceSettings&
+//    operator= (const ThreadInstanceSettings &rhs);
+//  
+//
+//    void
+//    UpdateInstanceSettingsVariable (const ConstString &var_name,
+//                                    const char *index_value,
+//                                    const char *value,
+//                                    const ConstString &instance_name,
+//                                    const SettingEntry &entry,
+//                                    VarSetOperationType op,
+//                                    Error &err,
+//                                    bool pending);
+//
+//    bool
+//    GetInstanceSettingsValue (const SettingEntry &entry,
+//                              const ConstString &var_name,
+//                              StringList &value,
+//                              Error *err);
+//
+//    RegularExpression *
+//    GetSymbolsToAvoidRegexp()
+//    {
+//        return m_avoid_regexp_ap.get();
+//    }
+//
+//    static const ConstString &
+//    StepAvoidRegexpVarName ();
+//    
+//    bool
+//    GetTraceEnabledState()
+//    {
+//        return m_trace_enabled;
+//    }
+//    static const ConstString &
+//    GetTraceThreadVarName ();
+//
+//protected:
+//
+//    void
+//    CopyInstanceSettings (const lldb::InstanceSettingsSP &new_settings,
+//                          bool pending);
+//
+//    const ConstString
+//    CreateInstanceName ();
+//
+//private:
+//
+//    std::auto_ptr<RegularExpression> m_avoid_regexp_ap;
+//    bool m_trace_enabled;
+//};
 
 class Thread :
     public STD_ENABLE_SHARED_FROM_THIS(Thread),
+    public ThreadProperties,
     public UserID,
-    public ExecutionContextScope,
-    public ThreadInstanceSettings
+    public ExecutionContextScope//,
+                                //public ThreadInstanceSettings
 {
 public:
 
-    class SettingsController : public UserSettingsController
-    {
-    public:
-        
-        SettingsController ();
-
-        virtual
-        ~SettingsController ();
-        
-        static SettingEntry global_settings_table[];
-        static SettingEntry instance_settings_table[];
-
-    protected:
-
-        lldb::InstanceSettingsSP
-        CreateInstanceSettings (const char *instance_name);
-
-    private:
-
-        // Class-wide settings.
-
-        DISALLOW_COPY_AND_ASSIGN (SettingsController);
-    };
+//    class SettingsController : public UserSettingsController
+//    {
+//    public:
+//        
+//        SettingsController ();
+//
+//        virtual
+//        ~SettingsController ();
+//        
+//        static SettingEntry global_settings_table[];
+//        static SettingEntry instance_settings_table[];
+//
+//    protected:
+//
+//        lldb::InstanceSettingsSP
+//        CreateInstanceSettings (const char *instance_name);
+//
+//    private:
+//
+//        // Class-wide settings.
+//
+//        DISALLOW_COPY_AND_ASSIGN (SettingsController);
+//    };
 
     // TODO: You shouldn't just checkpoint the register state alone, so this should get 
     // moved to protected.  To do that ThreadStateCheckpoint needs to be returned as a token...
@@ -191,17 +218,14 @@
         RegisterCheckpoint register_backup;  // You need to restore the registers, of course...
     };
 
-    void
-    UpdateInstanceName ();
-
     static void
     SettingsInitialize ();
 
     static void
     SettingsTerminate ();
 
-    static lldb::UserSettingsControllerSP &
-    GetSettingsController ();
+    static const ThreadPropertiesSP &
+    GetGlobalProperties();
 
     Thread (const lldb::ProcessSP &process_sp, lldb::tid_t tid);
     virtual ~Thread();
@@ -708,21 +732,6 @@
     void
     SetTracer (lldb::ThreadPlanTracerSP &tracer_sp);
     
-    //------------------------------------------------------------------
-    /// The regular expression returned determines symbols that this
-    /// thread won't stop in during "step-in" operations.
-    ///
-    /// @return
-    ///    A pointer to a regular expression to compare against symbols,
-    ///    or NULL if all symbols are allowed.
-    ///
-    //------------------------------------------------------------------
-    RegularExpression *
-    GetSymbolsToAvoidRegexp()
-    {
-        return ThreadInstanceSettings::GetSymbolsToAvoidRegexp();
-    }
-
     // Get the thread index ID. The index ID that is guaranteed to not be
     // re-used by a process. They start at 1 and increase with each new thread.
     // This allows easy command line access by a unique ID that is easier to

Modified: lldb/trunk/include/lldb/lldb-forward.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/lldb-forward.h?rev=162366&r1=162365&r2=162366&view=diff
==============================================================================
--- lldb/trunk/include/lldb/lldb-forward.h (original)
+++ lldb/trunk/include/lldb/lldb-forward.h Wed Aug 22 12:17:09 2012
@@ -134,6 +134,22 @@
 class   OperatingSystem;
 class   Options;
 class   OptionValue;
+class   OptionValueArch;
+class   OptionValueArgs;
+class   OptionValueArray;
+class   OptionValueBoolean;
+class   OptionValueDictionary;
+class   OptionValueEnumeration;
+class   OptionValueFileSpec;
+class   OptionValueFileSpecList;
+class   OptionValueFormat;
+class   OptionValuePathMappings;
+class   OptionValueProperties;
+class   OptionValueRegex;
+class   OptionValueSInt64;
+class   OptionValueString;
+class   OptionValueUInt64;
+class   OptionValueUUID;
 class   NamedOption;
 class   PathMappingList;
 class   Platform;
@@ -145,6 +161,8 @@
 class   ProcessInstanceInfoList;
 class   ProcessInstanceInfoMatch;
 class   ProcessLaunchInfo;
+class   Property;
+struct  PropertyDefinition;
 class   RegisterContext;
 class   RegisterLocation;
 class   RegisterLocationList;
@@ -161,6 +179,7 @@
 class   Section;
 class   SectionImpl;
 class   SectionList;
+class   Settings;
 class   SourceManager;
 class   SourceManagerImpl;
 class   StackFrame;
@@ -249,11 +268,11 @@
     typedef STD_SHARED_PTR(lldb_private::Baton) BatonSP;
     typedef STD_SHARED_PTR(lldb_private::Block) BlockSP;
     typedef STD_SHARED_PTR(lldb_private::Breakpoint) BreakpointSP;
-    typedef STD_WEAK_PTR(lldb_private::Breakpoint) BreakpointWP;
+    typedef STD_WEAK_PTR(  lldb_private::Breakpoint) BreakpointWP;
     typedef STD_SHARED_PTR(lldb_private::BreakpointSite) BreakpointSiteSP;
-    typedef STD_WEAK_PTR(lldb_private::BreakpointSite) BreakpointSiteWP;
+    typedef STD_WEAK_PTR(  lldb_private::BreakpointSite) BreakpointSiteWP;
     typedef STD_SHARED_PTR(lldb_private::BreakpointLocation) BreakpointLocationSP;
-    typedef STD_WEAK_PTR(lldb_private::BreakpointLocation) BreakpointLocationWP;
+    typedef STD_WEAK_PTR(  lldb_private::BreakpointLocation) BreakpointLocationWP;
     typedef STD_SHARED_PTR(lldb_private::BreakpointResolver) BreakpointResolverSP;
     typedef STD_SHARED_PTR(lldb_private::Broadcaster) BroadcasterSP;
     typedef STD_SHARED_PTR(lldb_private::ClangExpressionVariable) ClangExpressionVariableSP;
@@ -264,13 +283,13 @@
     typedef STD_SHARED_PTR(lldb_private::DataBuffer) DataBufferSP;
     typedef STD_SHARED_PTR(lldb_private::DataExtractor) DataExtractorSP;
     typedef STD_SHARED_PTR(lldb_private::Debugger) DebuggerSP;
-    typedef STD_WEAK_PTR(lldb_private::Debugger) DebuggerWP;
+    typedef STD_WEAK_PTR(  lldb_private::Debugger) DebuggerWP;
     typedef STD_SHARED_PTR(lldb_private::Disassembler) DisassemblerSP;
     typedef STD_SHARED_PTR(lldb_private::DynamicLoader) DynamicLoaderSP;
     typedef STD_SHARED_PTR(lldb_private::Event) EventSP;
     typedef STD_SHARED_PTR(lldb_private::ExecutionContextRef) ExecutionContextRefSP;
-    typedef STD_SHARED_PTR(lldb_private::TypeCategoryImpl) TypeCategoryImplSP;
     typedef STD_SHARED_PTR(lldb_private::Function) FunctionSP;
+    typedef STD_SHARED_PTR(lldb_private::FuncUnwinders) FuncUnwindersSP;
     typedef STD_SHARED_PTR(lldb_private::InlineFunctionInfo) InlineFunctionInfoSP;
     typedef STD_SHARED_PTR(lldb_private::InputReader) InputReaderSP;
     typedef STD_SHARED_PTR(lldb_private::InstanceSettings) InstanceSettingsSP;
@@ -281,59 +300,78 @@
     typedef STD_SHARED_PTR(lldb_private::Log) LogSP;
     typedef STD_SHARED_PTR(lldb_private::LogChannel) LogChannelSP;
     typedef STD_SHARED_PTR(lldb_private::Module) ModuleSP;
-    typedef STD_WEAK_PTR(lldb_private::Module) ModuleWP;
+    typedef STD_WEAK_PTR(  lldb_private::Module) ModuleWP;
     typedef STD_SHARED_PTR(lldb_private::ObjectFile) ObjectFileSP;
-    typedef STD_WEAK_PTR(lldb_private::ObjectFile) ObjectFileWP;
+    typedef STD_WEAK_PTR(  lldb_private::ObjectFile) ObjectFileWP;
     typedef STD_SHARED_PTR(lldb_private::OptionValue) OptionValueSP;
+    typedef STD_WEAK_PTR(  lldb_private::OptionValue) OptionValueWP;
+    typedef STD_SHARED_PTR(lldb_private::OptionValueArch) OptionValueArchSP;
+    typedef STD_SHARED_PTR(lldb_private::OptionValueArgs) OptionValueArgsSP;
+    typedef STD_SHARED_PTR(lldb_private::OptionValueArray) OptionValueArraySP;
+    typedef STD_SHARED_PTR(lldb_private::OptionValueBoolean) OptionValueBooleanSP;
+    typedef STD_SHARED_PTR(lldb_private::OptionValueDictionary) OptionValueDictionarySP;
+    typedef STD_SHARED_PTR(lldb_private::OptionValueFileSpec) OptionValueFileSpecSP;
+    typedef STD_SHARED_PTR(lldb_private::OptionValueFileSpecList) OptionValueFileSpecListSP;
+    typedef STD_SHARED_PTR(lldb_private::OptionValueFormat) OptionValueFormatSP;
+    typedef STD_SHARED_PTR(lldb_private::OptionValuePathMappings) OptionValuePathMappingsSP;
+    typedef STD_SHARED_PTR(lldb_private::OptionValueProperties) OptionValuePropertiesSP;
+//  typedef STD_WEAK_PTR(  lldb_private::OptionValueProperties) OptionValuePropertiesWP;
+    typedef STD_SHARED_PTR(lldb_private::OptionValueRegex) OptionValueRegexSP;
+    typedef STD_SHARED_PTR(lldb_private::OptionValueSInt64) OptionValueSInt64SP;
+    typedef STD_SHARED_PTR(lldb_private::OptionValueString) OptionValueStringSP;
+    typedef STD_SHARED_PTR(lldb_private::OptionValueUInt64) OptionValueUInt64SP;
+    typedef STD_SHARED_PTR(lldb_private::OptionValueUUID) OptionValueUUIDSP;
     typedef STD_SHARED_PTR(lldb_private::Platform) PlatformSP;
     typedef STD_SHARED_PTR(lldb_private::Process) ProcessSP;
     typedef STD_SHARED_PTR(lldb_private::ProcessAttachInfo) ProcessAttachInfoSP;
     typedef STD_SHARED_PTR(lldb_private::ProcessLaunchInfo) ProcessLaunchInfoSP;
-    typedef STD_WEAK_PTR(lldb_private::Process) ProcessWP;
+    typedef STD_WEAK_PTR(  lldb_private::Process) ProcessWP;
+    typedef STD_SHARED_PTR(lldb_private::Property) PropertySP;
     typedef STD_SHARED_PTR(lldb_private::RegisterContext) RegisterContextSP;
     typedef STD_SHARED_PTR(lldb_private::RegularExpression) RegularExpressionSP;
-    typedef STD_SHARED_PTR(lldb_private::Section) SectionSP;
-    typedef STD_WEAK_PTR(lldb_private::Section) SectionWP;
-    typedef STD_SHARED_PTR(lldb_private::SearchFilter) SearchFilterSP;
     typedef STD_SHARED_PTR(lldb_private::ScriptInterpreterObject) ScriptInterpreterObjectSP;
 #ifndef LLDB_DISABLE_PYTHON
     typedef STD_SHARED_PTR(lldb_private::ScriptSummaryFormat) ScriptSummaryFormatSP;
 #endif // #ifndef LLDB_DISABLE_PYTHON
+    typedef STD_SHARED_PTR(lldb_private::Section) SectionSP;
+    typedef STD_WEAK_PTR(  lldb_private::Section) SectionWP;
+    typedef STD_SHARED_PTR(lldb_private::SearchFilter) SearchFilterSP;
+    typedef STD_SHARED_PTR(lldb_private::Settings) SettingsSP;
     typedef STD_SHARED_PTR(lldb_private::StackFrame) StackFrameSP;
-    typedef STD_WEAK_PTR(lldb_private::StackFrame) StackFrameWP;
+    typedef STD_WEAK_PTR(  lldb_private::StackFrame) StackFrameWP;
     typedef STD_SHARED_PTR(lldb_private::StackFrameList) StackFrameListSP;
     typedef STD_SHARED_PTR(lldb_private::StopInfo) StopInfoSP;
     typedef STD_SHARED_PTR(lldb_private::StoppointLocation) StoppointLocationSP;
     typedef STD_SHARED_PTR(lldb_private::Stream) StreamSP;
     typedef STD_SHARED_PTR(lldb_private::StringSummaryFormat) StringTypeSummaryImplSP;
-    typedef STD_SHARED_PTR(lldb_private::TypeSummaryImpl) TypeSummaryImplSP;
-    typedef STD_SHARED_PTR(lldb_private::TypeNameSpecifierImpl) TypeNameSpecifierImplSP;
     typedef STD_SHARED_PTR(lldb_private::SymbolFile) SymbolFileSP;
     typedef STD_SHARED_PTR(lldb_private::SymbolFileType) SymbolFileTypeSP;
-    typedef STD_WEAK_PTR(lldb_private::SymbolFileType) SymbolFileTypeWP;
+    typedef STD_WEAK_PTR(  lldb_private::SymbolFileType) SymbolFileTypeWP;
     typedef STD_SHARED_PTR(lldb_private::SymbolContextSpecifier) SymbolContextSpecifierSP;
     typedef STD_SHARED_PTR(lldb_private::SyntheticChildren) SyntheticChildrenSP;
     typedef STD_SHARED_PTR(lldb_private::SyntheticChildrenFrontEnd) SyntheticChildrenFrontEndSP;
-    typedef STD_SHARED_PTR(lldb_private::TypeFilterImpl) TypeFilterImplSP;
-#ifndef LLDB_DISABLE_PYTHON
-    typedef STD_SHARED_PTR(lldb_private::TypeSyntheticImpl) TypeSyntheticImplSP;
-#endif
     typedef STD_SHARED_PTR(lldb_private::Target) TargetSP;
-    typedef STD_WEAK_PTR(lldb_private::Target) TargetWP;
+    typedef STD_WEAK_PTR(  lldb_private::Target) TargetWP;
     typedef STD_SHARED_PTR(lldb_private::Thread) ThreadSP;
-    typedef STD_WEAK_PTR(lldb_private::Thread) ThreadWP;
+    typedef STD_WEAK_PTR(  lldb_private::Thread) ThreadWP;
     typedef STD_SHARED_PTR(lldb_private::ThreadPlan) ThreadPlanSP;
     typedef STD_SHARED_PTR(lldb_private::ThreadPlanTracer) ThreadPlanTracerSP;
     typedef STD_SHARED_PTR(lldb_private::Type) TypeSP;
-    typedef STD_WEAK_PTR(lldb_private::Type) TypeWP;
+    typedef STD_WEAK_PTR(  lldb_private::Type) TypeWP;
+    typedef STD_SHARED_PTR(lldb_private::TypeCategoryImpl) TypeCategoryImplSP;
     typedef STD_SHARED_PTR(lldb_private::TypeImpl) TypeImplSP;
-    typedef STD_SHARED_PTR(lldb_private::FuncUnwinders) FuncUnwindersSP;
+    typedef STD_SHARED_PTR(lldb_private::TypeFilterImpl) TypeFilterImplSP;
+    typedef STD_SHARED_PTR(lldb_private::TypeFormatImpl) TypeFormatImplSP;
+    typedef STD_SHARED_PTR(lldb_private::TypeNameSpecifierImpl) TypeNameSpecifierImplSP;
+    typedef STD_SHARED_PTR(lldb_private::TypeSummaryImpl) TypeSummaryImplSP;
+#ifndef LLDB_DISABLE_PYTHON
+    typedef STD_SHARED_PTR(lldb_private::TypeSyntheticImpl) TypeSyntheticImplSP;
+#endif
     typedef STD_SHARED_PTR(lldb_private::UserSettingsController) UserSettingsControllerSP;
-    typedef STD_WEAK_PTR(lldb_private::UserSettingsController) UserSettingsControllerWP;
+    typedef STD_WEAK_PTR(  lldb_private::UserSettingsController) UserSettingsControllerWP;
     typedef STD_SHARED_PTR(lldb_private::UnwindPlan) UnwindPlanSP;
     typedef lldb_private::SharingPtr<lldb_private::ValueObject> ValueObjectSP;
     typedef STD_SHARED_PTR(lldb_private::Value) ValueSP;
-    typedef STD_SHARED_PTR(lldb_private::TypeFormatImpl) TypeFormatImplSP;
     typedef STD_SHARED_PTR(lldb_private::ValueList) ValueListSP;
     typedef STD_SHARED_PTR(lldb_private::Variable) VariableSP;
     typedef STD_SHARED_PTR(lldb_private::VariableList) VariableListSP;

Modified: lldb/trunk/include/lldb/lldb-private-enumerations.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/lldb-private-enumerations.h?rev=162366&r1=162365&r2=162366&view=diff
==============================================================================
--- lldb/trunk/include/lldb/lldb-private-enumerations.h (original)
+++ lldb/trunk/include/lldb/lldb-private-enumerations.h Wed Aug 22 12:17:09 2012
@@ -59,16 +59,16 @@
 ///
 //----------------------------------------------------------------------
 
-typedef enum SettableVariableType
-{
-    eSetVarTypeInt,
-    eSetVarTypeBoolean,
-    eSetVarTypeString,
-    eSetVarTypeArray,
-    eSetVarTypeDictionary,
-    eSetVarTypeEnum,
-    eSetVarTypeNone
-} SettableVariableType;
+//typedef enum SettableVariableType
+//{
+//    eSetVarTypeInt,
+//    eSetVarTypeBoolean,
+//    eSetVarTypeString,
+//    eSetVarTypeArray,
+//    eSetVarTypeDictionary,
+//    eSetVarTypeEnum,
+//    eSetVarTypeNone
+//} SettableVariableType;
 
 typedef enum VarSetOperationType
 {

Modified: lldb/trunk/include/lldb/lldb-private-types.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/lldb-private-types.h?rev=162366&r1=162365&r2=162366&view=diff
==============================================================================
--- lldb/trunk/include/lldb/lldb-private-types.h (original)
+++ lldb/trunk/include/lldb/lldb-private-types.h Wed Aug 22 12:17:09 2012
@@ -39,17 +39,17 @@
     //----------------------------------------------------------------------
     typedef struct
     {
-        const char * name;          // Name of this register set
-        const char * short_name;    // A short name for this register set
+        const char *name;           // Name of this register set
+        const char *short_name;     // A short name for this register set
         size_t num_registers;       // The number of registers in REGISTERS array below
         const uint32_t *registers;  // An array of register numbers in this set
     } RegisterSet;
 
     typedef struct
     {
-        int value;
-        const char * string_value;
-        const char * usage;
+        int64_t value;
+        const char *string_value;
+        const char *usage;
     } OptionEnumValueElement;
     
     typedef struct
@@ -57,13 +57,13 @@
         uint32_t usage_mask;                     // Used to mark options that can be used together.  If (1 << n & usage_mask) != 0
                                                  // then this option belongs to option set n.
         bool required;                           // This option is required (in the current usage level)
-        const char * long_option;                // Full name for this option.
+        const char *long_option;                 // Full name for this option.
         char short_option;                       // Single character for this option.
         int option_has_arg;                      // no_argument, required_argument or optional_argument
         OptionEnumValueElement *enum_values;     // If non-NULL an array of enum values.
         uint32_t completion_type;                // Cookie the option class can use to do define the argument completion.
         lldb::CommandArgumentType argument_type; // Type of argument this option takes
-        const char *  usage_text;                // Full text explaining what this options does and what (if any) argument to
+        const char *usage_text;                  // Full text explaining what this options does and what (if any) argument to
                                                  // pass it.
     } OptionDefinition;
 

Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=162366&r1=162365&r2=162366&view=diff
==============================================================================
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Wed Aug 22 12:17:09 2012
@@ -49,6 +49,33 @@
 /* End PBXAggregateTarget section */
 
 /* Begin PBXBuildFile section */
+		260A248E15D06C50009981B0 /* OptionValues.h in Headers */ = {isa = PBXBuildFile; fileRef = 260A248D15D06C4F009981B0 /* OptionValues.h */; };
+		260CC62E15D04377002BF2E0 /* OptionValueArgs.h in Headers */ = {isa = PBXBuildFile; fileRef = 260CC62115D04377002BF2E0 /* OptionValueArgs.h */; };
+		260CC62F15D04377002BF2E0 /* OptionValueArray.h in Headers */ = {isa = PBXBuildFile; fileRef = 260CC62215D04377002BF2E0 /* OptionValueArray.h */; };
+		260CC63015D04377002BF2E0 /* OptionValueBoolean.h in Headers */ = {isa = PBXBuildFile; fileRef = 260CC62315D04377002BF2E0 /* OptionValueBoolean.h */; };
+		260CC63115D04377002BF2E0 /* OptionValueProperties.h in Headers */ = {isa = PBXBuildFile; fileRef = 260CC62415D04377002BF2E0 /* OptionValueProperties.h */; };
+		260CC63215D04377002BF2E0 /* OptionValueDictionary.h in Headers */ = {isa = PBXBuildFile; fileRef = 260CC62515D04377002BF2E0 /* OptionValueDictionary.h */; };
+		260CC63315D04377002BF2E0 /* OptionValueEnumeration.h in Headers */ = {isa = PBXBuildFile; fileRef = 260CC62615D04377002BF2E0 /* OptionValueEnumeration.h */; };
+		260CC63415D04377002BF2E0 /* OptionValueFileSpec.h in Headers */ = {isa = PBXBuildFile; fileRef = 260CC62715D04377002BF2E0 /* OptionValueFileSpec.h */; };
+		260CC63515D04377002BF2E0 /* OptionValueFileSpecList.h in Headers */ = {isa = PBXBuildFile; fileRef = 260CC62815D04377002BF2E0 /* OptionValueFileSpecList.h */; };
+		260CC63615D04377002BF2E0 /* OptionValueFormat.h in Headers */ = {isa = PBXBuildFile; fileRef = 260CC62915D04377002BF2E0 /* OptionValueFormat.h */; };
+		260CC63715D04377002BF2E0 /* OptionValueSInt64.h in Headers */ = {isa = PBXBuildFile; fileRef = 260CC62A15D04377002BF2E0 /* OptionValueSInt64.h */; };
+		260CC63815D04377002BF2E0 /* OptionValueString.h in Headers */ = {isa = PBXBuildFile; fileRef = 260CC62B15D04377002BF2E0 /* OptionValueString.h */; };
+		260CC63915D04377002BF2E0 /* OptionValueUInt64.h in Headers */ = {isa = PBXBuildFile; fileRef = 260CC62C15D04377002BF2E0 /* OptionValueUInt64.h */; };
+		260CC63A15D04377002BF2E0 /* OptionValueUUID.h in Headers */ = {isa = PBXBuildFile; fileRef = 260CC62D15D04377002BF2E0 /* OptionValueUUID.h */; };
+		260CC64815D0440D002BF2E0 /* OptionValueArgs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260CC63B15D0440D002BF2E0 /* OptionValueArgs.cpp */; };
+		260CC64915D0440D002BF2E0 /* OptionValueArray.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260CC63C15D0440D002BF2E0 /* OptionValueArray.cpp */; };
+		260CC64A15D0440D002BF2E0 /* OptionValueBoolean.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260CC63D15D0440D002BF2E0 /* OptionValueBoolean.cpp */; };
+		260CC64B15D0440D002BF2E0 /* OptionValueProperties.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260CC63E15D0440D002BF2E0 /* OptionValueProperties.cpp */; };
+		260CC64C15D0440D002BF2E0 /* OptionValueDictionary.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260CC63F15D0440D002BF2E0 /* OptionValueDictionary.cpp */; };
+		260CC64D15D0440D002BF2E0 /* OptionValueEnumeration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260CC64015D0440D002BF2E0 /* OptionValueEnumeration.cpp */; };
+		260CC64E15D0440D002BF2E0 /* OptionValueFileSpec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260CC64115D0440D002BF2E0 /* OptionValueFileSpec.cpp */; };
+		260CC64F15D0440D002BF2E0 /* OptionValueFileSpecLIst.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260CC64215D0440D002BF2E0 /* OptionValueFileSpecLIst.cpp */; };
+		260CC65015D0440D002BF2E0 /* OptionValueFormat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260CC64315D0440D002BF2E0 /* OptionValueFormat.cpp */; };
+		260CC65115D0440D002BF2E0 /* OptionValueSInt64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260CC64415D0440D002BF2E0 /* OptionValueSInt64.cpp */; };
+		260CC65215D0440D002BF2E0 /* OptionValueString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260CC64515D0440D002BF2E0 /* OptionValueString.cpp */; };
+		260CC65315D0440D002BF2E0 /* OptionValueUInt64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260CC64615D0440D002BF2E0 /* OptionValueUInt64.cpp */; };
+		260CC65415D0440D002BF2E0 /* OptionValueUUID.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260CC64715D0440D002BF2E0 /* OptionValueUUID.cpp */; };
 		260E07C6136FA69E00CF21D3 /* OptionGroupUUID.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260E07C5136FA69E00CF21D3 /* OptionGroupUUID.cpp */; };
 		260E07C8136FAB9200CF21D3 /* OptionGroupFile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260E07C7136FAB9200CF21D3 /* OptionGroupFile.cpp */; };
 		261744781168585B005ADD65 /* SBType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 261744771168585B005ADD65 /* SBType.cpp */; };
@@ -61,9 +88,12 @@
 		26368A3C126B697600E8659F /* darwin-debug.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26368A3B126B697600E8659F /* darwin-debug.cpp */; };
 		26368AF7126B960500E8659F /* darwin-debug in Resources */ = {isa = PBXBuildFile; fileRef = 26579F68126A25920007C5CB /* darwin-debug */; };
 		263E949F13661AEA00E7D1CE /* UnwindAssembly-x86.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 263E949D13661AE400E7D1CE /* UnwindAssembly-x86.cpp */; };
+		2640E19F15DC78FD00F23B50 /* Property.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2640E19E15DC78FD00F23B50 /* Property.cpp */; };
 		2642FBAE13D003B400ED6808 /* CommunicationKDP.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2642FBA813D003B400ED6808 /* CommunicationKDP.cpp */; };
 		2642FBB013D003B400ED6808 /* ProcessKDP.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2642FBAA13D003B400ED6808 /* ProcessKDP.cpp */; };
 		2642FBB213D003B400ED6808 /* ProcessKDPLog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2642FBAC13D003B400ED6808 /* ProcessKDPLog.cpp */; };
+		26491E3B15E1DB8600CBFFC2 /* OptionValueRegex.h in Headers */ = {isa = PBXBuildFile; fileRef = 26491E3A15E1DB8600CBFFC2 /* OptionValueRegex.h */; };
+		26491E3E15E1DB9F00CBFFC2 /* OptionValueRegex.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26491E3D15E1DB9F00CBFFC2 /* OptionValueRegex.cpp */; };
 		264A97BF133918BC0017F0BE /* PlatformRemoteGDBServer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 264A97BD133918BC0017F0BE /* PlatformRemoteGDBServer.cpp */; };
 		264D8D5013661BD7003A368F /* UnwindAssembly.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 264D8D4F13661BD7003A368F /* UnwindAssembly.cpp */; };
 		265205A813D3E3F700132FE2 /* RegisterContextKDP_arm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 265205A213D3E3F700132FE2 /* RegisterContextKDP_arm.cpp */; };
@@ -378,13 +408,16 @@
 		26957D9813D381C900670048 /* RegisterContextDarwin_arm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26957D9213D381C900670048 /* RegisterContextDarwin_arm.cpp */; };
 		26957D9A13D381C900670048 /* RegisterContextDarwin_i386.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26957D9413D381C900670048 /* RegisterContextDarwin_i386.cpp */; };
 		26957D9C13D381C900670048 /* RegisterContextDarwin_x86_64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26957D9613D381C900670048 /* RegisterContextDarwin_x86_64.cpp */; };
+		2697A39315E404B1003E682C /* OptionValueArch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2697A39215E404B1003E682C /* OptionValueArch.cpp */; };
+		2697A39515E404BA003E682C /* OptionValueArch.h in Headers */ = {isa = PBXBuildFile; fileRef = 2697A39415E404BA003E682C /* OptionValueArch.h */; };
 		2697A54D133A6305004E4240 /* PlatformDarwin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2697A54B133A6305004E4240 /* PlatformDarwin.cpp */; };
 		26A527C114E24F5F00F3A14A /* ProcessMachCore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26A527BD14E24F5F00F3A14A /* ProcessMachCore.cpp */; };
 		26A527C214E24F5F00F3A14A /* ProcessMachCore.h in Headers */ = {isa = PBXBuildFile; fileRef = 26A527BE14E24F5F00F3A14A /* ProcessMachCore.h */; };
 		26A527C314E24F5F00F3A14A /* ThreadMachCore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26A527BF14E24F5F00F3A14A /* ThreadMachCore.cpp */; };
 		26A527C414E24F5F00F3A14A /* ThreadMachCore.h in Headers */ = {isa = PBXBuildFile; fileRef = 26A527C014E24F5F00F3A14A /* ThreadMachCore.h */; };
 		26A69C5F137A17A500262477 /* RegisterValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26C6886E137880C400407EDF /* RegisterValue.cpp */; };
-		26A7A035135E6E4200FB369E /* NamedOptionValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26A7A034135E6E4200FB369E /* NamedOptionValue.cpp */; };
+		26A7A035135E6E4200FB369E /* OptionValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26A7A034135E6E4200FB369E /* OptionValue.cpp */; };
+		26ACEC2815E077AE00E94760 /* Property.h in Headers */ = {isa = PBXBuildFile; fileRef = 26ACEC2715E077AE00E94760 /* Property.h */; };
 		26B1EFAE154638AF00E2DAC7 /* DWARFDeclContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26B1EFAC154638AF00E2DAC7 /* DWARFDeclContext.cpp */; };
 		26B1EFAF154638AF00E2DAC7 /* DWARFDeclContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 26B1EFAD154638AF00E2DAC7 /* DWARFDeclContext.h */; };
 		26B1FCB813381071002886E2 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 26F5C39010F3FA26009D5894 /* CoreFoundation.framework */; };
@@ -405,6 +438,8 @@
 		26D5E15F135BAEA2006EA0A7 /* OptionGroupArchitecture.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26D5E15E135BAEA2006EA0A7 /* OptionGroupArchitecture.cpp */; };
 		26D5E163135BB054006EA0A7 /* OptionGroupPlatform.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26D5E162135BB054006EA0A7 /* OptionGroupPlatform.cpp */; };
 		26D7E45D13D5E30A007FD12B /* SocketAddress.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26D7E45C13D5E30A007FD12B /* SocketAddress.cpp */; };
+		26DAED6015D327A200E15819 /* OptionValuePathMappings.h in Headers */ = {isa = PBXBuildFile; fileRef = 26DAED5F15D327A200E15819 /* OptionValuePathMappings.h */; };
+		26DAED6315D327C200E15819 /* OptionValuePathMappings.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26DAED6215D327C200E15819 /* OptionValuePathMappings.cpp */; };
 		26DB3E161379E7AD0080DC73 /* ABIMacOSX_arm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26DB3E071379E7AD0080DC73 /* ABIMacOSX_arm.cpp */; };
 		26DB3E1C1379E7AD0080DC73 /* ABIMacOSX_i386.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26DB3E0F1379E7AD0080DC73 /* ABIMacOSX_i386.cpp */; };
 		26DB3E1F1379E7AD0080DC73 /* ABISysV_x86_64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26DB3E131379E7AD0080DC73 /* ABISysV_x86_64.cpp */; };
@@ -661,6 +696,7 @@
 		260223E8115F06E500A601A2 /* SBCommunication.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBCommunication.cpp; path = source/API/SBCommunication.cpp; sourceTree = "<group>"; };
 		26022531115F27FA00A601A2 /* SBFileSpec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBFileSpec.h; path = include/lldb/API/SBFileSpec.h; sourceTree = "<group>"; };
 		26022532115F281400A601A2 /* SBFileSpec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBFileSpec.cpp; path = source/API/SBFileSpec.cpp; sourceTree = "<group>"; };
+		260A248D15D06C4F009981B0 /* OptionValues.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OptionValues.h; path = include/lldb/Interpreter/OptionValues.h; sourceTree = "<group>"; };
 		260C6EA013011578005E16B0 /* File.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = File.h; path = include/lldb/Host/File.h; sourceTree = "<group>"; };
 		260C6EA213011581005E16B0 /* File.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = File.cpp; sourceTree = "<group>"; };
 		260C847110F50EFC00BB2B04 /* ThreadPlanBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ThreadPlanBase.cpp; path = source/Target/ThreadPlanBase.cpp; sourceTree = "<group>"; };
@@ -731,6 +767,32 @@
 		260C89DF10F57C5600BB2B04 /* SymbolFileSymtab.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SymbolFileSymtab.h; sourceTree = "<group>"; };
 		260C89E210F57C5600BB2B04 /* SymbolVendorMacOSX.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SymbolVendorMacOSX.cpp; sourceTree = "<group>"; };
 		260C89E310F57C5600BB2B04 /* SymbolVendorMacOSX.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SymbolVendorMacOSX.h; sourceTree = "<group>"; };
+		260CC62115D04377002BF2E0 /* OptionValueArgs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OptionValueArgs.h; path = include/lldb/Interpreter/OptionValueArgs.h; sourceTree = "<group>"; };
+		260CC62215D04377002BF2E0 /* OptionValueArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OptionValueArray.h; path = include/lldb/Interpreter/OptionValueArray.h; sourceTree = "<group>"; };
+		260CC62315D04377002BF2E0 /* OptionValueBoolean.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OptionValueBoolean.h; path = include/lldb/Interpreter/OptionValueBoolean.h; sourceTree = "<group>"; };
+		260CC62415D04377002BF2E0 /* OptionValueProperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OptionValueProperties.h; path = include/lldb/Interpreter/OptionValueProperties.h; sourceTree = "<group>"; };
+		260CC62515D04377002BF2E0 /* OptionValueDictionary.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OptionValueDictionary.h; path = include/lldb/Interpreter/OptionValueDictionary.h; sourceTree = "<group>"; };
+		260CC62615D04377002BF2E0 /* OptionValueEnumeration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OptionValueEnumeration.h; path = include/lldb/Interpreter/OptionValueEnumeration.h; sourceTree = "<group>"; };
+		260CC62715D04377002BF2E0 /* OptionValueFileSpec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OptionValueFileSpec.h; path = include/lldb/Interpreter/OptionValueFileSpec.h; sourceTree = "<group>"; };
+		260CC62815D04377002BF2E0 /* OptionValueFileSpecList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OptionValueFileSpecList.h; path = include/lldb/Interpreter/OptionValueFileSpecList.h; sourceTree = "<group>"; };
+		260CC62915D04377002BF2E0 /* OptionValueFormat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OptionValueFormat.h; path = include/lldb/Interpreter/OptionValueFormat.h; sourceTree = "<group>"; };
+		260CC62A15D04377002BF2E0 /* OptionValueSInt64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OptionValueSInt64.h; path = include/lldb/Interpreter/OptionValueSInt64.h; sourceTree = "<group>"; };
+		260CC62B15D04377002BF2E0 /* OptionValueString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OptionValueString.h; path = include/lldb/Interpreter/OptionValueString.h; sourceTree = "<group>"; };
+		260CC62C15D04377002BF2E0 /* OptionValueUInt64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OptionValueUInt64.h; path = include/lldb/Interpreter/OptionValueUInt64.h; sourceTree = "<group>"; };
+		260CC62D15D04377002BF2E0 /* OptionValueUUID.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OptionValueUUID.h; path = include/lldb/Interpreter/OptionValueUUID.h; sourceTree = "<group>"; };
+		260CC63B15D0440D002BF2E0 /* OptionValueArgs.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionValueArgs.cpp; path = source/Interpreter/OptionValueArgs.cpp; sourceTree = "<group>"; };
+		260CC63C15D0440D002BF2E0 /* OptionValueArray.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionValueArray.cpp; path = source/Interpreter/OptionValueArray.cpp; sourceTree = "<group>"; };
+		260CC63D15D0440D002BF2E0 /* OptionValueBoolean.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionValueBoolean.cpp; path = source/Interpreter/OptionValueBoolean.cpp; sourceTree = "<group>"; };
+		260CC63E15D0440D002BF2E0 /* OptionValueProperties.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionValueProperties.cpp; path = source/Interpreter/OptionValueProperties.cpp; sourceTree = "<group>"; };
+		260CC63F15D0440D002BF2E0 /* OptionValueDictionary.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionValueDictionary.cpp; path = source/Interpreter/OptionValueDictionary.cpp; sourceTree = "<group>"; };
+		260CC64015D0440D002BF2E0 /* OptionValueEnumeration.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionValueEnumeration.cpp; path = source/Interpreter/OptionValueEnumeration.cpp; sourceTree = "<group>"; };
+		260CC64115D0440D002BF2E0 /* OptionValueFileSpec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionValueFileSpec.cpp; path = source/Interpreter/OptionValueFileSpec.cpp; sourceTree = "<group>"; };
+		260CC64215D0440D002BF2E0 /* OptionValueFileSpecLIst.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionValueFileSpecLIst.cpp; path = source/Interpreter/OptionValueFileSpecLIst.cpp; sourceTree = "<group>"; };
+		260CC64315D0440D002BF2E0 /* OptionValueFormat.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionValueFormat.cpp; path = source/Interpreter/OptionValueFormat.cpp; sourceTree = "<group>"; };
+		260CC64415D0440D002BF2E0 /* OptionValueSInt64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionValueSInt64.cpp; path = source/Interpreter/OptionValueSInt64.cpp; sourceTree = "<group>"; };
+		260CC64515D0440D002BF2E0 /* OptionValueString.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionValueString.cpp; path = source/Interpreter/OptionValueString.cpp; sourceTree = "<group>"; };
+		260CC64615D0440D002BF2E0 /* OptionValueUInt64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionValueUInt64.cpp; path = source/Interpreter/OptionValueUInt64.cpp; sourceTree = "<group>"; };
+		260CC64715D0440D002BF2E0 /* OptionValueUUID.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionValueUUID.cpp; path = source/Interpreter/OptionValueUUID.cpp; sourceTree = "<group>"; };
 		260E07C3136FA68900CF21D3 /* OptionGroupUUID.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = OptionGroupUUID.h; path = include/lldb/Interpreter/OptionGroupUUID.h; sourceTree = "<group>"; };
 		260E07C5136FA69E00CF21D3 /* OptionGroupUUID.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionGroupUUID.cpp; path = source/Interpreter/OptionGroupUUID.cpp; sourceTree = "<group>"; };
 		260E07C7136FAB9200CF21D3 /* OptionGroupFile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionGroupFile.cpp; path = source/Interpreter/OptionGroupFile.cpp; sourceTree = "<group>"; };
@@ -814,6 +876,7 @@
 		263E949D13661AE400E7D1CE /* UnwindAssembly-x86.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = "UnwindAssembly-x86.cpp"; sourceTree = "<group>"; };
 		263E949E13661AE400E7D1CE /* UnwindAssembly-x86.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UnwindAssembly-x86.h"; sourceTree = "<group>"; };
 		263FEDA5112CC1DA00E4C208 /* ThreadSafeSTLMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ThreadSafeSTLMap.h; path = include/lldb/Core/ThreadSafeSTLMap.h; sourceTree = "<group>"; };
+		2640E19E15DC78FD00F23B50 /* Property.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Property.cpp; path = source/Interpreter/Property.cpp; sourceTree = "<group>"; };
 		26424E3C125986CB0016D82C /* ValueObjectConstResult.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ValueObjectConstResult.cpp; path = source/Core/ValueObjectConstResult.cpp; sourceTree = "<group>"; };
 		26424E3E125986D30016D82C /* ValueObjectConstResult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ValueObjectConstResult.h; path = include/lldb/Core/ValueObjectConstResult.h; sourceTree = "<group>"; };
 		2642FBA813D003B400ED6808 /* CommunicationKDP.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CommunicationKDP.cpp; sourceTree = "<group>"; };
@@ -825,6 +888,8 @@
 		264334381110F63100CDB6C6 /* ValueObjectRegister.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ValueObjectRegister.cpp; path = source/Core/ValueObjectRegister.cpp; sourceTree = "<group>"; };
 		2643343A1110F63C00CDB6C6 /* ValueObjectRegister.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ValueObjectRegister.h; path = include/lldb/Core/ValueObjectRegister.h; sourceTree = "<group>"; };
 		264723A511FA076E00DE380C /* CleanUp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CleanUp.h; path = include/lldb/Utility/CleanUp.h; sourceTree = "<group>"; };
+		26491E3A15E1DB8600CBFFC2 /* OptionValueRegex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OptionValueRegex.h; path = include/lldb/Interpreter/OptionValueRegex.h; sourceTree = "<group>"; };
+		26491E3D15E1DB9F00CBFFC2 /* OptionValueRegex.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionValueRegex.cpp; path = source/Interpreter/OptionValueRegex.cpp; sourceTree = "<group>"; };
 		264A43BB1320B3B4005B4096 /* Platform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Platform.h; path = include/lldb/Target/Platform.h; sourceTree = "<group>"; };
 		264A43BD1320BCEB005B4096 /* Platform.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Platform.cpp; path = source/Target/Platform.cpp; sourceTree = "<group>"; };
 		264A97BD133918BC0017F0BE /* PlatformRemoteGDBServer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PlatformRemoteGDBServer.cpp; path = "gdb-server/PlatformRemoteGDBServer.cpp"; sourceTree = "<group>"; };
@@ -922,6 +987,8 @@
 		26957D9513D381C900670048 /* RegisterContextDarwin_i386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterContextDarwin_i386.h; path = Utility/RegisterContextDarwin_i386.h; sourceTree = "<group>"; };
 		26957D9613D381C900670048 /* RegisterContextDarwin_x86_64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegisterContextDarwin_x86_64.cpp; path = Utility/RegisterContextDarwin_x86_64.cpp; sourceTree = "<group>"; };
 		26957D9713D381C900670048 /* RegisterContextDarwin_x86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterContextDarwin_x86_64.h; path = Utility/RegisterContextDarwin_x86_64.h; sourceTree = "<group>"; };
+		2697A39215E404B1003E682C /* OptionValueArch.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionValueArch.cpp; path = source/Interpreter/OptionValueArch.cpp; sourceTree = "<group>"; };
+		2697A39415E404BA003E682C /* OptionValueArch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OptionValueArch.h; path = include/lldb/Interpreter/OptionValueArch.h; sourceTree = "<group>"; };
 		2697A54B133A6305004E4240 /* PlatformDarwin.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformDarwin.cpp; sourceTree = "<group>"; };
 		2697A54C133A6305004E4240 /* PlatformDarwin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformDarwin.h; sourceTree = "<group>"; };
 		269FF07D12494F7D00225026 /* FuncUnwinders.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FuncUnwinders.h; path = include/lldb/Symbol/FuncUnwinders.h; sourceTree = "<group>"; };
@@ -937,8 +1004,9 @@
 		26A527BE14E24F5F00F3A14A /* ProcessMachCore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProcessMachCore.h; sourceTree = "<group>"; };
 		26A527BF14E24F5F00F3A14A /* ThreadMachCore.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ThreadMachCore.cpp; sourceTree = "<group>"; };
 		26A527C014E24F5F00F3A14A /* ThreadMachCore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ThreadMachCore.h; sourceTree = "<group>"; };
-		26A7A034135E6E4200FB369E /* NamedOptionValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = NamedOptionValue.cpp; path = source/Interpreter/NamedOptionValue.cpp; sourceTree = "<group>"; };
-		26A7A036135E6E5300FB369E /* NamedOptionValue.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = NamedOptionValue.h; path = include/lldb/Interpreter/NamedOptionValue.h; sourceTree = "<group>"; };
+		26A7A034135E6E4200FB369E /* OptionValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionValue.cpp; path = source/Interpreter/OptionValue.cpp; sourceTree = "<group>"; };
+		26A7A036135E6E5300FB369E /* OptionValue.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = OptionValue.h; path = include/lldb/Interpreter/OptionValue.h; sourceTree = "<group>"; };
+		26ACEC2715E077AE00E94760 /* Property.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Property.h; path = include/lldb/Interpreter/Property.h; sourceTree = "<group>"; };
 		26B167A41123BF5500DC7B4F /* ThreadSafeValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ThreadSafeValue.h; path = include/lldb/Core/ThreadSafeValue.h; sourceTree = "<group>"; };
 		26B1EFAC154638AF00E2DAC7 /* DWARFDeclContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DWARFDeclContext.cpp; sourceTree = "<group>"; };
 		26B1EFAD154638AF00E2DAC7 /* DWARFDeclContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DWARFDeclContext.h; sourceTree = "<group>"; };
@@ -1232,6 +1300,8 @@
 		26D7E45C13D5E30A007FD12B /* SocketAddress.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SocketAddress.cpp; path = source/Host/common/SocketAddress.cpp; sourceTree = "<group>"; };
 		26D9FDC612F784E60003F2EE /* EmulateInstruction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = EmulateInstruction.h; path = include/lldb/Core/EmulateInstruction.h; sourceTree = "<group>"; };
 		26D9FDC812F784FD0003F2EE /* EmulateInstruction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = EmulateInstruction.cpp; path = source/Core/EmulateInstruction.cpp; sourceTree = "<group>"; };
+		26DAED5F15D327A200E15819 /* OptionValuePathMappings.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OptionValuePathMappings.h; path = include/lldb/Interpreter/OptionValuePathMappings.h; sourceTree = "<group>"; };
+		26DAED6215D327C200E15819 /* OptionValuePathMappings.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionValuePathMappings.cpp; path = source/Interpreter/OptionValuePathMappings.cpp; sourceTree = "<group>"; };
 		26DAFD9711529BC7005A394E /* ExecutionContextScope.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ExecutionContextScope.h; path = include/lldb/Target/ExecutionContextScope.h; sourceTree = "<group>"; };
 		26DB3E071379E7AD0080DC73 /* ABIMacOSX_arm.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ABIMacOSX_arm.cpp; sourceTree = "<group>"; };
 		26DB3E081379E7AD0080DC73 /* ABIMacOSX_arm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ABIMacOSX_arm.h; sourceTree = "<group>"; };
@@ -2756,8 +2826,41 @@
 				26BC7DE410F1B7F900F91463 /* CommandReturnObject.h */,
 				26BC7F0A10F1B8DD00F91463 /* CommandReturnObject.cpp */,
 				94005E0513F45A1B001EF42D /* embedded_interpreter.py */,
-				26A7A036135E6E5300FB369E /* NamedOptionValue.h */,
-				26A7A034135E6E4200FB369E /* NamedOptionValue.cpp */,
+				26A7A036135E6E5300FB369E /* OptionValue.h */,
+				26A7A034135E6E4200FB369E /* OptionValue.cpp */,
+				260A248D15D06C4F009981B0 /* OptionValues.h */,
+				2697A39415E404BA003E682C /* OptionValueArch.h */,
+				2697A39215E404B1003E682C /* OptionValueArch.cpp */,
+				260CC62115D04377002BF2E0 /* OptionValueArgs.h */,
+				260CC63B15D0440D002BF2E0 /* OptionValueArgs.cpp */,
+				260CC62215D04377002BF2E0 /* OptionValueArray.h */,
+				260CC63C15D0440D002BF2E0 /* OptionValueArray.cpp */,
+				260CC62315D04377002BF2E0 /* OptionValueBoolean.h */,
+				260CC63D15D0440D002BF2E0 /* OptionValueBoolean.cpp */,
+				260CC62515D04377002BF2E0 /* OptionValueDictionary.h */,
+				260CC63F15D0440D002BF2E0 /* OptionValueDictionary.cpp */,
+				260CC62615D04377002BF2E0 /* OptionValueEnumeration.h */,
+				260CC64015D0440D002BF2E0 /* OptionValueEnumeration.cpp */,
+				260CC62715D04377002BF2E0 /* OptionValueFileSpec.h */,
+				260CC64115D0440D002BF2E0 /* OptionValueFileSpec.cpp */,
+				260CC62815D04377002BF2E0 /* OptionValueFileSpecList.h */,
+				260CC64215D0440D002BF2E0 /* OptionValueFileSpecLIst.cpp */,
+				260CC62915D04377002BF2E0 /* OptionValueFormat.h */,
+				260CC64315D0440D002BF2E0 /* OptionValueFormat.cpp */,
+				26DAED5F15D327A200E15819 /* OptionValuePathMappings.h */,
+				26DAED6215D327C200E15819 /* OptionValuePathMappings.cpp */,
+				260CC62415D04377002BF2E0 /* OptionValueProperties.h */,
+				260CC63E15D0440D002BF2E0 /* OptionValueProperties.cpp */,
+				26491E3A15E1DB8600CBFFC2 /* OptionValueRegex.h */,
+				26491E3D15E1DB9F00CBFFC2 /* OptionValueRegex.cpp */,
+				260CC62A15D04377002BF2E0 /* OptionValueSInt64.h */,
+				260CC64415D0440D002BF2E0 /* OptionValueSInt64.cpp */,
+				260CC62B15D04377002BF2E0 /* OptionValueString.h */,
+				260CC64515D0440D002BF2E0 /* OptionValueString.cpp */,
+				260CC62C15D04377002BF2E0 /* OptionValueUInt64.h */,
+				260CC64615D0440D002BF2E0 /* OptionValueUInt64.cpp */,
+				260CC62D15D04377002BF2E0 /* OptionValueUUID.h */,
+				260CC64715D0440D002BF2E0 /* OptionValueUUID.cpp */,
 				26BC7D6D10F1B77400F91463 /* Options.h */,
 				26BC7E8610F1B85900F91463 /* Options.cpp */,
 				26D5E160135BAEB0006EA0A7 /* OptionGroupArchitecture.h */,
@@ -2779,9 +2882,11 @@
 				267C0128136880C7006E963E /* OptionGroupValueObjectDisplay.h */,
 				267C012A136880DF006E963E /* OptionGroupValueObjectDisplay.cpp */,
 				26ED3D6F13C5638A0017D45E /* OptionGroupVariable.h */,
-				B2462248141AD39B00F3D409 /* OptionGroupWatchpoint.h */,
 				26ED3D6C13C563810017D45E /* OptionGroupVariable.cpp */,
+				B2462248141AD39B00F3D409 /* OptionGroupWatchpoint.h */,
 				B2462246141AD37D00F3D409 /* OptionGroupWatchpoint.cpp */,
+				26ACEC2715E077AE00E94760 /* Property.h */,
+				2640E19E15DC78FD00F23B50 /* Property.cpp */,
 				26BC7DE510F1B7F900F91463 /* ScriptInterpreter.h */,
 				9A82010B10FFB49800182560 /* ScriptInterpreter.cpp */,
 				9A2771FB1135A35C00E6ADB6 /* ScriptInterpreterNone.h */,
@@ -3239,6 +3344,24 @@
 				2694E9A514FC0BBD0076DE67 /* PlatformLinux.h in Headers */,
 				2663E379152BD1890091EC22 /* ReadWriteLock.h in Headers */,
 				26B1EFAF154638AF00E2DAC7 /* DWARFDeclContext.h in Headers */,
+				260CC62E15D04377002BF2E0 /* OptionValueArgs.h in Headers */,
+				260CC62F15D04377002BF2E0 /* OptionValueArray.h in Headers */,
+				260CC63015D04377002BF2E0 /* OptionValueBoolean.h in Headers */,
+				260CC63115D04377002BF2E0 /* OptionValueProperties.h in Headers */,
+				260CC63215D04377002BF2E0 /* OptionValueDictionary.h in Headers */,
+				260CC63315D04377002BF2E0 /* OptionValueEnumeration.h in Headers */,
+				260CC63415D04377002BF2E0 /* OptionValueFileSpec.h in Headers */,
+				260CC63515D04377002BF2E0 /* OptionValueFileSpecList.h in Headers */,
+				260CC63615D04377002BF2E0 /* OptionValueFormat.h in Headers */,
+				260CC63715D04377002BF2E0 /* OptionValueSInt64.h in Headers */,
+				260CC63815D04377002BF2E0 /* OptionValueString.h in Headers */,
+				260CC63915D04377002BF2E0 /* OptionValueUInt64.h in Headers */,
+				260CC63A15D04377002BF2E0 /* OptionValueUUID.h in Headers */,
+				260A248E15D06C50009981B0 /* OptionValues.h in Headers */,
+				26DAED6015D327A200E15819 /* OptionValuePathMappings.h in Headers */,
+				26ACEC2815E077AE00E94760 /* Property.h in Headers */,
+				26491E3B15E1DB8600CBFFC2 /* OptionValueRegex.h in Headers */,
+				2697A39515E404BA003E682C /* OptionValueArch.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -3858,7 +3981,7 @@
 				26D5E15F135BAEA2006EA0A7 /* OptionGroupArchitecture.cpp in Sources */,
 				26D5E163135BB054006EA0A7 /* OptionGroupPlatform.cpp in Sources */,
 				26BD407F135D2AE000237D80 /* FileLineResolver.cpp in Sources */,
-				26A7A035135E6E4200FB369E /* NamedOptionValue.cpp in Sources */,
+				26A7A035135E6E4200FB369E /* OptionValue.cpp in Sources */,
 				9A22A161135E30370024DDC3 /* EmulateInstructionARM.cpp in Sources */,
 				9A22A163135E30370024DDC3 /* EmulationStateARM.cpp in Sources */,
 				9A4F35101368A51A00823F52 /* StreamAsynchronousIO.cpp in Sources */,
@@ -3938,8 +4061,25 @@
 				2694E9A414FC0BBD0076DE67 /* PlatformLinux.cpp in Sources */,
 				26B1EFAE154638AF00E2DAC7 /* DWARFDeclContext.cpp in Sources */,
 				B21EB71515CC99F100E60059 /* cxa_demangle.cpp in Sources */,
+				260CC64815D0440D002BF2E0 /* OptionValueArgs.cpp in Sources */,
+				260CC64915D0440D002BF2E0 /* OptionValueArray.cpp in Sources */,
+				260CC64A15D0440D002BF2E0 /* OptionValueBoolean.cpp in Sources */,
+				260CC64B15D0440D002BF2E0 /* OptionValueProperties.cpp in Sources */,
+				260CC64C15D0440D002BF2E0 /* OptionValueDictionary.cpp in Sources */,
+				260CC64D15D0440D002BF2E0 /* OptionValueEnumeration.cpp in Sources */,
+				260CC64E15D0440D002BF2E0 /* OptionValueFileSpec.cpp in Sources */,
+				260CC64F15D0440D002BF2E0 /* OptionValueFileSpecLIst.cpp in Sources */,
+				260CC65015D0440D002BF2E0 /* OptionValueFormat.cpp in Sources */,
+				260CC65115D0440D002BF2E0 /* OptionValueSInt64.cpp in Sources */,
+				260CC65215D0440D002BF2E0 /* OptionValueString.cpp in Sources */,
+				260CC65315D0440D002BF2E0 /* OptionValueUInt64.cpp in Sources */,
+				260CC65415D0440D002BF2E0 /* OptionValueUUID.cpp in Sources */,
+				26DAED6315D327C200E15819 /* OptionValuePathMappings.cpp in Sources */,
 				B2B7CCEB15D1BD6700EEFB57 /* CommandObjectWatchpointCommand.cpp in Sources */,
 				B2B7CCF015D1C20F00EEFB57 /* WatchpointOptions.cpp in Sources */,
+				2640E19F15DC78FD00F23B50 /* Property.cpp in Sources */,
+				26491E3E15E1DB9F00CBFFC2 /* OptionValueRegex.cpp in Sources */,
+				2697A39315E404B1003E682C /* OptionValueArch.cpp in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -4252,13 +4392,11 @@
 					Foundation,
 					"-v",
 					"-t",
-					"-Wl,-v",
 				);
 				"OTHER_LDFLAGS[sdk=iphoneos*][arch=*]" = (
 					"-lllvmclang",
 					"-v",
 					"-t",
-					"-Wl,-v",
 					"-framework",
 					Foundation,
 				);
@@ -4313,13 +4451,11 @@
 					AppKit,
 					"-v",
 					"-t",
-					"-Wl,-v",
 				);
 				"OTHER_LDFLAGS[sdk=iphoneos*][arch=*]" = (
 					"-lllvmclang",
 					"-v",
 					"-t",
-					"-Wl,-v",
 					"-framework",
 					Foundation,
 				);

Modified: lldb/trunk/source/API/SBDebugger.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBDebugger.cpp?rev=162366&r1=162365&r2=162366&view=diff
==============================================================================
--- lldb/trunk/source/API/SBDebugger.cpp (original)
+++ lldb/trunk/source/API/SBDebugger.cpp Wed Aug 22 12:17:09 2012
@@ -908,50 +908,54 @@
 const char *
 SBDebugger::GetInstanceName()
 {
-    if (m_opaque_sp)
-        return m_opaque_sp->GetInstanceName().AsCString();
-    else
+    // TODO: SETTINGS -- fill this in
+//    if (m_opaque_sp)
+//        return m_opaque_sp->GetInstanceName().AsCString();
+//    else
         return NULL;
 }
 
 SBError
 SBDebugger::SetInternalVariable (const char *var_name, const char *value, const char *debugger_instance_name)
 {
-    UserSettingsControllerSP root_settings_controller = Debugger::GetSettingsController();
-
-    Error err = root_settings_controller->SetVariable (var_name, 
-                                                       value, 
-                                                       eVarSetOperationAssign, 
-                                                       true,
-                                                       debugger_instance_name);
-    SBError sb_error;
-    sb_error.SetError (err);
-
-    return sb_error;
+    // TODO: SETTINGS -- fill this in
+//    UserSettingsControllerSP root_settings_controller = Debugger::GetSettingsController();
+//
+//    Error err = root_settings_controller->SetVariable (var_name, 
+//                                                       value, 
+//                                                       eVarSetOperationAssign, 
+//                                                       true,
+//                                                       debugger_instance_name);
+//    SBError sb_error;
+//    sb_error.SetError (err);
+//
+//    return sb_error;
+    return SBError();
 }
 
 SBStringList
 SBDebugger::GetInternalVariableValue (const char *var_name, const char *debugger_instance_name)
 {
     SBStringList ret_value;
-    SettableVariableType var_type;
-    Error err;
-
-    UserSettingsControllerSP root_settings_controller = Debugger::GetSettingsController();
-
-    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());
-    }
-
-
+    // TODO: SETTINGS -- fill this in
+//    SettableVariableType var_type;
+//    Error err;
+//
+//    UserSettingsControllerSP root_settings_controller = Debugger::GetSettingsController();
+//
+//    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;
 }
 

Modified: lldb/trunk/source/Commands/CommandCompletions.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandCompletions.cpp?rev=162366&r1=162365&r2=162366&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandCompletions.cpp (original)
+++ lldb/trunk/source/Commands/CommandCompletions.cpp Wed Aug 22 12:17:09 2012
@@ -405,15 +405,30 @@
                                    bool &word_complete,
                                    StringList &matches)
 {
-    lldb::UserSettingsControllerSP root_settings = Debugger::GetSettingsController();
-    Args partial_setting_name_pieces = UserSettingsController::BreakNameIntoPieces (partial_setting_name);
-
-    return UserSettingsController::CompleteSettingsNames (root_settings,
-                                                          partial_setting_name_pieces,
-                                                          word_complete,
-                                                          matches);
-
-    //return matches.GetSize();
+    // Cache the full setting name list
+    static StringList g_property_names;
+    if (g_property_names.GetSize() == 0)
+    {
+        // Generate the full setting name list on demand
+        lldb::OptionValuePropertiesSP properties_sp (interpreter.GetDebugger().GetValueProperties());
+        if (properties_sp)
+        {
+            StreamString strm;
+            properties_sp->DumpValue(NULL, strm, OptionValue::eDumpOptionName);
+            const std::string &str = strm.GetString();
+            g_property_names.SplitIntoLines(str.c_str(), str.size());
+        }
+    }
+    
+    size_t exact_matches_idx = SIZE_MAX;
+    const size_t num_matches = g_property_names.AutoComplete (partial_setting_name, matches, exact_matches_idx);
+//    return UserSettingsController::CompleteSettingsNames (root_settings,
+//                                                          partial_setting_name_pieces,
+//                                                          word_complete,
+//                                                          matches);
+//
+    word_complete = exact_matches_idx != SIZE_MAX;
+    return num_matches;
 }
 
 

Modified: lldb/trunk/source/Commands/CommandObjectApropos.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectApropos.cpp?rev=162366&r1=162365&r2=162366&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectApropos.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectApropos.cpp Wed Aug 22 12:17:09 2012
@@ -86,27 +86,22 @@
                 for (size_t i = 0; i < commands_found.GetSize(); ++i)
                     m_interpreter.OutputFormattedHelpText (result.GetOutputStream(), 
                                                            commands_found.GetStringAtIndex(i),
-                                                           "--", commands_help.
-                                                           GetStringAtIndex(i), 
+                                                           "--",
+                                                           commands_help.GetStringAtIndex(i),
                                                            max_len);
                 
             }
             
             
-            StreamString settings_search_results;
-            lldb::UserSettingsControllerSP root = Debugger::GetSettingsController ();
-            const char *settings_prefix = root->GetLevelName().GetCString();
-             
-            UserSettingsController::SearchAllSettingsDescriptions (m_interpreter, 
-                                                                   root, 
-                                                                   settings_prefix, 
-                                                                   search_word,
-                                                                   settings_search_results);
-            
-            if (settings_search_results.GetSize() > 0)
+            std::vector<const Property *> properties;
+            const size_t num_properties = m_interpreter.GetDebugger().Apropos(search_word, properties);
+            if (num_properties)
             {
+                const bool dump_qualified_name = true;
                 result.AppendMessageWithFormat ("\nThe following settings variables may relate to '%s': \n\n", search_word);
-                result.AppendMessageWithFormat ("%s", settings_search_results.GetData());
+                for (size_t i=0; i<num_properties; ++i)
+                    properties[i]->DumpDescription (m_interpreter, result.GetOutputStream(), 0, dump_qualified_name);
+
             }
             
             result.SetStatus (eReturnStatusSuccessFinishNoResult);

Modified: lldb/trunk/source/Commands/CommandObjectMemory.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectMemory.cpp?rev=162366&r1=162365&r2=162366&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectMemory.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectMemory.cpp Wed Aug 22 12:17:09 2012
@@ -25,6 +25,7 @@
 #include "lldb/Interpreter/OptionGroupFormat.h"
 #include "lldb/Interpreter/OptionGroupOutputFile.h"
 #include "lldb/Interpreter/OptionGroupValueObjectDisplay.h"
+#include "lldb/Interpreter/OptionValueString.h"
 #include "lldb/Symbol/ClangNamespaceDecl.h"
 #include "lldb/Target/Process.h"
 #include "lldb/Target/StackFrame.h"

Modified: lldb/trunk/source/Commands/CommandObjectPlatform.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectPlatform.cpp?rev=162366&r1=162365&r2=162366&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectPlatform.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectPlatform.cpp Wed Aug 22 12:17:09 2012
@@ -426,11 +426,7 @@
                 Debugger &debugger = m_interpreter.GetDebugger();
 
                 if (argc == 0)
-                {
-                    const Args &target_settings_args = target->GetRunArguments();
-                    if (target_settings_args.GetArgumentCount())
-                        m_options.launch_info.GetArguments() = target_settings_args;
-                }
+                    target->GetRunArguments(m_options.launch_info.GetArguments());
 
                 ProcessSP process_sp (platform_sp->DebugProcess (m_options.launch_info, 
                                                                  debugger,

Modified: lldb/trunk/source/Commands/CommandObjectProcess.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectProcess.cpp?rev=162366&r1=162365&r2=162366&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectProcess.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectProcess.cpp Wed Aug 22 12:17:09 2012
@@ -168,9 +168,9 @@
         
         if (launch_args.GetArgumentCount() == 0)
         {
-            const Args &process_args = target->GetRunArguments();
-            if (process_args.GetArgumentCount() > 0)
-                m_options.launch_info.GetArguments().AppendArguments (process_args);
+            Args target_setting_args;
+            if (target->GetRunArguments(target_setting_args) > 0)
+                m_options.launch_info.GetArguments().AppendArguments (target_setting_args);
         }
         else
         {

Modified: lldb/trunk/source/Commands/CommandObjectRegister.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectRegister.cpp?rev=162366&r1=162365&r2=162366&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectRegister.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectRegister.cpp Wed Aug 22 12:17:09 2012
@@ -20,9 +20,10 @@
 #include "lldb/Interpreter/Args.h"
 #include "lldb/Interpreter/CommandInterpreter.h"
 #include "lldb/Interpreter/CommandReturnObject.h"
-#include "lldb/Interpreter/NamedOptionValue.h"
 #include "lldb/Interpreter/Options.h"
 #include "lldb/Interpreter/OptionGroupFormat.h"
+#include "lldb/Interpreter/OptionValueArray.h"
+#include "lldb/Interpreter/OptionValueUInt64.h"
 #include "lldb/Target/ExecutionContext.h"
 #include "lldb/Target/Process.h"
 #include "lldb/Target/RegisterContext.h"

Modified: lldb/trunk/source/Commands/CommandObjectSettings.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectSettings.cpp?rev=162366&r1=162365&r2=162366&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectSettings.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectSettings.cpp Wed Aug 22 12:17:09 2012
@@ -21,12 +21,14 @@
 using namespace lldb_private;
 #include "llvm/ADT/StringRef.h"
 
-static inline void StripLeadingSpaces(llvm::StringRef &Str)
+static inline void StripLeadingSpaces(llvm::StringRef &s)
 {
-    while (!Str.empty() && isspace(Str[0]))
-        Str = Str.substr(1);
+    const size_t non_space = s.find_first_not_of(' ');
+    if (non_space > 0)
+        s = s.substr(non_space);
 }
 
+
 //-------------------------------------------------------------------------
 // CommandObjectSettingsSet
 //-------------------------------------------------------------------------
@@ -68,8 +70,8 @@
 "When setting a dictionary or array variable, you can set multiple entries \n\
 at once by giving the values to the set command.  For example: \n\
 \n\
-(lldb) settings set target.run-args value1  value2 value3 \n\
-(lldb) settings set target.env-vars [\"MYPATH\"]=~/.:/usr/bin  [\"SOME_ENV_VAR\"]=12345 \n\
+(lldb) settings set target.run-args value1 value2 value3 \n\
+(lldb) settings set target.env-vars MYPATH=~/.:/usr/bin  SOME_ENV_VAR=12345 \n\
 \n\
 (lldb) settings show target.run-args \n\
   [0]: 'value1' \n\
@@ -79,8 +81,6 @@
   'MYPATH=~/.:/usr/bin'\n\
   'SOME_ENV_VAR=12345' \n\
 \n\
-Note the special syntax for setting a dictionary element: [\"<key>\"]=<value> \n\
-\n\
 Warning:  The 'set' command re-sets the entire array or dictionary.  If you \n\
 just want to add, remove or update individual values (or add something to \n\
 the end), use one of the other settings sub-commands: append, replace, \n\
@@ -108,8 +108,7 @@
 
         CommandOptions (CommandInterpreter &interpreter) :
             Options (interpreter),
-            m_override (true),
-            m_reset (false)
+            m_global (false)
         {
         }
 
@@ -124,11 +123,8 @@
 
             switch (short_option)
             {
-                case 'n':
-                    m_override = false;
-                    break;
-                case 'r':
-                    m_reset = true;
+                case 'g':
+                    m_global = true;
                     break;
                 default:
                     error.SetErrorStringWithFormat ("unrecognized options '%c'", short_option);
@@ -141,8 +137,7 @@
         void
         OptionParsingStarting ()
         {
-            m_override = true;
-            m_reset = false;
+            m_global = false;
         }
         
         const OptionDefinition*
@@ -157,9 +152,7 @@
 
         // Instance variables to hold the values for command options.
 
-        bool m_override;
-        bool m_reset;
-
+        bool m_global;
     };
 
     virtual int
@@ -172,15 +165,20 @@
                               bool &word_complete,
                               StringList &matches)
     {
-        std::string completion_str (input.GetArgumentAtIndex (cursor_index));
-        completion_str.erase (cursor_char_position);
+        std::string completion_str (input.GetArgumentAtIndex (cursor_index), cursor_char_position);
 
-        // Attempting to complete variable name
-        llvm::StringRef prev_str(cursor_index == 2 ? input.GetArgumentAtIndex(1) : "");
-        if (cursor_index == 1 ||
-            (cursor_index == 2 && prev_str.startswith("-")) // "settings set -r th", followed by Tab.
-            )
+        const size_t argc = input.GetArgumentCount();
+        const char *arg = NULL;
+        int setting_var_idx;
+        for (setting_var_idx = 1; setting_var_idx < argc; ++setting_var_idx)
         {
+            arg = input.GetArgumentAtIndex(setting_var_idx);
+            if (arg && arg[0] != '-')
+                break; // We found our setting variable name index
+        }
+        if (cursor_index == setting_var_idx)
+        {
+            // Attempting to complete setting variable name
             CommandCompletions::InvokeCommonCompletionCallbacks (m_interpreter,
                                                                  CommandCompletions::eSettingsNameCompletion,
                                                                  completion_str.c_str(),
@@ -189,39 +187,37 @@
                                                                  NULL,
                                                                  word_complete,
                                                                  matches);
-            // If there is only 1 match which fulfills the completion request, do an early return.
-            if (matches.GetSize() == 1 && completion_str.compare(matches.GetStringAtIndex(0)) != 0)
-                return 1;
         }
-
-        // Attempting to complete value
-        if ((cursor_index == 2)   // Partly into the variable's value
-            || (cursor_index == 1  // Or at the end of a completed valid variable name
-                && matches.GetSize() == 1
-                && completion_str.compare (matches.GetStringAtIndex(0)) == 0))
-        {
-            matches.Clear();
-            UserSettingsControllerSP usc_sp = Debugger::GetSettingsController();
-            if (cursor_index == 1)
-            {
-                // The user is at the end of the variable name, which is complete and valid.
-                UserSettingsController::CompleteSettingsValue (usc_sp,
-                                                               input.GetArgumentAtIndex (1), // variable name
-                                                               NULL,                         // empty value string
-                                                               word_complete,
-                                                               matches);
-            }
-            else
+        else
+        {
+            arg = input.GetArgumentAtIndex(cursor_index);
+            
+            if (arg)
             {
-                // The user is partly into the variable value.
-                UserSettingsController::CompleteSettingsValue (usc_sp,
-                                                               input.GetArgumentAtIndex (1),  // variable name
-                                                               completion_str.c_str(),        // partial value string
-                                                               word_complete,
-                                                               matches);
+                if (arg[0] == '-')
+                {
+                    // Complete option name
+                }
+                else
+                {
+                    ExecutionContext exe_ctx(m_interpreter.GetExecutionContext());
+
+                    // Complete setting value
+                    const char *setting_var_name = input.GetArgumentAtIndex(setting_var_idx);
+                    Error error;
+                    lldb::OptionValueSP value_sp (m_interpreter.GetDebugger().GetPropertyValue(&exe_ctx, setting_var_name, false, error));
+                    if (value_sp)
+                    {
+                        value_sp->AutoComplete (m_interpreter,
+                                                completion_str.c_str(),
+                                                match_start_point,
+                                                max_return_elements,
+                                                word_complete,
+                                                matches);
+                    }
+                }
             }
         }
-
         return matches.GetSize();
     }
     
@@ -229,16 +225,14 @@
     virtual bool
     DoExecute (const char *command, CommandReturnObject &result)
     {
-        UserSettingsControllerSP usc_sp (Debugger::GetSettingsController ());
-
         Args cmd_args(command);
 
         // Process possible options.
         if (!ParseOptions (cmd_args, result))
             return false;
 
-        const int argc = cmd_args.GetArgumentCount ();
-        if ((argc < 2) && (!m_options.m_reset))
+        const size_t argc = cmd_args.GetArgumentCount ();
+        if ((argc < 2) && (!m_options.m_global))
         {
             result.AppendError ("'settings set' takes more arguments");
             result.SetStatus (eReturnStatusFailed);
@@ -248,7 +242,7 @@
         const char *var_name = cmd_args.GetArgumentAtIndex (0);
         if ((var_name == NULL) || (var_name[0] == '\0'))
         {
-            result.AppendError ("'settings set' command requires a valid variable name; No value supplied");
+            result.AppendError ("'settings set' command requires a valid variable name");
             result.SetStatus (eReturnStatusFailed);
             return false;
         }
@@ -260,27 +254,33 @@
         StripLeadingSpaces(var_value_str);
         std::string var_value_string = var_value_str.str();
 
-        if (!m_options.m_reset
-            && var_value_string.empty())
+        ExecutionContext exe_ctx(m_interpreter.GetExecutionContext());
+        Error error;
+        if (m_options.m_global)
+        {
+            error = m_interpreter.GetDebugger().SetPropertyValue (NULL,
+                                                                  eVarSetOperationAssign,
+                                                                  var_name,
+                                                                  var_value_string.c_str());
+        }
+        
+        if (error.Success())
+        {
+            error = m_interpreter.GetDebugger().SetPropertyValue (&exe_ctx,
+                                                                  eVarSetOperationAssign,
+                                                                  var_name,
+                                                                  var_value_string.c_str());
+        }
+
+        if (error.Fail())
         {
-            result.AppendError ("'settings set' command requires a valid variable value unless using '--reset' option;"
-                                " No value supplied");
+            result.AppendError (error.AsCString());
             result.SetStatus (eReturnStatusFailed);
+            return false;
         }
         else
         {
-          Error err = usc_sp->SetVariable (var_name_string.c_str(), 
-                                           var_value_string.c_str(), 
-                                           eVarSetOperationAssign, 
-                                           m_options.m_override, 
-                                           m_interpreter.GetDebugger().GetInstanceName().AsCString());
-            if (err.Fail ())
-            {
-                result.AppendError (err.AsCString());
-                result.SetStatus (eReturnStatusFailed);
-            }
-            else
-                result.SetStatus (eReturnStatusSuccessFinishNoResult);
+            result.SetStatus (eReturnStatusSuccessFinishResult);
         }
 
         return result.Succeeded();
@@ -292,8 +292,7 @@
 OptionDefinition
 CommandObjectSettingsSet::CommandOptions::g_option_table[] =
 {
-    { LLDB_OPT_SET_1, false, "no-override", 'n', no_argument, NULL, NULL, eArgTypeNone, "Prevents already existing instances and pending settings from being assigned this new value.  Using this option means that only the default or specified instance setting values will be updated." },
-    { LLDB_OPT_SET_2, false, "reset", 'r', no_argument,   NULL, NULL, eArgTypeNone, "Causes value to be reset to the original default for this variable.  No value needs to be specified when this option is used." },
+    { LLDB_OPT_SET_2, false, "global", 'g', no_argument,   NULL, NULL, eArgTypeNone, "Apply the new value to the global default value." },
     { 0, false, NULL, 0, 0, NULL, 0, eArgTypeNone, NULL }
 };
 
@@ -339,8 +338,7 @@
                               bool &word_complete,
                               StringList &matches)
     {
-        std::string completion_str (input.GetArgumentAtIndex (cursor_index));
-        completion_str.erase (cursor_char_position);
+        std::string completion_str (input.GetArgumentAtIndex (cursor_index), cursor_char_position);
 
         CommandCompletions::InvokeCommonCompletionCallbacks (m_interpreter,
                                                              CommandCompletions::eSettingsNameCompletion,
@@ -355,51 +353,33 @@
 
 protected:
     virtual bool
-    DoExecute (Args& command, CommandReturnObject &result)
+    DoExecute (Args& args, CommandReturnObject &result)
     {
-        UserSettingsControllerSP usc_sp (Debugger::GetSettingsController ());
-        const char *current_prefix = usc_sp->GetLevelName().GetCString();
-
-        Error err;
+        ExecutionContext exe_ctx(m_interpreter.GetExecutionContext());
+        result.SetStatus (eReturnStatusSuccessFinishResult);
 
-        if (command.GetArgumentCount())
+        const size_t argc = args.GetArgumentCount ();
+        if (argc > 0)
         {
-            // The user requested to see the value of a particular variable.
-            SettableVariableType var_type;
-            const char *variable_name = command.GetArgumentAtIndex (0);
-            StringList value = usc_sp->GetVariable (variable_name, 
-                                                    var_type,
-                                                    m_interpreter.GetDebugger().GetInstanceName().AsCString(),
-                                                    err);
-            
-            if (err.Fail ())
-            {
-                result.AppendError (err.AsCString());
-                result.SetStatus (eReturnStatusFailed);
-                  
-            }
-            else
+            for (size_t i=0; i<argc; ++i)
             {
-                UserSettingsController::DumpValue(m_interpreter, usc_sp, variable_name, result.GetOutputStream());
-                result.SetStatus (eReturnStatusSuccessFinishResult);
+                const char *property_path = args.GetArgumentAtIndex (i);
+
+                Error error(m_interpreter.GetDebugger().DumpPropertyValue (&exe_ctx, result.GetOutputStream(), property_path, OptionValue::eDumpGroupValue));
+                if (error.Success())
+                {
+                    result.GetOutputStream().EOL();
+                }
+                else
+                {
+                    result.AppendError (error.AsCString());
+                    result.SetStatus (eReturnStatusFailed);
+                }
             }
         }
         else
         {
-            UserSettingsController::GetAllVariableValues (m_interpreter, 
-                                                          usc_sp, 
-                                                          current_prefix, 
-                                                          result.GetOutputStream(), 
-                                                          err);
-            if (err.Fail ())
-            {
-                result.AppendError (err.AsCString());
-                result.SetStatus (eReturnStatusFailed);
-            }
-            else
-            {
-                result.SetStatus (eReturnStatusSuccessFinishNoResult);
-            }
+            m_interpreter.GetDebugger().DumpAllPropertyValues (& exe_ctx, result.GetOutputStream(), OptionValue::eDumpGroupValue);
         }
 
         return result.Succeeded();
@@ -451,8 +431,7 @@
                               bool &word_complete,
                               StringList &matches)
     {
-        std::string completion_str (input.GetArgumentAtIndex (cursor_index));
-        completion_str.erase (cursor_char_position);
+        std::string completion_str (input.GetArgumentAtIndex (cursor_index), cursor_char_position);
 
         CommandCompletions::InvokeCommonCompletionCallbacks (m_interpreter,
                                                              CommandCompletions::eSettingsNameCompletion,
@@ -467,46 +446,37 @@
 
 protected:
     virtual bool
-    DoExecute (Args& command, CommandReturnObject &result)
+    DoExecute (Args& args, CommandReturnObject &result)
     {
-        UserSettingsControllerSP usc_sp (Debugger::GetSettingsController ());
-        const char *current_prefix = usc_sp->GetLevelName().GetCString();
+        ExecutionContext exe_ctx(m_interpreter.GetExecutionContext());
+        result.SetStatus (eReturnStatusSuccessFinishResult);
 
-        Error err;
-
-        if (command.GetArgumentCount() == 0)
-        {
-            UserSettingsController::FindAllSettingsDescriptions (m_interpreter, 
-                                                                 usc_sp, 
-                                                                 current_prefix, 
-                                                                 result.GetOutputStream(), 
-                                                                 err);
-        }
-        else if (command.GetArgumentCount() == 1)
-        {
-            const char *search_name = command.GetArgumentAtIndex (0);
-            UserSettingsController::FindSettingsDescriptions (m_interpreter, 
-                                                              usc_sp, 
-                                                              current_prefix,
-                                                              search_name, 
-                                                              result.GetOutputStream(), 
-                                                              err);
-        }
-        else
+        const bool will_modify = false;
+        const size_t argc = args.GetArgumentCount ();
+        if (argc > 0)
         {
-            result.AppendError ("Too many aguments for 'settings list' command.\n");
-            result.SetStatus (eReturnStatusFailed);
-            return false;
-        }
+            const bool dump_qualified_name = true;
 
-        if (err.Fail ())
-        {
-            result.AppendError (err.AsCString());
-            result.SetStatus (eReturnStatusFailed);
+            for (size_t i=0; i<argc; ++i)
+            {
+                const char *property_path = args.GetArgumentAtIndex (i);
+                
+                const Property *property = m_interpreter.GetDebugger().GetValueProperties()->GetPropertyAtPath (&exe_ctx, will_modify, property_path);
+
+                if (property)
+                {
+                    property->DumpDescription (m_interpreter, result.GetOutputStream(), 0, dump_qualified_name);
+                }
+                else
+                {
+                    result.AppendErrorWithFormat ("invalid property path '%s'", property_path);
+                    result.SetStatus (eReturnStatusFailed);
+                }
+            }
         }
         else
         {
-            result.SetStatus (eReturnStatusSuccessFinishNoResult);
+            m_interpreter.GetDebugger().DumpAllDescriptions (m_interpreter, result.GetOutputStream());
         }
 
         return result.Succeeded();
@@ -517,14 +487,14 @@
 // CommandObjectSettingsRemove
 //-------------------------------------------------------------------------
 
-class CommandObjectSettingsRemove : public CommandObjectParsed
+class CommandObjectSettingsRemove : public CommandObjectRaw
 {
 public:
     CommandObjectSettingsRemove (CommandInterpreter &interpreter) :
-        CommandObjectParsed (interpreter,
-                             "settings remove",
-                             "Remove the specified element from an internal debugger settings array or dictionary variable.",
-                             NULL)
+        CommandObjectRaw (interpreter,
+                          "settings remove",
+                          "Remove the specified element from an array or dictionary settings variable.",
+                          NULL)
     {
         CommandArgumentEntry arg1;
         CommandArgumentEntry arg2;
@@ -569,8 +539,7 @@
                               bool &word_complete,
                               StringList &matches)
     {
-        std::string completion_str (input.GetArgumentAtIndex (cursor_index));
-        completion_str.erase (cursor_char_position);
+        std::string completion_str (input.GetArgumentAtIndex (cursor_index), cursor_char_position);
 
         // Attempting to complete variable name
         if (cursor_index < 2)
@@ -588,56 +557,51 @@
 
 protected:
     virtual bool
-    DoExecute (Args& command, CommandReturnObject &result)
+    DoExecute (const char *command, CommandReturnObject &result)
     {
-        UserSettingsControllerSP usc_sp (Debugger::GetSettingsController ());
-
-        const int argc = command.GetArgumentCount ();
-
-        if (argc != 2)
+        result.SetStatus (eReturnStatusSuccessFinishNoResult);
+     
+        Args cmd_args(command);
+        
+        // Process possible options.
+        if (!ParseOptions (cmd_args, result))
+            return false;
+        
+        const size_t argc = cmd_args.GetArgumentCount ();
+        if (argc == 0)
         {
-            result.AppendError ("'settings remove' takes two arguments");
+            result.AppendError ("'settings set' takes an array or dictionary item, or an array followed by one or more indexes, or a dictionary followed by one or more key names to remove");
             result.SetStatus (eReturnStatusFailed);
             return false;
         }
-
-        const char *var_name = command.GetArgumentAtIndex (0);
-        std::string var_name_string;
+        
+        const char *var_name = cmd_args.GetArgumentAtIndex (0);
         if ((var_name == NULL) || (var_name[0] == '\0'))
         {
-            result.AppendError ("'settings remove' command requires a valid variable name; No value supplied");
+            result.AppendError ("'settings set' command requires a valid variable name");
             result.SetStatus (eReturnStatusFailed);
             return false;
         }
-
-        var_name_string = var_name;
-        command.Shift();
-
-        const char *index_value = command.GetArgumentAtIndex (0);
-        std::string index_value_string;
-        if ((index_value == NULL) || (index_value[0] == '\0'))
+        
+        // Split the raw command into var_name and value pair.
+        std::string var_name_string = var_name;
+        llvm::StringRef raw_str(command);
+        llvm::StringRef var_value_str = raw_str.split(var_name).second;
+        StripLeadingSpaces(var_value_str);
+        std::string var_value_string = var_value_str.str();
+        
+        ExecutionContext exe_ctx(m_interpreter.GetExecutionContext());
+        Error error (m_interpreter.GetDebugger().SetPropertyValue (&exe_ctx,
+                                                                   eVarSetOperationRemove,
+                                                                   var_name,
+                                                                   var_value_string.c_str()));
+        if (error.Fail())
         {
-            result.AppendError ("'settings remove' command requires an index or key value; no value supplied");
+            result.AppendError (error.AsCString());
             result.SetStatus (eReturnStatusFailed);
             return false;
         }
-
-        index_value_string = index_value;
-
-        Error err = usc_sp->SetVariable (var_name_string.c_str(), 
-                                         NULL, 
-                                         eVarSetOperationRemove,  
-                                         true, 
-                                         m_interpreter.GetDebugger().GetInstanceName().AsCString(),
-                                         index_value_string.c_str());
-        if (err.Fail ())
-        {
-            result.AppendError (err.AsCString());
-            result.SetStatus (eReturnStatusFailed);
-        }
-        else
-            result.SetStatus (eReturnStatusSuccessFinishNoResult);
-
+        
         return result.Succeeded();
     }
 };
@@ -713,8 +677,7 @@
                               bool &word_complete,
                               StringList &matches)
     {
-        std::string completion_str (input.GetArgumentAtIndex (cursor_index));
-        completion_str.erase (cursor_char_position);
+        std::string completion_str (input.GetArgumentAtIndex (cursor_index), cursor_char_position);
 
         // Attempting to complete variable name
         if (cursor_index < 2)
@@ -734,18 +697,9 @@
     virtual bool
     DoExecute (const char *command, CommandReturnObject &result)
     {
-        UserSettingsControllerSP usc_sp (Debugger::GetSettingsController ());
+        result.SetStatus (eReturnStatusSuccessFinishNoResult);
 
         Args cmd_args(command);
-        const int argc = cmd_args.GetArgumentCount ();
-
-        if (argc < 3)
-        {
-            result.AppendError ("'settings replace' takes more arguments");
-            result.SetStatus (eReturnStatusFailed);
-            return false;
-        }
-
         const char *var_name = cmd_args.GetArgumentAtIndex (0);
         std::string var_name_string;
         if ((var_name == NULL) || (var_name[0] == '\0'))
@@ -756,46 +710,28 @@
         }
 
         var_name_string = var_name;
-        cmd_args.Shift();
-
-        const char *index_value = cmd_args.GetArgumentAtIndex (0);
-        std::string index_value_string;
-        if ((index_value == NULL) || (index_value[0] == '\0'))
-        {
-            result.AppendError ("'settings insert-before' command requires an index value; no value supplied");
-            result.SetStatus (eReturnStatusFailed);
-            return false;
-        }
-
-        index_value_string = index_value;
-        cmd_args.Shift();
 
         // Split the raw command into var_name, index_value, and value triple.
         llvm::StringRef raw_str(command);
-        llvm::StringRef var_value_str = raw_str.split(var_name).second.split(index_value).second;
+        llvm::StringRef var_value_str = raw_str.split(var_name).second;
         StripLeadingSpaces(var_value_str);
         std::string var_value_string = var_value_str.str();
 
-        if (var_value_string.empty())
+        ExecutionContext exe_ctx(m_interpreter.GetExecutionContext());
+        Error error(m_interpreter.GetDebugger().SetPropertyValue (&exe_ctx,
+                                                                  eVarSetOperationReplace,
+                                                                  var_name,
+                                                                  var_value_string.c_str()));
+        if (error.Fail())
         {
-            result.AppendError ("'settings replace' command requires a valid variable value; no value supplied");
+            result.AppendError (error.AsCString());
             result.SetStatus (eReturnStatusFailed);
+            return false;
         }
         else
         {
-            Error err = usc_sp->SetVariable (var_name_string.c_str(), 
-                                             var_value_string.c_str(), 
-                                             eVarSetOperationReplace, 
-                                             true, 
-                                             m_interpreter.GetDebugger().GetInstanceName().AsCString(),
-                                             index_value_string.c_str());
-            if (err.Fail ())
-            {
-                result.AppendError (err.AsCString());
-                result.SetStatus (eReturnStatusFailed);
-            }
-            else
-                result.SetStatus (eReturnStatusSuccessFinishNoResult);
+            result.SetStatus (eReturnStatusSuccessFinishNoResult);
+
         }
 
         return result.Succeeded();
@@ -866,8 +802,7 @@
                               bool &word_complete,
                               StringList &matches)
     {
-        std::string completion_str (input.GetArgumentAtIndex (cursor_index));
-        completion_str.erase (cursor_char_position);
+        std::string completion_str (input.GetArgumentAtIndex (cursor_index), cursor_char_position);
 
         // Attempting to complete variable name
         if (cursor_index < 2)
@@ -887,10 +822,10 @@
     virtual bool
     DoExecute (const char *command, CommandReturnObject &result)
     {
-        UserSettingsControllerSP usc_sp (Debugger::GetSettingsController ());
+        result.SetStatus (eReturnStatusSuccessFinishNoResult);
 
         Args cmd_args(command);
-        const int argc = cmd_args.GetArgumentCount ();
+        const size_t argc = cmd_args.GetArgumentCount ();
 
         if (argc < 3)
         {
@@ -909,47 +844,23 @@
         }
 
         var_name_string = var_name;
-        cmd_args.Shift();
-
-        const char *index_value = cmd_args.GetArgumentAtIndex (0);
-        std::string index_value_string;
-        if ((index_value == NULL) || (index_value[0] == '\0'))
-        {
-            result.AppendError ("'settings insert-before' command requires an index value; no value supplied");
-            result.SetStatus (eReturnStatusFailed);
-            return false;
-        }
-
-        index_value_string = index_value;
-        cmd_args.Shift();
 
         // Split the raw command into var_name, index_value, and value triple.
         llvm::StringRef raw_str(command);
-        llvm::StringRef var_value_str = raw_str.split(var_name).second.split(index_value).second;
+        llvm::StringRef var_value_str = raw_str.split(var_name).second;
         StripLeadingSpaces(var_value_str);
         std::string var_value_string = var_value_str.str();
 
-        if (var_value_string.empty())
+        ExecutionContext exe_ctx(m_interpreter.GetExecutionContext());
+        Error error(m_interpreter.GetDebugger().SetPropertyValue (&exe_ctx,
+                                                                  eVarSetOperationInsertBefore,
+                                                                  var_name,
+                                                                  var_value_string.c_str()));
+        if (error.Fail())
         {
-            result.AppendError ("'settings insert-before' command requires a valid variable value;"
-                                " No value supplied");
+            result.AppendError (error.AsCString());
             result.SetStatus (eReturnStatusFailed);
-        }
-        else
-        {
-            Error err = usc_sp->SetVariable (var_name_string.c_str(), 
-                                             var_value_string.c_str(), 
-                                             eVarSetOperationInsertBefore,
-                                             true, 
-                                             m_interpreter.GetDebugger().GetInstanceName().AsCString(),
-                                             index_value_string.c_str());
-            if (err.Fail ())
-            {
-                result.AppendError (err.AsCString());
-                result.SetStatus (eReturnStatusFailed);
-            }
-            else
-                result.SetStatus (eReturnStatusSuccessFinishNoResult);
+            return false;
         }
 
         return result.Succeeded();
@@ -1020,8 +931,7 @@
                               bool &word_complete,
                               StringList &matches)
     {
-        std::string completion_str (input.GetArgumentAtIndex (cursor_index));
-        completion_str.erase (cursor_char_position);
+        std::string completion_str (input.GetArgumentAtIndex (cursor_index), cursor_char_position);
 
         // Attempting to complete variable name
         if (cursor_index < 2)
@@ -1041,10 +951,10 @@
     virtual bool
     DoExecute (const char *command, CommandReturnObject &result)
     {
-        UserSettingsControllerSP usc_sp (Debugger::GetSettingsController ());
+        result.SetStatus (eReturnStatusSuccessFinishNoResult);
 
         Args cmd_args(command);
-        const int argc = cmd_args.GetArgumentCount ();
+        const size_t argc = cmd_args.GetArgumentCount ();
 
         if (argc < 3)
         {
@@ -1063,47 +973,23 @@
         }
 
         var_name_string = var_name;
-        cmd_args.Shift();
-
-        const char *index_value = cmd_args.GetArgumentAtIndex (0);
-        std::string index_value_string;
-        if ((index_value == NULL) || (index_value[0] == '\0'))
-        {
-            result.AppendError ("'settings insert-after' command requires an index value; no value supplied");
-            result.SetStatus (eReturnStatusFailed);
-            return false;
-        }
-
-        index_value_string = index_value;
-        cmd_args.Shift();
 
         // Split the raw command into var_name, index_value, and value triple.
         llvm::StringRef raw_str(command);
-        llvm::StringRef var_value_str = raw_str.split(var_name).second.split(index_value).second;
+        llvm::StringRef var_value_str = raw_str.split(var_name).second;
         StripLeadingSpaces(var_value_str);
         std::string var_value_string = var_value_str.str();
 
-        if (var_value_string.empty())
+        ExecutionContext exe_ctx(m_interpreter.GetExecutionContext());
+        Error error(m_interpreter.GetDebugger().SetPropertyValue (&exe_ctx,
+                                                                  eVarSetOperationInsertAfter,
+                                                                  var_name,
+                                                                  var_value_string.c_str()));
+        if (error.Fail())
         {
-            result.AppendError ("'settings insert-after' command requires a valid variable value;"
-                                " No value supplied");
+            result.AppendError (error.AsCString());
             result.SetStatus (eReturnStatusFailed);
-        }
-        else
-        {
-            Error err = usc_sp->SetVariable (var_name_string.c_str(), 
-                                             var_value_string.c_str(), 
-                                             eVarSetOperationInsertAfter,
-                                             true, 
-                                             m_interpreter.GetDebugger().GetInstanceName().AsCString(), 
-                                             index_value_string.c_str());
-            if (err.Fail ())
-            {
-                result.AppendError (err.AsCString());
-                result.SetStatus (eReturnStatusFailed);
-            }
-            else
-                result.SetStatus (eReturnStatusSuccessFinishNoResult);
+            return false;
         }
 
         return result.Succeeded();
@@ -1164,8 +1050,7 @@
                               bool &word_complete,
                               StringList &matches)
     {
-        std::string completion_str (input.GetArgumentAtIndex (cursor_index));
-        completion_str.erase (cursor_char_position);
+        std::string completion_str (input.GetArgumentAtIndex (cursor_index), cursor_char_position);
 
         // Attempting to complete variable name
         if (cursor_index < 2)
@@ -1185,10 +1070,9 @@
     virtual bool
     DoExecute (const char *command, CommandReturnObject &result)
     {
-        UserSettingsControllerSP usc_sp (Debugger::GetSettingsController ());
-
+        result.SetStatus (eReturnStatusSuccessFinishNoResult);
         Args cmd_args(command);
-        const int argc = cmd_args.GetArgumentCount ();
+        const size_t argc = cmd_args.GetArgumentCount ();
 
         if (argc < 2)
         {
@@ -1216,26 +1100,16 @@
         StripLeadingSpaces(var_value_str);
         std::string var_value_string = var_value_str.str();
 
-        if (var_value_string.empty())
+        ExecutionContext exe_ctx(m_interpreter.GetExecutionContext());
+        Error error(m_interpreter.GetDebugger().SetPropertyValue (&exe_ctx,
+                                                                  eVarSetOperationAppend,
+                                                                  var_name,
+                                                                  var_value_string.c_str()));
+        if (error.Fail())
         {
-            result.AppendError ("'settings append' command requires a valid variable value;"
-                                " No value supplied");
+            result.AppendError (error.AsCString());
             result.SetStatus (eReturnStatusFailed);
-        }
-        else
-        {
-            Error err = usc_sp->SetVariable (var_name_string.c_str(), 
-                                             var_value_string.c_str(), 
-                                             eVarSetOperationAppend, 
-                                             true, 
-                                             m_interpreter.GetDebugger().GetInstanceName().AsCString());
-            if (err.Fail ())
-            {
-                result.AppendError (err.AsCString());
-                result.SetStatus (eReturnStatusFailed);
-            }
-            else
-                result.SetStatus (eReturnStatusSuccessFinishNoResult);
+            return false;
         }
 
         return result.Succeeded();
@@ -1282,8 +1156,7 @@
                               bool &word_complete,
                               StringList &matches)
     {
-        std::string completion_str (input.GetArgumentAtIndex (cursor_index));
-        completion_str.erase (cursor_char_position);
+        std::string completion_str (input.GetArgumentAtIndex (cursor_index), cursor_char_position);
 
         // Attempting to complete variable name
         if (cursor_index < 2)
@@ -1303,9 +1176,8 @@
     virtual bool
     DoExecute (Args& command, CommandReturnObject &result)
     {
-        UserSettingsControllerSP usc_sp (Debugger::GetSettingsController ());
-
-        const int argc = command.GetArgumentCount ();
+        result.SetStatus (eReturnStatusSuccessFinishNoResult);
+        const size_t argc = command.GetArgumentCount ();
 
         if (argc != 1)
         {
@@ -1321,20 +1193,18 @@
             result.SetStatus (eReturnStatusFailed);
             return false;
         }
-
-        Error err = usc_sp->SetVariable (var_name, 
-                                         NULL, 
-                                         eVarSetOperationClear, 
-                                         false, 
-                                         m_interpreter.GetDebugger().GetInstanceName().AsCString());
-
-        if (err.Fail ())
+        
+        ExecutionContext exe_ctx(m_interpreter.GetExecutionContext());
+        Error error (m_interpreter.GetDebugger().SetPropertyValue (&exe_ctx,
+                                                                   eVarSetOperationClear,
+                                                                   var_name,
+                                                                   NULL));
+        if (error.Fail())
         {
-            result.AppendError (err.AsCString());
+            result.AppendError (error.AsCString());
             result.SetStatus (eReturnStatusFailed);
+            return false;
         }
-        else
-            result.SetStatus (eReturnStatusSuccessFinishNoResult);
 
         return result.Succeeded();
     }

Modified: lldb/trunk/source/Core/ConstString.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ConstString.cpp?rev=162366&r1=162365&r2=162366&view=diff
==============================================================================
--- lldb/trunk/source/Core/ConstString.cpp (original)
+++ lldb/trunk/source/Core/ConstString.cpp Wed Aug 22 12:17:09 2012
@@ -205,6 +205,11 @@
 {
 }
 
+ConstString::ConstString (const llvm::StringRef &s) :
+    m_string (StringPool().GetConstCStringWithLength (s.data(), s.size()))
+{
+}
+
 bool
 ConstString::operator < (const ConstString& rhs) const
 {
@@ -284,6 +289,12 @@
 }
 
 void
+ConstString::SetString (const llvm::StringRef &s)
+{
+    m_string = StringPool().GetConstCStringWithLength (s.data(), s.size());
+}
+
+void
 ConstString::SetCStringWithMangledCounterpart (const char *demangled, const ConstString &mangled)
 {
     m_string = StringPool().GetConstCStringAndSetMangledCounterPart (demangled, mangled.m_string);

Modified: lldb/trunk/source/Core/Debugger.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Debugger.cpp?rev=162366&r1=162365&r2=162366&view=diff
==============================================================================
--- lldb/trunk/source/Core/Debugger.cpp (original)
+++ lldb/trunk/source/Core/Debugger.cpp Wed Aug 22 12:17:09 2012
@@ -29,6 +29,8 @@
 #include "lldb/Core/ValueObjectVariable.h"
 #include "lldb/Host/Terminal.h"
 #include "lldb/Interpreter/CommandInterpreter.h"
+#include "lldb/Interpreter/OptionValueSInt64.h"
+#include "lldb/Interpreter/OptionValueString.h"
 #include "lldb/Symbol/VariableList.h"
 #include "lldb/Target/TargetList.h"
 #include "lldb/Target/Process.h"
@@ -63,124 +65,289 @@
     static DebuggerList g_list;
     return g_list;
 }
+//
+//
+//static const ConstString &
+//PromptVarName ()
+//{
+//    static ConstString g_const_string ("prompt");
+//    return g_const_string;
+//}
+//
+//static const ConstString &
+//GetNotifyVoidName ()
+//{
+//    static ConstString g_const_string ("notify-void");
+//    return g_const_string;
+//}
+//
+//static const ConstString &
+//GetFrameFormatName ()
+//{
+//    static ConstString g_const_string ("frame-format");
+//    return g_const_string;
+//}
+//
+//static const ConstString &
+//GetThreadFormatName ()
+//{
+//    static ConstString g_const_string ("thread-format");
+//    return g_const_string;
+//}
+//
+//static const ConstString &
+//ScriptLangVarName ()
+//{
+//    static ConstString g_const_string ("script-lang");
+//    return g_const_string;
+//}
+//
+//static const ConstString &
+//TermWidthVarName ()
+//{
+//    static ConstString g_const_string ("term-width");
+//    return g_const_string;
+//}
+//
+//static const ConstString &
+//UseExternalEditorVarName ()
+//{
+//    static ConstString g_const_string ("use-external-editor");
+//    return g_const_string;
+//}
+//
+//static const ConstString &
+//AutoConfirmName ()
+//{
+//    static ConstString g_const_string ("auto-confirm");
+//    return g_const_string;
+//}
+//
+//static const ConstString &
+//StopSourceContextBeforeName ()
+//{
+//    static ConstString g_const_string ("stop-line-count-before");
+//    return g_const_string;
+//}
+//
+//static const ConstString &
+//StopSourceContextAfterName ()
+//{
+//    static ConstString g_const_string ("stop-line-count-after");
+//    return g_const_string;
+//}
+//
+//static const ConstString &
+//StopDisassemblyCountName ()
+//{
+//    static ConstString g_const_string ("stop-disassembly-count");
+//    return g_const_string;
+//}
+//
+//static const ConstString &
+//StopDisassemblyDisplayName ()
+//{
+//    static ConstString g_const_string ("stop-disassembly-display");
+//    return g_const_string;
+//}
 
+OptionEnumValueElement
+g_show_disassembly_enum_values[] =
+{
+    { Debugger::eStopDisassemblyTypeNever,    "never",     "Never show disassembly when displaying a stop context."},
+    { Debugger::eStopDisassemblyTypeNoSource, "no-source", "Show disassembly when there is no source information, or the source file is missing when displaying a stop context."},
+    { Debugger::eStopDisassemblyTypeAlways,   "always",    "Always show disassembly when displaying a stop context."},
+    { 0, NULL, NULL }
+};
 
-static const ConstString &
-PromptVarName ()
+OptionEnumValueElement
+g_language_enumerators[] =
+{
+    { eScriptLanguageNone,      "none",     "Disable scripting languages."},
+    { eScriptLanguagePython,    "python",   "Select python as the default scripting language."},
+    { eScriptLanguageDefault,   "default",  "Select the lldb default as the default scripting language."},
+};
+
+#define MODULE_WITH_FUNC "{ ${module.file.basename}{`${function.name-with-args}${function.pc-offset}}}"
+#define FILE_AND_LINE "{ at ${line.file.basename}:${line.number}}"
+
+#define DEFAULT_THREAD_FORMAT "thread #${thread.index}: tid = ${thread.id}"\
+    "{, ${frame.pc}}"\
+    MODULE_WITH_FUNC\
+    FILE_AND_LINE\
+    "{, stop reason = ${thread.stop-reason}}"\
+    "{\\nReturn value: ${thread.return-value}}"\
+    "\\n"
+
+#define DEFAULT_FRAME_FORMAT "frame #${frame.index}: ${frame.pc}"\
+    MODULE_WITH_FUNC\
+    FILE_AND_LINE\
+    "\\n"
+
+
+
+PropertyDefinition
+g_instance_settings_table[] =
+{
+{   "auto-confirm",             OptionValue::eTypeBoolean, true, false, NULL, NULL, "If true all confirmation prompts will receive their default reply." },
+{   "frame-format",             OptionValue::eTypeString , true, 0    , DEFAULT_FRAME_FORMAT, NULL, "The default frame format string to use when displaying stack frame information for threads." },
+{   "notify-void",              OptionValue::eTypeBoolean, true, false, NULL, NULL, "Notify the user explicitly if an expression returns void (default: false)." },
+{   "prompt",                   OptionValue::eTypeString , true, 0    , "(lldb) ", NULL, "The debugger command line prompt displayed for the user." },
+{   "script-lang",              OptionValue::eTypeEnum   , true, eScriptLanguagePython, NULL, g_language_enumerators, "The script language to be used for evaluating user-written scripts." },
+{   "stop-disassembly-count",   OptionValue::eTypeSInt64 , true, 4    , NULL, NULL, "The number of disassembly lines to show when displaying a stopped context." },
+{   "stop-disassembly-display", OptionValue::eTypeEnum   , true, Debugger::eStopDisassemblyTypeNoSource, NULL, g_show_disassembly_enum_values, "Control when to display disassembly when displaying a stopped context." },
+{   "stop-line-count-after",    OptionValue::eTypeSInt64 , true, 3    , NULL, NULL, "The number of sources lines to display that come after the current source line when displaying a stopped context." },
+{   "stop-line-count-before",   OptionValue::eTypeSInt64 , true, 3    , NULL, NULL, "The number of sources lines to display that come before the current source line when displaying a stopped context." },
+{   "term-width",               OptionValue::eTypeSInt64 , true, 80   , NULL, NULL, "The maximum number of columns to use for displaying text." },
+{   "thread-format",            OptionValue::eTypeString , true, 0    , DEFAULT_THREAD_FORMAT, NULL, "The default thread format string to use when displaying thread information." },
+{   "use-external-editor",      OptionValue::eTypeBoolean, true, false, NULL, NULL, "Whether to use an external editor or not." },
+{   NULL,                       OptionValue::eTypeInvalid, true, 0    , NULL, NULL, NULL }
+};
+
+enum
+{
+    ePropertyAutoConfirm = 0,
+    ePropertyFrameFormat,
+    ePropertyNotiftVoid,
+    ePropertyPrompt,
+    ePropertyScriptLanguage,
+    ePropertyStopDisassemblyCount,
+    ePropertyStopDisassemblyDisplay,
+    ePropertyStopLineCountAfter,
+    ePropertyStopLineCountBefore,
+    ePropertyTerminalWidth,
+    ePropertyThreadFormat,
+    ePropertyUseExternalEditor
+};
+
+//
+//const char *
+//Debugger::GetFrameFormat() const
+//{
+//    return m_properties_sp->GetFrameFormat();
+//}
+//const char *
+//Debugger::GetThreadFormat() const
+//{
+//    return m_properties_sp->GetThreadFormat();
+//}
+//
+bool
+Debugger::GetAutoConfirm () const
 {
-    static ConstString g_const_string ("prompt");
-    return g_const_string;
+    const uint32_t idx = ePropertyAutoConfirm;
+    return m_collection_sp->GetPropertyAtIndexAsBoolean (NULL, idx, g_instance_settings_table[idx].default_uint_value != 0);
 }
 
-static const ConstString &
-GetNotifyVoidName ()
+const char *
+Debugger::GetFrameFormat() const
 {
-    static ConstString g_const_string ("notify-void");
-    return g_const_string;
+    const uint32_t idx = ePropertyFrameFormat;
+    return m_collection_sp->GetPropertyAtIndexAsString (NULL, idx, g_instance_settings_table[idx].default_cstr_value);
 }
 
-static const ConstString &
-GetFrameFormatName ()
+bool
+Debugger::GetNotifyVoid () const
 {
-    static ConstString g_const_string ("frame-format");
-    return g_const_string;
+    const uint32_t idx = ePropertyNotiftVoid;
+    return m_collection_sp->GetPropertyAtIndexAsBoolean (NULL, idx, g_instance_settings_table[idx].default_uint_value != 0);
 }
 
-static const ConstString &
-GetThreadFormatName ()
+const char *
+Debugger::GetPrompt() const
 {
-    static ConstString g_const_string ("thread-format");
-    return g_const_string;
+    const uint32_t idx = ePropertyPrompt;
+    return m_collection_sp->GetPropertyAtIndexAsString (NULL, idx, g_instance_settings_table[idx].default_cstr_value);
 }
 
-static const ConstString &
-ScriptLangVarName ()
+void
+Debugger::SetPrompt(const char *p)
 {
-    static ConstString g_const_string ("script-lang");
-    return g_const_string;
+    const uint32_t idx = ePropertyPrompt;
+    m_collection_sp->SetPropertyAtIndexAsString (NULL, idx, p);
+    const char *new_prompt = GetPrompt();
+    EventSP prompt_change_event_sp (new Event(CommandInterpreter::eBroadcastBitResetPrompt, new EventDataBytes (new_prompt)));;
+    GetCommandInterpreter().BroadcastEvent (prompt_change_event_sp);
 }
 
-static const ConstString &
-TermWidthVarName ()
+const char *
+Debugger::GetThreadFormat() const
 {
-    static ConstString g_const_string ("term-width");
-    return g_const_string;
+    const uint32_t idx = ePropertyThreadFormat;
+    return m_collection_sp->GetPropertyAtIndexAsString (NULL, idx, g_instance_settings_table[idx].default_cstr_value);
 }
 
-static const ConstString &
-UseExternalEditorVarName ()
+lldb::ScriptLanguage
+Debugger::GetScriptLanguage() const
 {
-    static ConstString g_const_string ("use-external-editor");
-    return g_const_string;
+    const uint32_t idx = ePropertyScriptLanguage;
+    return (lldb::ScriptLanguage)m_collection_sp->GetPropertyAtIndexAsEnumeration (NULL, idx, g_instance_settings_table[idx].default_uint_value);
 }
 
-static const ConstString &
-AutoConfirmName ()
+bool
+Debugger::SetScriptLanguage (lldb::ScriptLanguage script_lang)
 {
-    static ConstString g_const_string ("auto-confirm");
-    return g_const_string;
+    const uint32_t idx = ePropertyScriptLanguage;
+    return m_collection_sp->SetPropertyAtIndexAsEnumeration (NULL, idx, script_lang);
 }
 
-static const ConstString &
-StopSourceContextBeforeName ()
+uint32_t
+Debugger::GetTerminalWidth () const
 {
-    static ConstString g_const_string ("stop-line-count-before");
-    return g_const_string;
+    const uint32_t idx = ePropertyTerminalWidth;
+    return m_collection_sp->GetPropertyAtIndexAsSInt64 (NULL, idx, g_instance_settings_table[idx].default_uint_value);
 }
 
-static const ConstString &
-StopSourceContextAfterName ()
+bool
+Debugger::SetTerminalWidth (uint32_t term_width)
 {
-    static ConstString g_const_string ("stop-line-count-after");
-    return g_const_string;
+    const uint32_t idx = ePropertyTerminalWidth;
+    return m_collection_sp->SetPropertyAtIndexAsSInt64 (NULL, idx, term_width);
 }
 
-static const ConstString &
-StopDisassemblyCountName ()
+bool
+Debugger::GetUseExternalEditor () const
 {
-    static ConstString g_const_string ("stop-disassembly-count");
-    return g_const_string;
+    const uint32_t idx = ePropertyUseExternalEditor;
+    return m_collection_sp->GetPropertyAtIndexAsBoolean (NULL, idx, g_instance_settings_table[idx].default_uint_value != 0);
 }
 
-static const ConstString &
-StopDisassemblyDisplayName ()
+bool
+Debugger::SetUseExternalEditor (bool b)
 {
-    static ConstString g_const_string ("stop-disassembly-display");
-    return g_const_string;
+    const uint32_t idx = ePropertyUseExternalEditor;
+    return m_collection_sp->SetPropertyAtIndexAsBoolean (NULL, idx, b);
 }
 
-OptionEnumValueElement
-DebuggerInstanceSettings::g_show_disassembly_enum_values[] =
+uint32_t
+Debugger::GetStopSourceLineCount (bool before) const
 {
-    { eStopDisassemblyTypeNever,    "never",     "Never show disassembly when displaying a stop context."},
-    { eStopDisassemblyTypeNoSource, "no-source", "Show disassembly when there is no source information, or the source file is missing when displaying a stop context."},
-    { eStopDisassemblyTypeAlways,   "always",    "Always show disassembly when displaying a stop context."},
-    { 0, NULL, NULL }
-};
+    const uint32_t idx = before ? ePropertyStopLineCountBefore : ePropertyStopLineCountAfter;
+    return m_collection_sp->GetPropertyAtIndexAsSInt64 (NULL, idx, g_instance_settings_table[idx].default_uint_value);
+}
 
+Debugger::StopDisassemblyType
+Debugger::GetStopDisassemblyDisplay () const
+{
+    const uint32_t idx = ePropertyStopDisassemblyDisplay;
+    return (Debugger::StopDisassemblyType)m_collection_sp->GetPropertyAtIndexAsEnumeration (NULL, idx, g_instance_settings_table[idx].default_uint_value);
+}
 
+uint32_t
+Debugger::GetDisassemblyLineCount () const
+{
+    const uint32_t idx = ePropertyStopDisassemblyCount;
+    return m_collection_sp->GetPropertyAtIndexAsSInt64 (NULL, idx, g_instance_settings_table[idx].default_uint_value);
+}
 
 #pragma mark Debugger
 
-UserSettingsControllerSP &
-Debugger::GetSettingsController ()
-{
-    static UserSettingsControllerSP g_settings_controller_sp;
-    if (!g_settings_controller_sp)
-    {
-        g_settings_controller_sp.reset (new Debugger::SettingsController);
-    
-        // The first shared pointer to Debugger::SettingsController in
-        // g_settings_controller_sp must be fully created above so that 
-        // the DebuggerInstanceSettings can use a weak_ptr to refer back 
-        // to the master setttings controller
-        InstanceSettingsSP default_instance_settings_sp (new DebuggerInstanceSettings (g_settings_controller_sp, 
-                                                                                       false, 
-                                                                                       InstanceSettings::GetDefaultName().AsCString()));
-        g_settings_controller_sp->SetDefaultInstanceSettings (default_instance_settings_sp);
-    }
-    return g_settings_controller_sp;
-}
+//const DebuggerPropertiesSP &
+//Debugger::GetSettings() const
+//{
+//    return m_properties_sp;
+//}
+//
 
 int
 Debugger::TestDebuggerRefCount ()
@@ -216,33 +383,33 @@
 void
 Debugger::SettingsInitialize ()
 {
-    static bool g_initialized = false;
-    
-    if (!g_initialized)
-    {
-        g_initialized = true;
-        UserSettingsController::InitializeSettingsController (GetSettingsController(),
-                                                              SettingsController::global_settings_table,
-                                                              SettingsController::instance_settings_table);
-        // Now call SettingsInitialize for each settings 'child' of Debugger
-        Target::SettingsInitialize ();
-    }
+//    static bool g_initialized = false;
+//    
+//    if (!g_initialized)
+//    {
+//        g_initialized = true;
+//        UserSettingsController::InitializeSettingsController (GetSettingsController(),
+//                                                              SettingsController::global_settings_table,
+//                                                              SettingsController::instance_settings_table);
+//        // Now call SettingsInitialize for each settings 'child' of Debugger
+//        Target::SettingsInitialize ();
+//    }
 }
 
 void
 Debugger::SettingsTerminate ()
 {
-
-    // Must call SettingsTerminate() for each settings 'child' of Debugger, before terminating the Debugger's 
-    // Settings.
-
-    Target::SettingsTerminate ();
-
-    // Now terminate the Debugger Settings.
-
-    UserSettingsControllerSP &usc = GetSettingsController();
-    UserSettingsController::FinalizeSettingsController (usc);
-    usc.reset();
+//
+//    // Must call SettingsTerminate() for each settings 'child' of Debugger, before terminating the Debugger's 
+//    // Settings.
+//
+//    Target::SettingsTerminate ();
+//
+//    // Now terminate the Debugger Settings.
+//
+//    UserSettingsControllerSP &usc = GetSettingsController();
+//    UserSettingsController::FinalizeSettingsController (usc);
+//    usc.reset();
 }
 
 DebuggerSP
@@ -285,22 +452,22 @@
 Debugger::FindDebuggerWithInstanceName (const ConstString &instance_name)
 {
     DebuggerSP debugger_sp;
-   
-    if (g_shared_debugger_refcount > 0)
-    {
-        Mutex::Locker locker (GetDebuggerListMutex ());
-        DebuggerList &debugger_list = GetDebuggerList();
-        DebuggerList::iterator pos, end = debugger_list.end();
-
-        for (pos = debugger_list.begin(); pos != end; ++pos)
-        {
-            if ((*pos).get()->m_instance_name == instance_name)
-            {
-                debugger_sp = *pos;
-                break;
-            }
-        }
-    }
+    // TODO: SETTINGS
+//    if (g_shared_debugger_refcount > 0)
+//    {
+//        Mutex::Locker locker (GetDebuggerListMutex ());
+//        DebuggerList &debugger_list = GetDebuggerList();
+//        DebuggerList::iterator pos, end = debugger_list.end();
+//
+//        for (pos = debugger_list.begin(); pos != end; ++pos)
+//        {
+//            if ((*pos).get()->m_instance_name == instance_name)
+//            {
+//                debugger_sp = *pos;
+//                break;
+//            }
+//        }
+//    }
     return debugger_sp;
 }
 
@@ -342,10 +509,9 @@
     return target_sp;
 }
 
-
 Debugger::Debugger (lldb::LogOutputCallback log_callback, void *baton) :
     UserID (g_unique_id++),
-    DebuggerInstanceSettings (GetSettingsController()),
+    Properties(OptionValuePropertiesSP(new OptionValueProperties())), 
     m_input_comm("debugger.input"),
     m_input_file (),
     m_output_file (),
@@ -357,8 +523,12 @@
     m_source_file_cache(),
     m_command_interpreter_ap (new CommandInterpreter (*this, eScriptLanguageDefault, false)),
     m_input_reader_stack (),
-    m_input_reader_data ()
+    m_input_reader_data (),
+    m_instance_name()
 {
+    char instance_cstr[256];
+    snprintf(instance_cstr, sizeof(instance_cstr), "debugger_%d", (int)GetID());
+    m_instance_name.SetCString(instance_cstr);
     if (log_callback)
         m_log_callback_stream_sp.reset (new StreamCallback (log_callback, baton));
     m_command_interpreter_ap->Initialize ();
@@ -366,6 +536,15 @@
     PlatformSP default_platform_sp (Platform::GetDefaultPlatform());
     assert (default_platform_sp.get());
     m_platform_list.Append (default_platform_sp, true);
+    
+    m_collection_sp->Initialize (g_instance_settings_table);
+    m_collection_sp->AppendProperty (ConstString("target"),
+                                     ConstString("Settings specify to debugging targets."),
+                                     true,
+                                     Target::GetGlobalProperties()->GetValueProperties());
+    OptionValueSInt64 *term_width = m_collection_sp->GetPropertyAtIndexAsOptionValueSInt64 (NULL, ePropertyTerminalWidth);
+    term_width->SetMinimumValue(10);
+    term_width->SetMaximumValue(1024);
 }
 
 Debugger::~Debugger ()
@@ -1767,6 +1946,29 @@
                             }
                             else if (::strncmp (var_name_begin, "target.", strlen("target.")) == 0)
                             {
+                                // TODO: hookup properties
+//                                if (!target_properties_sp)
+//                                {
+//                                    Target *target = Target::GetTargetFromContexts (exe_ctx, sc);
+//                                    if (target)
+//                                        target_properties_sp = target->GetProperties();
+//                                }
+//
+//                                if (target_properties_sp)
+//                                {
+//                                    var_name_begin += ::strlen ("target.");
+//                                    const char *end_property = strchr(var_name_begin, '}');
+//                                    if (end_property)
+//                                    {
+//                                        ConstString property_name(var_name_begin, end_property - var_name_begin);
+//                                        std::string property_value (target_properties_sp->GetPropertyValue(property_name));
+//                                        if (!property_value.empty())
+//                                        {
+//                                            s.PutCString (property_value.c_str());
+//                                            var_success = true;
+//                                        }
+//                                    }
+//                                }                                        
                                 Target *target = Target::GetTargetFromContexts (exe_ctx, sc);
                                 if (target)
                                 {
@@ -1780,7 +1982,7 @@
                                             var_success = true;
                                         }
                                     }
-                                }                                        
+                                }
                             }
                             break;
                             
@@ -2395,459 +2597,797 @@
 // class Debugger::SettingsController
 //--------------------------------------------------
 
-Debugger::SettingsController::SettingsController () :
-    UserSettingsController ("", UserSettingsControllerSP())
-{
-}
-
-Debugger::SettingsController::~SettingsController ()
-{
-}
-
-
-InstanceSettingsSP
-Debugger::SettingsController::CreateInstanceSettings (const char *instance_name)
-{
-    InstanceSettingsSP new_settings_sp (new DebuggerInstanceSettings (GetSettingsController(),
-                                                                      false, 
-                                                                      instance_name));
-    return new_settings_sp;
-}
+//Debugger::SettingsController::SettingsController () :
+//    UserSettingsController ("", UserSettingsControllerSP())
+//{
+//}
+//
+//Debugger::SettingsController::~SettingsController ()
+//{
+//}
+//
+//
+//InstanceSettingsSP
+//Debugger::SettingsController::CreateInstanceSettings (const char *instance_name)
+//{
+//    InstanceSettingsSP new_settings_sp (new DebuggerInstanceSettings (GetSettingsController(),
+//                                                                      false, 
+//                                                                      instance_name));
+//    return new_settings_sp;
+//}
 
 #pragma mark DebuggerInstanceSettings
 //--------------------------------------------------
 //  class DebuggerInstanceSettings
 //--------------------------------------------------
 
-DebuggerInstanceSettings::DebuggerInstanceSettings 
-(
-    const UserSettingsControllerSP &m_owner_sp, 
-    bool live_instance,
-    const char *name
-) :
-    InstanceSettings (m_owner_sp, name ? name : InstanceSettings::InvalidName().AsCString(), live_instance),
-    m_term_width (80),
-    m_stop_source_before_count (3),
-    m_stop_source_after_count (3),
-    m_stop_disassembly_count (4),
-    m_stop_disassembly_display (eStopDisassemblyTypeNoSource),
-    m_prompt (),
-    m_notify_void (false),
-    m_frame_format (),
-    m_thread_format (),    
-    m_script_lang (),
-    m_use_external_editor (false),
-    m_auto_confirm_on (false)
-{
-    // CopyInstanceSettings is a pure virtual function in InstanceSettings; it therefore cannot be called
-    // until the vtables for DebuggerInstanceSettings are properly set up, i.e. AFTER all the initializers.
-    // For this reason it has to be called here, rather than in the initializer or in the parent constructor.
-    // The same is true of CreateInstanceName().
-
-    if (GetInstanceName() == InstanceSettings::InvalidName())
-    {
-        ChangeInstanceName (std::string (CreateInstanceName().AsCString()));
-        m_owner_sp->RegisterInstanceSettings (this);
-    }
-
-    if (live_instance)
-    {
-        const InstanceSettingsSP &pending_settings = m_owner_sp->FindPendingSettings (m_instance_name);
-        CopyInstanceSettings (pending_settings, false);
-    }
-}
-
-DebuggerInstanceSettings::DebuggerInstanceSettings (const DebuggerInstanceSettings &rhs) :
-    InstanceSettings (Debugger::GetSettingsController(), CreateInstanceName ().AsCString()),
-    m_prompt (rhs.m_prompt),
-    m_notify_void (rhs.m_notify_void),
-    m_frame_format (rhs.m_frame_format),
-    m_thread_format (rhs.m_thread_format),
-    m_script_lang (rhs.m_script_lang),
-    m_use_external_editor (rhs.m_use_external_editor),
-    m_auto_confirm_on(rhs.m_auto_confirm_on)
-{
-    UserSettingsControllerSP owner_sp (m_owner_wp.lock());
-    if (owner_sp)
-    {
-        CopyInstanceSettings (owner_sp->FindPendingSettings (m_instance_name), false);
-        owner_sp->RemovePendingSettings (m_instance_name);
-    }
-}
-
-DebuggerInstanceSettings::~DebuggerInstanceSettings ()
-{
-}
-
-DebuggerInstanceSettings&
-DebuggerInstanceSettings::operator= (const DebuggerInstanceSettings &rhs)
-{
-    if (this != &rhs)
-    {
-        m_term_width = rhs.m_term_width;
-        m_prompt = rhs.m_prompt;
-        m_notify_void = rhs.m_notify_void;
-        m_frame_format = rhs.m_frame_format;
-        m_thread_format = rhs.m_thread_format;
-        m_script_lang = rhs.m_script_lang;
-        m_use_external_editor = rhs.m_use_external_editor;
-        m_auto_confirm_on = rhs.m_auto_confirm_on;
-    }
-
-    return *this;
-}
-
-bool
-DebuggerInstanceSettings::ValidTermWidthValue (const char *value, Error err)
-{
-    bool valid = false;
-
-    // Verify we have a value string.
-    if (value == NULL || value[0] == '\0')
-    {
-        err.SetErrorString ("missing value, can't set terminal width without a value");
-    }
-    else
-    {
-        char *end = NULL;
-        const uint32_t width = ::strtoul (value, &end, 0);
-        
-        if (end && end[0] == '\0')
-        {
-            return ValidTermWidthValue (width, err);
-        }
-        else
-            err.SetErrorStringWithFormat ("'%s' is not a valid unsigned integer string", value);
-    }
-
-    return valid;
-}
-
-bool
-DebuggerInstanceSettings::ValidTermWidthValue (uint32_t value, Error err)
-{
-    if (value >= 10 && value <= 1024)
-        return true;
-    else
-    {
-        err.SetErrorString ("invalid term-width value; value must be between 10 and 1024");
-        return false;
-    }
-}
-
-void
-DebuggerInstanceSettings::UpdateInstanceSettingsVariable (const ConstString &var_name,
-                                                          const char *index_value,
-                                                          const char *value,
-                                                          const ConstString &instance_name,
-                                                          const SettingEntry &entry,
-                                                          VarSetOperationType op,
-                                                          Error &err,
-                                                          bool pending)
-{
-
-    if (var_name == TermWidthVarName())
-    {
-        if (ValidTermWidthValue (value, err))
-        {
-            m_term_width = ::strtoul (value, NULL, 0);
-        }
-    }
-    else if (var_name == PromptVarName())
-    {
-        UserSettingsController::UpdateStringVariable (op, m_prompt, value, err);
-        if (!pending)
-        {
-            // '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 == GetNotifyVoidName())
-    {
-        UserSettingsController::UpdateBooleanVariable (op, m_notify_void, value, false, err);
-    }
-    else if (var_name == GetFrameFormatName())
-    {
-        UserSettingsController::UpdateStringVariable (op, m_frame_format, value, err);
-    }
-    else if (var_name == GetThreadFormatName())
-    {
-        UserSettingsController::UpdateStringVariable (op, m_thread_format, value, err);
-    }
-    else if (var_name == ScriptLangVarName())
-    {
-        bool success;
-        m_script_lang = Args::StringToScriptLanguage (value, eScriptLanguageDefault,
-                                                      &success);
-    }
-    else if (var_name == UseExternalEditorVarName ())
-    {
-        UserSettingsController::UpdateBooleanVariable (op, m_use_external_editor, value, false, err);
-    }
-    else if (var_name == AutoConfirmName ())
-    {
-        UserSettingsController::UpdateBooleanVariable (op, m_auto_confirm_on, value, false, err);
-    }
-    else if (var_name == StopSourceContextBeforeName ())
-    {
-        uint32_t new_value = Args::StringToUInt32(value, UINT32_MAX, 10, NULL);
-        if (new_value != UINT32_MAX)
-            m_stop_source_before_count = new_value;
-        else
-            err.SetErrorStringWithFormat("invalid unsigned string value '%s' for the '%s' setting", value, StopSourceContextBeforeName ().GetCString());
-    }
-    else if (var_name == StopSourceContextAfterName ())
-    {
-        uint32_t new_value = Args::StringToUInt32(value, UINT32_MAX, 10, NULL);
-        if (new_value != UINT32_MAX)
-            m_stop_source_after_count = new_value;
-        else
-            err.SetErrorStringWithFormat("invalid unsigned string value '%s' for the '%s' setting", value, StopSourceContextAfterName ().GetCString());
-    }
-    else if (var_name == StopDisassemblyCountName ())
-    {
-        uint32_t new_value = Args::StringToUInt32(value, UINT32_MAX, 10, NULL);
-        if (new_value != UINT32_MAX)
-            m_stop_disassembly_count = new_value;
-        else
-            err.SetErrorStringWithFormat("invalid unsigned string value '%s' for the '%s' setting", value, StopDisassemblyCountName ().GetCString());
-    }
-    else if (var_name == StopDisassemblyDisplayName ())
-    {
-        int new_value;
-        UserSettingsController::UpdateEnumVariable (g_show_disassembly_enum_values, &new_value, value, err);
-        if (err.Success())
-            m_stop_disassembly_display = (StopDisassemblyType)new_value;
-    }
-}
-
-bool
-DebuggerInstanceSettings::GetInstanceSettingsValue (const SettingEntry &entry,
-                                                    const ConstString &var_name,
-                                                    StringList &value,
-                                                    Error *err)
-{
-    if (var_name == PromptVarName())
-    {
-        value.AppendString (m_prompt.c_str(), m_prompt.size());
-    }
-    else if (var_name == GetNotifyVoidName())
-    {
-        value.AppendString (m_notify_void ? "true" : "false");
-    }
-    else if (var_name == ScriptLangVarName())
-    {
-        value.AppendString (ScriptInterpreter::LanguageToString (m_script_lang).c_str());
-    }
-    else if (var_name == TermWidthVarName())
-    {
-        StreamString width_str;
-        width_str.Printf ("%u", m_term_width);
-        value.AppendString (width_str.GetData());
-    }
-    else if (var_name == GetFrameFormatName ())
-    {
-        value.AppendString(m_frame_format.c_str(), m_frame_format.size());
-    }
-    else if (var_name == GetThreadFormatName ())
-    {
-        value.AppendString(m_thread_format.c_str(), m_thread_format.size());
-    }
-    else if (var_name == UseExternalEditorVarName())
-    {
-        if (m_use_external_editor)
-            value.AppendString ("true");
-        else
-            value.AppendString ("false");
-    }
-    else if (var_name == AutoConfirmName())
-    {
-        if (m_auto_confirm_on)
-            value.AppendString ("true");
-        else
-            value.AppendString ("false");
-    }
-    else if (var_name == StopSourceContextAfterName ())
-    {
-        StreamString strm;
-        strm.Printf ("%u", m_stop_source_after_count);
-        value.AppendString (strm.GetData());
-    }
-    else if (var_name == StopSourceContextBeforeName ())
-    {
-        StreamString strm;
-        strm.Printf ("%u", m_stop_source_before_count);
-        value.AppendString (strm.GetData());
-    }
-    else if (var_name == StopDisassemblyCountName ())
-    {
-        StreamString strm;
-        strm.Printf ("%u", m_stop_disassembly_count);
-        value.AppendString (strm.GetData());
-    }
-    else if (var_name == StopDisassemblyDisplayName ())
-    {
-        if (m_stop_disassembly_display >= eStopDisassemblyTypeNever && m_stop_disassembly_display <= eStopDisassemblyTypeAlways)
-            value.AppendString (g_show_disassembly_enum_values[m_stop_disassembly_display].string_value);
-        else
-            value.AppendString ("<invalid>");
-    }
-    else
-    {
-        if (err)
-            err->SetErrorStringWithFormat ("unrecognized variable name '%s'", var_name.AsCString());
-        return false;
-    }
-    return true;
-}
-
-void
-DebuggerInstanceSettings::CopyInstanceSettings (const InstanceSettingsSP &new_settings,
-                                                bool pending)
-{
-    if (new_settings.get() == NULL)
-        return;
-
-    DebuggerInstanceSettings *new_debugger_settings = (DebuggerInstanceSettings *) new_settings.get();
-
-    m_prompt = new_debugger_settings->m_prompt;
-    if (!pending)
-    {
-        // '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_notify_void = new_debugger_settings->m_notify_void;
-    m_frame_format = new_debugger_settings->m_frame_format;
-    m_thread_format = new_debugger_settings->m_thread_format;
-    m_term_width = new_debugger_settings->m_term_width;
-    m_script_lang = new_debugger_settings->m_script_lang;
-    m_use_external_editor = new_debugger_settings->m_use_external_editor;
-    m_auto_confirm_on = new_debugger_settings->m_auto_confirm_on;
-}
-
-
-bool
-DebuggerInstanceSettings::BroadcastPromptChange (const ConstString &instance_name, const char *new_prompt)
-{
-    std::string tmp_prompt;
-    
-    if (new_prompt != NULL)
-    {
-        tmp_prompt = new_prompt ;
-        int len = tmp_prompt.size();
-        if (len > 1
-            && (tmp_prompt[0] == '\'' || tmp_prompt[0] == '"')
-            && (tmp_prompt[len-1] == tmp_prompt[0]))
-        {
-            tmp_prompt = tmp_prompt.substr(1,len-2);
-        }
-        len = tmp_prompt.size();
-        if (tmp_prompt[len-1] != ' ')
-            tmp_prompt.append(" ");
-    }
-    EventSP new_event_sp;
-    new_event_sp.reset (new Event(CommandInterpreter::eBroadcastBitResetPrompt, 
-                                  new EventDataBytes (tmp_prompt.c_str())));
-
-    if (instance_name.GetLength() != 0)
-    {
-        // Set prompt for a particular instance.
-        Debugger *dbg = Debugger::FindDebuggerWithInstanceName (instance_name).get();
-        if (dbg != NULL)
-        {
-            dbg->GetCommandInterpreter().BroadcastEvent (new_event_sp);
-        }
-    }
-
-    return true;
-}
-
-const ConstString
-DebuggerInstanceSettings::CreateInstanceName ()
-{
-    static int instance_count = 1;
-    StreamString sstr;
-
-    sstr.Printf ("debugger_%d", instance_count);
-    ++instance_count;
-
-    const ConstString ret_val (sstr.GetData());
-
-    return ret_val;
-}
-
+//DebuggerInstanceSettings::DebuggerInstanceSettings
+//(
+//    const UserSettingsControllerSP &m_owner_sp, 
+//    bool live_instance,
+//    const char *name
+//) :
+//    InstanceSettings (m_owner_sp, name ? name : InstanceSettings::InvalidName().AsCString(), live_instance),
+//    m_term_width (80),
+//    m_stop_source_before_count (3),
+//    m_stop_source_after_count (3),
+//    m_stop_disassembly_count (4),
+//    m_stop_disassembly_display (eStopDisassemblyTypeNoSource),
+//    m_prompt (),
+//    m_frame_format (),
+//    m_thread_format (),    
+//    m_script_lang (),
+//    m_use_external_editor (false),
+//    m_auto_confirm_on (false)
+//{
+//    // CopyInstanceSettings is a pure virtual function in InstanceSettings; it therefore cannot be called
+//    // until the vtables for DebuggerInstanceSettings are properly set up, i.e. AFTER all the initializers.
+//    // For this reason it has to be called here, rather than in the initializer or in the parent constructor.
+//    // The same is true of CreateInstanceName().
+//
+//    if (GetInstanceName() == InstanceSettings::InvalidName())
+//    {
+//        ChangeInstanceName (std::string (CreateInstanceName().AsCString()));
+//        m_owner_sp->RegisterInstanceSettings (this);
+//    }
+//
+//    if (live_instance)
+//    {
+//        const InstanceSettingsSP &pending_settings = m_owner_sp->FindPendingSettings (m_instance_name);
+//        CopyInstanceSettings (pending_settings, false);
+//    }
+//}
+//
+//DebuggerInstanceSettings::DebuggerInstanceSettings (const DebuggerInstanceSettings &rhs) :
+//    InstanceSettings (Debugger::GetSettingsController(), CreateInstanceName ().AsCString()),
+//    m_prompt (rhs.m_prompt),
+//    m_frame_format (rhs.m_frame_format),
+//    m_thread_format (rhs.m_thread_format),
+//    m_script_lang (rhs.m_script_lang),
+//    m_use_external_editor (rhs.m_use_external_editor),
+//    m_auto_confirm_on(rhs.m_auto_confirm_on)
+//{
+//    UserSettingsControllerSP owner_sp (m_owner_wp.lock());
+//    if (owner_sp)
+//    {
+//        CopyInstanceSettings (owner_sp->FindPendingSettings (m_instance_name), false);
+//        owner_sp->RemovePendingSettings (m_instance_name);
+//    }
+//}
+//
+//DebuggerInstanceSettings::~DebuggerInstanceSettings ()
+//{
+//}
+//
+//DebuggerInstanceSettings&
+//DebuggerInstanceSettings::operator= (const DebuggerInstanceSettings &rhs)
+//{
+//    if (this != &rhs)
+//    {
+//        m_term_width = rhs.m_term_width;
+//        m_prompt = rhs.m_prompt;
+//        m_frame_format = rhs.m_frame_format;
+//        m_thread_format = rhs.m_thread_format;
+//        m_script_lang = rhs.m_script_lang;
+//        m_use_external_editor = rhs.m_use_external_editor;
+//        m_auto_confirm_on = rhs.m_auto_confirm_on;
+//    }
+//
+//    return *this;
+//}
+//
+//bool
+//DebuggerInstanceSettings::ValidTermWidthValue (const char *value, Error err)
+//{
+//    bool valid = false;
+//
+//    // Verify we have a value string.
+//    if (value == NULL || value[0] == '\0')
+//    {
+//        err.SetErrorString ("missing value, can't set terminal width without a value");
+//    }
+//    else
+//    {
+//        char *end = NULL;
+//        const uint32_t width = ::strtoul (value, &end, 0);
+//        
+//        if (end && end[0] == '\0')
+//        {
+//            return ValidTermWidthValue (width, err);
+//        }
+//        else
+//            err.SetErrorStringWithFormat ("'%s' is not a valid unsigned integer string", value);
+//    }
+//
+//    return valid;
+//}
+//
+//bool
+//DebuggerInstanceSettings::ValidTermWidthValue (uint32_t value, Error err)
+//{
+//    if (value >= 10 && value <= 1024)
+//        return true;
+//    else
+//    {
+//        err.SetErrorString ("invalid term-width value; value must be between 10 and 1024");
+//        return false;
+//    }
+//}
+//
+//void
+//DebuggerInstanceSettings::UpdateInstanceSettingsVariable (const ConstString &var_name,
+//                                                          const char *index_value,
+//                                                          const char *value,
+//                                                          const ConstString &instance_name,
+//                                                          const SettingEntry &entry,
+//                                                          VarSetOperationType op,
+//                                                          Error &err,
+//                                                          bool pending)
+//{
+//
+//    if (var_name == TermWidthVarName())
+//    {
+//        if (ValidTermWidthValue (value, err))
+//        {
+//            m_term_width = ::strtoul (value, NULL, 0);
+//        }
+//    }
+//    else if (var_name == PromptVarName())
+//    {
+//        UserSettingsController::UpdateStringVariable (op, m_prompt, value, err);
+//        if (!pending)
+//        {
+//            // '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 == GetFrameFormatName())
+//    {
+//        UserSettingsController::UpdateStringVariable (op, m_frame_format, value, err);
+//    }
+//    else if (var_name == GetThreadFormatName())
+//    {
+//        UserSettingsController::UpdateStringVariable (op, m_thread_format, value, err);
+//    }
+//    else if (var_name == ScriptLangVarName())
+//    {
+//        bool success;
+//        m_script_lang = Args::StringToScriptLanguage (value, eScriptLanguageDefault,
+//                                                      &success);
+//    }
+//    else if (var_name == UseExternalEditorVarName ())
+//    {
+//        UserSettingsController::UpdateBooleanVariable (op, m_use_external_editor, value, false, err);
+//    }
+//    else if (var_name == AutoConfirmName ())
+//    {
+//        UserSettingsController::UpdateBooleanVariable (op, m_auto_confirm_on, value, false, err);
+//    }
+//    else if (var_name == StopSourceContextBeforeName ())
+//    {
+//        uint32_t new_value = Args::StringToUInt32(value, UINT32_MAX, 10, NULL);
+//        if (new_value != UINT32_MAX)
+//            m_stop_source_before_count = new_value;
+//        else
+//            err.SetErrorStringWithFormat("invalid unsigned string value '%s' for the '%s' setting", value, StopSourceContextBeforeName ().GetCString());
+//    }
+//    else if (var_name == StopSourceContextAfterName ())
+//    {
+//        uint32_t new_value = Args::StringToUInt32(value, UINT32_MAX, 10, NULL);
+//        if (new_value != UINT32_MAX)
+//            m_stop_source_after_count = new_value;
+//        else
+//            err.SetErrorStringWithFormat("invalid unsigned string value '%s' for the '%s' setting", value, StopSourceContextAfterName ().GetCString());
+//    }
+//    else if (var_name == StopDisassemblyCountName ())
+//    {
+//        uint32_t new_value = Args::StringToUInt32(value, UINT32_MAX, 10, NULL);
+//        if (new_value != UINT32_MAX)
+//            m_stop_disassembly_count = new_value;
+//        else
+//            err.SetErrorStringWithFormat("invalid unsigned string value '%s' for the '%s' setting", value, StopDisassemblyCountName ().GetCString());
+//    }
+//    else if (var_name == StopDisassemblyDisplayName ())
+//    {
+//        int new_value;
+//        UserSettingsController::UpdateEnumVariable (g_show_disassembly_enum_values, &new_value, value, err);
+//        if (err.Success())
+//            m_stop_disassembly_display = (StopDisassemblyType)new_value;
+//    }
+//}
+//
+//bool
+//DebuggerInstanceSettings::GetInstanceSettingsValue (const SettingEntry &entry,
+//                                                    const ConstString &var_name,
+//                                                    StringList &value,
+//                                                    Error *err)
+//{
+//    if (var_name == PromptVarName())
+//    {
+//        value.AppendString (m_prompt.c_str(), m_prompt.size());
+//        
+//    }
+//    else if (var_name == ScriptLangVarName())
+//    {
+//        value.AppendString (ScriptInterpreter::LanguageToString (m_script_lang).c_str());
+//    }
+//    else if (var_name == TermWidthVarName())
+//    {
+//        StreamString width_str;
+//        width_str.Printf ("%u", m_term_width);
+//        value.AppendString (width_str.GetData());
+//    }
+//    else if (var_name == GetFrameFormatName ())
+//    {
+//        value.AppendString(m_frame_format.c_str(), m_frame_format.size());
+//    }
+//    else if (var_name == GetThreadFormatName ())
+//    {
+//        value.AppendString(m_thread_format.c_str(), m_thread_format.size());
+//    }
+//    else if (var_name == UseExternalEditorVarName())
+//    {
+//        if (m_use_external_editor)
+//            value.AppendString ("true");
+//        else
+//            value.AppendString ("false");
+//    }
+//    else if (var_name == AutoConfirmName())
+//    {
+//        if (m_auto_confirm_on)
+//            value.AppendString ("true");
+//        else
+//            value.AppendString ("false");
+//    }
+//    else if (var_name == StopSourceContextAfterName ())
+//    {
+//        StreamString strm;
+//        strm.Printf ("%u", m_stop_source_after_count);
+//        value.AppendString (strm.GetData());
+//    }
+//    else if (var_name == StopSourceContextBeforeName ())
+//    {
+//        StreamString strm;
+//        strm.Printf ("%u", m_stop_source_before_count);
+//        value.AppendString (strm.GetData());
+//    }
+//    else if (var_name == StopDisassemblyCountName ())
+//    {
+//        StreamString strm;
+//        strm.Printf ("%u", m_stop_disassembly_count);
+//        value.AppendString (strm.GetData());
+//    }
+//    else if (var_name == StopDisassemblyDisplayName ())
+//    {
+//        if (m_stop_disassembly_display >= eStopDisassemblyTypeNever && m_stop_disassembly_display <= eStopDisassemblyTypeAlways)
+//            value.AppendString (g_show_disassembly_enum_values[m_stop_disassembly_display].string_value);
+//        else
+//            value.AppendString ("<invalid>");
+//    }
+//    else
+//    {
+//        if (err)
+//            err->SetErrorStringWithFormat ("unrecognized variable name '%s'", var_name.AsCString());
+//        return false;
+//    }
+//    return true;
+//}
+//
+//void
+//DebuggerInstanceSettings::CopyInstanceSettings (const InstanceSettingsSP &new_settings,
+//                                                bool pending)
+//{
+//    if (new_settings.get() == NULL)
+//        return;
+//
+//    DebuggerInstanceSettings *new_debugger_settings = (DebuggerInstanceSettings *) new_settings.get();
+//
+//    m_prompt = new_debugger_settings->m_prompt;
+//    if (!pending)
+//    {
+//        // '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_frame_format = new_debugger_settings->m_frame_format;
+//    m_thread_format = new_debugger_settings->m_thread_format;
+//    m_term_width = new_debugger_settings->m_term_width;
+//    m_script_lang = new_debugger_settings->m_script_lang;
+//    m_use_external_editor = new_debugger_settings->m_use_external_editor;
+//    m_auto_confirm_on = new_debugger_settings->m_auto_confirm_on;
+//}
+//
+//
+//bool
+//DebuggerInstanceSettings::BroadcastPromptChange (const ConstString &instance_name, const char *new_prompt)
+//{
+//    std::string tmp_prompt;
+//    
+//    if (new_prompt != NULL)
+//    {
+//        tmp_prompt = new_prompt ;
+//        int len = tmp_prompt.size();
+//        if (len > 1
+//            && (tmp_prompt[0] == '\'' || tmp_prompt[0] == '"')
+//            && (tmp_prompt[len-1] == tmp_prompt[0]))
+//        {
+//            tmp_prompt = tmp_prompt.substr(1,len-2);
+//        }
+//        len = tmp_prompt.size();
+//        if (tmp_prompt[len-1] != ' ')
+//            tmp_prompt.append(" ");
+//    }
+//    EventSP new_event_sp;
+//    new_event_sp.reset (new Event(CommandInterpreter::eBroadcastBitResetPrompt, 
+//                                  new EventDataBytes (tmp_prompt.c_str())));
+//
+//    if (instance_name.GetLength() != 0)
+//    {
+//        // Set prompt for a particular instance.
+//        Debugger *dbg = Debugger::FindDebuggerWithInstanceName (instance_name).get();
+//        if (dbg != NULL)
+//        {
+//            dbg->GetCommandInterpreter().BroadcastEvent (new_event_sp);
+//        }
+//    }
+//
+//    return true;
+//}
+//
+//const ConstString
+//DebuggerInstanceSettings::CreateInstanceName ()
+//{
+//    static int instance_count = 1;
+//    StreamString sstr;
+//
+//    sstr.Printf ("debugger_%d", instance_count);
+//    ++instance_count;
+//
+//    const ConstString ret_val (sstr.GetData());
+//
+//    return ret_val;
+//}
+//
+//
+
+//DebuggerInstanceSettings::DebuggerInstanceSettings
+//(
+//    const UserSettingsControllerSP &m_owner_sp, 
+//    bool live_instance,
+//    const char *name
+//) :
+//    InstanceSettings (m_owner_sp, name ? name : InstanceSettings::InvalidName().AsCString(), live_instance),
+//    m_term_width (80),
+//    m_stop_source_before_count (3),
+//    m_stop_source_after_count (3),
+//    m_stop_disassembly_count (4),
+//    m_stop_disassembly_display (eStopDisassemblyTypeNoSource),
+//    m_prompt (),
+//    m_notify_void (false),
+//    m_frame_format (),
+//    m_thread_format (),    
+//    m_script_lang (),
+//    m_use_external_editor (false),
+//    m_auto_confirm_on (false)
+//{
+//    // CopyInstanceSettings is a pure virtual function in InstanceSettings; it therefore cannot be called
+//    // until the vtables for DebuggerInstanceSettings are properly set up, i.e. AFTER all the initializers.
+//    // For this reason it has to be called here, rather than in the initializer or in the parent constructor.
+//    // The same is true of CreateInstanceName().
+//
+//    if (GetInstanceName() == InstanceSettings::InvalidName())
+//    {
+//        ChangeInstanceName (std::string (CreateInstanceName().AsCString()));
+//        m_owner_sp->RegisterInstanceSettings (this);
+//    }
+//
+//    if (live_instance)
+//    {
+//        const InstanceSettingsSP &pending_settings = m_owner_sp->FindPendingSettings (m_instance_name);
+//        CopyInstanceSettings (pending_settings, false);
+//    }
+//}
+//
+//DebuggerInstanceSettings::DebuggerInstanceSettings (const DebuggerInstanceSettings &rhs) :
+//    InstanceSettings (Debugger::GetSettingsController(), CreateInstanceName ().AsCString()),
+//    m_prompt (rhs.m_prompt),
+//    m_notify_void (rhs.m_notify_void),
+//    m_frame_format (rhs.m_frame_format),
+//    m_thread_format (rhs.m_thread_format),
+//    m_script_lang (rhs.m_script_lang),
+//    m_use_external_editor (rhs.m_use_external_editor),
+//    m_auto_confirm_on(rhs.m_auto_confirm_on)
+//{
+//    UserSettingsControllerSP owner_sp (m_owner_wp.lock());
+//    if (owner_sp)
+//    {
+//        CopyInstanceSettings (owner_sp->FindPendingSettings (m_instance_name), false);
+//        owner_sp->RemovePendingSettings (m_instance_name);
+//    }
+//}
+//
+//DebuggerInstanceSettings::~DebuggerInstanceSettings ()
+//{
+//}
+//
+//DebuggerInstanceSettings&
+//DebuggerInstanceSettings::operator= (const DebuggerInstanceSettings &rhs)
+//{
+//    if (this != &rhs)
+//    {
+//        m_term_width = rhs.m_term_width;
+//        m_prompt = rhs.m_prompt;
+//        m_notify_void = rhs.m_notify_void;
+//        m_frame_format = rhs.m_frame_format;
+//        m_thread_format = rhs.m_thread_format;
+//        m_script_lang = rhs.m_script_lang;
+//        m_use_external_editor = rhs.m_use_external_editor;
+//        m_auto_confirm_on = rhs.m_auto_confirm_on;
+//    }
+//
+//    return *this;
+//}
+//
+//bool
+//DebuggerInstanceSettings::ValidTermWidthValue (const char *value, Error err)
+//{
+//    bool valid = false;
+//
+//    // Verify we have a value string.
+//    if (value == NULL || value[0] == '\0')
+//    {
+//        err.SetErrorString ("missing value, can't set terminal width without a value");
+//    }
+//    else
+//    {
+//        char *end = NULL;
+//        const uint32_t width = ::strtoul (value, &end, 0);
+//        
+//        if (end && end[0] == '\0')
+//        {
+//            return ValidTermWidthValue (width, err);
+//        }
+//        else
+//            err.SetErrorStringWithFormat ("'%s' is not a valid unsigned integer string", value);
+//    }
+//
+//    return valid;
+//}
+//
+//bool
+//DebuggerInstanceSettings::ValidTermWidthValue (uint32_t value, Error err)
+//{
+//    if (value >= 10 && value <= 1024)
+//        return true;
+//    else
+//    {
+//        err.SetErrorString ("invalid term-width value; value must be between 10 and 1024");
+//        return false;
+//    }
+//}
+//
+//void
+//DebuggerInstanceSettings::UpdateInstanceSettingsVariable (const ConstString &var_name,
+//                                                          const char *index_value,
+//                                                          const char *value,
+//                                                          const ConstString &instance_name,
+//                                                          const SettingEntry &entry,
+//                                                          VarSetOperationType op,
+//                                                          Error &err,
+//                                                          bool pending)
+//{
+//
+//    if (var_name == TermWidthVarName())
+//    {
+//        if (ValidTermWidthValue (value, err))
+//        {
+//            m_term_width = ::strtoul (value, NULL, 0);
+//        }
+//    }
+//    else if (var_name == PromptVarName())
+//    {
+//        UserSettingsController::UpdateStringVariable (op, m_prompt, value, err);
+//        if (!pending)
+//        {
+//            // '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 == GetNotifyVoidName())
+//    {
+//        UserSettingsController::UpdateBooleanVariable (op, m_notify_void, value, false, err);
+//    }
+//    else if (var_name == GetFrameFormatName())
+//    {
+//        UserSettingsController::UpdateStringVariable (op, m_frame_format, value, err);
+//    }
+//    else if (var_name == GetThreadFormatName())
+//    {
+//        UserSettingsController::UpdateStringVariable (op, m_thread_format, value, err);
+//    }
+//    else if (var_name == ScriptLangVarName())
+//    {
+//        bool success;
+//        m_script_lang = Args::StringToScriptLanguage (value, eScriptLanguageDefault,
+//                                                      &success);
+//    }
+//    else if (var_name == UseExternalEditorVarName ())
+//    {
+//        UserSettingsController::UpdateBooleanVariable (op, m_use_external_editor, value, false, err);
+//    }
+//    else if (var_name == AutoConfirmName ())
+//    {
+//        UserSettingsController::UpdateBooleanVariable (op, m_auto_confirm_on, value, false, err);
+//    }
+//    else if (var_name == StopSourceContextBeforeName ())
+//    {
+//        uint32_t new_value = Args::StringToUInt32(value, UINT32_MAX, 10, NULL);
+//        if (new_value != UINT32_MAX)
+//            m_stop_source_before_count = new_value;
+//        else
+//            err.SetErrorStringWithFormat("invalid unsigned string value '%s' for the '%s' setting", value, StopSourceContextBeforeName ().GetCString());
+//    }
+//    else if (var_name == StopSourceContextAfterName ())
+//    {
+//        uint32_t new_value = Args::StringToUInt32(value, UINT32_MAX, 10, NULL);
+//        if (new_value != UINT32_MAX)
+//            m_stop_source_after_count = new_value;
+//        else
+//            err.SetErrorStringWithFormat("invalid unsigned string value '%s' for the '%s' setting", value, StopSourceContextAfterName ().GetCString());
+//    }
+//    else if (var_name == StopDisassemblyCountName ())
+//    {
+//        uint32_t new_value = Args::StringToUInt32(value, UINT32_MAX, 10, NULL);
+//        if (new_value != UINT32_MAX)
+//            m_stop_disassembly_count = new_value;
+//        else
+//            err.SetErrorStringWithFormat("invalid unsigned string value '%s' for the '%s' setting", value, StopDisassemblyCountName ().GetCString());
+//    }
+//    else if (var_name == StopDisassemblyDisplayName ())
+//    {
+//        int new_value;
+//        UserSettingsController::UpdateEnumVariable (g_show_disassembly_enum_values, &new_value, value, err);
+//        if (err.Success())
+//            m_stop_disassembly_display = (StopDisassemblyType)new_value;
+//    }
+//}
+//
+//bool
+//DebuggerInstanceSettings::GetInstanceSettingsValue (const SettingEntry &entry,
+//                                                    const ConstString &var_name,
+//                                                    StringList &value,
+//                                                    Error *err)
+//{
+//    if (var_name == PromptVarName())
+//    {
+//        value.AppendString (m_prompt.c_str(), m_prompt.size());
+//    }
+//    else if (var_name == GetNotifyVoidName())
+//    {
+//        value.AppendString (m_notify_void ? "true" : "false");
+//    }
+//    else if (var_name == ScriptLangVarName())
+//    {
+//        value.AppendString (ScriptInterpreter::LanguageToString (m_script_lang).c_str());
+//    }
+//    else if (var_name == TermWidthVarName())
+//    {
+//        StreamString width_str;
+//        width_str.Printf ("%u", m_term_width);
+//        value.AppendString (width_str.GetData());
+//    }
+//    else if (var_name == GetFrameFormatName ())
+//    {
+//        value.AppendString(m_frame_format.c_str(), m_frame_format.size());
+//    }
+//    else if (var_name == GetThreadFormatName ())
+//    {
+//        value.AppendString(m_thread_format.c_str(), m_thread_format.size());
+//    }
+//    else if (var_name == UseExternalEditorVarName())
+//    {
+//        if (m_use_external_editor)
+//            value.AppendString ("true");
+//        else
+//            value.AppendString ("false");
+//    }
+//    else if (var_name == AutoConfirmName())
+//    {
+//        if (m_auto_confirm_on)
+//            value.AppendString ("true");
+//        else
+//            value.AppendString ("false");
+//    }
+//    else if (var_name == StopSourceContextAfterName ())
+//    {
+//        StreamString strm;
+//        strm.Printf ("%u", m_stop_source_after_count);
+//        value.AppendString (strm.GetData());
+//    }
+//    else if (var_name == StopSourceContextBeforeName ())
+//    {
+//        StreamString strm;
+//        strm.Printf ("%u", m_stop_source_before_count);
+//        value.AppendString (strm.GetData());
+//    }
+//    else if (var_name == StopDisassemblyCountName ())
+//    {
+//        StreamString strm;
+//        strm.Printf ("%u", m_stop_disassembly_count);
+//        value.AppendString (strm.GetData());
+//    }
+//    else if (var_name == StopDisassemblyDisplayName ())
+//    {
+//        if (m_stop_disassembly_display >= eStopDisassemblyTypeNever && m_stop_disassembly_display <= eStopDisassemblyTypeAlways)
+//            value.AppendString (g_show_disassembly_enum_values[m_stop_disassembly_display].string_value);
+//        else
+//            value.AppendString ("<invalid>");
+//    }
+//    else
+//    {
+//        if (err)
+//            err->SetErrorStringWithFormat ("unrecognized variable name '%s'", var_name.AsCString());
+//        return false;
+//    }
+//    return true;
+//}
+//
+//void
+//DebuggerInstanceSettings::CopyInstanceSettings (const InstanceSettingsSP &new_settings,
+//                                                bool pending)
+//{
+//    if (new_settings.get() == NULL)
+//        return;
+//
+//    DebuggerInstanceSettings *new_debugger_settings = (DebuggerInstanceSettings *) new_settings.get();
+//
+//    m_prompt = new_debugger_settings->m_prompt;
+//    if (!pending)
+//    {
+//        // '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_notify_void = new_debugger_settings->m_notify_void;
+//    m_frame_format = new_debugger_settings->m_frame_format;
+//    m_thread_format = new_debugger_settings->m_thread_format;
+//    m_term_width = new_debugger_settings->m_term_width;
+//    m_script_lang = new_debugger_settings->m_script_lang;
+//    m_use_external_editor = new_debugger_settings->m_use_external_editor;
+//    m_auto_confirm_on = new_debugger_settings->m_auto_confirm_on;
+//}
+//
+//
+//bool
+//DebuggerInstanceSettings::BroadcastPromptChange (const ConstString &instance_name, const char *new_prompt)
+//{
+//    std::string tmp_prompt;
+//    
+//    if (new_prompt != NULL)
+//    {
+//        tmp_prompt = new_prompt ;
+//        int len = tmp_prompt.size();
+//        if (len > 1
+//            && (tmp_prompt[0] == '\'' || tmp_prompt[0] == '"')
+//            && (tmp_prompt[len-1] == tmp_prompt[0]))
+//        {
+//            tmp_prompt = tmp_prompt.substr(1,len-2);
+//        }
+//        len = tmp_prompt.size();
+//        if (tmp_prompt[len-1] != ' ')
+//            tmp_prompt.append(" ");
+//    }
+//    EventSP new_event_sp;
+//    new_event_sp.reset (new Event(CommandInterpreter::eBroadcastBitResetPrompt, 
+//                                  new EventDataBytes (tmp_prompt.c_str())));
+//
+//    if (instance_name.GetLength() != 0)
+//    {
+//        // Set prompt for a particular instance.
+//        Debugger *dbg = Debugger::FindDebuggerWithInstanceName (instance_name).get();
+//        if (dbg != NULL)
+//        {
+//            dbg->GetCommandInterpreter().BroadcastEvent (new_event_sp);
+//        }
+//    }
+//
+//    return true;
+//}
+//
+//const ConstString
+//DebuggerInstanceSettings::CreateInstanceName ()
+//{
+//    static int instance_count = 1;
+//    StreamString sstr;
+//
+//    sstr.Printf ("debugger_%d", instance_count);
+//    ++instance_count;
+//
+//    const ConstString ret_val (sstr.GetData());
+//
+//    return ret_val;
+//}
+//
 
 //--------------------------------------------------
 // SettingsController Variable Tables
 //--------------------------------------------------
 
-
-SettingEntry
-Debugger::SettingsController::global_settings_table[] =
-{
-  //{ "var-name",    var-type,      "default", enum-table, init'd, hidden, "help-text"},
-  // The Debugger level global table should always be empty; all Debugger settable variables should be instance
-  // variables.
-    {  NULL, eSetVarTypeNone, NULL, NULL, 0, 0, NULL }
-};
-
-#define MODULE_WITH_FUNC "{ ${module.file.basename}{`${function.name-with-args}${function.pc-offset}}}"
-#define FILE_AND_LINE "{ at ${line.file.basename}:${line.number}}"
-
-#define DEFAULT_THREAD_FORMAT "thread #${thread.index}: tid = ${thread.id}"\
-    "{, ${frame.pc}}"\
-    MODULE_WITH_FUNC\
-    FILE_AND_LINE\
-    "{, stop reason = ${thread.stop-reason}}"\
-    "{\\nReturn value: ${thread.return-value}}"\
-    "\\n"
-
-//#define DEFAULT_THREAD_FORMAT "thread #${thread.index}: tid = ${thread.id}"\
-//    "{, ${frame.pc}}"\
-//    MODULE_WITH_FUNC\
-//    FILE_AND_LINE\
-//    "{, stop reason = ${thread.stop-reason}}"\
-//    "{, name = ${thread.name}}"\
-//    "{, queue = ${thread.queue}}"\
-//    "\\n"
-
-#define DEFAULT_FRAME_FORMAT "frame #${frame.index}: ${frame.pc}"\
-    MODULE_WITH_FUNC\
-    FILE_AND_LINE\
-    "\\n"
-
-SettingEntry
-Debugger::SettingsController::instance_settings_table[] =
-{
-//  NAME                    Setting variable type   Default                 Enum  Init'd Hidden Help
-//  ======================= ======================= ======================  ====  ====== ====== ======================
-{   "frame-format",         eSetVarTypeString,      DEFAULT_FRAME_FORMAT,   NULL, false, false, "The default frame format string to use when displaying thread information." },
-{   "prompt",               eSetVarTypeString,      "(lldb) ",              NULL, false, false, "The debugger command line prompt displayed for the user." },
-{   "notify-void",          eSetVarTypeBoolean,     "false",                NULL, false, false, "Notify the user explicitly if an expression returns void." },
-{   "script-lang",          eSetVarTypeString,      "python",               NULL, false, false, "The script language to be used for evaluating user-written scripts." },
-{   "term-width",           eSetVarTypeInt,         "80"    ,               NULL, false, false, "The maximum number of columns to use for displaying text." },
-{   "thread-format",        eSetVarTypeString,      DEFAULT_THREAD_FORMAT,  NULL, false, false, "The default thread format string to use when displaying thread information." },
-{   "use-external-editor",  eSetVarTypeBoolean,     "false",                NULL, false, false, "Whether to use an external editor or not." },
-{   "auto-confirm",         eSetVarTypeBoolean,     "false",                NULL, false, false, "If true all confirmation prompts will receive their default reply." },
-{   "stop-line-count-before",eSetVarTypeInt,        "3",                    NULL, false, false, "The number of sources lines to display that come before the current source line when displaying a stopped context." },
-{   "stop-line-count-after", eSetVarTypeInt,        "3",                    NULL, false, false, "The number of sources lines to display that come after the current source line when displaying a stopped context." },
-{   "stop-disassembly-count",  eSetVarTypeInt,      "0",                    NULL, false, false, "The number of disassembly lines to show when displaying a stopped context." },
-{   "stop-disassembly-display", eSetVarTypeEnum,    "no-source",           g_show_disassembly_enum_values, false, false, "Control when to display disassembly when displaying a stopped context." },
-{   NULL,                   eSetVarTypeNone,        NULL,                   NULL, false, false, NULL }
-};
+//
+//SettingEntry
+//Debugger::SettingsController::global_settings_table[] =
+//{
+//  //{ "var-name",    var-type,      "default", enum-table, init'd, hidden, "help-text"},
+//  // The Debugger level global table should always be empty; all Debugger settable variables should be instance
+//  // variables.
+//    {  NULL, eSetVarTypeNone, NULL, NULL, 0, 0, NULL }
+//};
+
+//SettingEntry
+//Debugger::SettingsController::instance_settings_table[] =
+//{
+////  NAME                    Setting variable type   Default                 Enum  Init'd Hidden Help
+////  ======================= ======================= ======================  ====  ====== ====== ======================
+//{   "frame-format",         eSetVarTypeString,      DEFAULT_FRAME_FORMAT,   NULL, false, false, "The default frame format string to use when displaying thread information." },
+//{   "prompt",               eSetVarTypeString,      "(lldb) ",              NULL, false, false, "The debugger command line prompt displayed for the user." },
+//{   "script-lang",          eSetVarTypeString,      "python",               NULL, false, false, "The script language to be used for evaluating user-written scripts." },
+//{   "term-width",           eSetVarTypeInt,         "80"    ,               NULL, false, false, "The maximum number of columns to use for displaying text." },
+//{   "thread-format",        eSetVarTypeString,      DEFAULT_THREAD_FORMAT,  NULL, false, false, "The default thread format string to use when displaying thread information." },
+//{   "use-external-editor",  eSetVarTypeBoolean,     "false",                NULL, false, false, "Whether to use an external editor or not." },
+//{   "auto-confirm",         eSetVarTypeBoolean,     "false",                NULL, false, false, "If true all confirmation prompts will receive their default reply." },
+//{   "stop-line-count-before",eSetVarTypeInt,        "3",                    NULL, false, false, "The number of sources lines to display that come before the current source line when displaying a stopped context." },
+//{   "stop-line-count-after", eSetVarTypeInt,        "3",                    NULL, false, false, "The number of sources lines to display that come after the current source line when displaying a stopped context." },
+//{   "stop-disassembly-count",  eSetVarTypeInt,      "0",                    NULL, false, false, "The number of disassembly lines to show when displaying a stopped context." },
+//{   "stop-disassembly-display", eSetVarTypeEnum,    "no-source",           g_show_disassembly_enum_values, false, false, "Control when to display disassembly when displaying a stopped context." },
+//{   NULL,                   eSetVarTypeNone,        NULL,                   NULL, false, false, NULL }
+//};

Modified: lldb/trunk/source/Core/Disassembler.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Disassembler.cpp?rev=162366&r1=162365&r2=162366&view=diff
==============================================================================
--- lldb/trunk/source/Core/Disassembler.cpp (original)
+++ lldb/trunk/source/Core/Disassembler.cpp Wed Aug 22 12:17:09 2012
@@ -23,7 +23,11 @@
 #include "lldb/Core/PluginManager.h"
 #include "lldb/Core/RegularExpression.h"
 #include "lldb/Core/Timer.h"
-#include "lldb/Interpreter/NamedOptionValue.h"
+#include "lldb/Interpreter/OptionValue.h"
+#include "lldb/Interpreter/OptionValueArray.h"
+#include "lldb/Interpreter/OptionValueDictionary.h"
+#include "lldb/Interpreter/OptionValueString.h"
+#include "lldb/Interpreter/OptionValueUInt64.h"
 #include "lldb/Symbol/ClangNamespaceDecl.h"
 #include "lldb/Symbol/ObjectFile.h"
 #include "lldb/Target/ExecutionContext.h"

Modified: lldb/trunk/source/Core/FileSpecList.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/FileSpecList.cpp?rev=162366&r1=162365&r2=162366&view=diff
==============================================================================
--- lldb/trunk/source/Core/FileSpecList.cpp (original)
+++ lldb/trunk/source/Core/FileSpecList.cpp Wed Aug 22 12:17:09 2012
@@ -94,7 +94,7 @@
     for (pos = m_files.begin(); pos != end; ++pos)
     {
         pos->Dump(s);
-        if (separator_cstr)
+        if (separator_cstr && ((pos + 1) != end))
             s->PutCString(separator_cstr);
     }
 }

Modified: lldb/trunk/source/Core/RegularExpression.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/RegularExpression.cpp?rev=162366&r1=162365&r2=162366&view=diff
==============================================================================
--- lldb/trunk/source/Core/RegularExpression.cpp (original)
+++ lldb/trunk/source/Core/RegularExpression.cpp Wed Aug 22 12:17:09 2012
@@ -184,6 +184,8 @@
 const char*
 RegularExpression::GetText () const
 {
+    if (m_re.empty())
+        return NULL;
     return m_re.c_str();
 }
 

Modified: lldb/trunk/source/Core/StringList.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/StringList.cpp?rev=162366&r1=162365&r2=162366&view=diff
==============================================================================
--- lldb/trunk/source/Core/StringList.cpp (original)
+++ lldb/trunk/source/Core/StringList.cpp Wed Aug 22 12:17:09 2012
@@ -50,6 +50,12 @@
 }
 
 void
+StringList::AppendString (const std::string &s)
+{
+    m_strings.push_back (s);
+}
+
+void
 StringList::AppendString (const char *str, size_t str_len)
 {
     if (str)
@@ -253,3 +259,27 @@
     AppendList(strings);
     return *this;
 }
+
+size_t
+StringList::AutoComplete (const char *s, StringList &matches, size_t &exact_idx) const
+{
+    matches.Clear();
+    exact_idx = SIZE_MAX;
+    if (s && s[0])
+    {
+        const size_t s_len = strlen (s);
+        const size_t num_strings = m_strings.size();
+        
+        for (size_t i=0; i<num_strings; ++i)
+        {
+            if (m_strings[i].find(s) == 0)
+            {
+                if (exact_idx == SIZE_MAX && m_strings[i].size() == s_len)
+                    exact_idx = matches.GetSize();
+                matches.AppendString (m_strings[i]);
+            }
+        }
+    }
+    return matches.GetSize();
+}
+

Modified: lldb/trunk/source/Core/UserSettingsController.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/UserSettingsController.cpp?rev=162366&r1=162365&r2=162366&view=diff
==============================================================================
--- lldb/trunk/source/Core/UserSettingsController.cpp (original)
+++ lldb/trunk/source/Core/UserSettingsController.cpp Wed Aug 22 12:17:09 2012
@@ -16,2467 +16,126 @@
 #include "lldb/Core/Stream.h"
 #include "lldb/Core/StreamString.h"
 #include "lldb/Interpreter/CommandInterpreter.h"
+#include "lldb/Interpreter/OptionValueString.h"
 
 using namespace lldb;
 using namespace lldb_private;
 
-static void
-DumpSettingEntry (CommandInterpreter &interpreter, 
-                  Stream &strm,
-                  const uint32_t max_len, 
-                  const SettingEntry &entry)
-{
-    StreamString description;
-
-    if (entry.description)
-        description.Printf ("%s", entry.description);
-    
-    if (entry.default_value && entry.default_value[0])
-        description.Printf (" (default: %s)", entry.default_value);
-    
-    interpreter.OutputFormattedHelpText (strm, 
-                                         entry.var_name, 
-                                         "--", 
-                                         description.GetData(), 
-                                         max_len);
-    
-    if (entry.enum_values && entry.enum_values[0].string_value)
-    {
-        interpreter.OutputFormattedHelpText (strm, 
-                                             "", 
-                                             "  ", 
-                                             "Enumeration values:", 
-                                             max_len);
-        for (uint32_t enum_idx=0; entry.enum_values[enum_idx].string_value != NULL; ++enum_idx)
-        {
-            description.Clear();
-            if (entry.enum_values[enum_idx].usage)
-                description.Printf ("%s = %s", 
-                                    entry.enum_values[enum_idx].string_value,
-                                    entry.enum_values[enum_idx].usage);
-            else
-                description.Printf ("%s", entry.enum_values[enum_idx].string_value);
-            interpreter.OutputFormattedHelpText (strm, 
-                                                 "", 
-                                                 "  ", 
-                                                 description.GetData(), 
-                                                 max_len);
-        }
-    }
-}
-
-UserSettingsController::UserSettingsController (const char *level_name, 
-                                                const UserSettingsControllerSP &parent) :
-    m_default_settings (),
-    m_settings (),
-    m_children (),
-    m_pending_settings (),
-    m_live_settings (),
-    m_children_mutex (Mutex::eMutexTypeNormal),
-    m_pending_settings_mutex (Mutex::eMutexTypeRecursive),
-    m_live_settings_mutex (Mutex::eMutexTypeRecursive)
-{
-    m_settings.parent = parent;
-    m_settings.level_name.SetCString (level_name);
-}
-
-UserSettingsController::~UserSettingsController ()
-{
-    Mutex::Locker locker (m_live_settings_mutex);
-    m_live_settings.clear();
-}
-
-bool
-UserSettingsController::SetGlobalVariable
-(
-    const ConstString &var_name,
-    const char *index_value,
-    const char *value,
-    const SettingEntry &entry,
-    const VarSetOperationType op,
-    Error &err
-)
-{
-    err.SetErrorString ("UserSettingsController has no global settings");
-    return false;
-}
-
-bool
-UserSettingsController::GetGlobalVariable 
-(
-    const ConstString &var_name, 
-    StringList &value,
-    Error &err
-)
-{
-    return false;
-}
-
-bool
-UserSettingsController::InitializeSettingsController (UserSettingsControllerSP &controller_sp,
-                                                      SettingEntry *global_settings,
-                                                      SettingEntry *instance_settings)
-{
-    const UserSettingsControllerSP &parent = controller_sp->GetParent ();
-    if (parent)
-        parent->RegisterChild (controller_sp);
-
-    controller_sp->CreateSettingsVector (global_settings, true);
-    controller_sp->CreateSettingsVector (instance_settings, false);
-
-    controller_sp->InitializeGlobalVariables ();
-    controller_sp->CreateDefaultInstanceSettings ();
-
-    return true;
-}
-
-void
-UserSettingsController::FinalizeSettingsController (UserSettingsControllerSP &controller_sp)
-{
-    const UserSettingsControllerSP &parent = controller_sp->GetParent ();
-    if (parent)
-        parent->RemoveChild (controller_sp);
-}
-
-void
-UserSettingsController::InitializeGlobalVariables ()
-{
-    int num_entries;
-    const char *prefix = GetLevelName().GetCString();
-
-    num_entries = m_settings.global_settings.size();
-    for (int i = 0; i < num_entries; ++i)
-    {
-        const SettingEntry &entry = m_settings.global_settings[i];
-        if (entry.default_value != NULL)
-        {
-            StreamString full_name;
-            if (prefix[0] != '\0')
-                full_name.Printf ("%s.%s", prefix, entry.var_name);
-            else
-                full_name.Printf ("%s", entry.var_name);
-            SetVariable (full_name.GetData(), entry.default_value, eVarSetOperationAssign, false, "");
-        }
-    }
-}
-
-const UserSettingsControllerSP &
-UserSettingsController::GetParent ()
-{
-    return m_settings.parent;
-}
-
-void
-UserSettingsController::RegisterChild (const UserSettingsControllerSP &child)
-{
-    Mutex::Locker locker (m_children_mutex);
-
-    // Verify child is not already in m_children.
-    size_t num_children = m_children.size();
-    for (size_t i = 0; i < num_children; ++i)
-    {
-        if (m_children[i].get() == child.get())
-            return;
-    }
-    // Add child to m_children.
-    m_children.push_back (child);
-}
-
-const ConstString &
-UserSettingsController::GetLevelName ()
-{
-    return m_settings.level_name;
-}
-
-size_t
-UserSettingsController::GetNumChildren ()
-{
-    return m_children.size();
-}
-
-const UserSettingsControllerSP
-UserSettingsController::GetChildAtIndex (size_t index)
-{
-    if (index < m_children.size())
-        return m_children[index];
-
-    UserSettingsControllerSP dummy_value;
-
-    return dummy_value;
-}
-
-const SettingEntry *
-UserSettingsController::GetGlobalEntry (const ConstString &var_name)
-{
-
-    for (int i = 0; i < m_settings.global_settings.size(); ++i)
-    {
-        const SettingEntry &entry = m_settings.global_settings[i];
-        ConstString entry_name (entry.var_name);
-        if (entry_name == var_name)
-            return &entry;
-    }
-
-    return NULL;
-}
-
-const SettingEntry *
-UserSettingsController::GetInstanceEntry (const ConstString &const_var_name)
-{
-
-    for (int i = 0; i < m_settings.instance_settings.size(); ++i)
-    {
-        SettingEntry &entry = m_settings.instance_settings[i];
-        ConstString entry_name (entry.var_name);
-        if (entry_name == const_var_name)
-            return &entry;
-    }
-
-    return NULL;
-}
-
-void
-UserSettingsController::BuildParentPrefix (std::string &parent_prefix)
-{
-    UserSettingsControllerSP parent = GetParent();
-    if (parent.get() != NULL)
-    {
-        parent->BuildParentPrefix (parent_prefix);
-        if (parent_prefix.length() > 0)
-            parent_prefix.append (".");
-    }
-    parent_prefix.append (GetLevelName().GetCString());
-}
-
-void
-UserSettingsController::RemoveChild (const UserSettingsControllerSP &child)
-{
-    Mutex::Locker locker (m_children_mutex);
-    std::vector<UserSettingsControllerSP>::iterator pos, end = m_children.end();
-
-   for (pos = m_children.begin(); pos != end; ++pos)
-   {
-      UserSettingsControllerSP entry = *pos;
-      if (entry == child)
-      {
-          m_children.erase (pos);
-          break;
-      }
-   }
-}
-
-Error
-UserSettingsController::SetVariable (const char *full_dot_name, 
-                                     const char *value, 
-                                     const VarSetOperationType op,
-                                     const bool override,
-                                     const char *debugger_instance_name,
-                                     const char *index_value)
-{
-    Error err;
-    ConstString const_var_name;
-    const ConstString &default_name = InstanceSettings::GetDefaultName();
-
-    Args names;
-    if (full_dot_name )
-        names = UserSettingsController::BreakNameIntoPieces (full_dot_name);
-    int num_pieces = names.GetArgumentCount();
-
-    if (num_pieces < 1)
-    {
-        err.SetErrorStringWithFormat ("'%s' is not a valid variable name; cannot assign value", full_dot_name);
-        return err;
-    }
-
-    ConstString prefix (names.GetArgumentAtIndex (0));
-
-    if ((prefix == m_settings.level_name)
-        || (m_settings.level_name.GetLength() == 0))
-    {
-
-        if (prefix == m_settings.level_name)
-        {
-            names.Shift ();
-            num_pieces = names.GetArgumentCount();
-        }
-
-        if (num_pieces == 0)
-        {
-            err.SetErrorString ("no variable name specified, cannot assign value");
-            return err;
-        }
-        else if (num_pieces == 1)
-        {
-
-            // Must be one of the class-wide settings.
-
-            const_var_name.SetCString (names.GetArgumentAtIndex (0));
-            const SettingEntry *entry = GetGlobalEntry (const_var_name);
-            if (entry)
-            {
-                UserSettingsController::VerifyOperationForType (entry->var_type, op, const_var_name, err);
-
-                if (err.Fail())
-                    return err;
-
-                if ((value == NULL || value[0] == '\0')
-                    && (op == eVarSetOperationAssign))
-                {
-                    if (entry->var_type != eSetVarTypeEnum)
-                        value = entry->default_value;
-                    else
-                        value = entry->enum_values[0].string_value;
-                }
-                SetGlobalVariable (const_var_name, index_value, value, *entry, op, err);
-            }
-            else
-            {
-                // MIGHT be instance variable, to be for ALL instances.
-
-                entry = GetInstanceEntry (const_var_name);
-                if (entry == NULL)
-                {
-                    err.SetErrorStringWithFormat ("unable to find variable '%s.%s', cannot assign value",
-                                                  prefix.GetCString(), const_var_name.GetCString());
-                    return err;
-                }
-                else
-                {
-                    UserSettingsController::VerifyOperationForType (entry->var_type, op, const_var_name, err);
-
-                    if (err.Fail())
-                        return err;
-
-                    if ((value == NULL || value[0] == '\0')
-                        && (op == eVarSetOperationAssign))
-                    {
-                        if (entry->var_type != eSetVarTypeEnum)
-                            value = entry->default_value;
-                        else
-                            value = entry->enum_values[0].string_value;
-                    }
-
-                    if ((m_settings.level_name.GetLength() > 0)
-                        || strlen (debugger_instance_name) == 0)
-                      {
-                        // Set the default settings
-                        m_default_settings->UpdateInstanceSettingsVariable (const_var_name, index_value, value, 
-                                                                            default_name, *entry, op, err, true);
-                      }
-                    else
-                      {
-                        // We're at the Debugger level; find the correct debugger instance and set those settings
-                        StreamString tmp_name;
-                        if (debugger_instance_name[0] != '[')
-                            tmp_name.Printf ("[%s]", debugger_instance_name);
-                        else
-                            tmp_name.Printf ("%s", debugger_instance_name);
-                        ConstString dbg_name (tmp_name.GetData());
-                        InstanceSettings *dbg_settings = FindSettingsForInstance (dbg_name);
-                        if (dbg_settings)
-                            dbg_settings->UpdateInstanceSettingsVariable (const_var_name, index_value, value, dbg_name,
-                                                                          *entry, op, err, false);
-                      }
-
-                    if (override)
-                    {
-                        OverrideAllInstances (const_var_name, value, op, index_value, err);
-
-                        // Update all pending records as well.
-//                        std::map<std::string, InstanceSettingsSP>::iterator pos, end = m_pending_settings.end();
-//                        for (pos = m_pending_settings.begin(); pos != end; end++)
-//                        {
-//                            const ConstString instance_name (pos->first.c_str());
-//                            InstanceSettingsSP setting_sp = pos->second;
-//                            setting_sp->UpdateInstanceSettingsVariable (const_var_name, index_value, value, 
-//                                                                        instance_name, *entry, op, err, true);
-//                        }
-                    }
-                }
-            }
-        }
-        else
-        {
-            // Either a child's setting or an instance setting.
-
-            if (names.GetArgumentAtIndex(0)[0] == '[')
-            {
-                // An instance setting.  Supposedly.
-
-                ConstString instance_name (names.GetArgumentAtIndex (0));
-                
-                // First verify that there is only one more name.
-                
-                names.Shift();
-                
-                if (names.GetArgumentCount() != 1)
-                {
-                    err.SetErrorStringWithFormat ("invalid variable name format '%s', cannot assign value",
-                                                  full_dot_name);
-                    return err;
-                }
-                
-                // Next verify that it is a valid instance setting name.
-                
-                const_var_name.SetCString (names.GetArgumentAtIndex (0));
-                const SettingEntry *entry = GetInstanceEntry (const_var_name);
-
-                if (entry == NULL)
-                {
-                    err.SetErrorStringWithFormat ("unknown instance variable '%s', cannot assign value",
-                                                  const_var_name.GetCString());
-                    return err;
-                }
-
-                UserSettingsController::VerifyOperationForType (entry->var_type, op, const_var_name, err);
-
-                if (err.Fail())
-                    return err;
-
-                if ((value == NULL || value[0] == '\0')
-                    && (op == eVarSetOperationAssign))
-                {
-                    if (entry->var_type != eSetVarTypeEnum)
-                        value = entry->default_value;
-                    else
-                        value = entry->enum_values[0].string_value;
-                }
-
-                // Now look for existing instance with given instance name; if not found, find or create pending
-                // setting for instance with given name.
-
-                InstanceSettings *current_settings = FindSettingsForInstance (instance_name);
-
-                if (current_settings != NULL)
-                {
-                    current_settings->UpdateInstanceSettingsVariable (const_var_name, index_value, value, 
-                                                                      instance_name, *entry, op, err, false);
-
-                }
-                else
-                {
-                    // Instance does not currently exist; make or update a pending setting for it.
-                    InstanceSettingsSP current_settings_sp = PendingSettingsForInstance (instance_name);
-
-                    // Now we have a settings record, update it appropriately.
-
-                    current_settings_sp->UpdateInstanceSettingsVariable (const_var_name, index_value, value, 
-                                                                         instance_name, *entry, op, err, true);
-                    
-                    {   // Scope for mutex.
-                        Mutex::Locker locker (m_pending_settings_mutex);
-                        m_pending_settings[instance_name.GetCString()] = current_settings_sp;
-                    }
- 
-                    if (override)
-                    {
-                        OverrideAllInstances (const_var_name, value, op, index_value, err);
-                        
-                        // Update all pending records as well.
-                        std::map<std::string, InstanceSettingsSP>::iterator pos;
-                        std::map<std::string, InstanceSettingsSP>::iterator end = m_pending_settings.end();
-                        for (pos = m_pending_settings.begin(); pos != end; end++)
-                        {
-                            const ConstString tmp_inst_name (pos->first.c_str());
-                            InstanceSettingsSP setting_sp = pos->second;
-                            setting_sp->UpdateInstanceSettingsVariable (const_var_name, index_value, value, 
-                                                                        tmp_inst_name, *entry, op, err, true);
-                        }
-                    }
-                }
-            }
-            else
-            {
-                // A child setting.
-                UserSettingsControllerSP child;
-                ConstString child_prefix (names.GetArgumentAtIndex (0));
-                int num_children = GetNumChildren();
-                for (int i = 0; i < num_children; ++i)
-                {
-                    child = GetChildAtIndex (i);
-                    ConstString current_prefix = child->GetLevelName();
-                    if (current_prefix == child_prefix)
-                    {
-                        std::string new_name;
-                        for (int j = 0; j < names.GetArgumentCount(); ++j)
-                        {
-                            if (j > 0)
-                                new_name += '.';
-                            new_name += names.GetArgumentAtIndex (j);
-                        }
-                        return child->SetVariable (new_name.c_str(), value, op, override, debugger_instance_name,
-                                                   index_value);
-                    }
-                }
-                err.SetErrorStringWithFormat ("unable to find variable '%s', cannot assign value",
-                                              full_dot_name);
-                return err;
-            }
-        }
-    }
-    else
-    {
-        err.SetErrorStringWithFormat ("'%s' is not a valid level name; was expecting '%s', cannot assign value",
-                                      prefix.GetCString(), m_settings.level_name.GetCString());
-    }
-
-    return err;
-}
-
-StringList
-UserSettingsController::GetVariable 
-(
-    const char *full_dot_name, 
-    SettableVariableType &var_type, 
-    const char *debugger_instance_name,
-    Error &err
-)
-{
-    StringList value;
-    if (!full_dot_name)
-    {
-        err.SetErrorString ("invalid variable name");
-        return value;
-    }
-
-    Args names = UserSettingsController::BreakNameIntoPieces (full_dot_name);
-    int num_pieces = names.GetArgumentCount();
-
-    ConstString const_var_name;
-
-    ConstString prefix (names.GetArgumentAtIndex (0));
-    const_var_name.SetCString (names.GetArgumentAtIndex (num_pieces - 1));
-
-    const SettingEntry *global_entry = GetGlobalEntry (const_var_name);
-    const SettingEntry *instance_entry = GetInstanceEntry (const_var_name);
-
-    if ((prefix != m_settings.level_name)
-        && (m_settings.level_name.GetLength () > 0))
-    {
-        err.SetErrorString ("invalid variable name");
-        return value;
-    }
-
-    // prefix name matched; remove it from names.
-    if (m_settings.level_name.GetLength() > 0)
-        names.Shift();
-
-    // Should we pass this off to a child?  If there is more than one name piece left, and the next name piece
-    // matches a child prefix, then yes.
-
-    UserSettingsControllerSP child;
-    if (names.GetArgumentCount() > 1)
-    {
-        ConstString child_prefix (names.GetArgumentAtIndex (0));
-        for (int i = 0; i < m_children.size(); ++i)
-        {
-            if (child_prefix == m_children[i]->GetLevelName())
-            {
-                child = m_children[i];
-                std::string new_name;
-                for (int j = 0; j < names.GetArgumentCount(); ++j)
-                {
-                    if (j > 0)
-                        new_name += '.';
-                    new_name += names.GetArgumentAtIndex (j);
-                }
-                return child->GetVariable (new_name.c_str(), var_type, debugger_instance_name, err);
-            }
-        }
-
-        // Cannot be handled by a child, because name did not match any child prefixes.
-        // Cannot be a class-wide variable because there are too many name pieces.
-
-        if (instance_entry != NULL)
-        {
-            var_type = instance_entry->var_type;
-            ConstString instance_name (names.GetArgumentAtIndex (0));
-            InstanceSettings *current_settings = FindSettingsForInstance (instance_name);
-
-            if (current_settings != NULL)
-            {
-                current_settings->GetInstanceSettingsValue (*instance_entry, const_var_name, value, &err);
-            }
-            else
-            {
-                // Look for instance name setting in pending settings.
-
-                std::string inst_name_str = instance_name.GetCString();
-                std::map<std::string, InstanceSettingsSP>::iterator pos;
-
-                pos = m_pending_settings.find (inst_name_str);
-                if (pos != m_pending_settings.end())
-                {
-                    InstanceSettingsSP settings_sp = pos->second;
-                    settings_sp->GetInstanceSettingsValue (*instance_entry, const_var_name,  value, &err);
-                }
-                else 
-                {
-                    if (m_settings.level_name.GetLength() > 0)
-                    {
-                        // No valid instance name; assume they want the default settings.
-                        m_default_settings->GetInstanceSettingsValue (*instance_entry, const_var_name, value, &err);
-                    }
-                    else
-                    {
-                        // We're at the Debugger level;  use the debugger's instance settings.
-                        StreamString tmp_name;
-                        if (debugger_instance_name[0] != '[')
-                            tmp_name.Printf ("[%s]", debugger_instance_name);
-                        else
-                            tmp_name.Printf ("%s", debugger_instance_name);
-                        ConstString dbg_name (debugger_instance_name);
-                        InstanceSettings *dbg_settings = FindSettingsForInstance (dbg_name);
-                        if (dbg_settings)
-                            dbg_settings->GetInstanceSettingsValue (*instance_entry, const_var_name, value, &err);
-                    }
-                }
-            }
-        }
-        else
-            err.SetErrorString ("invalid variable name");
-    }
-    else
-    {
-        // Only one name left.  It must belong to the current level, or be an error.
-        if ((global_entry == NULL)
-            && (instance_entry == NULL))
-        {
-            err.SetErrorString ("invalid variable name");
-        }
-        else if (global_entry)
-        {
-            var_type = global_entry->var_type;
-            GetGlobalVariable (const_var_name, value, err);
-        }
-        else if (instance_entry)
-        {
-            var_type = instance_entry->var_type;
-            if (m_settings.level_name.GetLength() > 0)
-                m_default_settings->GetInstanceSettingsValue  (*instance_entry, const_var_name, value, &err);
-            else
-            {
-                // We're at the Debugger level;  use the debugger's instance settings.
-                StreamString tmp_name;
-                if (debugger_instance_name[0] != '[')
-                    tmp_name.Printf ("[%s]", debugger_instance_name);
-                else
-                    tmp_name.Printf ("%s", debugger_instance_name);
-                ConstString dbg_name (tmp_name.GetData());
-                InstanceSettings *dbg_settings = FindSettingsForInstance (dbg_name);
-                if (dbg_settings)
-                    dbg_settings->GetInstanceSettingsValue (*instance_entry, const_var_name, value, &err);
-            }
-        }
-    }
-
-    return value;
-}
-
-void
-UserSettingsController::RemovePendingSettings (const ConstString &instance_name)
-{
-    StreamString tmp_name;
-
-    // Add surrounding brackets to instance name if not already present.
-
-    if (instance_name.GetCString()[0] != '[')
-        tmp_name.Printf ("[%s]", instance_name.GetCString());
-    else
-        tmp_name.Printf ("%s", instance_name.GetCString());
-
-    std::string instance_name_str (tmp_name.GetData());
-    std::map<std::string, InstanceSettingsSP>::iterator pos;
-    Mutex::Locker locker (m_pending_settings_mutex);
-
-    m_pending_settings.erase (instance_name_str);
-}
-
-const InstanceSettingsSP &
-UserSettingsController::FindPendingSettings (const ConstString &instance_name)
-{
-    std::map<std::string, InstanceSettingsSP>::iterator pos;
-    StreamString tmp_name;
-
-    // Add surrounding brackets to instance name if not already present.
-
-    if (instance_name.GetCString()[0] != '[')
-        tmp_name.Printf ("[%s]", instance_name.GetCString());
-    else
-        tmp_name.Printf ("%s", instance_name.GetCString());
-
-    std::string instance_name_str (tmp_name.GetData());  // Need std::string for std::map look-up
-
-    {   // Scope for mutex.
-        Mutex::Locker locker (m_pending_settings_mutex);
-
-        pos = m_pending_settings.find (instance_name_str);
-        if (pos != m_pending_settings.end())
-            return pos->second;
-    }
-
-    return m_default_settings;
-}
-
-void
-UserSettingsController::CreateDefaultInstanceSettings ()
-{
-    Error err;
-    const ConstString &default_instance_name = InstanceSettings::GetDefaultName();
-    for (int i = 0; i < m_settings.instance_settings.size(); ++i)
-    {
-        SettingEntry &entry = m_settings.instance_settings[i];
-        ConstString var_name (entry.var_name);
-        const char *default_value = entry.default_value;
-
-        // If there is no default value, then use the first enumeration value
-        // as the default value
-        if (default_value == NULL && entry.var_type == eSetVarTypeEnum)
-            default_value = entry.enum_values[0].string_value;
-  
-        if (default_value != NULL)
-            m_default_settings->UpdateInstanceSettingsVariable (var_name, 
-                                                                NULL, 
-                                                                default_value, 
-                                                                default_instance_name, 
-                                                                entry, 
-                                                                eVarSetOperationAssign, 
-                                                                err, 
-                                                                true);
-    } 
-}
-
-void
-UserSettingsController::CopyDefaultSettings (const InstanceSettingsSP &actual_settings,
-                                             const ConstString &instance_name,
-                                             bool pending)
-{
-    Error err;
-    for (int i = 0; i < m_settings.instance_settings.size(); ++i)
-    {
-        SettingEntry &entry = m_settings.instance_settings[i];
-        ConstString var_name (entry.var_name);
-        StringList value;
-        m_default_settings->GetInstanceSettingsValue (entry, var_name, value, NULL);
-
-        std::string value_str;
-        if (value.GetSize() == 1)
-            value_str.append (value.GetStringAtIndex (0));
-        else if (value.GetSize() > 1)
-        {
-            for (int j = 0; j < value.GetSize(); ++j)
-            {
-                if (j > 0)
-                    value_str.append (" ");
-              value_str.append (value.GetStringAtIndex (j));
-            }
-        }
-
-        actual_settings->UpdateInstanceSettingsVariable (var_name, NULL, value_str.c_str(), instance_name, entry, 
-                                                         eVarSetOperationAssign, err, pending);
-
-    }
-}
-
-InstanceSettingsSP
-UserSettingsController::PendingSettingsForInstance (const ConstString &instance_name)
-{
-    std::string name_str (instance_name.GetCString());
-    std::map<std::string, InstanceSettingsSP>::iterator pos;
-    Mutex::Locker locker (m_pending_settings_mutex);
-
-    pos = m_pending_settings.find (name_str);
-    if (pos != m_pending_settings.end())
-    {
-        InstanceSettingsSP settings_sp = pos->second;
-        return settings_sp;
-    }
-    else
-    {
-        InstanceSettingsSP new_settings_sp = CreateInstanceSettings (instance_name.GetCString());
-        CopyDefaultSettings (new_settings_sp, instance_name, true);
-        m_pending_settings[name_str] = new_settings_sp;
-        return new_settings_sp;
-    }
-    
-    // Should never reach this line.
-
-    InstanceSettingsSP dummy;
-
-    return dummy;
-}
-
-void
-UserSettingsController::GetAllDefaultSettingValues (Stream &strm)
-{
-    std::string parent_prefix;
-    BuildParentPrefix (parent_prefix);
-
-    for (int i = 0; i < m_settings.instance_settings.size(); ++i)
-    {
-        SettingEntry &entry = m_settings.instance_settings[i];
-        ConstString var_name (entry.var_name);
-        StringList value;
-        m_default_settings->GetInstanceSettingsValue (entry, var_name, value, NULL);
-        
-        if (!parent_prefix.empty())
-            strm.Printf ("%s.", parent_prefix.c_str());
-    
-        DumpValue (var_name.GetCString(),
-                   entry.var_type,
-                   value,
-                   strm);
-    }
-}
-
-void
-UserSettingsController::GetAllPendingSettingValues (Stream &strm)
-{
-    std::map<std::string, InstanceSettingsSP>::iterator pos;
-
-    std::string parent_prefix;
-    BuildParentPrefix (parent_prefix);
-    const char *prefix = parent_prefix.c_str();
-    
-    for (pos = m_pending_settings.begin(); pos != m_pending_settings.end(); ++pos)
-    {
-        std::string tmp_name = pos->first;
-        InstanceSettingsSP settings_sp = pos->second;
-
-        const ConstString instance_name (tmp_name.c_str());
-
-        for (int i = 0; i < m_settings.instance_settings.size(); ++i)
-        {
-            SettingEntry &entry = m_settings.instance_settings[i];
-            ConstString var_name (entry.var_name);
-            StringList tmp_value;
-            settings_sp->GetInstanceSettingsValue (entry, var_name, tmp_value, NULL);
-
-            StreamString value_str;
-
-            if (tmp_value.GetSize() == 1)
-                value_str.Printf ("%s", tmp_value.GetStringAtIndex (0));
-            else
-            {
-                for (int j = 0; j < tmp_value.GetSize(); ++j)
-                    value_str.Printf  ("%s ", tmp_value.GetStringAtIndex (j));
-            }
-            
-            if (parent_prefix.length() > 0)
-            {
-                strm.Printf ("%s.%s.%s (%s) = '%s' [pending]\n", prefix, instance_name.GetCString(), 
-                                      var_name.GetCString(), UserSettingsController::GetTypeString (entry.var_type),
-                                      value_str.GetData());
-            }
-            else
-            {
-                strm.Printf ("%s (%s) = '%s' [pending]\n", var_name.GetCString(),
-                                      UserSettingsController::GetTypeString (entry.var_type), 
-                                      value_str.GetData());                                      
-            }
-        }
-    }
-}
-
-InstanceSettings *
-UserSettingsController::FindSettingsForInstance (const ConstString &instance_name)
-{
-    std::string instance_name_str (instance_name.GetCString());
-    Mutex::Locker locker (m_live_settings_mutex);
-    InstanceSettingsMap::iterator pos = m_live_settings.find (instance_name_str);
-    if (pos != m_live_settings.end ())
-        return pos->second;
-    return NULL;
-}
-
-void
-UserSettingsController::GetAllInstanceVariableValues (CommandInterpreter &interpreter,
-                                                      Stream &strm)
-{
-    std::string parent_prefix;
-    BuildParentPrefix (parent_prefix);
-    StreamString description;
-
-    Mutex::Locker locker (m_live_settings_mutex);
-    for (InstanceSettingsMap::iterator pos = m_live_settings.begin(); pos != m_live_settings.end(); ++pos)
-    {
-        std::string instance_name = pos->first;
-        InstanceSettings *settings = pos->second;
-
-        for (int i = 0; i < m_settings.instance_settings.size(); ++i)
-        {
-            SettingEntry &entry = m_settings.instance_settings[i];
-            const ConstString var_name (entry.var_name);
-            StringList tmp_value;
-            settings->GetInstanceSettingsValue (entry, var_name, tmp_value, NULL);
-            
-            if (!parent_prefix.empty())
-                strm.Printf ("%s.", parent_prefix.c_str());
-            
-            DumpValue(var_name.GetCString(), entry.var_type, tmp_value, strm);
-        }
-    }
-}
-
-void
-UserSettingsController::OverrideAllInstances (const ConstString &var_name,
-                                              const char *value,
-                                              VarSetOperationType op,
-                                              const char *index_value,
-                                              Error &err)
-{
-    StreamString description;
-
-    Mutex::Locker locker (m_live_settings_mutex);
-    for (InstanceSettingsMap::iterator pos = m_live_settings.begin(); pos != m_live_settings.end(); ++pos)
-    {
-        InstanceSettings *settings = pos->second;
-        StreamString tmp_name;
-        tmp_name.Printf ("[%s]", settings->GetInstanceName().GetCString());
-        const ConstString instance_name (tmp_name.GetData());
-        const SettingEntry *entry = GetInstanceEntry (var_name);
-        settings->UpdateInstanceSettingsVariable (var_name, index_value, value, instance_name, *entry, op, err, false);
-
-    }
-}
-
-void
-UserSettingsController::RegisterInstanceSettings (InstanceSettings *instance_settings)
-{
-    Mutex::Locker locker (m_live_settings_mutex);
-    StreamString tmp_name;
-    tmp_name.Printf ("[%s]", instance_settings->GetInstanceName().GetCString());
-    const ConstString instance_name (tmp_name.GetData());
-    std::string instance_name_str (instance_name.GetCString());
-    if (instance_name_str.compare (InstanceSettings::GetDefaultName().GetCString()) != 0)
-        m_live_settings[instance_name_str] = instance_settings;
-}
-
-void
-UserSettingsController::UnregisterInstanceSettings (InstanceSettings *instance)
-{
-    Mutex::Locker locker (m_live_settings_mutex);
-    StreamString tmp_name;
-    tmp_name.Printf ("[%s]", instance->GetInstanceName().GetCString());
-    std::string instance_name (tmp_name.GetData());
-
-    InstanceSettingsMap::iterator pos = m_live_settings.find (instance_name);
-    if (pos != m_live_settings.end())
-        m_live_settings.erase (pos);
-}
-
-void
-UserSettingsController::CreateSettingsVector (const SettingEntry *table,
-                                              bool global)
-{
-    int i = 0;
-    while (table[i].var_name != NULL)
-    {
-        const SettingEntry &table_entry = table[i];
-        ConstString const_var_name (table_entry.var_name);
-        SettingEntry new_entry;
-        
-        new_entry = table_entry;
-        new_entry.var_name = const_var_name.GetCString();
-        
-        if (global)
-            m_settings.global_settings.push_back (new_entry);
-        else
-            m_settings.instance_settings.push_back (new_entry);
-
-        ++i;
-    }
-}
-
-//----------------------------------------------------------------------
-// UserSettingsController static methods
-//----------------------------------------------------------------------
-
-int
-FindMaxNameLength (std::vector<SettingEntry> table)
-{
-    int max_length = 1;
-
-    for (int i = 0; i < table.size(); ++i)
-    {
-        int len = strlen (table[i].var_name);
-        if (len > max_length)
-            max_length = len;
-    }
-
-    return max_length;
-}
-
-const char *
-UserSettingsController::GetTypeString (SettableVariableType var_type)
-{
-    switch (var_type)
-    {
-        case eSetVarTypeInt:
-            return "int";
-        case eSetVarTypeBoolean:
-            return "boolean";
-        case eSetVarTypeString:
-            return "string";
-        case eSetVarTypeArray:
-            return "array";
-        case eSetVarTypeDictionary:
-            return "dictionary";
-        case eSetVarTypeEnum:
-            return "enum";
-        case eSetVarTypeNone:
-            return "no type";
-    }
-
-    return "";
-}
-
-void
-UserSettingsController::PrintEnumValues (const OptionEnumValueElement *enum_values, Stream &str)
-{
-    int i = 0;
-    while (enum_values[i].string_value != NULL)
-    {
-        str.Printf ("%s ", enum_values[i].string_value);
-        ++i;
-    }
-  
-}
-
-void
-UserSettingsController::FindAllSettingsDescriptions (CommandInterpreter &interpreter,
-                                                     const UserSettingsControllerSP& usc_sp, 
-                                                     const char *current_prefix, 
-                                                     Stream &strm,
-                                                     Error &err)
-{
-    // Write out current prefix line.
-    StreamString prefix_line;
-    StreamString description;
-    uint32_t max_len = FindMaxNameLength (usc_sp->m_settings.global_settings);
-    int num_entries = usc_sp->m_settings.global_settings.size();
-
-    if (current_prefix && current_prefix[0])
-        strm.Printf ("\n'%s' variables:\n\n", current_prefix);
-    else
-        strm.Printf ("\nTop level variables:\n\n");
-        
-    if (num_entries > 0)
-    {
-        // Write out all "global" variables.
-        for (int i = 0; i < num_entries; ++i)
-        {
-            DumpSettingEntry (interpreter, strm, max_len, usc_sp->m_settings.global_settings[i]);
-        }
-    }
-
-    num_entries = usc_sp->m_settings.instance_settings.size();
-    max_len = FindMaxNameLength (usc_sp->m_settings.instance_settings);
-   
-    if (num_entries > 0)
-    {
-        // Write out all instance variables.
-        for (int i = 0; i < num_entries; ++i)
-        {
-            DumpSettingEntry (interpreter, strm, max_len, usc_sp->m_settings.instance_settings[i]);
-        }
-    }
-    
-    // Now, recurse across all children.
-    int num_children = usc_sp->GetNumChildren();
-    for (int i = 0; i < num_children; ++i)
-    {
-        UserSettingsControllerSP child = usc_sp->GetChildAtIndex (i);
-        
-        if (child)
-        {
-            ConstString child_prefix = child->GetLevelName();
-            if (current_prefix && current_prefix[0])
-            {
-                StreamString new_prefix;
-                new_prefix.Printf ("%s.%s", current_prefix, child_prefix.GetCString());
-                UserSettingsController::FindAllSettingsDescriptions (interpreter, 
-                                                                     child, 
-                                                                     new_prefix.GetData(), 
-                                                                     strm, 
-                                                                     err);
-            }
-            else
-            {
-                UserSettingsController::FindAllSettingsDescriptions (interpreter, 
-                                                                     child, 
-                                                                     child_prefix.GetCString(),
-                                                                     strm, 
-                                                                     err);
-            }
-        }
-    }
-}
-
-void
-UserSettingsController::FindSettingsDescriptions (CommandInterpreter &interpreter,
-                                                  const UserSettingsControllerSP& usc_sp,
-                                                  const char *current_prefix,
-                                                  const char *search_name,
-                                                  Stream &strm,
-                                                  Error &err)
-{
-    Args names = UserSettingsController::BreakNameIntoPieces (search_name);
-    int num_pieces = names.GetArgumentCount ();
-
-    if (num_pieces == 0)
-        return;
-
-    if (usc_sp->GetLevelName().GetLength() > 0)
-    {
-        ConstString prefix (names.GetArgumentAtIndex (0));
-        if (prefix != usc_sp->GetLevelName())
-        {
-            std::string parent_prefix;
-            usc_sp->BuildParentPrefix (parent_prefix);
-            err.SetErrorStringWithFormat ("cannot find match for '%s.%s'", parent_prefix.c_str(), 
-                                          prefix.GetCString());
-            return;
-        }
-        else
-        {
-            names.Shift();
-            --num_pieces;
-        }
-    }
-
-    // If there's nothing left then dump all global and instance descriptions for this root.
-    if (num_pieces == 0)
-    {
-        StreamString prefix_line;
-        StreamString description;
-        uint32_t max_len;
-        int num_entries = usc_sp->m_settings.global_settings.size();
-        
-        max_len = FindMaxNameLength (usc_sp->m_settings.global_settings);
-
-        strm.Printf ("\n'%s' variables:\n\n", search_name);
-        
-        if (num_entries > 0)
-        {
-            // Write out all "global" variables.
-            for (int i = 0; i < num_entries; ++i)
-            {
-                DumpSettingEntry (interpreter, strm, max_len, usc_sp->m_settings.global_settings[i]);
-            }
-        }
-        
-        num_entries = usc_sp->m_settings.instance_settings.size();
-        max_len = FindMaxNameLength (usc_sp->m_settings.instance_settings);
-        
-        if (num_entries > 0)
-        {
-            // Write out all instance variables.
-            for (int i = 0; i < num_entries; ++i)
-            {
-                DumpSettingEntry (interpreter, strm, max_len, usc_sp->m_settings.instance_settings[i]);
-            }
-        }
-    }
-    else if (num_pieces == 1)
-    {
-        ConstString var_name (names.GetArgumentAtIndex (0));
-
-        const SettingEntry *setting_entry = usc_sp->GetGlobalEntry (var_name);
-
-        if (setting_entry == NULL)
-            setting_entry = usc_sp->GetInstanceEntry (var_name);
-
-        // Check to see if it is a global or instance variable name.
-        if (setting_entry != NULL)
-        {
-            DumpSettingEntry (interpreter, strm, var_name.GetLength(), *setting_entry);
-        }
-        else
-        {
-            // It must be a child name.
-            int num_children = usc_sp->GetNumChildren();
-            bool found = false;
-            for (int i = 0; i < num_children && !found; ++i)
-            {
-                UserSettingsControllerSP child = usc_sp->GetChildAtIndex (i);
-                if (child)
-                {
-                    ConstString child_prefix = child->GetLevelName();
-                    if (child_prefix == var_name)
-                    {
-                        found = true;
-                        UserSettingsController::FindSettingsDescriptions (interpreter, 
-                                                                          child, 
-                                                                          current_prefix,
-                                                                          var_name.GetCString(), 
-                                                                          strm, 
-                                                                          err);
-                    }
-                }
-            }
-            if (!found)
-            {
-                std::string parent_prefix;
-                usc_sp->BuildParentPrefix (parent_prefix);
-                err.SetErrorStringWithFormat ("cannot find match for '%s.%s'", parent_prefix.c_str(), search_name);
-                return;
-            }
-        }
-    }
-    else
-    {
-        // It must be a child name; find the child and call this function recursively on child.
-        ConstString child_name (names.GetArgumentAtIndex (0));
-
-        StreamString rest_of_search_name;
-        for (int i = 0; i < num_pieces; ++i)
-        {
-            rest_of_search_name.Printf ("%s", names.GetArgumentAtIndex (i));
-            if ((i + 1) < num_pieces)
-                rest_of_search_name.Printf (".");
-        }
-
-        int num_children = usc_sp->GetNumChildren();
-        bool found = false;
-        for (int i = 0; i < num_children && !found; ++i)
-        {
-            UserSettingsControllerSP child = usc_sp->GetChildAtIndex (i);
-            if (child)
-            {
-                ConstString child_prefix = child->GetLevelName();
-                if (child_prefix == child_name)
-                {
-                    found = true;
-                    UserSettingsController::FindSettingsDescriptions (interpreter, child, current_prefix,
-                                                                      rest_of_search_name.GetData(), strm,
-                                                                      err);
-                }
-            }
-        }
-        if (!found)
-        {
-            std::string parent_prefix;
-            usc_sp->BuildParentPrefix (parent_prefix);
-            err.SetErrorStringWithFormat ("cannot find match for '%s.%s'", parent_prefix.c_str(), search_name);
-            return;
-        }
-    }
-}
-
-void
-UserSettingsController::SearchAllSettingsDescriptions (CommandInterpreter &interpreter,
-                                                       const UserSettingsControllerSP& usc_sp,
-                                                       const char *current_prefix,
-                                                       const char *search_word,
-                                                       Stream &strm)
-{
-    if ((search_word == NULL) || (strlen (search_word) == 0))
-        return;
-    
-    int num_entries = usc_sp->m_settings.global_settings.size();
-
-    if (num_entries > 0)
-    {
-        for (int i = 0; i < num_entries; ++i)
-        {
-            const SettingEntry &entry = usc_sp->m_settings.global_settings[i];
-            if (strcasestr (entry.description, search_word) != NULL)
-            {
-                StreamString var_name;
-                if (current_prefix && current_prefix[0])
-                    var_name.Printf ("%s.%s", current_prefix, entry.var_name);
-                else
-                    var_name.Printf ("%s", entry.var_name);
-                interpreter.OutputFormattedHelpText (strm, var_name.GetData(), "--", entry.description,
-                                                     var_name.GetSize());
-            }
-        }
-    }
-    
-    num_entries = usc_sp->m_settings.instance_settings.size();
-    if (num_entries > 0)
-    {
-        for (int i = 0; i < num_entries; ++i)
-        {
-            SettingEntry &entry = usc_sp->m_settings.instance_settings[i];
-            if (strcasestr (entry.description, search_word) != NULL)
-            {
-                StreamString var_name;
-                if (current_prefix && current_prefix[0])
-                    var_name.Printf ("%s.%s", current_prefix, entry.var_name);
-                else
-                    var_name.Printf ("%s", entry.var_name);
-                interpreter.OutputFormattedHelpText (strm, 
-                                                     var_name.GetData(),
-                                                     "--", 
-                                                     entry.description,
-                                                     var_name.GetSize());
-            }
-        }
-    }
-    
-    int num_children = usc_sp->GetNumChildren ();
-    for (int i = 0; i < num_children; ++i)
-    {
-        UserSettingsControllerSP child = usc_sp->GetChildAtIndex (i);
-        
-        if (child)
-        {
-            ConstString child_prefix = child->GetLevelName();
-            if (current_prefix && current_prefix[0])
-            {
-                StreamString new_prefix;
-                new_prefix.Printf ("%s.%s", current_prefix, child_prefix.GetCString());
-                UserSettingsController::SearchAllSettingsDescriptions (interpreter, 
-                                                                       child, 
-                                                                       new_prefix.GetData(), 
-                                                                       search_word,
-                                                                       strm);
-            }
-            else
-            {
-                UserSettingsController::SearchAllSettingsDescriptions (interpreter, 
-                                                                       child, 
-                                                                       child_prefix.GetCString(),
-                                                                       search_word,
-                                                                       strm);
-            }
-        }
-    }
-}
-
-bool
-UserSettingsController::DumpValue (CommandInterpreter &interpreter, 
-                                   const UserSettingsControllerSP& usc_sp,
-                                   const char *variable_dot_name,
-                                   Stream &strm)
-{
-    SettableVariableType var_type;
-    Error err;
-    StringList value = usc_sp->GetVariable (variable_dot_name, 
-                                            var_type,
-                                            interpreter.GetDebugger().GetInstanceName().GetCString(),
-                                            err);
-    
-    if (err.Success())
-        return DumpValue (variable_dot_name, var_type, value, strm);
-    return false;
-}
-
-
-bool
-UserSettingsController::DumpValue (const char *variable_dot_name,
-                                   SettableVariableType var_type,
-                                   const StringList &value,
-                                   Stream &strm)
-{
-    const char *type_name = UserSettingsController::GetTypeString (var_type);
-    
-    strm.Printf ("%s (%s) = ", variable_dot_name, type_name);
-    if (value.GetSize() == 0)
-    {
-        strm.EOL();
-    }
-    else
-    {
-        switch (var_type)
-        {
-            case eSetVarTypeNone:
-            case eSetVarTypeEnum:
-            case eSetVarTypeInt:
-            case eSetVarTypeBoolean:
-                strm.Printf ("%s\n", value.GetStringAtIndex (0));
-                break;
-
-            case eSetVarTypeString:
-                strm.Printf ("\"%s\"\n", value.GetStringAtIndex (0));
-                break;
-                
-            case eSetVarTypeArray:
-                {
-                    strm.EOL();
-                    for (unsigned i = 0, e = value.GetSize(); i != e; ++i)
-                        strm.Printf ("  [%u]: \"%s\"\n", i, value.GetStringAtIndex (i));
-                }
-                break;
-                
-            case eSetVarTypeDictionary:
-                {   
-                    strm.EOL();
-                    for (unsigned i = 0, e = value.GetSize(); i != e; ++i)
-                        strm.Printf ("  %s\n", value.GetStringAtIndex (i));
-                }
-                break;
-                
-            default:
-                return false;
-        }
-    }
-    return true;
-}
-
-void
-UserSettingsController::GetAllVariableValues (CommandInterpreter &interpreter,
-                                              const UserSettingsControllerSP& usc_sp,
-                                              const char *current_prefix,
-                                              Stream &strm,
-                                              Error &err)
-{
-    StreamString description;
-    int num_entries = usc_sp->m_settings.global_settings.size();
-
-    for (int i = 0; i < num_entries; ++i)
-    {
-        StreamString full_var_name;
-        const SettingEntry &entry = usc_sp->m_settings.global_settings[i];
-        
-        if (current_prefix && current_prefix[0])
-            full_var_name.Printf ("%s.%s", current_prefix, entry.var_name);
-        else
-            full_var_name.Printf ("%s", entry.var_name);
-        
-        DumpValue (interpreter, usc_sp, full_var_name.GetData(),  strm);
-    }
-
-    usc_sp->GetAllInstanceVariableValues (interpreter, strm);
-    usc_sp->GetAllPendingSettingValues (strm);
-    if (usc_sp->GetLevelName().GetLength() > 0)               // Don't bother with default values for Debugger level.
-         usc_sp->GetAllDefaultSettingValues (strm);
-
-
-    // Now, recurse across all children.
-    int num_children = usc_sp->GetNumChildren();
-    for (int i = 0; i < num_children; ++i)
-    {
-        UserSettingsControllerSP child = usc_sp->GetChildAtIndex (i);
-        
-        if (child)
-        {
-            ConstString child_prefix = child->GetLevelName();
-            if (current_prefix && current_prefix[0])
-            {
-                StreamString new_prefix;
-                new_prefix.Printf ("%s.%s", current_prefix, child_prefix.GetCString());
-                UserSettingsController::GetAllVariableValues (interpreter, 
-                                                              child, 
-                                                              new_prefix.GetData(), 
-                                                              strm, 
-                                                              err);
-            }
-            else
-            {
-                UserSettingsController::GetAllVariableValues (interpreter, 
-                                                              child, 
-                                                              child_prefix.GetCString(),
-                                                              strm, 
-                                                              err);
-            }
-        }
-    }
-
-}
-
-Args
-UserSettingsController::BreakNameIntoPieces (const char *full_dot_name)
-{
-    Args return_value;
-    std::string name_string (full_dot_name);
-    bool done = false;
-    
-    std::string piece;
-    std::string remainder (full_dot_name);
-  
-    while (!done)
-    {
-        size_t idx = remainder.find_first_of ('.');
-        piece = remainder.substr (0, idx);
-        return_value.AppendArgument (piece.c_str());
-        if (idx != std::string::npos)
-            remainder = remainder.substr (idx+1);
-        else
-            done = true;
-    }
-
-    return return_value;
-}
-
-bool
-UserSettingsController::IsLiveInstance (const std::string &instance_name)
-{
-    Mutex::Locker locker (m_live_settings_mutex);
-    InstanceSettingsMap::iterator pos = m_live_settings.find (instance_name);
-    if (pos != m_live_settings.end())
-        return true;
-    
-    return false;
-}
-
-int
-UserSettingsController::CompleteSettingsValue (const UserSettingsControllerSP& usc_sp,
-                                               const char *full_dot_name,
-                                               const char *partial_value,
-                                               bool &word_complete,
-                                               StringList &matches)
-{
-    Args names = UserSettingsController::BreakNameIntoPieces (full_dot_name);
-    int num_pieces = names.GetArgumentCount();
-    word_complete = true;
-
-    ConstString root_level = usc_sp->GetLevelName();
-    int num_extra_levels = num_pieces - 2;
-    if ((num_extra_levels > 0)
-        && root_level.GetLength() > 0)
-    {
-        ConstString current_level (names.GetArgumentAtIndex (0));
-        if (current_level == root_level)
-        {
-            names.Shift();
-            --num_extra_levels;
-        }
-        else
-            return 0;
-    }
-
-    for (int i = 0; i < num_extra_levels; ++i)
-    {
-        ConstString child_level (names.GetArgumentAtIndex (0));
-        bool found = false;
-        int num_children = usc_sp->GetNumChildren();
-        UserSettingsControllerSP child_usc_sp = usc_sp;
-        for (int j = 0; j < num_children && !found; ++j)
-        {
-            if (child_usc_sp->GetChildAtIndex (j)->GetLevelName() == child_level)
-            {
-                found = true;
-                child_usc_sp = child_usc_sp->GetChildAtIndex (j);
-                names.Shift();
-            }
-        }
-        if (!found)
-            return 0;
-    }
-
-    if (names.GetArgumentCount() != 2)
-        return 0;
-
-    std::string next_name (names.GetArgumentAtIndex (0));
-    int len = next_name.length();
-    names.Shift();
-
-    if ((next_name[0] == '[') && (next_name[len-1] == ']'))
-    {
-        // 'next_name' is instance name.  Instance names are irrelevent here.
-    }
-    else
-    {
-        // 'next_name' is child name.
-        bool found = false;
-        int num_children = usc_sp->GetNumChildren();
-        ConstString child_level (next_name.c_str());
-        UserSettingsControllerSP child_usc_sp = usc_sp;
-        for (int j = 0; j < num_children && !found; ++j)
-        {
-            if (child_usc_sp->GetChildAtIndex (j)->GetLevelName() == child_level)
-            {
-                found = true;
-                child_usc_sp = child_usc_sp->GetChildAtIndex (j);
-            }
-        }
-        if (!found)
-            return 0;
-    }
-
-    ConstString var_name (names.GetArgumentAtIndex(0));
-    const SettingEntry *entry = usc_sp->GetGlobalEntry (var_name);
-    if (entry == NULL)
-        entry = usc_sp->GetInstanceEntry (var_name);
-
-    if (entry == NULL)
-        return 0;
-
-    if (entry->var_type == eSetVarTypeBoolean)
-        return UserSettingsController::BooleanMatches (partial_value, word_complete, matches);
-    else if (entry->var_type == eSetVarTypeEnum)
-        return UserSettingsController::EnumMatches (partial_value, entry->enum_values, word_complete, matches);
-    else
-        return 0;
-}
-
-int
-UserSettingsController::BooleanMatches (const char *partial_value,
-                                        bool &word_complete,
-                                        StringList &matches)
-{
-    static const std::string true_string ("true");
-    static const std::string false_string ("false");
-
-    if (partial_value == NULL)
-    {
-        matches.AppendString ("true");
-        matches.AppendString ("false");
-    }
-    else
-    {
-        int partial_len = strlen (partial_value);
-
-        if ((partial_len <= true_string.length())
-            && (true_string.find (partial_value) == 0))
-            matches.AppendString ("true");
-        else if ((partial_len <= false_string.length())
-                 && (false_string.find (partial_value) == 0))
-            matches.AppendString ("false");
-    }
-
-    word_complete = false;
-    if (matches.GetSize() == 1)
-        word_complete = true;
-
-    return matches.GetSize();
-}
-
-int
-UserSettingsController::EnumMatches (const char *partial_value,
-                                     OptionEnumValueElement *enum_values,
-                                     bool &word_complete,
-                                     StringList &matches)
-{
-    int len = (partial_value != NULL) ? strlen (partial_value) : 0;
-
-    int i = 0;
-    while (enum_values[i].string_value != NULL)
-    {
-        if (len == 0)
-            matches.AppendString (enum_values[i].string_value);
-        else
-        {
-            std::string tmp_value (enum_values[i].string_value);
-            if ((len <= tmp_value.length())
-                && tmp_value.find (partial_value) == 0)
-              matches.AppendString (enum_values[i].string_value);
-        }
-        ++i;
-    }
-
-    word_complete = false;
-    if (matches.GetSize() == 1)
-      word_complete = true;
-
-    return matches.GetSize();
-}
-
-int
-UserSettingsController::CompleteSettingsNames (const UserSettingsControllerSP& usc_sp,
-                                               Args &partial_setting_name_pieces,
-                                               bool &word_complete,
-                                               StringList &matches)
-{
-    int num_matches = 0;
-    int num_name_pieces = partial_setting_name_pieces.GetArgumentCount();
-
-    if (num_name_pieces > 1)
-    {
-        // There are at least two pieces, perhaps with multiple level names preceding them.
-        // First traverse all the extra levels, until we have exactly two pieces left.
-        
-        int num_extra_levels = num_name_pieces - 2;
-
-        // Deal with current level first.
-
-        ConstString root_level = usc_sp->GetLevelName();
-        if ((num_extra_levels > 0)
-            && (root_level.GetLength() > 0))
-        {
-            ConstString current_level (partial_setting_name_pieces.GetArgumentAtIndex (0));
-            if (current_level == root_level)
-            {
-                partial_setting_name_pieces.Shift();
-                --num_extra_levels;
-            }
-            else
-                return 0; // The current level did not match the name pieces; something is wrong, so return immediately
-            
-        }
-
-        // The variable my_usc_sp keeps track of the user settings controller as
-        // we descend through the tree hierarchy.
-        UserSettingsControllerSP my_usc_sp = usc_sp;
-        for (int i = 0; i < num_extra_levels; ++i)
-        {
-            ConstString child_level (partial_setting_name_pieces.GetArgumentAtIndex (0));
-            bool found = false;
-            int num_children = my_usc_sp->GetNumChildren();
-
-            for (int j = 0; j < num_children && !found; ++j)
-            {
-                if (my_usc_sp->GetChildAtIndex (j)->GetLevelName() == child_level)
-                {
-                    found = true;
-                    my_usc_sp = my_usc_sp->GetChildAtIndex (j);
-                    partial_setting_name_pieces.Shift();
-                }
-            }
-            if (! found)
-            {
-                return 0; // Unable to find a matching child level name; something is wrong, so return immediately.
-            }
-        }
-
-        // Now there should be exactly two name pieces left.  If not there is an error, so return immediately
-
-        if (partial_setting_name_pieces.GetArgumentCount() != 2)
-            return 0;
-
-        std::string next_name (partial_setting_name_pieces.GetArgumentAtIndex (0));
-        int len = next_name.length();
-        partial_setting_name_pieces.Shift();
-
-        if ((next_name[0] == '[') && (next_name[len-1] == ']'))
-        {
-            // 'next_name' is an instance name.  The last name piece must be a non-empty partial match against an
-            // instance_name, assuming 'next_name' is valid.
-
-            if (my_usc_sp->IsLiveInstance (next_name))
-            {
-                std::string complete_prefix;
-                my_usc_sp->BuildParentPrefix (complete_prefix);
-
-                num_matches = my_usc_sp->InstanceVariableMatches(partial_setting_name_pieces.GetArgumentAtIndex(0),
-                                                                 complete_prefix,
-                                                                 next_name.c_str(),
-                                                                 matches);
-                word_complete = true;
-                if (num_matches > 1)
-                    word_complete = false;
-
-                return num_matches;
-            }
-            else
-                return 0;   // Invalid instance_name
-        }
-        else
-        {
-            // 'next_name' must be a child name.  Find the correct child and pass the remaining piece to be resolved.
-            int num_children = my_usc_sp->GetNumChildren();
-            ConstString child_level (next_name.c_str());
-            for (int i = 0; i < num_children; ++i)
-            {
-                if (my_usc_sp->GetChildAtIndex (i)->GetLevelName() == child_level)
-                {
-                    return UserSettingsController::CompleteSettingsNames (my_usc_sp->GetChildAtIndex (i),
-                                                                          partial_setting_name_pieces,
-                                                                          word_complete, matches);
-                }
-            }
-            return 0;
-        }
-    }
-    else if (num_name_pieces == 1)
-    {
-        std::string complete_prefix;
-        usc_sp->BuildParentPrefix (complete_prefix);
-
-        word_complete = true;
-        std::string name (partial_setting_name_pieces.GetArgumentAtIndex (0));
-
-        if (name[0] == '[')
-        {
-            // It's a partial instance name.
-
-            num_matches = usc_sp->LiveInstanceMatches (name.c_str(), complete_prefix, word_complete, matches);
-        }
-        else
-        {
-            // It could be anything *except* an instance name...
-
-            num_matches = usc_sp->GlobalVariableMatches (name.c_str(), complete_prefix, matches);
-            num_matches += usc_sp->InstanceVariableMatches (name.c_str(), complete_prefix, NULL, matches);
-            num_matches += usc_sp->ChildMatches (name.c_str(), complete_prefix, word_complete, matches);
-        }
-
-        if (num_matches > 1)
-            word_complete = false;
-
-        return num_matches;
-    }
-    else
-    {
-        // We have a user settings controller with a blank partial string.  Return everything possible at this level.
-
-        std::string complete_prefix;
-        usc_sp->BuildParentPrefix (complete_prefix);
-        num_matches = usc_sp->GlobalVariableMatches (NULL, complete_prefix, matches);
-        num_matches += usc_sp->InstanceVariableMatches (NULL, complete_prefix, NULL, matches);
-        num_matches += usc_sp->LiveInstanceMatches (NULL, complete_prefix, word_complete, matches);
-        num_matches += usc_sp->ChildMatches (NULL, complete_prefix, word_complete, matches);
-        word_complete = false;
-        return num_matches;
-    }
-
-    return num_matches;
-}
-
-int
-UserSettingsController::GlobalVariableMatches (const char *partial_name,
-                                               const std::string &complete_prefix,
-                                               StringList &matches)
-{
-    int partial_len = (partial_name != NULL) ? strlen (partial_name) : 0;
-    int num_matches = 0;
-
-    for (size_t i = 0; i < m_settings.global_settings.size(); ++i)
-    {
-        const SettingEntry &entry = m_settings.global_settings[i];
-        std::string var_name (entry.var_name);
-        if ((partial_len == 0)
-            || ((partial_len <= var_name.length())
-                && (var_name.find (partial_name) == 0)))
-        {
-            StreamString match_name;
-            if (complete_prefix.length() > 0)
-            {
-                match_name.Printf ("%s.%s", complete_prefix.c_str(), var_name.c_str());
-                matches.AppendString (match_name.GetData());
-            }
-            else
-                matches.AppendString (var_name.c_str());
-            ++num_matches;
-        }
-    }
-    return num_matches;
-}
-
-int
-UserSettingsController::InstanceVariableMatches (const char *partial_name,
-                                                 const std::string &complete_prefix,
-                                                 const char *instance_name,
-                                                 StringList &matches)
-{
-    int partial_len = (partial_name != NULL) ? strlen (partial_name) : 0;
-    int num_matches = 0;
-
-    for (size_t i = 0; i < m_settings.instance_settings.size(); ++i)
-    {
-        SettingEntry &entry = m_settings.instance_settings[i];
-        std::string var_name (entry.var_name);
-        if ((partial_len == 0)
-            || ((partial_len <= var_name.length())
-                && (var_name.find (partial_name) == 0)))
-        {
-            StreamString match_name;
-            if (complete_prefix.length() > 0)
-            {
-                if (instance_name != NULL)
-                    match_name.Printf ("%s.%s.%s", complete_prefix.c_str(), instance_name, var_name.c_str());
-                else
-                    match_name.Printf ("%s.%s", complete_prefix.c_str(), var_name.c_str());
-
-                matches.AppendString (match_name.GetData());
-            }
-            else
-            {
-                if (instance_name != NULL)
-                {
-                    match_name.Printf ("%s.%s", instance_name, var_name.c_str());
-                    matches.AppendString (match_name.GetData());
-                }
-                else
-                    matches.AppendString (var_name.c_str());
-            }
-            ++num_matches;
-        }
-    }
-    return num_matches;
+//static void
+//DumpSettingEntry (CommandInterpreter &interpreter, 
+//                  Stream &strm,
+//                  const uint32_t max_len, 
+//                  const SettingEntry &entry)
+//{
+//    StreamString description;
+//
+//    if (entry.description)
+//        description.Printf ("%s", entry.description);
+//    
+//    if (entry.default_value && entry.default_value[0])
+//        description.Printf (" (default: %s)", entry.default_value);
+//    
+//    interpreter.OutputFormattedHelpText (strm, 
+//                                         entry.var_name, 
+//                                         "--", 
+//                                         description.GetData(), 
+//                                         max_len);
+//    
+//    if (entry.enum_values && entry.enum_values[0].string_value)
+//    {
+//        interpreter.OutputFormattedHelpText (strm, 
+//                                             "", 
+//                                             "  ", 
+//                                             "Enumeration values:", 
+//                                             max_len);
+//        for (uint32_t enum_idx=0; entry.enum_values[enum_idx].string_value != NULL; ++enum_idx)
+//        {
+//            description.Clear();
+//            if (entry.enum_values[enum_idx].usage)
+//                description.Printf ("%s = %s", 
+//                                    entry.enum_values[enum_idx].string_value,
+//                                    entry.enum_values[enum_idx].usage);
+//            else
+//                description.Printf ("%s", entry.enum_values[enum_idx].string_value);
+//            interpreter.OutputFormattedHelpText (strm, 
+//                                                 "", 
+//                                                 "  ", 
+//                                                 description.GetData(), 
+//                                                 max_len);
+//        }
+//    }
+//}
+
+lldb::OptionValueSP
+Properties::GetPropertyValue (const ExecutionContext *exe_ctx,
+                              const char *path,
+                              bool will_modify,
+                              Error &error) const
+{
+    OptionValuePropertiesSP properties_sp (GetValueProperties ());
+    if (properties_sp)
+        return properties_sp->GetSubValue(exe_ctx, path, will_modify, error);
+    return lldb::OptionValueSP();
 }
 
-int
-UserSettingsController::LiveInstanceMatches (const char *partial_name,
-                                             const std::string &complete_prefix,
-                                             bool &word_complete,
-                                             StringList &matches)
-{
-    int partial_len = (partial_name != NULL) ? strlen (partial_name) : 0;
-    int num_matches = 0;
-
-    InstanceSettingsMap::iterator pos;
-    Mutex::Locker locker (m_live_settings_mutex);
-    for (pos = m_live_settings.begin(); pos != m_live_settings.end(); ++pos)
-    {
-        std::string instance_name = pos->first;
-        if ((partial_len == 0)
-            || ((partial_len <= instance_name.length())
-                && (instance_name.find (partial_name) == 0)))
-        {
-            StreamString match_name;
-            if (complete_prefix.length() > 0)
-                match_name.Printf ("%s.%s.", complete_prefix.c_str(), instance_name.c_str());
-            else
-                match_name.Printf ("%s.", instance_name.c_str());
-            matches.AppendString (match_name.GetData());
-            ++num_matches;
-        }
-    }
-
-    if (num_matches > 0)
-        word_complete = false;
-
-    return num_matches;
-}
-
-int
-UserSettingsController::ChildMatches (const char *partial_name,
-                                      const std::string &complete_prefix,
-                                      bool &word_complete,
-                                      StringList &matches)
-{
-    int partial_len = (partial_name != NULL) ? strlen (partial_name) : 0;
-    int num_children = GetNumChildren();
-    int num_matches = 0;
-    for (int i = 0; i < num_children; ++i)
-    {
-        std::string child_name (GetChildAtIndex(i)->GetLevelName().GetCString());
-        StreamString match_name;
-        if ((partial_len == 0)
-          || ((partial_len <= child_name.length())
-              && (child_name.find (partial_name) == 0)))
-        {
-            if (complete_prefix.length() > 0)
-                match_name.Printf ("%s.%s.", complete_prefix.c_str(), child_name.c_str());
-            else
-                match_name.Printf ("%s.", child_name.c_str());
-            matches.AppendString (match_name.GetData());
-            ++num_matches;
-        }
-    }
-
-    if (num_matches > 0)
-        word_complete = false;
-
-    return num_matches;
-}
-
-void
-UserSettingsController::VerifyOperationForType (SettableVariableType var_type, 
-                                                VarSetOperationType op, 
-                                                const ConstString &var_name,
-                                                Error &err)
-{
-    if (op == eVarSetOperationAssign)
-        return;
-
-
-    if (op == eVarSetOperationInvalid)
-    {
-        err.SetErrorString ("invalid 'settings' subcommand operation");  
-        return;
-    }
-
-    switch (op)
-    {
-        case eVarSetOperationInsertBefore:
-        case eVarSetOperationInsertAfter:
-            if (var_type != eSetVarTypeArray)
-                err.SetErrorString ("invalid operation: this operation can only be performed on array variables");
-            break;
-        case eVarSetOperationReplace:
-        case eVarSetOperationRemove:
-            if ((var_type != eSetVarTypeArray)
-                && (var_type != eSetVarTypeDictionary))
-                err.SetErrorString ("invalid operation: this operation can only be performed on array or dictionary variables");
-            break;
-        case eVarSetOperationAppend:
-        case eVarSetOperationClear:
-            if ((var_type != eSetVarTypeArray)
-                && (var_type != eSetVarTypeDictionary)
-                && (var_type != eSetVarTypeString))
-                err.SetErrorString ("invalid operation: this operation can only be performed on array, dictionary or string variables");
-            break;
-        default:
-            break;
-    }
-
-    return;
-}
-
-void
-UserSettingsController::UpdateStringVariable (VarSetOperationType op, 
-                                              std::string &string_var, 
-                                              const char *new_value,
-                                              Error &err)
-{
-    if (op == eVarSetOperationAssign)
-    {
-        if (new_value && new_value[0])
-            string_var.assign (new_value);
-        else
-            string_var.clear();
-    }
-    else if (op == eVarSetOperationAppend)
-    {
-        if (new_value && new_value[0])
-            string_var.append (new_value);
-    }
-    else if (op == eVarSetOperationClear)
-        string_var.clear();
-    else
-        err.SetErrorString ("unrecognized operation. Cannot update value");
-}
-
-Error
-UserSettingsController::UpdateStringOptionValue (const char *value,
-                                                 VarSetOperationType op, 
-                                                 OptionValueString &option_value)
-{
-    Error error;
-    if (op == eVarSetOperationAssign)
-    {
-        option_value.SetCurrentValue (value);
-    }
-    else if (op == eVarSetOperationAppend)
-    {
-        option_value.AppendToCurrentValue (value);
-    }
-    else if (op == eVarSetOperationClear)
-    {
-        option_value.Clear();
-    }
-    else
-    {
-        error.SetErrorString ("unrecognized operation, cannot update value");
-    }
-    return error;
-}
-
-Error
-UserSettingsController::UpdateFileSpecOptionValue (const char *value,
-                                                   VarSetOperationType op, 
-                                                   OptionValueFileSpec &option_value)
-{
-    Error error;
-    if (op == eVarSetOperationAssign)
-    {
-        option_value.GetCurrentValue().SetFile (value, false);
-    }
-    else if (op == eVarSetOperationAppend)
-    {
-        char path[PATH_MAX];
-        if (option_value.GetCurrentValue().GetPath (path, sizeof(path)))
-        {
-            int path_len = ::strlen (path);
-            int value_len = ::strlen (value);
-            if (value_len + 1  > sizeof(path) - path_len)
-            {
-                error.SetErrorString("path too long.");
-            }
-            else
-            {
-                ::strncat (path, value, sizeof(path) - path_len - 1);
-                option_value.GetCurrentValue().SetFile (path, false);
-            }
-        }
-        else
-        {
-            error.SetErrorString("path too long.");
-        }
-    }
-    else if (op == eVarSetOperationClear)
-    {
-        option_value.Clear();
-    }
-    else
-    {
-        error.SetErrorString ("operation not supported for FileSpec option value type.");
-    }
-    return error;
-}
-
-
-void
-UserSettingsController::UpdateBooleanVariable (VarSetOperationType op,
-                                               bool &bool_value,
-                                               const char *value_cstr,
-                                               bool clear_value,
-                                               Error &err)
-{
-    switch (op)
-    {
-    case eVarSetOperationReplace:
-    case eVarSetOperationInsertBefore:
-    case eVarSetOperationInsertAfter:
-    case eVarSetOperationRemove:
-    case eVarSetOperationAppend:
-    case eVarSetOperationInvalid:
-    default:
-        err.SetErrorString ("invalid operation for Boolean variable, cannot update value");
-        break;
-
-    case eVarSetOperationClear:
-        err.Clear();
-        bool_value = clear_value;
-        break;
-        
-    case eVarSetOperationAssign:
-        {
-            bool success = false;
-            
-            
-            if (value_cstr == NULL)
-                err.SetErrorStringWithFormat ("invalid boolean string value (NULL)");
-            else if (value_cstr[0] == '\0')
-                err.SetErrorStringWithFormat ("invalid boolean string value (empty)");
-            else
-            {
-                bool new_value = Args::StringToBoolean (value_cstr, false, &success);
-                if (success)
-                {
-                    err.Clear();
-                    bool_value = new_value;
-                }
-                else
-                    err.SetErrorStringWithFormat ("invalid boolean string value: '%s'", value_cstr);
-            }
-        }
-        break;
-    }
-}
 Error
-UserSettingsController::UpdateBooleanOptionValue (const char *value,
-                                                  VarSetOperationType op,
-                                                  OptionValueBoolean &option_value)
-{
+Properties::SetPropertyValue (const ExecutionContext *exe_ctx,
+                              VarSetOperationType op,
+                              const char *path,
+                              const char *value)
+{
+    OptionValuePropertiesSP properties_sp (GetValueProperties ());
+    if (properties_sp)
+        return properties_sp->SetSubValue(exe_ctx, op, path, value);
     Error error;
-    switch (op)
-    {
-    case eVarSetOperationReplace:
-    case eVarSetOperationInsertBefore:
-    case eVarSetOperationInsertAfter:
-    case eVarSetOperationRemove:
-    case eVarSetOperationAppend:
-    case eVarSetOperationInvalid:
-    default:
-        error.SetErrorString ("Invalid operation for Boolean variable.  Cannot update value.\n");
-        break;
-
-    case eVarSetOperationClear:
-        option_value.Clear();
-        break;
-        
-    case eVarSetOperationAssign:
-        {
-            bool success = false;
-            error = option_value.SetValueFromCString(value);
-            
-            if (value == NULL)
-                error.SetErrorStringWithFormat ("invalid boolean string value (NULL)\n");
-            else if (value[0] == '\0')
-                error.SetErrorStringWithFormat ("invalid boolean string value (empty)\n");
-            else
-            {
-                bool new_value = Args::StringToBoolean (value, false, &success);
-                if (success)
-                {
-                    error.Clear();
-                    option_value = new_value;
-                }
-                else
-                    error.SetErrorStringWithFormat ("invalid boolean string value: '%s'\n", value);
-            }
-        }
-        break;
-    }
+    error.SetErrorString ("no properties");
     return error;
 }
 
 void
-UserSettingsController::UpdateStringArrayVariable (VarSetOperationType op, 
-                                                   const char *index_value,
-                                                   Args &array_var,
-                                                   const char *new_value,
-                                                   Error &err)
+Properties::DumpAllPropertyValues (const ExecutionContext *exe_ctx, Stream &strm, uint32_t dump_mask)
 {
-    int index = -1;
-    bool valid_index = true;
-    
-    if (index_value != NULL)
-    {
-        for (int i = 0; i < strlen(index_value); ++i)
-            if (!isdigit (index_value[i]))
-            {
-                valid_index = false;
-                err.SetErrorStringWithFormat ("'%s' is not a valid integer index, cannot update array value", 
-                                              index_value);
-            }
-                
-        if (valid_index)
-            index = atoi (index_value);
-            
-        if (index < 0
-            || index >= array_var.GetArgumentCount())
-        {
-            valid_index = false;
-            err.SetErrorStringWithFormat ("%d is outside the bounds of the specified array variable, "
-                                          "cannot update array value", index);
-        }
-    }
-
-    switch (op) 
-    {
-        case eVarSetOperationAssign:
-            array_var.SetCommandString (new_value);
-            break;
-        case eVarSetOperationReplace:
-        {
-            if (valid_index)
-                array_var.ReplaceArgumentAtIndex (index, new_value);
-            break;
-        }
-        case eVarSetOperationInsertBefore:
-        case eVarSetOperationInsertAfter:
-        {
-            if (valid_index)
-            {
-                Args new_array (new_value);
-                if (op == eVarSetOperationInsertAfter)
-                    ++index;
-                for (int i = 0; i < new_array.GetArgumentCount(); ++i)
-                    array_var.InsertArgumentAtIndex (index, new_array.GetArgumentAtIndex (i));
-            }
-            break;
-        }
-        case eVarSetOperationRemove:
-        {
-            if (valid_index)
-                array_var.DeleteArgumentAtIndex (index);
-            break;
-        }
-        case eVarSetOperationAppend:
-        {
-            Args new_array (new_value);
-            array_var.AppendArguments (new_array);
-            break;
-        }
-        case eVarSetOperationClear:
-            array_var.Clear();
-            break;
-        default:
-            err.SetErrorString ("unrecognized operation, cannot update value");
-            break;
-    }
+    OptionValuePropertiesSP properties_sp (GetValueProperties ());
+    if (properties_sp)
+        return properties_sp->DumpValue (exe_ctx, strm, dump_mask);
 }
 
 void
-UserSettingsController::UpdateDictionaryVariable (VarSetOperationType op,
-                                                  const char *index_value,
-                                                  std::map<std::string, std::string> &dictionary,
-                                                  const char *new_value,
-                                                  Error &err)
-{
-    switch (op)
-    {
-        case eVarSetOperationReplace:
-            if (index_value != NULL)
-            {
-                std::string key (index_value);
-                std::map<std::string, std::string>::iterator pos;
-                
-                pos = dictionary.find (key);
-                if (pos != dictionary.end())
-                    dictionary[key] = new_value;
-                else
-                    err.SetErrorStringWithFormat ("'%s' is not an existing key; cannot replace value", index_value);
-            }
-            else
-                err.SetErrorString ("'settings replace' requires a key for dictionary variables, no key supplied");
-            break;
-        case eVarSetOperationRemove:
-            if (index_value != NULL)
-            {
-                std::string key (index_value);
-                dictionary.erase (key);
-            }
-            else
-                err.SetErrorString ("'settings remove' requires a key for dictionary variables, no key supplied");
-            break;
-        case eVarSetOperationClear:
-            dictionary.clear ();
-            break;
-        case eVarSetOperationAppend:
-        case eVarSetOperationAssign:
-            {
-                // Clear the dictionary if it's an assign with new_value as NULL.
-                if (new_value == NULL && op == eVarSetOperationAssign)
-                {
-                    dictionary.clear ();
-                    break;
-                }
-                Args args (new_value);
-                size_t num_args = args.GetArgumentCount();
-                RegularExpression regex("(\\[\"?)?"                 // Regex match 1 (optional key prefix of '["' pr '[')
-                                        "([A-Za-z_][A-Za-z_0-9]*)"  // Regex match 2 (key string)
-                                        "(\"?\\])?"                 // Regex match 3 (optional key suffix of '"]' pr ']')
-                                        "="                         // The equal sign that is required
-                                        "(.*)");                    // Regex match 4 (value string)
-                std::string key, value;
-
-                for (size_t i = 0; i < num_args; ++i)
-                {
-                    const char *key_equal_value_arg = args.GetArgumentAtIndex (i);
-                    // Execute the regular expression on each arg.
-                    if (regex.Execute(key_equal_value_arg, 5))
-                    {
-                        // The regular expression succeeded. The match at index
-                        // zero will be the entire string that matched the entire
-                        // regular expression. The match at index 1 - 4 will be
-                        // as mentioned above by the creation of the regex pattern.
-                        // Match index 2 is the key, match index 4 is the value.
-                        regex.GetMatchAtIndex (key_equal_value_arg, 2, key);
-                        regex.GetMatchAtIndex (key_equal_value_arg, 4, value);
-                        dictionary[key] = value;
-                    }
-                    else
-                    {
-                        err.SetErrorString ("invalid format for dictionary value, expected one of '[\"<key>\"]=<value>', '[<key>]=<value>', or '<key>=<value>'");
-                    }
-                }
-            }  
-            break;
-        case eVarSetOperationInsertBefore:
-        case eVarSetOperationInsertAfter:
-            err.SetErrorString ("specified operation cannot be performed on dictionary variables");
-            break;
-        default:
-            err.SetErrorString ("unrecognized operation");
-            break;
-    }
-}
-
-const char *
-UserSettingsController::EnumToString (const OptionEnumValueElement *enum_values,
-                                      int value)
+Properties::DumpAllDescriptions (CommandInterpreter &interpreter,
+                                 Stream &strm) const
 {
-    int i = 0;
-    while (enum_values[i].string_value != NULL)
-    {
-        if (enum_values[i].value == value)
-            return enum_values[i].string_value;
-        ++i;
-    }
+    strm.PutCString("Top level variables:\n\n");
 
-    return "";
+    OptionValuePropertiesSP properties_sp (GetValueProperties ());
+    if (properties_sp)
+        return properties_sp->DumpAllDescriptions (interpreter, strm);
 }
 
 
-void
-UserSettingsController::UpdateEnumVariable (OptionEnumValueElement *enum_values,
-                                            int *enum_var,
-                                            const char *new_value,
-                                            Error &error)
-{
-    *enum_var = Args::StringToOptionEnum (new_value, enum_values, enum_values[0].value, error);
-}
 
-void
-UserSettingsController::RenameInstanceSettings (const char *old_name, const char *new_name)
+Error
+Properties::DumpPropertyValue (const ExecutionContext *exe_ctx, Stream &strm, const char *property_path, uint32_t dump_mask)
 {
-    Mutex::Locker live_mutex (m_live_settings_mutex);
-    Mutex::Locker pending_mutex (m_pending_settings_mutex);
-    std::string old_name_key (old_name);
-    std::string new_name_key (new_name);
-
-    // First, find the live instance settings for the old_name.  If they don't exist in the live settings
-    // list, then this is not a setting that can be renamed.
-
-    if ((old_name_key[0] != '[') || (old_name_key[old_name_key.size() -1] != ']'))
-    {
-        StreamString tmp_str;
-        tmp_str.Printf ("[%s]", old_name);
-          old_name_key = tmp_str.GetData();
-    }
-
-    if ((new_name_key[0] != '[') || (new_name_key[new_name_key.size() -1] != ']'))
-    {
-        StreamString tmp_str;
-        tmp_str.Printf ("[%s]", new_name);
-        new_name_key = tmp_str.GetData();
-    }
-
-    if (old_name_key.compare (new_name_key) == 0) 
-        return;
-
-    size_t len = new_name_key.length();
-    std::string stripped_new_name = new_name_key.substr (1, len-2);  // new name without the '[ ]'
-
-    InstanceSettingsMap::iterator pos;
-
-    pos = m_live_settings.find (old_name_key);
-    if (pos != m_live_settings.end())
+    OptionValuePropertiesSP properties_sp (GetValueProperties ());
+    if (properties_sp)
     {
-        InstanceSettings *live_settings = pos->second;
-
-        // Rename the settings.
-        live_settings->ChangeInstanceName (stripped_new_name);
-
-        // Now see if there are any pending settings for the new name; if so, copy them into live_settings.
-        std::map<std::string,  InstanceSettingsSP>::iterator pending_pos;
-        pending_pos = m_pending_settings.find (new_name_key);
-        if (pending_pos != m_pending_settings.end())
-        {
-            InstanceSettingsSP pending_settings_sp = pending_pos->second;
-            live_settings->CopyInstanceSettings (pending_settings_sp, false);
-        }
-
-        // Erase the old entry (under the old name) from live settings.
-        m_live_settings.erase (pos);
-
-        // Add the new entry, with the new name, into live settings.
-        m_live_settings[new_name_key] = live_settings;
+        return properties_sp->DumpPropertyValue (exe_ctx,
+                                                 strm,
+                                                 property_path,
+                                                 dump_mask);
     }
+    Error error;
+    error.SetErrorString("empty property list");
+    return error;
 }
 
-//----------------------------------------------------------------------
-// class InstanceSettings
-//----------------------------------------------------------------------
-
-InstanceSettings::InstanceSettings (const UserSettingsControllerSP &owner_sp, const char *instance_name, bool live_instance) :
-    m_owner_wp (owner_sp),
-    m_instance_name (instance_name)
-{
-    if ((m_instance_name != InstanceSettings::GetDefaultName())
-        && (m_instance_name !=  InstanceSettings::InvalidName())
-        && live_instance)
-        owner_sp->RegisterInstanceSettings (this);
-}
-
-InstanceSettings::~InstanceSettings ()
+size_t
+Properties::Apropos (const char *keyword, std::vector<const Property *> &matching_properties) const
 {
-    if (m_instance_name != InstanceSettings::GetDefaultName())
+    OptionValuePropertiesSP properties_sp (GetValueProperties ());
+    if (properties_sp)
     {
-        UserSettingsControllerSP owner_sp (m_owner_wp.lock());
-        if (owner_sp)
-            owner_sp->UnregisterInstanceSettings (this);
+        properties_sp->Apropos (keyword, matching_properties);
     }
+    return matching_properties.size();
 }
-
-const ConstString &
-InstanceSettings::GetDefaultName ()
-{
-    static const ConstString g_default_settings_name ("[DEFAULT]");
-
-    return g_default_settings_name;
-}
-
-const ConstString &
-InstanceSettings::InvalidName ()
-{
-    static const ConstString g_invalid_name ("Invalid instance name");
-
-    return g_invalid_name;
-}
-
-void
-InstanceSettings::ChangeInstanceName (const std::string &new_instance_name)
-{
-    m_instance_name.SetCString (new_instance_name.c_str());
-}
-
-

Modified: lldb/trunk/source/Host/common/FileSpec.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/FileSpec.cpp?rev=162366&r1=162365&r2=162366&view=diff
==============================================================================
--- lldb/trunk/source/Host/common/FileSpec.cpp (original)
+++ lldb/trunk/source/Host/common/FileSpec.cpp Wed Aug 22 12:17:09 2012
@@ -523,15 +523,9 @@
 void
 FileSpec::Dump(Stream *s) const
 {
-    if (m_filename)
-        m_directory.Dump(s, "");    // Provide a default for m_directory when we dump it in case it is invalid
-
+    m_directory.Dump(s);
     if (m_directory)
-    {
-        // If dirname was valid, then we need to print a slash between
-        // the directory and the filename
         s->PutChar('/');
-    }
     m_filename.Dump(s);
 }
 

Modified: lldb/trunk/source/Interpreter/CommandInterpreter.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/CommandInterpreter.cpp?rev=162366&r1=162365&r2=162366&view=diff
==============================================================================
--- lldb/trunk/source/Interpreter/CommandInterpreter.cpp (original)
+++ lldb/trunk/source/Interpreter/CommandInterpreter.cpp Wed Aug 22 12:17:09 2012
@@ -84,17 +84,10 @@
     m_truncation_warning(eNoTruncation),
     m_command_source_depth (0)
 {
-    const char *dbg_name = debugger.GetInstanceName().AsCString();
-    std::string lang_name = ScriptInterpreter::LanguageToString (script_language);
-    StreamString var_name;
-    var_name.Printf ("[%s].script-lang", dbg_name);
-    debugger.GetSettingsController()->SetVariable (var_name.GetData(), lang_name.c_str(), 
-                                                   eVarSetOperationAssign, false, 
-                                                   m_debugger.GetInstanceName().AsCString());                                                   
+    debugger.SetScriptLanguage (script_language);
     SetEventName (eBroadcastBitThreadShouldExit, "thread-should-exit");
     SetEventName (eBroadcastBitResetPrompt, "reset-prompt");
-    SetEventName (eBroadcastBitQuitCommandReceived, "quit");
-    
+    SetEventName (eBroadcastBitQuitCommandReceived, "quit");    
     CheckInWithManager ();
 }
 
@@ -2505,6 +2498,7 @@
                 while (end > start
                        && text[end] != ' ' && text[end] != '\t' && text[end] != '\n')
                     end--;
+                assert (end > 0);
             }
 
             sub_len = end - start;

Removed: lldb/trunk/source/Interpreter/NamedOptionValue.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/NamedOptionValue.cpp?rev=162365&view=auto
==============================================================================
--- lldb/trunk/source/Interpreter/NamedOptionValue.cpp (original)
+++ lldb/trunk/source/Interpreter/NamedOptionValue.cpp (removed)
@@ -1,503 +0,0 @@
-//===-- NamedOptionValue.cpp ------------------------------------*- C++ -*-===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#include "lldb/Interpreter/NamedOptionValue.h"
-
-// C Includes
-// C++ Includes
-// Other libraries and framework includes
-// Project includes
-#include "lldb/Core/FormatManager.h"
-#include "lldb/Core/State.h"
-#include "lldb/Core/Stream.h"
-#include "lldb/Interpreter/Args.h"
-
-using namespace lldb;
-using namespace lldb_private;
-
-
-//-------------------------------------------------------------------------
-// OptionValue
-//-------------------------------------------------------------------------
-
-// Get this value as a uint64_t value if it is encoded as a boolean,
-// uint64_t or int64_t. Other types will cause "fail_value" to be 
-// returned
-uint64_t
-OptionValue::GetUInt64Value (uint64_t fail_value, bool *success_ptr)
-{
-    if (success_ptr)
-        *success_ptr = true;
-    switch (GetType())
-    {
-    case OptionValue::eTypeBoolean: return static_cast<OptionValueBoolean *>(this)->GetCurrentValue();
-    case OptionValue::eTypeSInt64:  return static_cast<OptionValueSInt64 *>(this)->GetCurrentValue();
-    case OptionValue::eTypeUInt64:  return static_cast<OptionValueUInt64 *>(this)->GetCurrentValue();
-    default: 
-        break;
-    }
-    if (success_ptr)
-        *success_ptr = false;
-    return fail_value;
-}
-
-
-OptionValueBoolean *
-OptionValue::GetAsBoolean ()
-{
-    if (GetType () == OptionValue::eTypeBoolean)
-        return static_cast<OptionValueBoolean *>(this);
-    return NULL;
-}
-
-OptionValueSInt64 *
-OptionValue::GetAsSInt64 ()
-{
-    if (GetType () == OptionValue::eTypeSInt64)
-        return static_cast<OptionValueSInt64 *>(this);
-    return NULL;
-}
-
-OptionValueUInt64 *
-OptionValue::GetAsUInt64 ()
-{
-    if (GetType () == OptionValue::eTypeUInt64)
-        return static_cast<OptionValueUInt64 *>(this);
-    return NULL;
-}
-
-OptionValueString *
-OptionValue::GetAsString ()
-{
-    if (GetType () == OptionValue::eTypeString)
-        return static_cast<OptionValueString *>(this);
-    return NULL;
-}
-
-OptionValueFileSpec *
-OptionValue::GetAsFileSpec ()
-{
-    if (GetType () == OptionValue::eTypeFileSpec)
-        return static_cast<OptionValueFileSpec *>(this);
-    return NULL;
-
-}
-
-OptionValueFormat *
-OptionValue::GetAsFormat ()
-{
-    if (GetType () == OptionValue::eTypeFormat)
-        return static_cast<OptionValueFormat *>(this);
-    return NULL;
-}
-
-OptionValueUUID *
-OptionValue::GetAsUUID ()
-{
-    if (GetType () == OptionValue::eTypeUUID)
-        return static_cast<OptionValueUUID *>(this);
-    return NULL;
-    
-}
-
-
-OptionValueArray *
-OptionValue::GetAsArray ()
-{
-    if (GetType () == OptionValue::eTypeArray)
-        return static_cast<OptionValueArray *>(this);
-    return NULL;
-}
-
-OptionValueDictionary *
-OptionValue::GetAsDictionary ()
-{
-    if (GetType () == OptionValue::eTypeDictionary)
-        return static_cast<OptionValueDictionary *>(this);
-    return NULL;
-}
-
-const char *
-OptionValue::GetStringValue (const char *fail_value)
-{
-    OptionValueString *option_value = GetAsString ();
-    if (option_value)
-        return option_value->GetCurrentValue();
-    return fail_value;
-}
-
-uint64_t
-OptionValue::GetUInt64Value (uint64_t fail_value)
-{
-    OptionValueUInt64 *option_value = GetAsUInt64 ();
-    if (option_value)
-        return option_value->GetCurrentValue();
-    return fail_value;
-}
-
-lldb::Format
-OptionValue::GetFormatValue (lldb::Format fail_value)
-{
-    OptionValueFormat *option_value = GetAsFormat ();
-    if (option_value)
-        return option_value->GetCurrentValue();
-    return fail_value;
-}
-
-//-------------------------------------------------------------------------
-// OptionValueCollection
-//-------------------------------------------------------------------------
-
-void
-OptionValueCollection::GetQualifiedName (Stream &strm)
-{
-    if (m_parent)
-    {
-        m_parent->GetQualifiedName (strm);
-        strm.PutChar('.');
-    }
-    strm << m_name;
-}
-
-
-//-------------------------------------------------------------------------
-// OptionValueBoolean
-//-------------------------------------------------------------------------
-void
-OptionValueBoolean::DumpValue (Stream &strm)
-{
-    strm.PutCString (m_current_value ? "true" : "false");
-}
-
-Error
-OptionValueBoolean::SetValueFromCString (const char *value_cstr)
-{
-    Error error;
-    bool success = false;
-    bool value = Args::StringToBoolean(value_cstr, false, &success);
-    if (success)
-    {
-        m_value_was_set = true;
-        m_current_value = value;
-    }
-    else
-    {
-        if (value_cstr == NULL)
-            error.SetErrorString ("invalid boolean string value: NULL");
-        else if (value_cstr[0] == '\0')
-            error.SetErrorString ("invalid boolean string value <empty>");
-        else
-            error.SetErrorStringWithFormat ("invalid boolean string value: '%s'", value_cstr);
-    }
-    return error;
-}
-
-//-------------------------------------------------------------------------
-// OptionValueSInt64
-//-------------------------------------------------------------------------
-void
-OptionValueSInt64::DumpValue (Stream &strm)
-{
-    strm.Printf ("%lli", m_current_value);
-}
-
-Error
-OptionValueSInt64::SetValueFromCString (const char *value_cstr)
-{
- 
-    Error error;
-    bool success = false;
-    int64_t value = Args::StringToSInt64 (value_cstr, 0, 0, &success);
-    if (success)
-    {
-        m_value_was_set = true;
-        m_current_value = value;
-    }
-    else
-    {
-        error.SetErrorStringWithFormat ("invalid int64_t string value: '%s'", value_cstr);
-    }
-    return error;
-}
-
-//-------------------------------------------------------------------------
-// OptionValueUInt64
-//-------------------------------------------------------------------------
-
-lldb::OptionValueSP
-OptionValueUInt64::Create (const char *value_cstr, Error &error)
-{
-    lldb::OptionValueSP value_sp (new OptionValueUInt64());
-    error = value_sp->SetValueFromCString (value_cstr);
-    if (error.Fail())
-        value_sp.reset();
-    return value_sp;
-}
-
-
-void
-OptionValueUInt64::DumpValue (Stream &strm)
-{
-    strm.Printf ("0x%llx", m_current_value);
-}
-
-Error
-OptionValueUInt64::SetValueFromCString (const char *value_cstr)
-{
-    Error error;
-    bool success = false;
-    uint64_t value = Args::StringToUInt64 (value_cstr, 0, 0, &success);
-    if (success)
-    {
-        m_value_was_set = true;
-        m_current_value = value;
-    }
-    else
-    {
-        error.SetErrorStringWithFormat ("invalid uint64_t string value: '%s'", value_cstr);
-    }
-    return error;
-}
-
-//-------------------------------------------------------------------------
-// OptionValueDictionary
-//-------------------------------------------------------------------------
-void
-OptionValueString::DumpValue (Stream &strm)
-{
-    strm.Printf ("\"%s\"", m_current_value.c_str());
-}
-
-Error
-OptionValueString::SetValueFromCString (const char *value_cstr)
-{
-    m_value_was_set = true;
-    SetCurrentValue (value_cstr);
-    return Error ();
-}
-
-//-------------------------------------------------------------------------
-// OptionValueFileSpec
-//-------------------------------------------------------------------------
-void
-OptionValueFileSpec::DumpValue (Stream &strm)
-{
-    if (m_current_value)
-    {
-        if (m_current_value.GetDirectory())
-        {
-            strm << '"' << m_current_value.GetDirectory();
-            if (m_current_value.GetFilename())
-                strm << '/' << m_current_value.GetFilename();
-            strm << '"';
-        }
-        else
-        {
-            strm << '"' << m_current_value.GetFilename() << '"';
-        }
-    }
-}
-
-Error
-OptionValueFileSpec::SetValueFromCString (const char *value_cstr)
-{
-    if (value_cstr && value_cstr[0])
-        m_current_value.SetFile(value_cstr, false);
-    else
-        m_current_value.Clear();
-    m_value_was_set = true;
-    return Error();
-}
-
-//-------------------------------------------------------------------------
-// OptionValueFileSpecList
-//-------------------------------------------------------------------------
-void
-OptionValueFileSpecList::DumpValue (Stream &strm)
-{
-    m_current_value.Dump(&strm, "\n");
-}
-
-Error
-OptionValueFileSpecList::SetValueFromCString (const char *value_cstr)
-{
-    if (value_cstr && value_cstr[0])
-    {
-        FileSpec file (value_cstr, false);
-        m_current_value.Append(file);
-    }
-    m_value_was_set = true;
-    return Error();
-}
-
-
-//-------------------------------------------------------------------------
-// OptionValueUUID
-//-------------------------------------------------------------------------
-void
-OptionValueUUID::DumpValue (Stream &strm)
-{
-    m_uuid.Dump (&strm);
-}
-
-Error
-OptionValueUUID::SetValueFromCString (const char *value_cstr)
-{
-    Error error;
-    if (m_uuid.SetfromCString(value_cstr) == 0)
-        error.SetErrorStringWithFormat ("invalid uuid string value '%s'", value_cstr);
-    return error;
-}
-
-//-------------------------------------------------------------------------
-// OptionValueFormat
-//-------------------------------------------------------------------------
-void
-OptionValueFormat::DumpValue (Stream &strm)
-{
-    strm.PutCString (FormatManager::GetFormatAsCString (m_current_value));
-}
-
-Error
-OptionValueFormat::SetValueFromCString (const char *value_cstr)
-{
-    Format new_format;
-    Error error (Args::StringToFormat (value_cstr, new_format, NULL));
-    if (error.Success())
-    {
-        m_value_was_set = true;
-        m_current_value = new_format;
-    }
-    return error;
-}
-
-
-//-------------------------------------------------------------------------
-// OptionValueArray
-//-------------------------------------------------------------------------
-void
-OptionValueArray::DumpValue (Stream &strm)
-{
-    const uint32_t size = m_values.size();
-    for (uint32_t i = 0; i<size; ++i)
-    {
-        strm.Printf("[%u] ", i);
-        m_values[i]->DumpValue (strm);
-    }
-}
-
-Error
-OptionValueArray::SetValueFromCString (const char *value_cstr)
-{
-    Error error;
-    error.SetErrorStringWithFormat ("array option values don't yet support being set by string: '%s'", value_cstr);
-    return error;
-}
-
-//-------------------------------------------------------------------------
-// OptionValueDictionary
-//-------------------------------------------------------------------------
-void
-OptionValueDictionary::DumpValue (Stream &strm)
-{
-    collection::iterator pos, end = m_values.end();
-
-    for (pos = m_values.begin(); pos != end; ++pos)
-    {
-        strm.Printf("%s=", pos->first.GetCString());
-        pos->second->DumpValue (strm);
-    }
-}
-
-Error
-OptionValueDictionary::SetValueFromCString (const char *value_cstr)
-{
-    Error error;
-    error.SetErrorStringWithFormat ("dictionary option values don't yet support being set by string: '%s'", value_cstr);
-    return error;
-}
-
-lldb::OptionValueSP
-OptionValueDictionary::GetValueForKey (const ConstString &key) const
-{
-    lldb::OptionValueSP value_sp;
-    collection::const_iterator pos = m_values.find (key);
-    if (pos != m_values.end())
-        value_sp = pos->second;
-    return value_sp;
-}
-
-const char *
-OptionValueDictionary::GetStringValueForKey (const ConstString &key)
-{
-    collection::const_iterator pos = m_values.find (key);
-    if (pos != m_values.end())
-    {
-        if (pos->second->GetType() == OptionValue::eTypeString)
-            return static_cast<OptionValueString *>(pos->second.get())->GetCurrentValue();
-    }
-    return NULL;
-}
-
-
-bool
-OptionValueDictionary::SetStringValueForKey (const ConstString &key, 
-                                             const char *value, 
-                                             bool can_replace)
-{
-    collection::const_iterator pos = m_values.find (key);
-    if (pos != m_values.end())
-    {
-        if (!can_replace)
-            return false;
-        if (pos->second->GetType() == OptionValue::eTypeString)
-        {
-            pos->second->SetValueFromCString(value);
-            return true;
-        }
-    }
-    m_values[key] = OptionValueSP (new OptionValueString (value));
-    return true;
-
-}
-
-bool
-OptionValueDictionary::SetValueForKey (const ConstString &key, 
-                                       const lldb::OptionValueSP &value_sp, 
-                                       bool can_replace)
-{
-    // Make sure the value_sp object is allowed to contain
-    // values of the type passed in...
-    if (value_sp && (m_type_mask & value_sp->GetTypeAsMask()))
-    {
-        if (!can_replace)
-        {
-            collection::const_iterator pos = m_values.find (key);
-            if (pos != m_values.end())
-                return false;
-        }
-        m_values[key] = value_sp;
-        return true;
-    }
-    return false;
-}
-
-bool
-OptionValueDictionary::DeleteValueForKey (const ConstString &key)
-{
-    collection::iterator pos = m_values.find (key);
-    if (pos != m_values.end())
-    {
-        m_values.erase(pos);
-        return true;
-    }
-    return false;
-}
-
-

Modified: lldb/trunk/source/Interpreter/OptionGroupValueObjectDisplay.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/OptionGroupValueObjectDisplay.cpp?rev=162366&r1=162365&r2=162366&view=diff
==============================================================================
--- lldb/trunk/source/Interpreter/OptionGroupValueObjectDisplay.cpp (original)
+++ lldb/trunk/source/Interpreter/OptionGroupValueObjectDisplay.cpp Wed Aug 22 12:17:09 2012
@@ -31,8 +31,7 @@
 static OptionDefinition
 g_option_table[] =
 {
-    { LLDB_OPT_SET_1, false, "dynamic-type",     'd', required_argument, TargetInstanceSettings::g_dynamic_value_types, 
-                                                                              0, eArgTypeNone,      "Show the object as its full dynamic type, not its static type, if available."},
+    { LLDB_OPT_SET_1, false, "dynamic-type",     'd', required_argument, g_dynamic_value_types, 0, eArgTypeNone,      "Show the object as its full dynamic type, not its static type, if available."},
     { LLDB_OPT_SET_1, false, "synthetic-type",   'S', required_argument, NULL, 0, eArgTypeBoolean,   "Show the object obeying its synthetic provider, if available."},
     { LLDB_OPT_SET_1, false, "depth",            'D', required_argument, NULL, 0, eArgTypeCount,     "Set the max recurse depth when dumping aggregate types (default is infinity)."},
     { LLDB_OPT_SET_1, false, "flat",             'F', no_argument,       NULL, 0, eArgTypeNone,      "Display results in a flat format that uses expression paths for each variable or member."},
@@ -73,7 +72,7 @@
         case 'd':
             {
                 int32_t result;
-                result = Args::StringToOptionEnum (option_arg, TargetInstanceSettings::g_dynamic_value_types, 2, error);
+                result = Args::StringToOptionEnum (option_arg, g_dynamic_value_types, 2, error);
                 if (error.Success())
                     use_dynamic = (lldb::DynamicValueType) result;
             }

Copied: lldb/trunk/source/Interpreter/OptionValue.cpp (from r161327, lldb/trunk/source/Interpreter/NamedOptionValue.cpp)
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/OptionValue.cpp?p2=lldb/trunk/source/Interpreter/OptionValue.cpp&p1=lldb/trunk/source/Interpreter/NamedOptionValue.cpp&r1=161327&r2=162366&rev=162366&view=diff
==============================================================================
--- lldb/trunk/source/Interpreter/NamedOptionValue.cpp (original)
+++ lldb/trunk/source/Interpreter/OptionValue.cpp Wed Aug 22 12:17:09 2012
@@ -1,4 +1,4 @@
-//===-- NamedOptionValue.cpp ------------------------------------*- C++ -*-===//
+//===-- OptionValue.cpp -----------------------------------------*- C++ -*-===//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -7,28 +7,24 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "lldb/Interpreter/NamedOptionValue.h"
+#include "lldb/Interpreter/OptionValue.h"
 
 // C Includes
 // C++ Includes
 // Other libraries and framework includes
 // Project includes
-#include "lldb/Core/FormatManager.h"
-#include "lldb/Core/State.h"
-#include "lldb/Core/Stream.h"
-#include "lldb/Interpreter/Args.h"
+#include "lldb/Core/StringList.h"
+#include "lldb/Interpreter/OptionValues.h"
 
 using namespace lldb;
 using namespace lldb_private;
 
 
 //-------------------------------------------------------------------------
-// OptionValue
-//-------------------------------------------------------------------------
-
 // Get this value as a uint64_t value if it is encoded as a boolean,
 // uint64_t or int64_t. Other types will cause "fail_value" to be 
 // returned
+//-------------------------------------------------------------------------
 uint64_t
 OptionValue::GetUInt64Value (uint64_t fail_value, bool *success_ptr)
 {
@@ -47,6 +43,17 @@
     return fail_value;
 }
 
+Error
+OptionValue::SetSubValue (const ExecutionContext *exe_ctx,
+                          VarSetOperationType op,
+                          const char *name,
+                          const char *value)
+{
+    Error error;
+    error.SetErrorStringWithFormat("SetSubValue is not supported");
+    return error;
+}
+
 
 OptionValueBoolean *
 OptionValue::GetAsBoolean ()
@@ -56,57 +63,68 @@
     return NULL;
 }
 
-OptionValueSInt64 *
-OptionValue::GetAsSInt64 ()
+const OptionValueBoolean *
+OptionValue::GetAsBoolean () const
 {
-    if (GetType () == OptionValue::eTypeSInt64)
-        return static_cast<OptionValueSInt64 *>(this);
+    if (GetType () == OptionValue::eTypeBoolean)
+        return static_cast<const OptionValueBoolean *>(this);
     return NULL;
 }
 
-OptionValueUInt64 *
-OptionValue::GetAsUInt64 ()
+
+OptionValueFileSpec *
+OptionValue::GetAsFileSpec ()
 {
-    if (GetType () == OptionValue::eTypeUInt64)
-        return static_cast<OptionValueUInt64 *>(this);
+    if (GetType () == OptionValue::eTypeFileSpec)
+        return static_cast<OptionValueFileSpec *>(this);
     return NULL;
+    
 }
 
-OptionValueString *
-OptionValue::GetAsString ()
+const OptionValueFileSpec *
+OptionValue::GetAsFileSpec () const
 {
-    if (GetType () == OptionValue::eTypeString)
-        return static_cast<OptionValueString *>(this);
+    if (GetType () == OptionValue::eTypeFileSpec)
+        return static_cast<const OptionValueFileSpec *>(this);
     return NULL;
+    
 }
 
-OptionValueFileSpec *
-OptionValue::GetAsFileSpec ()
+OptionValueFileSpecList *
+OptionValue::GetAsFileSpecList ()
 {
-    if (GetType () == OptionValue::eTypeFileSpec)
-        return static_cast<OptionValueFileSpec *>(this);
+    if (GetType () == OptionValue::eTypeFileSpecList)
+        return static_cast<OptionValueFileSpecList *>(this);
     return NULL;
-
+    
 }
 
-OptionValueFormat *
-OptionValue::GetAsFormat ()
+const OptionValueFileSpecList *
+OptionValue::GetAsFileSpecList () const
 {
-    if (GetType () == OptionValue::eTypeFormat)
-        return static_cast<OptionValueFormat *>(this);
+    if (GetType () == OptionValue::eTypeFileSpecList)
+        return static_cast<const OptionValueFileSpecList *>(this);
     return NULL;
+    
 }
 
-OptionValueUUID *
-OptionValue::GetAsUUID ()
+OptionValueArch *
+OptionValue::GetAsArch ()
 {
-    if (GetType () == OptionValue::eTypeUUID)
-        return static_cast<OptionValueUUID *>(this);
+    if (GetType () == OptionValue::eTypeArch)
+        return static_cast<OptionValueArch *>(this);
     return NULL;
-    
 }
 
 
+const OptionValueArch *
+OptionValue::GetAsArch () const
+{
+    if (GetType () == OptionValue::eTypeArch)
+        return static_cast<const OptionValueArch *>(this);
+    return NULL;
+}
+
 OptionValueArray *
 OptionValue::GetAsArray ()
 {
@@ -115,6 +133,32 @@
     return NULL;
 }
 
+
+const OptionValueArray *
+OptionValue::GetAsArray () const
+{
+    if (GetType () == OptionValue::eTypeArray)
+        return static_cast<const OptionValueArray *>(this);
+    return NULL;
+}
+
+OptionValueArgs *
+OptionValue::GetAsArgs ()
+{
+    if (GetType () == OptionValue::eTypeArgs)
+        return static_cast<OptionValueArgs *>(this);
+    return NULL;
+}
+
+
+const OptionValueArgs *
+OptionValue::GetAsArgs () const
+{
+    if (GetType () == OptionValue::eTypeArgs)
+        return static_cast<const OptionValueArgs *>(this);
+    return NULL;
+}
+
 OptionValueDictionary *
 OptionValue::GetAsDictionary ()
 {
@@ -123,381 +167,467 @@
     return NULL;
 }
 
-const char *
-OptionValue::GetStringValue (const char *fail_value)
+const OptionValueDictionary *
+OptionValue::GetAsDictionary () const
 {
-    OptionValueString *option_value = GetAsString ();
-    if (option_value)
-        return option_value->GetCurrentValue();
-    return fail_value;
+    if (GetType () == OptionValue::eTypeDictionary)
+        return static_cast<const OptionValueDictionary *>(this);
+    return NULL;
 }
 
-uint64_t
-OptionValue::GetUInt64Value (uint64_t fail_value)
+OptionValueEnumeration *
+OptionValue::GetAsEnumeration ()
 {
-    OptionValueUInt64 *option_value = GetAsUInt64 ();
-    if (option_value)
-        return option_value->GetCurrentValue();
-    return fail_value;
+    if (GetType () == OptionValue::eTypeEnum)
+        return static_cast<OptionValueEnumeration *>(this);
+    return NULL;
 }
 
-lldb::Format
-OptionValue::GetFormatValue (lldb::Format fail_value)
+const OptionValueEnumeration *
+OptionValue::GetAsEnumeration () const
 {
-    OptionValueFormat *option_value = GetAsFormat ();
-    if (option_value)
-        return option_value->GetCurrentValue();
-    return fail_value;
+    if (GetType () == OptionValue::eTypeEnum)
+        return static_cast<const OptionValueEnumeration *>(this);
+    return NULL;
 }
 
-//-------------------------------------------------------------------------
-// OptionValueCollection
-//-------------------------------------------------------------------------
+OptionValueFormat *
+OptionValue::GetAsFormat ()
+{
+    if (GetType () == OptionValue::eTypeFormat)
+        return static_cast<OptionValueFormat *>(this);
+    return NULL;
+}
 
-void
-OptionValueCollection::GetQualifiedName (Stream &strm)
+const OptionValueFormat *
+OptionValue::GetAsFormat () const
 {
-    if (m_parent)
-    {
-        m_parent->GetQualifiedName (strm);
-        strm.PutChar('.');
-    }
-    strm << m_name;
+    if (GetType () == OptionValue::eTypeFormat)
+        return static_cast<const OptionValueFormat *>(this);
+    return NULL;
 }
 
+OptionValuePathMappings *
+OptionValue::GetAsPathMappings ()
+{
+    if (GetType () == OptionValue::eTypePathMap)
+        return static_cast<OptionValuePathMappings *>(this);
+    return NULL;
+}
 
-//-------------------------------------------------------------------------
-// OptionValueBoolean
-//-------------------------------------------------------------------------
-void
-OptionValueBoolean::DumpValue (Stream &strm)
+const OptionValuePathMappings *
+OptionValue::GetAsPathMappings () const
 {
-    strm.PutCString (m_current_value ? "true" : "false");
+    if (GetType () == OptionValue::eTypePathMap)
+        return static_cast<const OptionValuePathMappings *>(this);
+    return NULL;
 }
 
-Error
-OptionValueBoolean::SetValueFromCString (const char *value_cstr)
+OptionValueProperties *
+OptionValue::GetAsProperties ()
 {
-    Error error;
-    bool success = false;
-    bool value = Args::StringToBoolean(value_cstr, false, &success);
-    if (success)
-    {
-        m_value_was_set = true;
-        m_current_value = value;
-    }
-    else
-    {
-        if (value_cstr == NULL)
-            error.SetErrorString ("invalid boolean string value: NULL");
-        else if (value_cstr[0] == '\0')
-            error.SetErrorString ("invalid boolean string value <empty>");
-        else
-            error.SetErrorStringWithFormat ("invalid boolean string value: '%s'", value_cstr);
-    }
-    return error;
+    if (GetType () == OptionValue::eTypeProperties)
+        return static_cast<OptionValueProperties *>(this);
+    return NULL;
 }
 
-//-------------------------------------------------------------------------
-// OptionValueSInt64
-//-------------------------------------------------------------------------
-void
-OptionValueSInt64::DumpValue (Stream &strm)
+const OptionValueProperties *
+OptionValue::GetAsProperties () const
 {
-    strm.Printf ("%lli", m_current_value);
+    if (GetType () == OptionValue::eTypeProperties)
+        return static_cast<const OptionValueProperties *>(this);
+    return NULL;
 }
 
-Error
-OptionValueSInt64::SetValueFromCString (const char *value_cstr)
+OptionValueRegex *
+OptionValue::GetAsRegex ()
 {
- 
-    Error error;
-    bool success = false;
-    int64_t value = Args::StringToSInt64 (value_cstr, 0, 0, &success);
-    if (success)
-    {
-        m_value_was_set = true;
-        m_current_value = value;
-    }
-    else
-    {
-        error.SetErrorStringWithFormat ("invalid int64_t string value: '%s'", value_cstr);
-    }
-    return error;
+    if (GetType () == OptionValue::eTypeRegex)
+        return static_cast<OptionValueRegex *>(this);
+    return NULL;
 }
 
-//-------------------------------------------------------------------------
-// OptionValueUInt64
-//-------------------------------------------------------------------------
+const OptionValueRegex *
+OptionValue::GetAsRegex () const
+{
+    if (GetType () == OptionValue::eTypeRegex)
+        return static_cast<const OptionValueRegex *>(this);
+    return NULL;
+}
 
-lldb::OptionValueSP
-OptionValueUInt64::Create (const char *value_cstr, Error &error)
+OptionValueSInt64 *
+OptionValue::GetAsSInt64 ()
 {
-    lldb::OptionValueSP value_sp (new OptionValueUInt64());
-    error = value_sp->SetValueFromCString (value_cstr);
-    if (error.Fail())
-        value_sp.reset();
-    return value_sp;
+    if (GetType () == OptionValue::eTypeSInt64)
+        return static_cast<OptionValueSInt64 *>(this);
+    return NULL;
 }
 
+const OptionValueSInt64 *
+OptionValue::GetAsSInt64 () const
+{
+    if (GetType () == OptionValue::eTypeSInt64)
+        return static_cast<const OptionValueSInt64 *>(this);
+    return NULL;
+}
 
-void
-OptionValueUInt64::DumpValue (Stream &strm)
+OptionValueString *
+OptionValue::GetAsString ()
 {
-    strm.Printf ("0x%llx", m_current_value);
+    if (GetType () == OptionValue::eTypeString)
+        return static_cast<OptionValueString *>(this);
+    return NULL;
 }
 
-Error
-OptionValueUInt64::SetValueFromCString (const char *value_cstr)
+const OptionValueString *
+OptionValue::GetAsString () const
 {
-    Error error;
-    bool success = false;
-    uint64_t value = Args::StringToUInt64 (value_cstr, 0, 0, &success);
-    if (success)
-    {
-        m_value_was_set = true;
-        m_current_value = value;
-    }
-    else
-    {
-        error.SetErrorStringWithFormat ("invalid uint64_t string value: '%s'", value_cstr);
-    }
-    return error;
+    if (GetType () == OptionValue::eTypeString)
+        return static_cast<const OptionValueString *>(this);
+    return NULL;
 }
 
-//-------------------------------------------------------------------------
-// OptionValueDictionary
-//-------------------------------------------------------------------------
-void
-OptionValueString::DumpValue (Stream &strm)
+OptionValueUInt64 *
+OptionValue::GetAsUInt64 ()
 {
-    strm.Printf ("\"%s\"", m_current_value.c_str());
+    if (GetType () == OptionValue::eTypeUInt64)
+        return static_cast<OptionValueUInt64 *>(this);
+    return NULL;
 }
 
-Error
-OptionValueString::SetValueFromCString (const char *value_cstr)
+const OptionValueUInt64 *
+OptionValue::GetAsUInt64 () const
+{
+    if (GetType () == OptionValue::eTypeUInt64)
+        return static_cast<const OptionValueUInt64 *>(this);
+    return NULL;
+}
+
+OptionValueUUID *
+OptionValue::GetAsUUID ()
 {
-    m_value_was_set = true;
-    SetCurrentValue (value_cstr);
-    return Error ();
+    if (GetType () == OptionValue::eTypeUUID)
+        return static_cast<OptionValueUUID *>(this);
+    return NULL;
+    
 }
 
-//-------------------------------------------------------------------------
-// OptionValueFileSpec
-//-------------------------------------------------------------------------
-void
-OptionValueFileSpec::DumpValue (Stream &strm)
+const OptionValueUUID *
+OptionValue::GetAsUUID () const
+{
+    if (GetType () == OptionValue::eTypeUUID)
+        return static_cast<const OptionValueUUID *>(this);
+    return NULL;
+    
+}
+
+bool
+OptionValue::GetBooleanValue (bool fail_value) const
+{
+    const OptionValueBoolean *option_value = GetAsBoolean ();
+    if (option_value)
+        return option_value->GetCurrentValue();
+    return fail_value;
+}
+
+bool
+OptionValue::SetBooleanValue (bool new_value)
 {
-    if (m_current_value)
+    OptionValueBoolean *option_value = GetAsBoolean ();
+    if (option_value)
     {
-        if (m_current_value.GetDirectory())
-        {
-            strm << '"' << m_current_value.GetDirectory();
-            if (m_current_value.GetFilename())
-                strm << '/' << m_current_value.GetFilename();
-            strm << '"';
-        }
-        else
-        {
-            strm << '"' << m_current_value.GetFilename() << '"';
-        }
+        option_value->SetCurrentValue(new_value);
+        return true;
     }
+    return false;
 }
 
-Error
-OptionValueFileSpec::SetValueFromCString (const char *value_cstr)
+int64_t
+OptionValue::GetEnumerationValue (int64_t fail_value) const
 {
-    if (value_cstr && value_cstr[0])
-        m_current_value.SetFile(value_cstr, false);
-    else
-        m_current_value.Clear();
-    m_value_was_set = true;
-    return Error();
+    const OptionValueEnumeration *option_value = GetAsEnumeration();
+    if (option_value)
+        option_value->GetCurrentValue();
+    return fail_value;
 }
 
-//-------------------------------------------------------------------------
-// OptionValueFileSpecList
-//-------------------------------------------------------------------------
-void
-OptionValueFileSpecList::DumpValue (Stream &strm)
+bool
+OptionValue::SetEnumerationValue (int64_t value)
 {
-    m_current_value.Dump(&strm, "\n");
+    OptionValueEnumeration *option_value = GetAsEnumeration();
+    if (option_value)
+    {
+        option_value->SetCurrentValue(value);
+        return true;
+    }
+    return false;
 }
 
-Error
-OptionValueFileSpecList::SetValueFromCString (const char *value_cstr)
+FileSpec
+OptionValue::GetFileSpecValue () const
 {
-    if (value_cstr && value_cstr[0])
+    const OptionValueFileSpec *option_value = GetAsFileSpec ();
+    if (option_value)
+        return option_value->GetCurrentValue();
+    return FileSpec();
+}
+
+
+bool
+OptionValue::SetFileSpecValue (const FileSpec &file_spec)
+{
+    OptionValueFileSpec *option_value = GetAsFileSpec ();
+    if (option_value)
     {
-        FileSpec file (value_cstr, false);
-        m_current_value.Append(file);
+        option_value->SetCurrentValue(file_spec);
+        return true;
     }
-    m_value_was_set = true;
-    return Error();
+    return false;
 }
 
+FileSpecList
+OptionValue::GetFileSpecListValue () const
+{
+    const OptionValueFileSpecList *option_value = GetAsFileSpecList ();
+    if (option_value)
+        return option_value->GetCurrentValue();
+    return FileSpecList();
+}
 
-//-------------------------------------------------------------------------
-// OptionValueUUID
-//-------------------------------------------------------------------------
-void
-OptionValueUUID::DumpValue (Stream &strm)
+
+lldb::Format
+OptionValue::GetFormatValue (lldb::Format fail_value) const
 {
-    m_uuid.Dump (&strm);
+    const OptionValueFormat *option_value = GetAsFormat ();
+    if (option_value)
+        return option_value->GetCurrentValue();
+    return fail_value;
 }
 
-Error
-OptionValueUUID::SetValueFromCString (const char *value_cstr)
+bool
+OptionValue::SetFormatValue (lldb::Format new_value)
 {
-    Error error;
-    if (m_uuid.SetfromCString(value_cstr) == 0)
-        error.SetErrorStringWithFormat ("invalid uuid string value '%s'", value_cstr);
-    return error;
+    OptionValueFormat *option_value = GetAsFormat ();
+    if (option_value)
+    {
+        option_value->SetCurrentValue(new_value);
+        return true;
+    }
+    return false;
 }
 
-//-------------------------------------------------------------------------
-// OptionValueFormat
-//-------------------------------------------------------------------------
-void
-OptionValueFormat::DumpValue (Stream &strm)
+const RegularExpression *
+OptionValue::GetRegexValue () const
 {
-    strm.PutCString (FormatManager::GetFormatAsCString (m_current_value));
+    const OptionValueRegex *option_value = GetAsRegex ();
+    if (option_value)
+        return option_value->GetCurrentValue();
+    return NULL;
 }
 
-Error
-OptionValueFormat::SetValueFromCString (const char *value_cstr)
+
+int64_t
+OptionValue::GetSInt64Value (int64_t fail_value) const
 {
-    Format new_format;
-    Error error (Args::StringToFormat (value_cstr, new_format, NULL));
-    if (error.Success())
+    const OptionValueSInt64 *option_value = GetAsSInt64 ();
+    if (option_value)
+        return option_value->GetCurrentValue();
+    return fail_value;
+}
+
+bool
+OptionValue::SetSInt64Value (int64_t new_value)
+{
+    OptionValueSInt64 *option_value = GetAsSInt64 ();
+    if (option_value)
     {
-        m_value_was_set = true;
-        m_current_value = new_format;
+        option_value->SetCurrentValue(new_value);
+        return true;
     }
-    return error;
+    return false;
 }
 
+const char *
+OptionValue::GetStringValue (const char *fail_value) const
+{
+    const OptionValueString *option_value = GetAsString ();
+    if (option_value)
+        return option_value->GetCurrentValue();
+    return fail_value;
+}
 
-//-------------------------------------------------------------------------
-// OptionValueArray
-//-------------------------------------------------------------------------
-void
-OptionValueArray::DumpValue (Stream &strm)
+bool
+OptionValue::SetStringValue (const char *new_value)
 {
-    const uint32_t size = m_values.size();
-    for (uint32_t i = 0; i<size; ++i)
+    OptionValueString *option_value = GetAsString ();
+    if (option_value)
     {
-        strm.Printf("[%u] ", i);
-        m_values[i]->DumpValue (strm);
+        option_value->SetCurrentValue(new_value);
+        return true;
     }
+    return false;
 }
 
-Error
-OptionValueArray::SetValueFromCString (const char *value_cstr)
+uint64_t
+OptionValue::GetUInt64Value (uint64_t fail_value) const
 {
-    Error error;
-    error.SetErrorStringWithFormat ("array option values don't yet support being set by string: '%s'", value_cstr);
-    return error;
+    const OptionValueUInt64 *option_value = GetAsUInt64 ();
+    if (option_value)
+        return option_value->GetCurrentValue();
+    return fail_value;
 }
 
-//-------------------------------------------------------------------------
-// OptionValueDictionary
-//-------------------------------------------------------------------------
-void
-OptionValueDictionary::DumpValue (Stream &strm)
+bool
+OptionValue::SetUInt64Value (uint64_t new_value)
 {
-    collection::iterator pos, end = m_values.end();
-
-    for (pos = m_values.begin(); pos != end; ++pos)
+    OptionValueUInt64 *option_value = GetAsUInt64 ();
+    if (option_value)
     {
-        strm.Printf("%s=", pos->first.GetCString());
-        pos->second->DumpValue (strm);
+        option_value->SetCurrentValue(new_value);
+        return true;
     }
+    return false;
 }
 
-Error
-OptionValueDictionary::SetValueFromCString (const char *value_cstr)
+UUID
+OptionValue::GetUUIDValue () const
 {
-    Error error;
-    error.SetErrorStringWithFormat ("dictionary option values don't yet support being set by string: '%s'", value_cstr);
-    return error;
+    const OptionValueUUID *option_value = GetAsUUID();
+    if (option_value)
+        return option_value->GetCurrentValue();
+    return UUID();
 }
 
-lldb::OptionValueSP
-OptionValueDictionary::GetValueForKey (const ConstString &key) const
+bool
+OptionValue::SetUUIDValue (const UUID &uuid)
 {
-    lldb::OptionValueSP value_sp;
-    collection::const_iterator pos = m_values.find (key);
-    if (pos != m_values.end())
-        value_sp = pos->second;
-    return value_sp;
+    OptionValueUUID *option_value = GetAsUUID();
+    if (option_value)
+    {
+        option_value->SetCurrentValue(uuid);
+        return true;
+    }
+    return false;
 }
 
 const char *
-OptionValueDictionary::GetStringValueForKey (const ConstString &key)
+OptionValue::GetBuiltinTypeAsCString (Type t)
 {
-    collection::const_iterator pos = m_values.find (key);
-    if (pos != m_values.end())
+    switch (t)
     {
-        if (pos->second->GetType() == OptionValue::eTypeString)
-            return static_cast<OptionValueString *>(pos->second.get())->GetCurrentValue();
+        case eTypeInvalid:      return "invalid";
+        case eTypeArch:         return "arch";
+        case eTypeArgs:         return "arguments";
+        case eTypeArray:        return "array";
+        case eTypeBoolean:      return "boolean";
+        case eTypeDictionary:   return "dictionary";
+        case eTypeEnum:         return "enum";
+        case eTypeFileSpec:     return "file";
+        case eTypeFileSpecList: return "file-list";
+        case eTypeFormat:       return "format";
+        case eTypePathMap:      return "path-map";
+        case eTypeProperties:   return "properties";
+        case eTypeRegex:        return "regex";
+        case eTypeSInt64:       return "int";
+        case eTypeString:       return "string";
+        case eTypeUInt64:       return "unsigned";
+        case eTypeUUID:         return "uuid";
     }
     return NULL;
 }
 
 
-bool
-OptionValueDictionary::SetStringValueForKey (const ConstString &key, 
-                                             const char *value, 
-                                             bool can_replace)
-{
-    collection::const_iterator pos = m_values.find (key);
-    if (pos != m_values.end())
-    {
-        if (!can_replace)
-            return false;
-        if (pos->second->GetType() == OptionValue::eTypeString)
-        {
-            pos->second->SetValueFromCString(value);
-            return true;
-        }
+lldb::OptionValueSP
+OptionValue::CreateValueFromCStringForTypeMask (const char *value_cstr, uint32_t type_mask, Error &error)
+{
+    // If only 1 bit is set in the type mask for a dictionary or array
+    // then we know how to decode a value from a cstring
+    lldb::OptionValueSP value_sp;
+    switch (type_mask)
+    {
+    case 1u << eTypeArch:       value_sp.reset(new OptionValueArch()); break;
+    case 1u << eTypeBoolean:    value_sp.reset(new OptionValueBoolean(false)); break;
+    case 1u << eTypeFileSpec:   value_sp.reset(new OptionValueFileSpec()); break;
+    case 1u << eTypeFormat:     value_sp.reset(new OptionValueFormat(eFormatInvalid));    break;
+    case 1u << eTypeSInt64:     value_sp.reset(new OptionValueSInt64()); break;
+    case 1u << eTypeString:     value_sp.reset(new OptionValueString()); break;
+    case 1u << eTypeUInt64:     value_sp.reset(new OptionValueUInt64()); break;
+    case 1u << eTypeUUID:       value_sp.reset(new OptionValueUUID()); break;
     }
-    m_values[key] = OptionValueSP (new OptionValueString (value));
-    return true;
 
+    if (value_sp)
+        error = value_sp->SetValueFromCString (value_cstr, eVarSetOperationAssign);
+    else
+        error.SetErrorString("unsupported type mask");
+    return value_sp;
 }
 
 bool
-OptionValueDictionary::SetValueForKey (const ConstString &key, 
-                                       const lldb::OptionValueSP &value_sp, 
-                                       bool can_replace)
-{
-    // Make sure the value_sp object is allowed to contain
-    // values of the type passed in...
-    if (value_sp && (m_type_mask & value_sp->GetTypeAsMask()))
-    {
-        if (!can_replace)
-        {
-            collection::const_iterator pos = m_values.find (key);
-            if (pos != m_values.end())
-                return false;
-        }
-        m_values[key] = value_sp;
-        return true;
+OptionValue::DumpQualifiedName (Stream &strm) const
+{
+    bool dumped_something = false;
+    lldb::OptionValueSP m_parent_sp(m_parent_wp.lock());
+    if (m_parent_sp)
+    {
+        if (m_parent_sp->DumpQualifiedName(strm))
+            dumped_something = true;
     }
-    return false;
+    ConstString name (GetName());
+    if (name)
+    {
+        if (dumped_something)
+            strm.PutChar('.');
+        else
+            dumped_something = true;
+        strm << name;
+    }
+    return dumped_something;
 }
 
-bool
-OptionValueDictionary::DeleteValueForKey (const ConstString &key)
+size_t
+OptionValue::AutoComplete (CommandInterpreter &interpreter,
+                           const char *s,
+                           int match_start_point,
+                           int max_return_elements,
+                           bool &word_complete,
+                           StringList &matches)
+{
+    word_complete = false;
+    matches.Clear();
+    return matches.GetSize();
+}
+
+Error
+OptionValue::SetValueFromCString (const char *value, VarSetOperationType op)
 {
-    collection::iterator pos = m_values.find (key);
-    if (pos != m_values.end())
+    Error error;
+    switch (op)
     {
-        m_values.erase(pos);
-        return true;
+    case eVarSetOperationReplace:
+        error.SetErrorStringWithFormat ("%s objects do not support the 'replace' operation", GetTypeAsCString());
+        break;
+    case eVarSetOperationInsertBefore:
+        error.SetErrorStringWithFormat ("%s objects do not support the 'insert-before' operation", GetTypeAsCString());
+        break;
+    case eVarSetOperationInsertAfter:
+        error.SetErrorStringWithFormat ("%s objects do not support the 'insert-after' operation", GetTypeAsCString());
+        break;
+    case eVarSetOperationRemove:
+        error.SetErrorStringWithFormat ("%s objects do not support the 'remove' operation", GetTypeAsCString());
+        break;
+    case eVarSetOperationAppend:
+        error.SetErrorStringWithFormat ("%s objects do not support the 'append' operation", GetTypeAsCString());
+        break;
+    case eVarSetOperationClear:
+        error.SetErrorStringWithFormat ("%s objects do not support the 'clear' operation", GetTypeAsCString());
+        break;
+    case eVarSetOperationAssign:
+        error.SetErrorStringWithFormat ("%s objects do not support the 'assign' operation", GetTypeAsCString());
+        break;
+    case eVarSetOperationInvalid:
+        error.SetErrorStringWithFormat ("invalid operation performed on a %s object", GetTypeAsCString());
+        break;
     }
-    return false;
+    return error;
 }
 
-

Added: lldb/trunk/source/Interpreter/OptionValueArch.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/OptionValueArch.cpp?rev=162366&view=auto
==============================================================================
--- lldb/trunk/source/Interpreter/OptionValueArch.cpp (added)
+++ lldb/trunk/source/Interpreter/OptionValueArch.cpp Wed Aug 22 12:17:09 2012
@@ -0,0 +1,109 @@
+//===-- OptionValueArch.cpp ---------------------------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "lldb/Interpreter/OptionValueArch.h"
+
+// C Includes
+// C++ Includes
+// Other libraries and framework includes
+// Project includes
+#include "lldb/Core/FormatManager.h"
+#include "lldb/Core/State.h"
+#include "lldb/Interpreter/Args.h"
+#include "lldb/Interpreter/CommandCompletions.h"
+
+using namespace lldb;
+using namespace lldb_private;
+
+void
+OptionValueArch::DumpValue (const ExecutionContext *exe_ctx, Stream &strm, uint32_t dump_mask)
+{
+    if (dump_mask & eDumpOptionType)
+        strm.Printf ("(%s)", GetTypeAsCString ());
+    if (dump_mask & eDumpOptionValue)
+    {
+        if (dump_mask & eDumpOptionType)
+            strm.PutCString (" = ");
+
+        if (m_current_value.IsValid())
+        {
+            const char *arch_name = m_current_value.GetArchitectureName();
+            if (arch_name)
+                strm.PutCString (arch_name);
+        }
+    }
+}
+
+Error
+OptionValueArch::SetValueFromCString (const char *value_cstr, VarSetOperationType op)
+{
+    Error error;
+    switch (op)
+    {
+    case eVarSetOperationClear:
+        Clear();
+        break;
+        
+    case eVarSetOperationReplace:
+    case eVarSetOperationAssign:
+        if (value_cstr && value_cstr[0])
+        {
+            if (m_current_value.SetTriple (value_cstr))
+                m_value_was_set = true;
+            else
+                error.SetErrorStringWithFormat("unsupported architecture '%s'", value_cstr);
+        }
+        else
+        {
+            error.SetErrorString("invalid value string");
+        }
+        break;
+        
+    case eVarSetOperationInsertBefore:
+    case eVarSetOperationInsertAfter:
+    case eVarSetOperationRemove:
+    case eVarSetOperationAppend:
+    case eVarSetOperationInvalid:
+        error = OptionValue::SetValueFromCString (value_cstr, op);
+        break;
+    }
+    return error;
+}
+
+lldb::OptionValueSP
+OptionValueArch::DeepCopy () const
+{
+    return OptionValueSP(new OptionValueArch(*this));
+}
+
+
+size_t
+OptionValueArch::AutoComplete (CommandInterpreter &interpreter,
+                                   const char *s,
+                                   int match_start_point,
+                                   int max_return_elements,
+                                   bool &word_complete,
+                                   StringList &matches)
+{
+    word_complete = false;
+    matches.Clear();
+    CommandCompletions::InvokeCommonCompletionCallbacks (interpreter,
+                                                         CommandCompletions::eArchitectureCompletion,
+                                                         s,
+                                                         match_start_point,
+                                                         max_return_elements,
+                                                         NULL,
+                                                         word_complete,
+                                                         matches);
+    return matches.GetSize();
+}
+
+
+
+

Added: lldb/trunk/source/Interpreter/OptionValueArgs.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/OptionValueArgs.cpp?rev=162366&view=auto
==============================================================================
--- lldb/trunk/source/Interpreter/OptionValueArgs.cpp (added)
+++ lldb/trunk/source/Interpreter/OptionValueArgs.cpp Wed Aug 22 12:17:09 2012
@@ -0,0 +1,38 @@
+//===-- OptionValueArgs.cpp -------------------------------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "lldb/Interpreter/OptionValueArgs.h"
+
+// C Includes
+// C++ Includes
+// Other libraries and framework includes
+// Project includes
+#include "lldb/Interpreter/Args.h"
+
+using namespace lldb;
+using namespace lldb_private;
+
+size_t
+OptionValueArgs::GetArgs (Args &args)
+{
+    const uint32_t size = m_values.size();
+    std::vector<const char *> argv;
+    for (uint32_t i = 0; i<size; ++i)
+    {
+        const char *string_value = m_values[i]->GetStringValue ();
+        if (string_value)
+            argv.push_back(string_value);
+    }
+
+    if (argv.empty())
+        args.Clear();
+    else
+        args.SetArguments(argv.size(), &argv[0]);
+    return args.GetArgumentCount();
+}

Added: lldb/trunk/source/Interpreter/OptionValueArray.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/OptionValueArray.cpp?rev=162366&view=auto
==============================================================================
--- lldb/trunk/source/Interpreter/OptionValueArray.cpp (added)
+++ lldb/trunk/source/Interpreter/OptionValueArray.cpp Wed Aug 22 12:17:09 2012
@@ -0,0 +1,350 @@
+//===-- OptionValueArray.cpp ------------------------------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "lldb/Interpreter/OptionValueArray.h"
+
+// C Includes
+// C++ Includes
+// Other libraries and framework includes
+// Project includes
+#include "lldb/Core/Stream.h"
+#include "lldb/Interpreter/Args.h"
+
+using namespace lldb;
+using namespace lldb_private;
+
+void
+OptionValueArray::DumpValue (const ExecutionContext *exe_ctx, Stream &strm, uint32_t dump_mask)
+{
+    const Type array_element_type = ConvertTypeMaskToType (m_type_mask);
+    if (dump_mask & eDumpOptionType)
+    {
+        if ((GetType() == eTypeArray) && (m_type_mask != eTypeInvalid))
+            strm.Printf ("(%s of %ss)", GetTypeAsCString(), GetBuiltinTypeAsCString(array_element_type));
+        else
+            strm.Printf ("(%s)", GetTypeAsCString());
+    }
+    if (dump_mask & eDumpOptionValue)
+    {
+        if (dump_mask & eDumpOptionType)
+            strm.Printf (" =%s", (m_values.size() > 0) ? "\n" : "");
+        strm.IndentMore();
+        const uint32_t size = m_values.size();
+        for (uint32_t i = 0; i<size; ++i)
+        {
+            strm.Indent();
+            strm.Printf("[%u]: ", i);
+            const uint32_t extra_dump_options = m_raw_value_dump ? eDumpOptionRaw : 0;
+            switch (array_element_type)
+            {
+                default:
+                case eTypeArray:
+                case eTypeDictionary:
+                case eTypeProperties:
+                case eTypeFileSpecList:
+                case eTypePathMap:
+                    m_values[i]->DumpValue(exe_ctx, strm, dump_mask | extra_dump_options);
+                    break;
+                    
+                case eTypeBoolean:
+                case eTypeEnum:
+                case eTypeFileSpec:
+                case eTypeFormat:
+                case eTypeSInt64:
+                case eTypeString:
+                case eTypeUInt64:
+                case eTypeUUID:
+                    // No need to show the type for dictionaries of simple items
+                    m_values[i]->DumpValue(exe_ctx, strm, (dump_mask & (~eDumpOptionType)) | extra_dump_options);
+                    break;
+            }
+            if (i < (size - 1))
+                strm.EOL();
+        }
+        strm.IndentLess();
+    }
+}
+
+Error
+OptionValueArray::SetValueFromCString (const char *value, VarSetOperationType op)
+{
+    Args args(value);
+    return SetArgs (args, op);
+}
+
+
+lldb::OptionValueSP
+OptionValueArray::GetSubValue (const ExecutionContext *exe_ctx,
+                               const char *name,
+                               bool will_modify,
+                               Error &error) const
+{
+    if (name && name[0] == '[')
+    {
+        const char *end_bracket = strchr (name+1, ']');
+        if (end_bracket)
+        {
+            const char *sub_value = NULL;
+            if (end_bracket[1])
+                sub_value = end_bracket + 1;
+            std::string index_str (name+1, end_bracket);
+            const size_t array_count = m_values.size();
+            int32_t idx = Args::StringToSInt32(index_str.c_str(), INT32_MAX, 0, NULL);
+            if (idx != INT32_MAX)
+            {
+                ;
+                uint32_t new_idx = UINT32_MAX;
+                if (idx < 0)
+                {
+                    // Access from the end of the array if the index is negative
+                    new_idx = array_count - idx;
+                }
+                else
+                {
+                    // Just a standard index
+                    new_idx = idx;
+                }
+
+                if (new_idx < array_count)
+                {
+                    if (m_values[new_idx])
+                    {
+                        if (sub_value)
+                            return m_values[new_idx]->GetSubValue (exe_ctx, sub_value, will_modify, error);
+                        else
+                            return m_values[new_idx];
+                    }
+                }
+                else
+                {
+                    if (array_count == 0)
+                        error.SetErrorStringWithFormat("index %i is not valid for an empty array", idx);
+                    else if (idx > 0)
+                        error.SetErrorStringWithFormat("index %i out of range, valid values are 0 through %zu", idx, array_count - 1);
+                    else
+                        error.SetErrorStringWithFormat("negative index %i out of range, valid values are -1 through -%zu", idx, array_count);
+                }
+            }
+        }
+    }
+    else
+    {
+        error.SetErrorStringWithFormat("invalid value path '%s', %s values only support '[<index>]' subvalues where <index> is a positive or negative array index", name, GetTypeAsCString());
+    }
+    return OptionValueSP();
+}
+
+
+size_t
+OptionValueArray::GetArgs (Args &args) const
+{
+    const uint32_t size = m_values.size();
+    std::vector<const char *> argv;
+    for (uint32_t i = 0; i<size; ++i)
+    {
+        const char *string_value = m_values[i]->GetStringValue ();
+        if (string_value)
+            argv.push_back(string_value);
+    }
+    
+    if (argv.empty())
+        args.Clear();
+    else
+        args.SetArguments(argv.size(), &argv[0]);
+    return args.GetArgumentCount();
+}
+
+Error
+OptionValueArray::SetArgs (const Args &args, VarSetOperationType op)
+{
+    Error error;
+    const size_t argc = args.GetArgumentCount();
+    switch (op)
+    {
+    case eVarSetOperationInvalid:
+        error.SetErrorString("unsupported operation");
+        break;
+        
+    case eVarSetOperationInsertBefore:
+    case eVarSetOperationInsertAfter:
+        if (argc > 1)
+        {
+            uint32_t idx = Args::StringToUInt32(args.GetArgumentAtIndex(0), UINT32_MAX);
+            const uint32_t count = GetSize();
+            if (idx > count)
+            {
+                error.SetErrorStringWithFormat("invalid insert array index %u, index must be 0 through %u", idx, count);
+            }
+            else
+            {
+                if (op == eVarSetOperationInsertAfter)
+                    ++idx;
+                for (size_t i=1; i<argc; ++i, ++idx)
+                {
+                    lldb::OptionValueSP value_sp (CreateValueFromCStringForTypeMask (args.GetArgumentAtIndex(i),
+                                                                                     m_type_mask,
+                                                                                     error));
+                    if (value_sp)
+                    {
+                        if (error.Fail())
+                            return error;
+                        if (idx >= m_values.size())
+                            m_values.push_back(value_sp);
+                        else
+                            m_values.insert(m_values.begin() + idx, value_sp);
+                    }
+                    else
+                    {
+                        error.SetErrorString("array of complex types must subclass OptionValueArray");
+                        return error;
+                    }
+                }
+            }
+        }
+        else
+        {
+            error.SetErrorString("insert operation takes an array index followed by one or more values");
+        }
+        break;
+        
+    case eVarSetOperationRemove:
+        if (argc > 0)
+        {
+            const uint32_t size = m_values.size();
+            std::vector<int> remove_indexes;
+            bool all_indexes_valid = true;
+            size_t i;
+            for (i=0; i<argc; ++i)
+            {
+                const int idx = Args::StringToSInt32(args.GetArgumentAtIndex(i), INT32_MAX);
+                if (idx >= size)
+                {
+                    all_indexes_valid = false;
+                    break;
+                }
+                else
+                    remove_indexes.push_back(idx);
+            }
+            
+            if (all_indexes_valid)
+            {
+                size_t num_remove_indexes = remove_indexes.size();
+                if (num_remove_indexes)
+                {
+                    // Sort and then erase in reverse so indexes are always valid
+                    if (num_remove_indexes > 1)
+                    {
+                        std::sort(remove_indexes.begin(), remove_indexes.end());
+                        for (std::vector<int>::const_reverse_iterator pos = remove_indexes.rbegin(), end = remove_indexes.rend(); pos != end; ++pos)
+                        {
+                            m_values.erase(m_values.begin() + *pos);
+                        }
+                    }
+                    else
+                    {
+                        // Only one index
+                        m_values.erase(m_values.begin() + remove_indexes.front());
+                    }
+                }
+            }
+            else
+            {
+                error.SetErrorStringWithFormat("invalid array index '%s', aborting remove operation", args.GetArgumentAtIndex(i));
+            }
+        }
+        else
+        {
+            error.SetErrorString("remove operation takes one or more array indices");
+        }
+        break;
+        
+    case eVarSetOperationClear:
+        Clear ();
+        break;
+        
+    case eVarSetOperationReplace:
+        if (argc > 1)
+        {
+            uint32_t idx = Args::StringToUInt32(args.GetArgumentAtIndex(0), UINT32_MAX);
+            const uint32_t count = GetSize();
+            if (idx > count)
+            {
+                error.SetErrorStringWithFormat("invalid replace array index %u, index must be 0 through %u", idx, count);
+            }
+            else
+            {
+                for (size_t i=1; i<argc; ++i, ++idx)
+                {
+                    lldb::OptionValueSP value_sp (CreateValueFromCStringForTypeMask (args.GetArgumentAtIndex(i),
+                                                                                     m_type_mask,
+                                                                                     error));
+                    if (value_sp)
+                    {
+                        if (error.Fail())
+                            return error;
+                        if (idx < count)
+                            m_values[idx] = value_sp;
+                        else
+                            m_values.push_back(value_sp);
+                    }
+                    else
+                    {
+                        error.SetErrorString("array of complex types must subclass OptionValueArray");
+                        return error;
+                    }
+                }
+            }
+        }
+        else
+        {
+            error.SetErrorString("replace operation takes an array index followed by one or more values");
+        }
+        break;
+        
+    case eVarSetOperationAssign:
+        m_values.clear();
+        // Fall through to append case
+    case eVarSetOperationAppend:
+        for (size_t i=0; i<argc; ++i)
+        {
+            lldb::OptionValueSP value_sp (CreateValueFromCStringForTypeMask (args.GetArgumentAtIndex(i),
+                                                                             m_type_mask,
+                                                                             error));
+            if (value_sp)
+            {
+                if (error.Fail())
+                    return error;
+                m_value_was_set = true;
+                AppendValue(value_sp);
+            }
+            else
+            {
+                error.SetErrorString("array of complex types must subclass OptionValueArray");
+            }
+        }
+        break;
+    }
+    return error;
+}
+
+lldb::OptionValueSP
+OptionValueArray::DeepCopy () const
+{
+    OptionValueArray *copied_array = new OptionValueArray (m_type_mask, m_raw_value_dump);
+    lldb::OptionValueSP copied_value_sp(copied_array);
+    const uint32_t size = m_values.size();
+    for (uint32_t i = 0; i<size; ++i)
+    {
+        copied_array->AppendValue (m_values[i]->DeepCopy());
+    }
+    return copied_value_sp;
+}
+
+
+

Added: lldb/trunk/source/Interpreter/OptionValueBoolean.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/OptionValueBoolean.cpp?rev=162366&view=auto
==============================================================================
--- lldb/trunk/source/Interpreter/OptionValueBoolean.cpp (added)
+++ lldb/trunk/source/Interpreter/OptionValueBoolean.cpp Wed Aug 22 12:17:09 2012
@@ -0,0 +1,87 @@
+//===-- OptionValueBoolean.cpp ------------------------------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "lldb/Interpreter/OptionValueBoolean.h"
+
+// C Includes
+// C++ Includes
+// Other libraries and framework includes
+// Project includes
+#include "lldb/Core/Stream.h"
+#include "lldb/Interpreter/Args.h"
+
+using namespace lldb;
+using namespace lldb_private;
+
+void
+OptionValueBoolean::DumpValue (const ExecutionContext *exe_ctx, Stream &strm, uint32_t dump_mask)
+{
+    if (dump_mask & eDumpOptionType)
+        strm.Printf ("(%s)", GetTypeAsCString ());
+//    if (dump_mask & eDumpOptionName)
+//        DumpQualifiedName (strm);
+    if (dump_mask & eDumpOptionValue)
+    {
+        if (dump_mask & eDumpOptionType)
+            strm.PutCString (" = ");
+        strm.PutCString (m_current_value ? "true" : "false");
+    }
+}
+
+Error
+OptionValueBoolean::SetValueFromCString (const char *value_cstr,
+                                         VarSetOperationType op)
+{
+    Error error;
+    switch (op)
+    {
+    case eVarSetOperationClear:
+        Clear();
+        break;
+
+    case eVarSetOperationReplace:
+    case eVarSetOperationAssign:
+        {
+            bool success = false;
+            bool value = Args::StringToBoolean(value_cstr, false, &success);
+            if (success)
+            {
+                m_value_was_set = true;
+                m_current_value = value;
+            }
+            else
+            {
+                if (value_cstr == NULL)
+                    error.SetErrorString ("invalid boolean string value: NULL");
+                else if (value_cstr[0] == '\0')
+                    error.SetErrorString ("invalid boolean string value <empty>");
+                else
+                    error.SetErrorStringWithFormat ("invalid boolean string value: '%s'", value_cstr);
+            }
+        }
+        break;
+
+    case eVarSetOperationInsertBefore:
+    case eVarSetOperationInsertAfter:
+    case eVarSetOperationRemove:
+    case eVarSetOperationAppend:
+    case eVarSetOperationInvalid:
+        error = OptionValue::SetValueFromCString (value_cstr, op);
+        break;
+    }
+    return error;
+}
+
+lldb::OptionValueSP
+OptionValueBoolean::DeepCopy () const
+{
+    return OptionValueSP(new OptionValueBoolean(*this));
+}
+
+

Added: lldb/trunk/source/Interpreter/OptionValueDictionary.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/OptionValueDictionary.cpp?rev=162366&view=auto
==============================================================================
--- lldb/trunk/source/Interpreter/OptionValueDictionary.cpp (added)
+++ lldb/trunk/source/Interpreter/OptionValueDictionary.cpp Wed Aug 22 12:17:09 2012
@@ -0,0 +1,434 @@
+//===-- OptionValueDictionary.cpp -------------------------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "lldb/Interpreter/OptionValueDictionary.h"
+
+// C Includes
+// C++ Includes
+// Other libraries and framework includes
+#include "llvm/ADT/StringRef.h"
+// Project includes
+#include "lldb/Core/FormatManager.h"
+#include "lldb/Core/State.h"
+#include "lldb/Interpreter/Args.h"
+#include "lldb/Interpreter/OptionValueString.h"
+
+using namespace lldb;
+using namespace lldb_private;
+
+void
+OptionValueDictionary::DumpValue (const ExecutionContext *exe_ctx, Stream &strm, uint32_t dump_mask)
+{
+    const Type dict_type = ConvertTypeMaskToType (m_type_mask);
+    if (dump_mask & eDumpOptionType)
+    {
+        if (m_type_mask != eTypeInvalid)
+            strm.Printf ("(%s of %ss)", GetTypeAsCString(), GetBuiltinTypeAsCString(dict_type));
+        else
+            strm.Printf ("(%s)", GetTypeAsCString());
+    }
+    if (dump_mask & eDumpOptionValue)
+    {
+        if (dump_mask & eDumpOptionType)
+            strm.PutCString (" =");
+
+        collection::iterator pos, end = m_values.end();
+
+        strm.IndentMore();
+        
+        for (pos = m_values.begin(); pos != end; ++pos)
+        {
+            OptionValue *option_value = pos->second.get();
+            strm.EOL();
+            strm.Indent(pos->first.GetCString());
+            
+            const uint32_t extra_dump_options = m_raw_value_dump ? eDumpOptionRaw : 0;
+            switch (dict_type)
+            {
+                default:
+                case eTypeArray:
+                case eTypeDictionary:
+                case eTypeProperties:
+                case eTypeFileSpecList:
+                case eTypePathMap:
+                    strm.PutChar (' ');
+                    option_value->DumpValue(exe_ctx, strm, dump_mask | extra_dump_options);
+                    break;
+
+                case eTypeBoolean:
+                case eTypeEnum:
+                case eTypeFileSpec:
+                case eTypeFormat:
+                case eTypeSInt64:
+                case eTypeString:
+                case eTypeUInt64:
+                case eTypeUUID:
+                    // No need to show the type for dictionaries of simple items
+                    strm.PutCString("=");
+                    option_value->DumpValue(exe_ctx, strm, (dump_mask & (~eDumpOptionType)) | extra_dump_options);
+                    break;
+            }
+        }
+        strm.IndentLess();
+    }
+
+}
+
+size_t
+OptionValueDictionary::GetArgs (Args &args) const
+{
+    args.Clear();
+    collection::const_iterator pos, end = m_values.end();
+    for (pos = m_values.begin(); pos != end; ++pos)
+    {
+        StreamString strm;
+        strm.Printf("%s=", pos->first.GetCString());
+        pos->second->DumpValue(NULL, strm, eDumpOptionValue|eDumpOptionRaw);
+        args.AppendArgument(strm.GetString().c_str());
+    }
+    return args.GetArgumentCount();
+}
+
+Error
+OptionValueDictionary::SetArgs (const Args &args, VarSetOperationType op)
+{
+    Error error;
+    const size_t argc = args.GetArgumentCount();
+    switch (op)
+    {
+    case eVarSetOperationClear:
+        Clear();
+        break;
+        
+    case eVarSetOperationAppend:
+    case eVarSetOperationReplace:
+    case eVarSetOperationAssign:
+        if (argc > 0)
+        {
+            for (size_t i=0; i<argc; ++i)
+            {
+                llvm::StringRef key_and_value(args.GetArgumentAtIndex(i));
+                if (!key_and_value.empty())
+                {
+                    std::pair<llvm::StringRef, llvm::StringRef> kvp(key_and_value.split('='));
+                    llvm::StringRef key = kvp.first;
+                    bool key_valid = false;
+                    if (!key.empty())
+                    {
+                        if (key.front() == '[')
+                        {
+                            // Key name starts with '[', so the the key value must be in single or double quotes like:
+                            // ['<key>']
+                            // ["<key>"]
+                            if ((key.size() > 2) && (key.back() == ']'))
+                            {
+                                // Strip leading '[' and trailing ']'
+                                key = key.substr(1, key.size()-2);
+                                const char quote_char = key.front();
+                                if ((quote_char == '\'') || (quote_char == '"'))
+                                {
+                                    if ((key.size() > 2) && (key.back() == quote_char))
+                                    {
+                                        // Strip the quotes
+                                        key = key.substr(1, key.size()-2);
+                                        key_valid = true;
+                                    }
+                                }
+                                else
+                                {
+                                    // square brackets, no quotes
+                                    key_valid = true;
+                                }
+                            }
+                        }
+                        else
+                        {
+                            // No square brackets or quotes
+                            key_valid = true;
+                        }
+                    }
+                    if (!key_valid)
+                    {
+                        error.SetErrorStringWithFormat("invalid key \"%s\", the key must be a bare string or surrounded by brackets with optional quotes: [<key>] or ['<key>'] or [\"<key>\"]", kvp.first.str().c_str());
+                        return error;
+                    }
+
+                    lldb::OptionValueSP value_sp (CreateValueFromCStringForTypeMask (kvp.second.data(),
+                                                                                     m_type_mask,
+                                                                                     error));
+                    if (value_sp)
+                    {
+                        if (error.Fail())
+                            return error;
+                        m_value_was_set = true;
+                        SetValueForKey (ConstString(key), value_sp, true);
+                    }
+                    else
+                    {
+                        error.SetErrorString("dictionaries that can contain multiple types must subclass OptionValueArray");
+                    }
+                }
+                else
+                {
+                    error.SetErrorString("empty argument");
+                }
+            }
+        }
+        else
+        {
+            error.SetErrorString("assign operation takes one or more key=value arguments");
+        }
+        break;
+        
+    case eVarSetOperationRemove:
+        if (argc > 0)
+        {
+            for (size_t i=0; i<argc; ++i)
+            {
+                ConstString key(args.GetArgumentAtIndex(i));
+                if (!DeleteValueForKey(key))
+                {
+                    error.SetErrorStringWithFormat("no value found named '%s', aborting remove operation", key.GetCString());
+                    break;
+                }
+            }
+        }
+        else
+        {
+            error.SetErrorString("remove operation takes one or more key arguments");
+        }
+        break;
+        
+    case eVarSetOperationInsertBefore:
+    case eVarSetOperationInsertAfter:
+    case eVarSetOperationInvalid:
+        error = OptionValue::SetValueFromCString (NULL, op);
+        break;
+    }
+    return error;
+}
+
+Error
+OptionValueDictionary::SetValueFromCString (const char *value_cstr, VarSetOperationType op)
+{
+    Args args(value_cstr);
+    return SetArgs (args, op);
+}
+
+lldb::OptionValueSP
+OptionValueDictionary::GetSubValue (const ExecutionContext *exe_ctx, const char *name, bool will_modify, Error &error) const
+{
+    lldb::OptionValueSP value_sp;
+
+    if (name && name[0])
+    {
+        const char *sub_name = NULL;
+        ConstString key;
+        const char *open_bracket = ::strchr (name, '[');
+
+        if (open_bracket)
+        {
+            const char *key_start = open_bracket + 1;
+            const char *key_end = NULL;
+            switch (open_bracket[1])
+            {
+                case '\'':
+                    ++key_start;
+                    key_end = strchr(key_start, '\'');
+                    if (key_end)
+                    {
+                        if (key_end[1] == ']')
+                        {
+                            if (key_end[2])
+                                sub_name = key_end + 2;
+                        }
+                        else
+                        {
+                            error.SetErrorStringWithFormat ("invalid value path '%s', single quoted key names must be formatted as ['<key>'] where <key> is a string that doesn't contain quotes", name);
+                            return value_sp;
+                        }
+                    }
+                    else
+                    {
+                        error.SetErrorString ("missing '] key name terminator, key name started with ['");
+                        return value_sp;
+                    }
+                    break;
+                case '"':
+                    ++key_start;
+                    key_end = strchr(key_start, '"');
+                    if (key_end)
+                    {
+                        if (key_end[1] == ']')
+                        {
+                            if (key_end[2])
+                                sub_name = key_end + 2;
+                            break;
+                        }
+                        error.SetErrorStringWithFormat ("invalid value path '%s', double quoted key names must be formatted as [\"<key>\"] where <key> is a string that doesn't contain quotes", name);
+                        return value_sp;
+                    }
+                    else
+                    {
+                        error.SetErrorString ("missing \"] key name terminator, key name started with [\"");
+                        return value_sp;
+                    }
+                    break;
+
+                default:
+                    key_end = strchr(key_start, ']');
+                    if (key_end)
+                    {
+                        if (key_end[1])
+                            sub_name = key_end + 1;
+                    }
+                    else
+                    {
+                        error.SetErrorString ("missing ] key name terminator, key name started with [");
+                        return value_sp;
+                    }
+                    break;
+            }
+            
+            if (key_start && key_end)
+            {
+                key.SetCStringWithLength (key_start, key_end - key_start);
+        
+                value_sp = GetValueForKey (key);
+                if (value_sp)
+                {
+                    if (sub_name)
+                        return value_sp->GetSubValue (exe_ctx, sub_name, will_modify, error);
+                }
+                else
+                {
+                    error.SetErrorStringWithFormat("dictionary does not contain a value for the key name '%s'", key.GetCString());
+                }
+            }
+        }
+        if (!value_sp && error.AsCString() == NULL)
+        {
+            error.SetErrorStringWithFormat ("invalid value path '%s', %s values only support '[<key>]' subvalues where <key> a string value optionally delimitted by single or double quotes",
+                                            name,
+                                            GetTypeAsCString());
+        }
+    }
+    return value_sp;
+}
+
+Error
+OptionValueDictionary::SetSubValue (const ExecutionContext *exe_ctx, VarSetOperationType op, const char *name, const char *value)
+{
+    Error error;
+    const bool will_modify = true;
+    lldb::OptionValueSP value_sp (GetSubValue (exe_ctx, name, will_modify, error));
+    if (value_sp)
+        error = value_sp->SetValueFromCString(value, op);
+    else
+    {
+        if (error.AsCString() == NULL)
+            error.SetErrorStringWithFormat("invalid value path '%s'", name);
+    }
+    return error;
+}
+
+
+lldb::OptionValueSP
+OptionValueDictionary::GetValueForKey (const ConstString &key) const
+{
+    lldb::OptionValueSP value_sp;
+    collection::const_iterator pos = m_values.find (key);
+    if (pos != m_values.end())
+        value_sp = pos->second;
+    return value_sp;
+}
+
+const char *
+OptionValueDictionary::GetStringValueForKey (const ConstString &key)
+{
+    collection::const_iterator pos = m_values.find (key);
+    if (pos != m_values.end())
+    {
+        OptionValueString *string_value = pos->second->GetAsString();
+        if (string_value)
+            return string_value->GetCurrentValue();
+    }
+    return NULL;
+}
+
+
+bool
+OptionValueDictionary::SetStringValueForKey (const ConstString &key, 
+                                             const char *value, 
+                                             bool can_replace)
+{
+    collection::const_iterator pos = m_values.find (key);
+    if (pos != m_values.end())
+    {
+        if (!can_replace)
+            return false;
+        if (pos->second->GetType() == OptionValue::eTypeString)
+        {
+            pos->second->SetValueFromCString(value);
+            return true;
+        }
+    }
+    m_values[key] = OptionValueSP (new OptionValueString (value));
+    return true;
+
+}
+
+bool
+OptionValueDictionary::SetValueForKey (const ConstString &key, 
+                                       const lldb::OptionValueSP &value_sp, 
+                                       bool can_replace)
+{
+    // Make sure the value_sp object is allowed to contain
+    // values of the type passed in...
+    if (value_sp && (m_type_mask & value_sp->GetTypeAsMask()))
+    {
+        if (!can_replace)
+        {
+            collection::const_iterator pos = m_values.find (key);
+            if (pos != m_values.end())
+                return false;
+        }
+        m_values[key] = value_sp;
+        return true;
+    }
+    return false;
+}
+
+bool
+OptionValueDictionary::DeleteValueForKey (const ConstString &key)
+{
+    collection::iterator pos = m_values.find (key);
+    if (pos != m_values.end())
+    {
+        m_values.erase(pos);
+        return true;
+    }
+    return false;
+}
+
+lldb::OptionValueSP
+OptionValueDictionary::DeepCopy () const
+{
+    OptionValueDictionary *copied_dict = new OptionValueDictionary (m_type_mask, m_raw_value_dump);
+    lldb::OptionValueSP copied_value_sp(copied_dict);
+    collection::const_iterator pos, end = m_values.end();
+    for (pos = m_values.begin(); pos != end; ++pos)
+    {
+        StreamString strm;
+        strm.Printf("%s=", pos->first.GetCString());
+        copied_dict->SetValueForKey (pos->first, pos->second->DeepCopy(), true);
+    }
+    return copied_value_sp;
+}
+

Added: lldb/trunk/source/Interpreter/OptionValueEnumeration.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/OptionValueEnumeration.cpp?rev=162366&view=auto
==============================================================================
--- lldb/trunk/source/Interpreter/OptionValueEnumeration.cpp (added)
+++ lldb/trunk/source/Interpreter/OptionValueEnumeration.cpp Wed Aug 22 12:17:09 2012
@@ -0,0 +1,131 @@
+//===-- OptionValueEnumeration.cpp ------------------------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "lldb/Interpreter/OptionValueEnumeration.h"
+
+// C Includes
+// C++ Includes
+// Other libraries and framework includes
+// Project includes
+
+using namespace lldb;
+using namespace lldb_private;
+
+OptionValueEnumeration::OptionValueEnumeration (const OptionEnumValueElement *enumerators,
+                                                enum_type value) :
+    OptionValue(),
+    m_current_value (value),
+    m_default_value (value),
+    m_enumerations ()
+{
+    SetEnumerations(enumerators);
+}
+
+OptionValueEnumeration::~OptionValueEnumeration()
+{
+}
+
+void
+OptionValueEnumeration::DumpValue (const ExecutionContext *exe_ctx, Stream &strm, uint32_t dump_mask)
+{
+    if (dump_mask & eDumpOptionType)
+        strm.Printf ("(%s)", GetTypeAsCString ());
+    if (dump_mask & eDumpOptionValue)
+    {
+        if (dump_mask & eDumpOptionType)
+            strm.PutCString (" = ");
+        const size_t count = m_enumerations.GetSize ();
+        for (size_t i=0; i<count; ++i)
+        {
+            if (m_enumerations.GetValueAtIndexUnchecked(i).value == m_current_value)
+            {
+                strm.PutCString(m_enumerations.GetCStringAtIndex(i));
+                return;
+            }
+        }
+        strm.Printf("%llu", (uint64_t)m_current_value);
+    }
+}
+
+Error
+OptionValueEnumeration::SetValueFromCString (const char *value, VarSetOperationType op)
+{
+    Error error;
+    switch (op)
+    {
+        case eVarSetOperationClear:
+            Clear ();
+            break;
+            
+        case eVarSetOperationReplace:
+        case eVarSetOperationAssign:
+            if (value && value[0])
+            {
+                ConstString const_enumerator_name(value);
+                const EnumerationMapEntry *enumerator_entry = m_enumerations.FindFirstValueForName (const_enumerator_name.GetCString());
+                if (enumerator_entry)
+                {
+                    m_current_value = enumerator_entry->value.value;
+                }
+                else
+                {
+                    StreamString error_strm;
+                    error_strm.Printf("invalid enumeration value '%s'", value);
+                    const size_t count = m_enumerations.GetSize ();
+                    if (count)
+                    {
+                        error_strm.Printf(", valid values are: %s", m_enumerations.GetCStringAtIndex(0));
+                        for (size_t i=1; i<count; ++i)
+                        {
+                            error_strm.Printf (", %s", m_enumerations.GetCStringAtIndex(i));
+                        }
+                    }
+                    error.SetErrorString(error_strm.GetData());
+                }
+            }
+            else
+            {
+                error.SetErrorString("invalid enumeration value");
+            }
+            break;
+            
+        case eVarSetOperationInsertBefore:
+        case eVarSetOperationInsertAfter:
+        case eVarSetOperationRemove:
+        case eVarSetOperationAppend:
+        case eVarSetOperationInvalid:
+            error = OptionValue::SetValueFromCString (value, op);
+            break;
+    }
+    return error;
+}
+
+void
+OptionValueEnumeration::SetEnumerations (const OptionEnumValueElement *enumerators)
+{
+    m_enumerations.Clear();
+    if (enumerators)
+    {
+        for (size_t i=0; enumerators[i].string_value != NULL; ++i)
+        {
+            ConstString const_enumerator_name(enumerators[i].string_value);
+            EnumeratorInfo enumerator_info = { enumerators[i].value, enumerators[i].usage };
+            m_enumerations.Append (const_enumerator_name.GetCString(), enumerator_info);
+        }
+        m_enumerations.Sort();
+    }
+}
+
+
+lldb::OptionValueSP
+OptionValueEnumeration::DeepCopy () const
+{
+    return OptionValueSP(new OptionValueEnumeration(*this));
+}
+

Added: lldb/trunk/source/Interpreter/OptionValueFileSpec.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/OptionValueFileSpec.cpp?rev=162366&view=auto
==============================================================================
--- lldb/trunk/source/Interpreter/OptionValueFileSpec.cpp (added)
+++ lldb/trunk/source/Interpreter/OptionValueFileSpec.cpp Wed Aug 22 12:17:09 2012
@@ -0,0 +1,116 @@
+//===-- OptionValueFileSpec.cpp ---------------------------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "lldb/Interpreter/OptionValueFileSpec.h"
+
+// C Includes
+// C++ Includes
+// Other libraries and framework includes
+// Project includes
+#include "lldb/Core/FormatManager.h"
+#include "lldb/Core/State.h"
+#include "lldb/Interpreter/Args.h"
+#include "lldb/Interpreter/CommandCompletions.h"
+
+using namespace lldb;
+using namespace lldb_private;
+
+void
+OptionValueFileSpec::DumpValue (const ExecutionContext *exe_ctx, Stream &strm, uint32_t dump_mask)
+{
+    if (dump_mask & eDumpOptionType)
+        strm.Printf ("(%s)", GetTypeAsCString ());
+    if (dump_mask & eDumpOptionValue)
+    {
+        if (dump_mask & eDumpOptionType)
+            strm.PutCString (" = ");
+
+        if (m_current_value)
+        {
+            if (m_current_value.GetDirectory())
+            {
+                strm << '"' << m_current_value.GetDirectory();
+                if (m_current_value.GetFilename())
+                    strm << '/' << m_current_value.GetFilename();
+                strm << '"';
+            }
+            else
+            {
+                strm << '"' << m_current_value.GetFilename() << '"';
+            }
+        }
+    }
+}
+
+Error
+OptionValueFileSpec::SetValueFromCString (const char *value_cstr,
+                                          VarSetOperationType op)
+{
+    Error error;
+    switch (op)
+    {
+    case eVarSetOperationClear:
+        Clear ();
+        break;
+        
+    case eVarSetOperationReplace:
+    case eVarSetOperationAssign:
+        if (value_cstr && value_cstr[0])
+        {
+            m_value_was_set = true;
+            m_current_value.SetFile(value_cstr, false);
+        }
+        else
+        {
+            error.SetErrorString("invalid value string");
+        }
+        break;
+        
+    case eVarSetOperationInsertBefore:
+    case eVarSetOperationInsertAfter:
+    case eVarSetOperationRemove:
+    case eVarSetOperationAppend:
+    case eVarSetOperationInvalid:
+        error = OptionValue::SetValueFromCString (value_cstr, op);
+        break;
+    }
+    return error;
+}
+
+lldb::OptionValueSP
+OptionValueFileSpec::DeepCopy () const
+{
+    return OptionValueSP(new OptionValueFileSpec(*this));
+}
+
+
+size_t
+OptionValueFileSpec::AutoComplete (CommandInterpreter &interpreter,
+                                   const char *s,
+                                   int match_start_point,
+                                   int max_return_elements,
+                                   bool &word_complete,
+                                   StringList &matches)
+{
+    word_complete = false;
+    matches.Clear();
+    CommandCompletions::InvokeCommonCompletionCallbacks (interpreter,
+                                                         CommandCompletions::eDiskFileCompletion,
+                                                         s,
+                                                         match_start_point,
+                                                         max_return_elements,
+                                                         NULL,
+                                                         word_complete,
+                                                         matches);
+    return matches.GetSize();
+}
+
+
+
+

Added: lldb/trunk/source/Interpreter/OptionValueFileSpecLIst.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/OptionValueFileSpecLIst.cpp?rev=162366&view=auto
==============================================================================
--- lldb/trunk/source/Interpreter/OptionValueFileSpecLIst.cpp (added)
+++ lldb/trunk/source/Interpreter/OptionValueFileSpecLIst.cpp Wed Aug 22 12:17:09 2012
@@ -0,0 +1,186 @@
+//===-- OptionValueFileSpecList.cpp -----------------------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "lldb/Interpreter/OptionValueFileSpecList.h"
+
+// C Includes
+// C++ Includes
+// Other libraries and framework includes
+// Project includes
+#include "lldb/Core/Stream.h"
+#include "lldb/Interpreter/Args.h"
+
+using namespace lldb;
+using namespace lldb_private;
+
+void
+OptionValueFileSpecList::DumpValue (const ExecutionContext *exe_ctx, Stream &strm, uint32_t dump_mask)
+{
+    if (dump_mask & eDumpOptionType)
+        strm.Printf ("(%s)", GetTypeAsCString ());
+    if (dump_mask & eDumpOptionValue)
+    {
+        if (dump_mask & eDumpOptionType)
+            strm.Printf (" =%s", m_current_value.GetSize() > 0 ? "\n" : "");
+        strm.IndentMore();
+        const uint32_t size = m_current_value.GetSize();
+        for (uint32_t i = 0; i<size; ++i)
+        {
+            strm.Indent();
+            strm.Printf("[%u]: ", i);
+            m_current_value.GetFileSpecAtIndex(i).Dump(&strm);
+        }
+        strm.IndentLess();
+    }
+}
+
+Error
+OptionValueFileSpecList::SetValueFromCString (const char *value, VarSetOperationType op)
+{
+    Error error;
+    Args args(value);
+    const size_t argc = args.GetArgumentCount();
+
+    switch (op)
+    {
+        case eVarSetOperationClear:
+            Clear ();
+            break;
+            
+        case eVarSetOperationReplace:
+            if (argc > 1)
+            {
+                uint32_t idx = Args::StringToUInt32(args.GetArgumentAtIndex(0), UINT32_MAX);
+                const uint32_t count = m_current_value.GetSize();
+                if (idx > count)
+                {
+                    error.SetErrorStringWithFormat("invalid file list index %u, index must be 0 through %u", idx, count);
+                }
+                else
+                {
+                    for (size_t i=1; i<argc; ++i, ++idx)
+                    {
+                        FileSpec file (args.GetArgumentAtIndex(i), false);
+                        if (idx < count)
+                            m_current_value.Replace(idx, file);
+                        else
+                            m_current_value.Append(file);
+                    }
+                }
+            }
+            else
+            {
+                error.SetErrorString("replace operation takes an array index followed by one or more values");
+            }
+            break;
+            
+            
+            
+        case eVarSetOperationAssign:
+            m_current_value.Clear();
+            // Fall through to append case
+        case eVarSetOperationAppend:
+            if (argc > 0)
+            {
+                m_value_was_set = true;
+                for (size_t i=0; i<argc; ++i)
+                {
+                    FileSpec file (args.GetArgumentAtIndex(i), false);
+                    m_current_value.Append(file);
+                }
+            }
+            else
+            {
+                error.SetErrorString("assign operation takes at least one file path argument");
+            }
+            break;
+            
+        case eVarSetOperationInsertBefore:
+        case eVarSetOperationInsertAfter:
+            if (argc > 1)
+            {
+                uint32_t idx = Args::StringToUInt32(args.GetArgumentAtIndex(0), UINT32_MAX);
+                const uint32_t count = m_current_value.GetSize();
+                if (idx > count)
+                {
+                    error.SetErrorStringWithFormat("invalid insert file list index %u, index must be 0 through %u", idx, count);
+                }
+                else
+                {
+                    if (op == eVarSetOperationInsertAfter)
+                        ++idx;
+                    for (size_t i=1; i<argc; ++i, ++idx)
+                    {
+                        FileSpec file (args.GetArgumentAtIndex(i), false);
+                        m_current_value.Insert (idx, file);
+                    }
+                }
+            }
+            else
+            {
+                error.SetErrorString("insert operation takes an array index followed by one or more values");
+            }
+            break;
+            
+        case eVarSetOperationRemove:
+            if (argc > 0)
+            {
+                std::vector<int> remove_indexes;
+                bool all_indexes_valid = true;
+                size_t i;
+                for (i=0; all_indexes_valid && i<argc; ++i)
+                {
+                    const int idx = Args::StringToSInt32(args.GetArgumentAtIndex(i), INT32_MAX);
+                    if (idx == INT32_MAX)
+                        all_indexes_valid = false;
+                    else
+                        remove_indexes.push_back(idx);
+                }
+                
+                if (all_indexes_valid)
+                {
+                    size_t num_remove_indexes = remove_indexes.size();
+                    if (num_remove_indexes)
+                    {
+                        // Sort and then erase in reverse so indexes are always valid
+                        std::sort(remove_indexes.begin(), remove_indexes.end());
+                        for (int i=num_remove_indexes-1; i<num_remove_indexes; ++i)
+                        {
+                            m_current_value.Remove (i);
+                        }
+                    }
+                }
+                else
+                {
+                    error.SetErrorStringWithFormat("invalid array index '%s', aborting remove operation", args.GetArgumentAtIndex(i));
+                }
+            }
+            else
+            {
+                error.SetErrorString("remove operation takes one or more array index");
+            }
+            break;
+
+        case eVarSetOperationInvalid:
+            error = OptionValue::SetValueFromCString (value, op);
+            break;
+    }
+    return error;
+
+    m_value_was_set = true;
+    return Error();
+}
+
+lldb::OptionValueSP
+OptionValueFileSpecList::DeepCopy () const
+{
+    return OptionValueSP(new OptionValueFileSpecList(*this));
+}
+
+

Added: lldb/trunk/source/Interpreter/OptionValueFormat.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/OptionValueFormat.cpp?rev=162366&view=auto
==============================================================================
--- lldb/trunk/source/Interpreter/OptionValueFormat.cpp (added)
+++ lldb/trunk/source/Interpreter/OptionValueFormat.cpp Wed Aug 22 12:17:09 2012
@@ -0,0 +1,76 @@
+//===-- OptionValueFormat.cpp -----------------------------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "lldb/Interpreter/OptionValueFormat.h"
+
+// C Includes
+// C++ Includes
+// Other libraries and framework includes
+// Project includes
+#include "lldb/Core/FormatManager.h"
+#include "lldb/Core/Stream.h"
+#include "lldb/Interpreter/Args.h"
+
+using namespace lldb;
+using namespace lldb_private;
+
+void
+OptionValueFormat::DumpValue (const ExecutionContext *exe_ctx, Stream &strm, uint32_t dump_mask)
+{
+    if (dump_mask & eDumpOptionType)
+        strm.Printf ("(%s)", GetTypeAsCString ());
+    if (dump_mask & eDumpOptionValue)
+    {
+        if (dump_mask & eDumpOptionType)
+            strm.PutCString (" = ");
+        strm.PutCString (FormatManager::GetFormatAsCString (m_current_value));
+    }
+}
+
+Error
+OptionValueFormat::SetValueFromCString (const char *value_cstr, VarSetOperationType op)
+{
+    Error error;
+    switch (op)
+    {
+    case eVarSetOperationClear:
+        Clear();
+        break;
+        
+    case eVarSetOperationReplace:
+    case eVarSetOperationAssign:
+        {
+            Format new_format;
+            error = Args::StringToFormat (value_cstr, new_format, NULL);
+            if (error.Success())
+            {
+                m_value_was_set = true;
+                m_current_value = new_format;
+            }
+        }
+        break;
+        
+    case eVarSetOperationInsertBefore:
+    case eVarSetOperationInsertAfter:
+    case eVarSetOperationRemove:
+    case eVarSetOperationAppend:
+    case eVarSetOperationInvalid:
+        error = OptionValue::SetValueFromCString (value_cstr, op);
+        break;
+    }
+    return error;
+}
+
+
+lldb::OptionValueSP
+OptionValueFormat::DeepCopy () const
+{
+    return OptionValueSP(new OptionValueFormat(*this));
+}
+

Added: lldb/trunk/source/Interpreter/OptionValuePathMappings.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/OptionValuePathMappings.cpp?rev=162366&view=auto
==============================================================================
--- lldb/trunk/source/Interpreter/OptionValuePathMappings.cpp (added)
+++ lldb/trunk/source/Interpreter/OptionValuePathMappings.cpp Wed Aug 22 12:17:09 2012
@@ -0,0 +1,185 @@
+//===-- OptionValuePathMappings.cpp -----------------------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "lldb/Interpreter/OptionValuePathMappings.h"
+
+// C Includes
+// C++ Includes
+// Other libraries and framework includes
+// Project includes
+#include "lldb/Core/Stream.h"
+#include "lldb/Interpreter/Args.h"
+
+using namespace lldb;
+using namespace lldb_private;
+
+void
+OptionValuePathMappings::DumpValue (const ExecutionContext *exe_ctx, Stream &strm, uint32_t dump_mask)
+{
+    if (dump_mask & eDumpOptionType)
+        strm.Printf ("(%s)", GetTypeAsCString ());
+    if (dump_mask & eDumpOptionValue)
+    {
+        if (dump_mask & eDumpOptionType)
+            strm.Printf (" =%s", (m_path_mappings.GetSize() > 0) ? "\n" : "");
+        m_path_mappings.Dump(&strm);
+    }
+}
+
+Error
+OptionValuePathMappings::SetValueFromCString (const char *value, VarSetOperationType op)
+{
+    Error error;
+    Args args(value);
+    const size_t argc = args.GetArgumentCount();
+
+    switch (op)
+    {
+        case eVarSetOperationClear:
+            Clear ();
+            break;
+            
+        case eVarSetOperationReplace:
+            // Must be at least one index + 1 pair of paths, and the pair count must be even
+            if (argc >= 3 && (((argc - 1) & 1) == 0))
+            {
+                uint32_t idx = Args::StringToUInt32(args.GetArgumentAtIndex(0), UINT32_MAX);
+                const uint32_t count = m_path_mappings.GetSize();
+                if (idx > count)
+                {
+                    error.SetErrorStringWithFormat("invalid file list index %u, index must be 0 through %u", idx, count);
+                }
+                else
+                {
+                    for (size_t i=1; i<argc; i += 2, ++idx)
+                    {
+                        ConstString a(args.GetArgumentAtIndex(i));
+                        ConstString b(args.GetArgumentAtIndex(i+1));
+                        if (!m_path_mappings.Replace (a, b, idx, m_notify_changes))
+                            m_path_mappings.Append(a, b, m_notify_changes);
+                    }
+                }
+            }
+            else
+            {
+                error.SetErrorString("replace operation takes an array index followed by one or more path pairs");
+            }
+            break;
+            
+            
+            
+        case eVarSetOperationAssign:
+            if (argc < 2 || (argc & 1))
+            {
+                error.SetErrorString("assign operation takes one or more path pairs");
+                break;
+            }
+            m_path_mappings.Clear(m_notify_changes);
+            // Fall through to append case
+        case eVarSetOperationAppend:
+            if (argc < 2 || (argc & 1))
+            {
+                error.SetErrorString("append operation takes one or more path pairs");
+                break;
+            }
+            else
+            {
+                for (size_t i=0; i<argc; i += 2)
+                {
+                    ConstString a(args.GetArgumentAtIndex(i));
+                    ConstString b(args.GetArgumentAtIndex(i+1));
+                    m_path_mappings.Append(a, b, m_notify_changes);
+                    m_value_was_set = true;
+                }
+            }
+            break;
+            
+        case eVarSetOperationInsertBefore:
+        case eVarSetOperationInsertAfter:
+            // Must be at least one index + 1 pair of paths, and the pair count must be even
+            if (argc >= 3 && (((argc - 1) & 1) == 0))
+            {
+                uint32_t idx = Args::StringToUInt32(args.GetArgumentAtIndex(0), UINT32_MAX);
+                const uint32_t count = m_path_mappings.GetSize();
+                if (idx > count)
+                {
+                    error.SetErrorStringWithFormat("invalid file list index %u, index must be 0 through %u", idx, count);
+                }
+                else
+                {
+                    if (op == eVarSetOperationInsertAfter)
+                        ++idx;
+                    for (size_t i=1; i<argc; i += 2, ++idx)
+                    {
+                        ConstString a(args.GetArgumentAtIndex(i));
+                        ConstString b(args.GetArgumentAtIndex(i+1));
+                        m_path_mappings.Insert (a, b, idx, m_notify_changes);
+                    }
+                }
+            }
+            else
+            {
+                error.SetErrorString("insert operation takes an array index followed by one or more path pairs");
+            }
+            break;
+            
+        case eVarSetOperationRemove:
+            if (argc > 0)
+            {
+                std::vector<int> remove_indexes;
+                bool all_indexes_valid = true;
+                size_t i;
+                for (i=0; all_indexes_valid && i<argc; ++i)
+                {
+                    const int idx = Args::StringToSInt32(args.GetArgumentAtIndex(i), INT32_MAX);
+                    if (idx == INT32_MAX)
+                        all_indexes_valid = false;
+                    else
+                        remove_indexes.push_back(idx);
+                }
+                
+                if (all_indexes_valid)
+                {
+                    size_t num_remove_indexes = remove_indexes.size();
+                    if (num_remove_indexes)
+                    {
+                        // Sort and then erase in reverse so indexes are always valid
+                        std::sort(remove_indexes.begin(), remove_indexes.end());
+                        for (int i=num_remove_indexes-1; i<num_remove_indexes; ++i)
+                        {
+                            m_path_mappings.Remove (i, m_notify_changes);
+                        }
+                    }
+                }
+                else
+                {
+                    error.SetErrorStringWithFormat("invalid array index '%s', aborting remove operation", args.GetArgumentAtIndex(i));
+                }
+            }
+            else
+            {
+                error.SetErrorString("remove operation takes one or more array index");
+            }
+            break;
+
+        case eVarSetOperationInvalid:
+            error = OptionValue::SetValueFromCString (value, op);
+            break;
+    }
+    return error;
+
+    m_value_was_set = true;
+    return Error();
+}
+
+lldb::OptionValueSP
+OptionValuePathMappings::DeepCopy () const
+{
+    return OptionValueSP(new OptionValuePathMappings(*this));
+}

Added: lldb/trunk/source/Interpreter/OptionValueProperties.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/OptionValueProperties.cpp?rev=162366&view=auto
==============================================================================
--- lldb/trunk/source/Interpreter/OptionValueProperties.cpp (added)
+++ lldb/trunk/source/Interpreter/OptionValueProperties.cpp Wed Aug 22 12:17:09 2012
@@ -0,0 +1,719 @@
+//===-- OptionValueProperties.cpp ---------------------------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "lldb/Interpreter/OptionValueProperties.h"
+
+// C Includes
+// C++ Includes
+// Other libraries and framework includes
+// Project includes
+#include "lldb/Core/Flags.h"
+#include "lldb/Core/Stream.h"
+#include "lldb/Core/StringList.h"
+#include "lldb/Core/UserSettingsController.h"
+#include "lldb/Interpreter/Args.h"
+#include "lldb/Interpreter/OptionValues.h"
+#include "lldb/Interpreter/Property.h"
+
+using namespace lldb;
+using namespace lldb_private;
+
+
+OptionValueProperties::OptionValueProperties (const ConstString &name) :
+    m_name (name)
+{
+}
+
+OptionValueProperties::OptionValueProperties (const OptionValueProperties &global_properties) :
+    m_name (global_properties.m_name),
+    m_properties (global_properties.m_properties),
+    m_name_to_index (global_properties.m_name_to_index)
+{
+    // We now have an exact copy of "global_properties". We need to now
+    // find all non-global settings and copy the property values so that
+    // all non-global settings get new OptionValue instances created for
+    // them.
+    const size_t num_properties = m_properties.size();
+    for (size_t i=0; i<num_properties; ++i)
+    {
+        // Duplicate any values that are not global when contructing properties from
+        // a global copy
+        if (m_properties[i].IsGlobal() == false)
+        {
+            lldb::OptionValueSP new_value_sp (m_properties[i].GetValue()->DeepCopy());
+            m_properties[i].SetOptionValue(new_value_sp);
+        }
+    }
+}
+
+
+
+size_t
+OptionValueProperties::GetNumProperties() const
+{
+    return m_properties.size();
+}
+
+
+void
+OptionValueProperties::Initialize (const PropertyDefinition *defs)
+{
+    for (size_t i=0; defs[i].name; ++i)
+    {
+        Property property(defs[i]);
+        assert(property.IsValid());
+        m_name_to_index.Append(property.GetName().GetCString(),m_properties.size());
+        property.GetValue()->SetParent(shared_from_this());
+        m_properties.push_back(property);
+    }
+    m_name_to_index.Sort();
+}
+
+void
+OptionValueProperties::AppendProperty(const ConstString &name,
+                                      const ConstString &desc,
+                                      bool is_global,
+                                      const OptionValueSP &value_sp)
+{
+    Property property(name, desc, is_global, value_sp);
+    m_name_to_index.Append(name.GetCString(),m_properties.size());
+    m_properties.push_back(property);
+    value_sp->SetParent (shared_from_this());
+    m_name_to_index.Sort();
+}
+
+
+
+//bool
+//OptionValueProperties::GetQualifiedName (Stream &strm)
+//{
+//    bool dumped_something = false;
+////    lldb::OptionValuePropertiesSP parent_sp(GetParent ());
+////    if (parent_sp)
+////    {
+////        parent_sp->GetQualifiedName (strm);
+////        strm.PutChar('.');
+////        dumped_something = true;
+////    }
+//    if (m_name)
+//    {
+//        strm << m_name;
+//        dumped_something = true;
+//    }
+//    return dumped_something;
+//}
+//
+lldb::OptionValueSP
+OptionValueProperties::GetValueForKey  (const ExecutionContext *exe_ctx,
+                                        const ConstString &key,
+                                        bool will_modify) const
+{
+    lldb::OptionValueSP value_sp;
+    size_t idx = m_name_to_index.Find (key.GetCString(), SIZE_MAX);
+    if (idx < m_properties.size())
+        value_sp = GetPropertyAtIndex(exe_ctx, will_modify, idx)->GetValue();
+    return value_sp;
+}
+
+lldb::OptionValueSP
+OptionValueProperties::GetSubValue (const ExecutionContext *exe_ctx,
+                                    const char *name,
+                                    bool will_modify,
+                                    Error &error) const
+{
+    lldb::OptionValueSP value_sp;
+    
+    if (name && name[0])
+    {
+        const char *sub_name = NULL;
+        ConstString key;
+        size_t key_len = ::strcspn (name, ".[{");
+        
+        if (name[key_len])
+        {
+            key.SetCStringWithLength (name, key_len);
+            sub_name = name + key_len;
+        }
+        else
+            key.SetCString (name);
+        
+        value_sp = GetValueForKey (exe_ctx, key, will_modify);
+        if (sub_name && value_sp)
+        {
+            switch (sub_name[0])
+            {
+            case '.':
+                return value_sp->GetSubValue (exe_ctx, sub_name + 1, will_modify, error);
+            
+            case '{':
+                // Predicate matching for predicates like
+                // "<setting-name>{<predicate>}"
+                // strings are parsed by the current OptionValueProperties subclass
+                // to mean whatever they want to. For instance a subclass of
+                // OptionValueProperties for a lldb_private::Target might implement:
+                // "target.run-args{arch==i386}"   -- only set run args if the arch is i386
+                // "target.run-args{path=/tmp/a/b/c/a.out}" -- only set run args if the path matches
+                // "target.run-args{basename==test&&arch==x86_64}" -- only set run args if exectable basename is "test" and arch is "x86_64"
+                if (sub_name[1])
+                {
+                    const char *predicate_start = sub_name + 1;
+                    const char *predicate_end = strchr(predicate_start, '}');
+                    if (predicate_end)
+                    {
+                        std::string predicate(predicate_start, predicate_end);
+                        if (PredicateMatches(exe_ctx, predicate.c_str()))
+                        {
+                            if (predicate_end[1])
+                            {
+                                // Still more subvalue string to evaluate
+                                return value_sp->GetSubValue (exe_ctx, predicate_end + 1, will_modify, error);
+                            }
+                            else
+                            {
+                                // We have a match!
+                                break;
+                            }
+                        }
+                    }
+                }
+                // Predicate didn't match or wasn't correctly formed
+                value_sp.reset();
+                break;
+            
+            case '[':
+                // Array or dictionary access for subvalues like:
+                // "[12]"       -- access 12th array element
+                // "['hello']"  -- dictionary access of key named hello
+                return value_sp->GetSubValue (exe_ctx, sub_name, will_modify, error);
+
+            default:
+                value_sp.reset();
+                break;
+            }
+        }
+    }
+    return value_sp;
+}
+
+Error
+OptionValueProperties::SetSubValue (const ExecutionContext *exe_ctx,
+                                    VarSetOperationType op,
+                                    const char *name,
+                                    const char *value)
+{
+    Error error;
+    const bool will_modify = true;
+    lldb::OptionValueSP value_sp (GetSubValue (exe_ctx, name, will_modify, error));
+    if (value_sp)
+        error = value_sp->SetValueFromCString(value, op);
+    else
+    {
+        if (error.AsCString() == NULL)
+            error.SetErrorStringWithFormat("invalid value path '%s'", name);
+    }
+    return error;
+}
+
+
+ConstString
+OptionValueProperties::GetPropertyNameAtIndex (uint32_t idx) const
+{
+    const Property *property = GetPropertyAtIndex(NULL, false, idx);
+    if (property)
+        return property->GetName();
+    return ConstString();
+    
+}
+
+const char *
+OptionValueProperties::GetPropertyDescriptionAtIndex (uint32_t idx) const
+{
+    const Property *property = GetPropertyAtIndex(NULL, false, idx);
+    if (property)
+        return property->GetDescription();
+    return NULL;
+}
+
+uint32_t
+OptionValueProperties::GetPropertyIndex (const ConstString &name) const
+{
+    return m_name_to_index.Find (name.GetCString(), SIZE_MAX);
+}
+
+const Property *
+OptionValueProperties::GetProperty (const ExecutionContext *exe_ctx, bool will_modify, const ConstString &name) const
+{
+    return GetPropertyAtIndex (exe_ctx, will_modify, m_name_to_index.Find (name.GetCString(), SIZE_MAX));
+}
+
+const Property *
+OptionValueProperties::GetPropertyAtIndex (const ExecutionContext *exe_ctx, bool will_modify, uint32_t idx) const
+{
+    return ProtectedGetPropertyAtIndex (idx);
+}
+
+lldb::OptionValueSP
+OptionValueProperties::GetPropertyValueAtIndex (const ExecutionContext *exe_ctx,
+                                                bool will_modify,
+                                                uint32_t idx) const
+{
+    const Property *setting = GetPropertyAtIndex (exe_ctx, will_modify, idx);
+    if (setting)
+        return setting->GetValue();
+    return OptionValueSP();
+}
+
+OptionValuePathMappings *
+OptionValueProperties::GetPropertyAtIndexAsOptionValuePathMappings (const ExecutionContext *exe_ctx, bool will_modify, uint32_t idx) const
+{
+    OptionValueSP value_sp(GetPropertyValueAtIndex (exe_ctx, will_modify, idx));
+    if (value_sp)
+        return value_sp->GetAsPathMappings();
+    return NULL;
+}
+
+OptionValueFileSpecList *
+OptionValueProperties::GetPropertyAtIndexAsOptionValueFileSpecList (const ExecutionContext *exe_ctx, bool will_modify, uint32_t idx) const
+{
+    OptionValueSP value_sp(GetPropertyValueAtIndex (exe_ctx, will_modify, idx));
+    if (value_sp)
+        return value_sp->GetAsFileSpecList();
+    return NULL;    
+}
+
+OptionValueArch *
+OptionValueProperties::GetPropertyAtIndexAsOptionValueArch (const ExecutionContext *exe_ctx, uint32_t idx) const
+{
+    const Property *property = GetPropertyAtIndex (exe_ctx, false, idx);
+    if (property)
+        return property->GetValue()->GetAsArch();
+    return NULL;
+}
+
+bool
+OptionValueProperties::GetPropertyAtIndexAsArgs (const ExecutionContext *exe_ctx, uint32_t idx, Args &args) const
+{
+    const Property *property = GetPropertyAtIndex (exe_ctx, false, idx);
+    if (property)
+    {
+        OptionValue *value = property->GetValue().get();
+        if (value)
+        {
+            const OptionValueArray *array = value->GetAsArray();
+            if (array)
+                return array->GetArgs(args);
+            else
+            {
+                const OptionValueDictionary *dict = value->GetAsDictionary();
+                if (dict)
+                    return dict->GetArgs(args);
+            }
+        }
+    }
+    return false;
+}
+
+bool
+OptionValueProperties::SetPropertyAtIndexFromArgs (const ExecutionContext *exe_ctx, uint32_t idx, const Args &args)
+{
+    const Property *property = GetPropertyAtIndex (exe_ctx, true, idx);
+    if (property)
+    {
+        OptionValue *value = property->GetValue().get();
+        if (value)
+        {
+            OptionValueArray *array = value->GetAsArray();
+            if (array)
+                return array->SetArgs(args, eVarSetOperationAssign).Success();
+            else
+            {
+                OptionValueDictionary *dict = value->GetAsDictionary();
+                if (dict)
+                    return dict->SetArgs(args, eVarSetOperationAssign).Success();
+            }
+        }
+    }
+    return false;
+}
+
+bool
+OptionValueProperties::GetPropertyAtIndexAsBoolean (const ExecutionContext *exe_ctx, uint32_t idx, bool fail_value) const
+{
+    const Property *property = GetPropertyAtIndex (exe_ctx, false, idx);
+    if (property)
+    {
+        OptionValue *value = property->GetValue().get();
+        if (value)
+            return value->GetBooleanValue(fail_value);
+    }
+    return fail_value;
+}
+
+bool
+OptionValueProperties::SetPropertyAtIndexAsBoolean (const ExecutionContext *exe_ctx, uint32_t idx, bool new_value)
+{
+    const Property *property = GetPropertyAtIndex (exe_ctx, true, idx);
+    if (property)
+    {
+        OptionValue *value = property->GetValue().get();
+        if (value)
+        {
+            value->SetBooleanValue(new_value);
+            return true;
+        }
+    }
+    return false;
+}
+
+OptionValueDictionary *
+OptionValueProperties::GetPropertyAtIndexAsOptionValueDictionary (const ExecutionContext *exe_ctx, uint32_t idx) const
+{
+    const Property *property = GetPropertyAtIndex (exe_ctx, false, idx);
+    if (property)
+        return property->GetValue()->GetAsDictionary();
+    return NULL;
+}
+
+int64_t
+OptionValueProperties::GetPropertyAtIndexAsEnumeration (const ExecutionContext *exe_ctx, uint32_t idx, int64_t fail_value) const
+{
+    const Property *property = GetPropertyAtIndex (exe_ctx, false, idx);
+    if (property)
+    {
+        OptionValue *value = property->GetValue().get();
+        if (value)
+            return value->GetEnumerationValue(fail_value);
+    }
+    return fail_value;
+}
+
+bool
+OptionValueProperties::SetPropertyAtIndexAsEnumeration (const ExecutionContext *exe_ctx, uint32_t idx, int64_t new_value)
+{
+    const Property *property = GetPropertyAtIndex (exe_ctx, true, idx);
+    if (property)
+    {
+        OptionValue *value = property->GetValue().get();
+        if (value)
+            return value->SetEnumerationValue(new_value);
+    }
+    return false;
+}
+
+
+FileSpec
+OptionValueProperties::GetPropertyAtIndexAsFileSpec (const ExecutionContext *exe_ctx, uint32_t idx) const
+{
+    const Property *property = GetPropertyAtIndex (exe_ctx, false, idx);
+    if (property)
+    {
+        OptionValue *value = property->GetValue().get();
+        if (value)
+            return value->GetFileSpecValue();
+    }
+    return FileSpec();
+}
+
+
+bool
+OptionValueProperties::SetPropertyAtIndexAsFileSpec (const ExecutionContext *exe_ctx, uint32_t idx, const FileSpec &new_file_spec)
+{
+    const Property *property = GetPropertyAtIndex (exe_ctx, true, idx);
+    if (property)
+    {
+        OptionValue *value = property->GetValue().get();
+        if (value)
+            return value->SetFileSpecValue(new_file_spec);
+    }
+    return false;
+}
+
+const RegularExpression *
+OptionValueProperties::GetPropertyAtIndexAsOptionValueRegex (const ExecutionContext *exe_ctx, uint32_t idx) const
+{
+    const Property *property = GetPropertyAtIndex (exe_ctx, false, idx);
+    if (property)
+    {
+        OptionValue *value = property->GetValue().get();
+        if (value)
+            return value->GetRegexValue();
+    }
+    return NULL;
+}
+
+OptionValueSInt64 *
+OptionValueProperties::GetPropertyAtIndexAsOptionValueSInt64 (const ExecutionContext *exe_ctx, uint32_t idx) const
+{
+    const Property *property = GetPropertyAtIndex (exe_ctx, false, idx);
+    if (property)
+    {
+        OptionValue *value = property->GetValue().get();
+        if (value)
+            return value->GetAsSInt64();
+    }
+    return NULL;
+}
+
+int64_t
+OptionValueProperties::GetPropertyAtIndexAsSInt64 (const ExecutionContext *exe_ctx, uint32_t idx, int64_t fail_value) const
+{
+    const Property *property = GetPropertyAtIndex (exe_ctx, false, idx);
+    if (property)
+    {
+        OptionValue *value = property->GetValue().get();
+        if (value)
+            return value->GetSInt64Value(fail_value);
+    }
+    return fail_value;
+}
+
+bool
+OptionValueProperties::SetPropertyAtIndexAsSInt64 (const ExecutionContext *exe_ctx, uint32_t idx, int64_t new_value)
+{
+    const Property *property = GetPropertyAtIndex (exe_ctx, true, idx);
+    if (property)
+    {
+        OptionValue *value = property->GetValue().get();
+        if (value)
+            return value->SetSInt64Value(new_value);
+    }
+    return false;
+}
+
+const char *
+OptionValueProperties::GetPropertyAtIndexAsString (const ExecutionContext *exe_ctx, uint32_t idx, const char *fail_value) const
+{
+    const Property *property = GetPropertyAtIndex (exe_ctx, false, idx);
+    if (property)
+    {
+        OptionValue *value = property->GetValue().get();
+        if (value)
+            return value->GetStringValue(fail_value);
+    }
+    return fail_value;
+}
+
+bool
+OptionValueProperties::SetPropertyAtIndexAsString (const ExecutionContext *exe_ctx, uint32_t idx, const char *new_value)
+{
+    const Property *property = GetPropertyAtIndex (exe_ctx, true, idx);
+    if (property)
+    {
+        OptionValue *value = property->GetValue().get();
+        if (value)
+            return value->SetStringValue(new_value);
+    }
+    return false;
+}
+
+uint64_t
+OptionValueProperties::GetPropertyAtIndexAsUInt64 (const ExecutionContext *exe_ctx, uint32_t idx, uint64_t fail_value) const
+{
+    const Property *property = GetPropertyAtIndex (exe_ctx, false, idx);
+    if (property)
+    {
+        OptionValue *value = property->GetValue().get();
+        if (value)
+            return value->GetUInt64Value(fail_value);
+    }
+    return fail_value;
+}
+
+bool
+OptionValueProperties::SetPropertyAtIndexAsUInt64 (const ExecutionContext *exe_ctx, uint32_t idx, uint64_t new_value)
+{
+    const Property *property = GetPropertyAtIndex (exe_ctx, true, idx);
+    if (property)
+    {
+        OptionValue *value = property->GetValue().get();
+        if (value)
+            return value->SetUInt64Value(new_value);
+    }
+    return false;
+}
+
+bool
+OptionValueProperties::Clear ()
+{
+    const size_t num_properties = m_properties.size();
+    for (size_t i=0; i<num_properties; ++i)
+        m_properties[i].GetValue()->Clear();
+    return true;
+}
+
+
+Error
+OptionValueProperties::SetValueFromCString (const char *value, VarSetOperationType op)
+{
+    Error error;
+    
+//    Args args(value_cstr);
+//    const size_t argc = args.GetArgumentCount();
+    switch (op)
+    {
+        case eVarSetOperationClear:
+            Clear ();
+            break;
+            
+        case eVarSetOperationReplace:
+        case eVarSetOperationAssign:
+        case eVarSetOperationRemove:
+        case eVarSetOperationInsertBefore:
+        case eVarSetOperationInsertAfter:
+        case eVarSetOperationAppend:
+        case eVarSetOperationInvalid:
+            error = OptionValue::SetValueFromCString (value, op);
+            break;
+    }
+    
+    return error;
+}
+
+void
+OptionValueProperties::DumpValue (const ExecutionContext *exe_ctx, Stream &strm, uint32_t dump_mask)
+{
+    const size_t num_properties = m_properties.size();
+    for (size_t i=0; i<num_properties; ++i)
+    {
+        const Property *property = GetPropertyAtIndex(exe_ctx, false, i);
+        if (property)
+        {
+            OptionValue *option_value = property->GetValue().get();
+            assert (option_value);
+            const bool transparent_value = option_value->ValueIsTransparent ();
+            property->Dump (exe_ctx,
+                            strm,
+                            dump_mask);
+            if (!transparent_value)
+                strm.EOL();
+        }
+    }
+}
+
+Error
+OptionValueProperties::DumpPropertyValue (const ExecutionContext *exe_ctx,
+                                          Stream &strm,
+                                          const char *property_path,
+                                          uint32_t dump_mask)
+{
+    Error error;
+    const bool will_modify = false;
+    lldb::OptionValueSP value_sp (GetSubValue (exe_ctx, property_path, will_modify, error));
+    if (value_sp)
+    {
+        if (!value_sp->ValueIsTransparent ())
+        {
+            if (dump_mask & eDumpOptionName)
+                strm.PutCString (property_path);
+            if (dump_mask & ~eDumpOptionName)
+                strm.PutChar (' ');
+        }
+        value_sp->DumpValue (exe_ctx, strm, dump_mask);
+    }
+    return error;
+}
+
+lldb::OptionValueSP
+OptionValueProperties::DeepCopy () const
+{
+    assert(!"this shouldn't happen");
+}
+
+const Property *
+OptionValueProperties::GetPropertyAtPath (const ExecutionContext *exe_ctx,
+                                          bool will_modify,
+                                          const char *name) const
+{
+    const Property *property = NULL;
+    if (name && name[0])
+    {
+        const char *sub_name = NULL;
+        ConstString key;
+        size_t key_len = ::strcspn (name, ".[{");
+        
+        if (name[key_len])
+        {
+            key.SetCStringWithLength (name, key_len);
+            sub_name = name + key_len;
+        }
+        else
+            key.SetCString (name);
+        
+        property = GetProperty (exe_ctx, will_modify, key);
+        if (sub_name && property)
+        {
+            if (sub_name[0] == '.')
+            {
+                OptionValueProperties *sub_properties = property->GetValue()->GetAsProperties();
+                if (sub_properties)
+                    return sub_properties->GetPropertyAtPath(exe_ctx, will_modify, sub_name + 1);
+            }
+            property = NULL;
+        }
+    }
+    return property;
+}
+
+void
+OptionValueProperties::DumpAllDescriptions (CommandInterpreter &interpreter,
+                                            Stream &strm) const
+{
+    size_t max_name_len = 0;
+    const size_t num_properties = m_properties.size();
+    for (size_t i=0; i<num_properties; ++i)
+    {
+        const Property *property = ProtectedGetPropertyAtIndex(i);
+        if (property)
+            max_name_len = std::max<size_t>(property->GetName().GetLength(), max_name_len);
+    }
+    for (size_t i=0; i<num_properties; ++i)
+    {
+        const Property *property = ProtectedGetPropertyAtIndex(i);
+        if (property)
+            property->DumpDescription (interpreter, strm, max_name_len, false);
+    }
+}
+
+void
+OptionValueProperties::Apropos (const char *keyword, std::vector<const Property *> &matching_properties) const
+{
+    const size_t num_properties = m_properties.size();
+    StreamString strm;
+    for (size_t i=0; i<num_properties; ++i)
+    {
+        const Property *property = ProtectedGetPropertyAtIndex(i);
+        if (property)
+        {
+            const OptionValueProperties *properties = property->GetValue()->GetAsProperties();
+            if (properties)
+            {
+                properties->Apropos (keyword, matching_properties);
+            }
+            else
+            {
+                bool match = false;
+                const char *name = property->GetName().GetCString();
+                if (name && ::strcasestr(name, keyword))
+                    match = true;
+                else
+                {
+                    const char *desc = property->GetDescription();
+                    if (desc && ::strcasestr(desc, keyword))
+                        match = true;
+                }
+                if (match)
+                {
+                    matching_properties.push_back (property);
+                }
+            }
+        }
+    }
+}
+
+

Added: lldb/trunk/source/Interpreter/OptionValueRegex.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/OptionValueRegex.cpp?rev=162366&view=auto
==============================================================================
--- lldb/trunk/source/Interpreter/OptionValueRegex.cpp (added)
+++ lldb/trunk/source/Interpreter/OptionValueRegex.cpp Wed Aug 22 12:17:09 2012
@@ -0,0 +1,86 @@
+//===-- OptionValueRegex.cpp ------------------------------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "lldb/Interpreter/OptionValueRegex.h"
+
+// C Includes
+// C++ Includes
+// Other libraries and framework includes
+// Project includes
+#include "lldb/Core/Stream.h"
+
+using namespace lldb;
+using namespace lldb_private;
+
+void
+OptionValueRegex::DumpValue (const ExecutionContext *exe_ctx, Stream &strm, uint32_t dump_mask)
+{
+    if (dump_mask & eDumpOptionType)
+        strm.Printf ("(%s)", GetTypeAsCString ());
+    if (dump_mask & eDumpOptionValue)
+    {
+        if (dump_mask & eDumpOptionType)
+            strm.PutCString (" = ");
+        if (m_regex.IsValid())
+        {
+            const char *regex_text = m_regex.GetText();
+            if (regex_text && regex_text[0])
+                strm.Printf ("%s", regex_text);
+        }
+        else
+        {
+            
+        }
+    }
+}
+
+Error
+OptionValueRegex::SetValueFromCString (const char *value_cstr,
+                                        VarSetOperationType op)
+{
+    Error error;
+    switch (op)
+    {
+    case eVarSetOperationInvalid:
+    case eVarSetOperationInsertBefore:
+    case eVarSetOperationInsertAfter:
+    case eVarSetOperationRemove:
+    case eVarSetOperationAppend:
+        error = OptionValue::SetValueFromCString (value_cstr, op);
+        break;
+
+    case eVarSetOperationClear:
+        Clear();
+        break;
+
+    case eVarSetOperationReplace:
+    case eVarSetOperationAssign:
+        if (m_regex.Compile (value_cstr, m_regex.GetCompileFlags()))
+        {
+            m_value_was_set = true;
+        }
+        else
+        {
+            char regex_error[1024];
+            if (m_regex.GetErrorAsCString(regex_error, sizeof(regex_error)))
+                error.SetErrorString (regex_error);
+            else
+                error.SetErrorStringWithFormat ("regex error %u", m_regex.GetErrorCode());
+        }
+        break;
+    }
+    return error;
+}
+
+
+lldb::OptionValueSP
+OptionValueRegex::DeepCopy () const
+{
+    return OptionValueSP(new OptionValueRegex(m_regex.GetText(), m_regex.GetCompileFlags()));
+}

Added: lldb/trunk/source/Interpreter/OptionValueSInt64.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/OptionValueSInt64.cpp?rev=162366&view=auto
==============================================================================
--- lldb/trunk/source/Interpreter/OptionValueSInt64.cpp (added)
+++ lldb/trunk/source/Interpreter/OptionValueSInt64.cpp Wed Aug 22 12:17:09 2012
@@ -0,0 +1,89 @@
+//===-- OptionValueSInt64.cpp -----------------------------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "lldb/Interpreter/OptionValueSInt64.h"
+
+// C Includes
+// C++ Includes
+// Other libraries and framework includes
+// Project includes
+#include "lldb/Core/Stream.h"
+#include "lldb/Interpreter/Args.h"
+
+using namespace lldb;
+using namespace lldb_private;
+
+void
+OptionValueSInt64::DumpValue (const ExecutionContext *exe_ctx, Stream &strm, uint32_t dump_mask)
+{
+    //printf ("%p: DumpValue (exe_ctx=%p, strm, mask) m_current_value = %lli\n", this, exe_ctx, m_current_value);
+    if (dump_mask & eDumpOptionType)
+        strm.Printf ("(%s)", GetTypeAsCString ());
+//    if (dump_mask & eDumpOptionName)
+//        DumpQualifiedName (strm);
+    if (dump_mask & eDumpOptionValue)
+    {
+        if (dump_mask & eDumpOptionType)
+            strm.PutCString (" = ");
+        strm.Printf ("%lli", m_current_value);
+    }
+}
+
+Error
+OptionValueSInt64::SetValueFromCString (const char *value_cstr, VarSetOperationType op)
+{
+    //printf ("%p: SetValueFromCString (s=\"%s\", op=%i)\n", this, value_cstr, op);
+    Error error;
+    switch (op)
+    {
+        case eVarSetOperationClear:
+            Clear();
+            break;
+            
+        case eVarSetOperationReplace:
+        case eVarSetOperationAssign:
+            {
+                bool success = false;
+                int64_t value = Args::StringToSInt64 (value_cstr, 0, 0, &success);
+                if (success)
+                {
+                    if (value >= m_min_value && value <= m_max_value)
+                    {
+                        m_value_was_set = true;
+                        m_current_value = value;
+                    }
+                    else
+                        error.SetErrorStringWithFormat ("%lli is out of range, valid values must be between %lli and %lli.",
+                                                        value,
+                                                        m_min_value,
+                                                        m_max_value);
+                }
+                else
+                {
+                    error.SetErrorStringWithFormat ("invalid int64_t string value: '%s'", value_cstr);
+                }
+            }
+            break;
+            
+        case eVarSetOperationInsertBefore:
+        case eVarSetOperationInsertAfter:
+        case eVarSetOperationRemove:
+        case eVarSetOperationAppend:
+        case eVarSetOperationInvalid:
+            error = OptionValue::SetValueFromCString (value_cstr, op);
+            break;
+    }
+    return error;
+}
+
+lldb::OptionValueSP
+OptionValueSInt64::DeepCopy () const
+{
+    return OptionValueSP(new OptionValueSInt64(*this));
+}

Added: lldb/trunk/source/Interpreter/OptionValueString.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/OptionValueString.cpp?rev=162366&view=auto
==============================================================================
--- lldb/trunk/source/Interpreter/OptionValueString.cpp (added)
+++ lldb/trunk/source/Interpreter/OptionValueString.cpp Wed Aug 22 12:17:09 2012
@@ -0,0 +1,77 @@
+//===-- OptionValueString.cpp ------------------------------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "lldb/Interpreter/OptionValueString.h"
+
+// C Includes
+// C++ Includes
+// Other libraries and framework includes
+// Project includes
+#include "lldb/Core/Stream.h"
+
+using namespace lldb;
+using namespace lldb_private;
+
+void
+OptionValueString::DumpValue (const ExecutionContext *exe_ctx, Stream &strm, uint32_t dump_mask)
+{
+    if (dump_mask & eDumpOptionType)
+        strm.Printf ("(%s)", GetTypeAsCString ());
+    if (dump_mask & eDumpOptionValue)
+    {
+        if (dump_mask & eDumpOptionType)
+            strm.PutCString (" = ");
+        if (!m_current_value.empty() || m_value_was_set)
+        {
+            if (dump_mask & eDumpOptionRaw)
+                strm.Printf ("%s", m_current_value.c_str());
+            else
+                strm.Printf ("\"%s\"", m_current_value.c_str());
+        }
+    }
+}
+
+Error
+OptionValueString::SetValueFromCString (const char *value_cstr,
+                                        VarSetOperationType op)
+{
+    Error error;
+    switch (op)
+    {
+    case eVarSetOperationInvalid:
+    case eVarSetOperationInsertBefore:
+    case eVarSetOperationInsertAfter:
+    case eVarSetOperationRemove:
+        error = OptionValue::SetValueFromCString (value_cstr, op);
+        break;
+
+    case eVarSetOperationAppend:
+        if (value_cstr && value_cstr[0])
+            m_current_value += value_cstr;
+        break;
+
+    case eVarSetOperationClear:
+        Clear ();
+        break;
+
+    case eVarSetOperationReplace:
+    case eVarSetOperationAssign:
+        m_value_was_set = true;
+        SetCurrentValue (value_cstr);
+        break;
+    }
+    return error;
+}
+
+
+lldb::OptionValueSP
+OptionValueString::DeepCopy () const
+{
+    return OptionValueSP(new OptionValueString(*this));
+}

Added: lldb/trunk/source/Interpreter/OptionValueUInt64.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/OptionValueUInt64.cpp?rev=162366&view=auto
==============================================================================
--- lldb/trunk/source/Interpreter/OptionValueUInt64.cpp (added)
+++ lldb/trunk/source/Interpreter/OptionValueUInt64.cpp Wed Aug 22 12:17:09 2012
@@ -0,0 +1,89 @@
+//===-- OptionValueUInt64.cpp ------------------------------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "lldb/Interpreter/OptionValueUInt64.h"
+
+// C Includes
+// C++ Includes
+// Other libraries and framework includes
+// Project includes
+#include "lldb/Core/Stream.h"
+#include "lldb/Interpreter/Args.h"
+
+using namespace lldb;
+using namespace lldb_private;
+
+lldb::OptionValueSP
+OptionValueUInt64::Create (const char *value_cstr, Error &error)
+{
+    lldb::OptionValueSP value_sp (new OptionValueUInt64());
+    error = value_sp->SetValueFromCString (value_cstr);
+    if (error.Fail())
+        value_sp.reset();
+    return value_sp;
+}
+
+
+void
+OptionValueUInt64::DumpValue (const ExecutionContext *exe_ctx, Stream &strm, uint32_t dump_mask)
+{
+    if (dump_mask & eDumpOptionType)
+        strm.Printf ("(%s)", GetTypeAsCString ());
+    if (dump_mask & eDumpOptionValue)
+    {
+        if (dump_mask & eDumpOptionType)
+            strm.PutCString (" = ");
+        strm.Printf ("%llu", m_current_value);
+    }
+}
+
+Error
+OptionValueUInt64::SetValueFromCString (const char *value_cstr, VarSetOperationType op)
+{
+    Error error;
+    switch (op)
+    {
+        case eVarSetOperationClear:
+            Clear ();
+            break;
+            
+        case eVarSetOperationReplace:
+        case eVarSetOperationAssign:
+        {
+            bool success = false;
+            uint64_t value = Args::StringToUInt64 (value_cstr, 0, 0, &success);
+            if (success)
+            {
+                m_value_was_set = true;
+                m_current_value = value;
+            }
+            else
+            {
+                error.SetErrorStringWithFormat ("invalid uint64_t string value: '%s'", value_cstr);
+            }
+        }
+            break;
+            
+        case eVarSetOperationInsertBefore:
+        case eVarSetOperationInsertAfter:
+        case eVarSetOperationRemove:
+        case eVarSetOperationAppend:
+        case eVarSetOperationInvalid:
+            error = OptionValue::SetValueFromCString (value_cstr, op);
+            break;
+    }
+    return error;
+}
+
+lldb::OptionValueSP
+OptionValueUInt64::DeepCopy () const
+{
+    return OptionValueSP(new OptionValueUInt64(*this));
+}
+

Added: lldb/trunk/source/Interpreter/OptionValueUUID.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/OptionValueUUID.cpp?rev=162366&view=auto
==============================================================================
--- lldb/trunk/source/Interpreter/OptionValueUUID.cpp (added)
+++ lldb/trunk/source/Interpreter/OptionValueUUID.cpp Wed Aug 22 12:17:09 2012
@@ -0,0 +1,70 @@
+//===-- OptionValueUUID.cpp ------------------------------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "lldb/Interpreter/OptionValueUUID.h"
+
+// C Includes
+// C++ Includes
+// Other libraries and framework includes
+// Project includes
+#include "lldb/Core/Stream.h"
+
+using namespace lldb;
+using namespace lldb_private;
+
+void
+OptionValueUUID::DumpValue (const ExecutionContext *exe_ctx, Stream &strm, uint32_t dump_mask)
+{
+    if (dump_mask & eDumpOptionType)
+        strm.Printf ("(%s)", GetTypeAsCString ());
+    if (dump_mask & eDumpOptionValue)
+    {
+        if (dump_mask & eDumpOptionType)
+            strm.PutCString (" = ");
+        m_uuid.Dump (&strm);
+    }
+}
+
+Error
+OptionValueUUID::SetValueFromCString (const char *value_cstr,
+                                      VarSetOperationType op)
+{
+    Error error;
+    switch (op)
+    {
+        case eVarSetOperationClear:
+            Clear();
+            break;
+            
+        case eVarSetOperationReplace:
+        case eVarSetOperationAssign:
+            {
+                if (m_uuid.SetfromCString(value_cstr) == 0)
+                    error.SetErrorStringWithFormat ("invalid uuid string value '%s'", value_cstr);
+                else
+                    m_value_was_set = true;
+            }
+            break;
+            
+        case eVarSetOperationInsertBefore:
+        case eVarSetOperationInsertAfter:
+        case eVarSetOperationRemove:
+        case eVarSetOperationAppend:
+        case eVarSetOperationInvalid:
+            error = OptionValue::SetValueFromCString (value_cstr, op);
+            break;
+    }
+    return error;
+}
+
+lldb::OptionValueSP
+OptionValueUUID::DeepCopy () const
+{
+    return OptionValueSP(new OptionValueUUID(*this));
+}

Added: lldb/trunk/source/Interpreter/Property.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/Property.cpp?rev=162366&view=auto
==============================================================================
--- lldb/trunk/source/Interpreter/Property.cpp (added)
+++ lldb/trunk/source/Interpreter/Property.cpp Wed Aug 22 12:17:09 2012
@@ -0,0 +1,268 @@
+//===-- Property.cpp --------------------------------------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "lldb/Interpreter/Property.h"
+
+// C Includes
+// C++ Includes
+// Other libraries and framework includes
+// Project includes
+#include "lldb/Core/UserSettingsController.h"
+#include "lldb/Interpreter/Args.h"
+#include "lldb/Interpreter/CommandInterpreter.h"
+#include "lldb/Interpreter/OptionValues.h"
+
+using namespace lldb;
+using namespace lldb_private;
+
+Property::Property (const PropertyDefinition &definition) :
+    m_name (definition.name),
+    m_description (definition.description),
+    m_value_sp (),
+    m_is_global (definition.global)
+{
+    switch (definition.type)
+    {
+        case OptionValue::eTypeInvalid:
+        case OptionValue::eTypeProperties:
+            break;
+        case OptionValue::eTypeArch:
+            // "definition.default_uint_value" is not used
+            // "definition.default_cstr_value" as a string value that represents the default string value for the architecture/triple
+            m_value_sp.reset (new OptionValueArch(definition.default_cstr_value));
+            break;
+            
+        case OptionValue::eTypeArgs:
+            // "definition.default_uint_value" is always a OptionValue::Type
+            m_value_sp.reset (new OptionValueArgs());
+            break;
+            
+        case OptionValue::eTypeArray:
+            // "definition.default_uint_value" is always a OptionValue::Type
+            m_value_sp.reset (new OptionValueArray(OptionValue::ConvertTypeToMask((OptionValue::Type)definition.default_uint_value)));
+            break;
+            
+        case OptionValue::eTypeBoolean:
+            // "definition.default_uint_value" is the default boolean value if
+            // "definition.default_cstr_value" is NULL, otherwise interpret
+            // "definition.default_cstr_value" as a string value that represents the default
+            // value.
+            if (definition.default_cstr_value)
+                m_value_sp.reset (new OptionValueBoolean(Args::StringToBoolean (definition.default_cstr_value, false, NULL)));
+            else
+                m_value_sp.reset (new OptionValueBoolean(definition.default_uint_value != 0));
+            break;
+            
+        case OptionValue::eTypeDictionary:
+            // "definition.default_uint_value" is always a OptionValue::Type
+            m_value_sp.reset (new OptionValueDictionary(OptionValue::ConvertTypeToMask((OptionValue::Type)definition.default_uint_value)));
+            break;
+            
+        case OptionValue::eTypeEnum:
+            // "definition.default_uint_value" is the default enumeration value if
+            // "definition.default_cstr_value" is NULL, otherwise interpret
+            // "definition.default_cstr_value" as a string value that represents the default
+            // value.
+        {
+            OptionValueEnumeration *enum_value = new OptionValueEnumeration(definition.enum_values, definition.default_uint_value);
+            m_value_sp.reset (enum_value);
+            if (definition.default_cstr_value)
+            {
+                if (enum_value->SetValueFromCString(definition.default_cstr_value).Success())
+                {
+                    enum_value->SetDefaultValue(enum_value->GetCurrentValue());
+                    // Call Clear() since we don't want the value to appear as
+                    // having been set since we called SetValueFromCString() above.
+                    // Clear will set the current value to the default and clear
+                    // the boolean that says that the value has been set.
+                    enum_value->Clear();
+                }
+            }
+        }
+            break;
+            
+        case OptionValue::eTypeFileSpec:
+            // "definition.default_uint_value" represents if the "definition.default_cstr_value" should
+            // be resolved or not
+            m_value_sp.reset (new OptionValueFileSpec(FileSpec(definition.default_cstr_value, definition.default_uint_value != 0)));
+            break;
+            
+        case OptionValue::eTypeFileSpecList:
+            // "definition.default_uint_value" is not used for a OptionValue::eTypeFileSpecList
+            m_value_sp.reset (new OptionValueFileSpecList());
+            break;
+            
+        case OptionValue::eTypeFormat:
+            // "definition.default_uint_value" is the default format enumeration value if
+            // "definition.default_cstr_value" is NULL, otherwise interpret
+            // "definition.default_cstr_value" as a string value that represents the default
+            // value.
+        {
+            Format new_format = eFormatInvalid;
+            if (definition.default_cstr_value)
+                Args::StringToFormat (definition.default_cstr_value, new_format, NULL);
+            else
+                new_format = (Format)definition.default_uint_value;
+            m_value_sp.reset (new OptionValueFormat(new_format));
+        }
+            break;
+            
+        case OptionValue::eTypePathMap:
+            // "definition.default_uint_value" tells us if notifications should occur for
+            // path mappings
+            m_value_sp.reset (new OptionValuePathMappings(definition.default_uint_value != 0));
+            break;
+            
+        case OptionValue::eTypeRegex:
+            // "definition.default_uint_value" is used to the regular expression flags
+            // "definition.default_cstr_value" the default regular expression value
+            // value.
+            m_value_sp.reset (new OptionValueRegex(definition.default_cstr_value, definition.default_uint_value));
+            break;
+            
+        case OptionValue::eTypeSInt64:
+            // "definition.default_uint_value" is the default integer value if
+            // "definition.default_cstr_value" is NULL, otherwise interpret
+            // "definition.default_cstr_value" as a string value that represents the default
+            // value.
+            m_value_sp.reset (new OptionValueSInt64(definition.default_cstr_value ? Args::StringToSInt64 (definition.default_cstr_value) : definition.default_uint_value));
+            break;
+            
+        case OptionValue::eTypeUInt64:
+            // "definition.default_uint_value" is the default unsigned integer value if
+            // "definition.default_cstr_value" is NULL, otherwise interpret
+            // "definition.default_cstr_value" as a string value that represents the default
+            // value.
+            m_value_sp.reset (new OptionValueUInt64(definition.default_cstr_value ? Args::StringToUInt64 (definition.default_cstr_value) : definition.default_uint_value));
+            break;
+            
+        case OptionValue::eTypeUUID:
+            // "definition.default_uint_value" is not used for a OptionValue::eTypeUUID
+            // "definition.default_cstr_value" can contain a default UUID value
+        {
+            UUID uuid;
+            if (definition.default_cstr_value)
+                uuid.SetfromCString (definition.default_cstr_value);
+            m_value_sp.reset (new OptionValueUUID(uuid));
+        }
+            break;
+            
+        case OptionValue::eTypeString:
+            // "definition.default_uint_value" is not used for a OptionValueFileSpecList
+            // "definition.default_cstr_value" can contain a default string value
+            m_value_sp.reset (new OptionValueString(definition.default_cstr_value));
+            break;
+    }
+}
+
+Property::Property (const ConstString &name,
+                    const ConstString &desc,
+                    bool is_global,
+                    const lldb::OptionValueSP &value_sp) :
+    m_name (name),
+    m_description (desc),
+    m_value_sp (value_sp),
+    m_is_global (is_global)
+{
+}
+
+bool
+Property::DumpQualifiedName(Stream &strm) const
+{
+    if (m_name)
+    {
+        if (m_value_sp->DumpQualifiedName(strm))
+            strm.PutChar('.');
+        strm << m_name;
+        return true;
+    }
+    return false;
+}
+
+
+void
+Property::Dump (const ExecutionContext *exe_ctx, Stream &strm, uint32_t dump_mask) const
+{
+    if (m_value_sp)
+    {
+        const bool dump_desc = dump_mask & OptionValue::eDumpOptionDescription;
+        const bool transparent = m_value_sp->ValueIsTransparent ();
+        if (dump_desc || !transparent)
+        {
+            if ((dump_mask & OptionValue::eDumpOptionName) && m_name)
+            {
+                DumpQualifiedName(strm);
+                if (dump_mask & ~OptionValue::eDumpOptionName)
+                    strm.PutChar(' ');
+            }
+        }
+        if (dump_desc)
+        {
+            const char *desc = GetDescription();
+            if (desc)
+                strm.Printf ("-- %s", desc);
+            
+            if (transparent && (dump_mask == (OptionValue::eDumpOptionName | OptionValue::eDumpOptionDescription)))
+                strm.EOL();
+        }
+        m_value_sp->DumpValue(exe_ctx, strm, dump_mask);
+    }
+}
+
+
+void
+Property::DumpDescription (CommandInterpreter &interpreter,
+                           Stream &strm,
+                           uint32_t output_width,
+                           bool display_qualified_name) const
+{
+    if (m_value_sp)
+    {
+        const char *desc = GetDescription();
+
+        if (desc)
+        {
+            StreamString qualified_name;
+            const OptionValueProperties *sub_properties = m_value_sp->GetAsProperties();
+            if (sub_properties)
+            {
+                strm.EOL();
+                
+                if (m_value_sp->DumpQualifiedName(qualified_name))
+                    strm.Printf("'%s' variables:\n\n", qualified_name.GetString().c_str());
+                sub_properties->DumpAllDescriptions(interpreter, strm);
+            }
+            else
+            {
+                if (desc)
+                {
+                    if (display_qualified_name)
+                    {
+                        StreamString qualified_name;
+                        DumpQualifiedName(qualified_name);
+                        interpreter.OutputFormattedHelpText (strm,
+                                                             qualified_name.GetString().c_str(),
+                                                             "--",
+                                                             desc,
+                                                             output_width);
+                    }
+                    else
+                    {
+                        interpreter.OutputFormattedHelpText (strm,
+                                                             m_name.GetCString(),
+                                                             "--",
+                                                             desc,
+                                                             output_width);
+                    }
+                }
+            }
+        }
+    }
+}
+

Modified: lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp?rev=162366&r1=162365&r2=162366&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp (original)
+++ lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp Wed Aug 22 12:17:09 2012
@@ -16,6 +16,8 @@
 #include "lldb/Core/ConstString.h"
 #include "lldb/Core/PluginManager.h"
 #include "lldb/Core/Stream.h"
+#include "lldb/Interpreter/OptionValueArray.h"
+#include "lldb/Interpreter/OptionValueDictionary.h"
 #include "lldb/Symbol/UnwindPlan.h"
 
 #include "Plugins/Process/Utility/ARMDefines.h"

Modified: lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.h?rev=162366&r1=162365&r2=162366&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.h (original)
+++ lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.h Wed Aug 22 12:17:09 2012
@@ -12,7 +12,6 @@
 
 #include "lldb/Core/EmulateInstruction.h"
 #include "lldb/Core/Error.h"
-#include "lldb/Interpreter/NamedOptionValue.h"
 #include "Plugins/Process/Utility/ARMDefines.h"
 
 namespace lldb_private {

Modified: lldb/trunk/source/Plugins/Instruction/ARM/EmulationStateARM.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Instruction/ARM/EmulationStateARM.cpp?rev=162366&r1=162365&r2=162366&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Instruction/ARM/EmulationStateARM.cpp (original)
+++ lldb/trunk/source/Plugins/Instruction/ARM/EmulationStateARM.cpp Wed Aug 22 12:17:09 2012
@@ -11,6 +11,8 @@
 
 #include "lldb/Core/RegisterValue.h"
 #include "lldb/Core/Scalar.h"
+#include "lldb/Interpreter/OptionValueArray.h"
+#include "lldb/Interpreter/OptionValueDictionary.h"
 #include "lldb/Target/StackFrame.h"
 #include "lldb/Target/RegisterContext.h"
 

Modified: lldb/trunk/source/Plugins/Instruction/ARM/EmulationStateARM.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Instruction/ARM/EmulationStateARM.h?rev=162366&r1=162365&r2=162366&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Instruction/ARM/EmulationStateARM.h (original)
+++ lldb/trunk/source/Plugins/Instruction/ARM/EmulationStateARM.h Wed Aug 22 12:17:09 2012
@@ -14,7 +14,6 @@
 
 #include "lldb/Core/EmulateInstruction.h"
 #include "lldb/Core/Opcode.h"
-#include "lldb/Interpreter/NamedOptionValue.h"
 
 class EmulationStateARM {
 public: 

Modified: lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp?rev=162366&r1=162365&r2=162366&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp (original)
+++ lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp Wed Aug 22 12:17:09 2012
@@ -18,14 +18,13 @@
 #include "lldb/Breakpoint/StoppointCallbackContext.h"
 #include "lldb/Core/ConstString.h"
 #include "lldb/Core/Debugger.h"
-#include "lldb/Host/FileSpec.h"
 #include "lldb/Core/Log.h"
 #include "lldb/Core/Module.h"
 #include "lldb/Core/Value.h"
 #include "lldb/Expression/ClangExpression.h"
 #include "lldb/Expression/ClangFunction.h"
 #include "lldb/Expression/ClangUtilityFunction.h"
-
+#include "lldb/Host/FileSpec.h"
 #include "lldb/Symbol/ClangASTContext.h"
 #include "lldb/Target/ObjCLanguageRuntime.h"
 #include "lldb/Target/Process.h"

Modified: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp?rev=162366&r1=162365&r2=162366&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp (original)
+++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp Wed Aug 22 12:17:09 2012
@@ -864,3 +864,14 @@
     return bp_sp;
 }
 
+size_t
+PlatformDarwin::GetEnvironment (StringList &env)
+{
+    if (IsRemote())
+    {
+        if (m_remote_platform_sp)
+            return m_remote_platform_sp->GetEnvironment(env);
+        return 0;
+    }
+    return Host::GetEnvironment(env);
+}

Modified: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.h?rev=162366&r1=162365&r2=162366&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.h (original)
+++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.h Wed Aug 22 12:17:09 2012
@@ -98,7 +98,10 @@
 
     virtual bool
     ModuleIsExcludedForNonModuleSpecificSearches (lldb_private::Target &target, const lldb::ModuleSP &module_sp);
-                
+    
+    virtual size_t
+    GetEnvironment (lldb_private::StringList &environment);
+
     bool
     ARMGetSupportedArchitectureAtIndex (uint32_t idx, lldb_private::ArchSpec &arch);
     

Modified: lldb/trunk/source/Target/PathMappingList.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/PathMappingList.cpp?rev=162366&r1=162365&r2=162366&view=diff
==============================================================================
--- lldb/trunk/source/Target/PathMappingList.cpp (original)
+++ lldb/trunk/source/Target/PathMappingList.cpp Wed Aug 22 12:17:09 2012
@@ -112,6 +112,21 @@
 }
 
 bool
+PathMappingList::Replace (const ConstString &path,
+                          const ConstString &replacement,
+                          uint32_t index,
+                          bool notify)
+{
+    iterator insert_iter;
+    if (index >= m_pairs.size())
+        return false;
+    m_pairs[index] = pair(path, replacement);
+    if (notify && m_callback)
+        m_callback (*this, m_callback_baton);
+    return true;
+}
+
+bool
 PathMappingList::Remove (off_t index, bool notify)
 {
     if (index >= m_pairs.size())

Modified: lldb/trunk/source/Target/Platform.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Platform.cpp?rev=162366&r1=162365&r2=162366&view=diff
==============================================================================
--- lldb/trunk/source/Target/Platform.cpp (original)
+++ lldb/trunk/source/Target/Platform.cpp Wed Aug 22 12:17:09 2012
@@ -685,3 +685,10 @@
     return lldb::BreakpointSP();
 }
 
+size_t
+Platform::GetEnvironment (StringList &environment)
+{
+    environment.Clear();
+    return false;
+}
+

Modified: lldb/trunk/source/Target/Process.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Process.cpp?rev=162366&r1=162365&r2=162366&view=diff
==============================================================================
--- lldb/trunk/source/Target/Process.cpp (original)
+++ lldb/trunk/source/Target/Process.cpp Wed Aug 22 12:17:09 2012
@@ -41,6 +41,109 @@
 using namespace lldb;
 using namespace lldb_private;
 
+
+// Comment out line below to disable memory caching, overriding the process setting
+// target.process.disable-memory-cache
+#define ENABLE_MEMORY_CACHING
+
+#ifdef ENABLE_MEMORY_CACHING
+#define DISABLE_MEM_CACHE_DEFAULT false
+#else
+#define DISABLE_MEM_CACHE_DEFAULT true
+#endif
+
+class ProcessOptionValueProperties : public OptionValueProperties
+{
+public:
+    ProcessOptionValueProperties (const ConstString &name) :
+        OptionValueProperties (name)
+    {
+    }
+    
+    // This constructor is used when creating ProcessOptionValueProperties when it
+    // is part of a new lldb_private::Process instance. It will copy all current
+    // global property values as needed
+    ProcessOptionValueProperties (ProcessProperties *global_properties) :
+        OptionValueProperties(*global_properties->GetValueProperties())
+    {
+    }
+    
+    virtual const Property *
+    GetPropertyAtIndex (const ExecutionContext *exe_ctx, bool will_modify, uint32_t idx) const
+    {
+        // When gettings the value for a key from the process options, we will always
+        // try and grab the setting from the current process if there is one. Else we just
+        // use the one from this instance.
+        if (exe_ctx)
+        {
+            Process *process = exe_ctx->GetProcessPtr();
+            if (process)
+            {
+                ProcessOptionValueProperties *instance_properties = static_cast<ProcessOptionValueProperties *>(process->GetValueProperties().get());
+                if (this != instance_properties)
+                    return instance_properties->ProtectedGetPropertyAtIndex (idx);
+            }
+        }
+        return ProtectedGetPropertyAtIndex (idx);
+    }
+};
+
+static PropertyDefinition
+g_properties[] =
+{
+    { "disable-memory-cache" , OptionValue::eTypeBoolean, false, DISABLE_MEM_CACHE_DEFAULT, NULL, NULL, "Disable reading and caching of memory in fixed-size units." },
+    { "extra-startup-command", OptionValue::eTypeArray  , false, OptionValue::eTypeString, NULL, NULL, "A list containing extra commands understood by the particular process plugin used." },
+    {  NULL                  , OptionValue::eTypeInvalid, false, 0, NULL, NULL, NULL  }
+};
+
+enum {
+    ePropertyDisableMemCache,
+    ePropertyExtraStartCommand
+};
+
+ProcessProperties::ProcessProperties (bool is_global) :
+    Properties ()
+{
+    if (is_global)
+    {
+        m_collection_sp.reset (new ProcessOptionValueProperties(ConstString("process")));
+        m_collection_sp->Initialize(g_properties);
+        m_collection_sp->AppendProperty(ConstString("thread"),
+                                        ConstString("Settings specify to threads."),
+                                        true,
+                                        Thread::GetGlobalProperties()->GetValueProperties());
+    }
+    else
+        m_collection_sp.reset (new ProcessOptionValueProperties(Process::GetGlobalProperties().get()));
+}
+
+ProcessProperties::~ProcessProperties()
+{
+}
+
+bool
+ProcessProperties::GetDisableMemoryCache() const
+{
+    const uint32_t idx = ePropertyDisableMemCache;
+    return m_collection_sp->GetPropertyAtIndexAsBoolean (NULL, idx, g_properties[idx].default_uint_value != 0);
+}
+
+Args
+ProcessProperties::GetExtraStartupCommands () const
+{
+    Args args;
+    const uint32_t idx = ePropertyExtraStartCommand;
+    m_collection_sp->GetPropertyAtIndexAsArgs(NULL, idx, args);
+    return args;
+}
+
+void
+ProcessProperties::SetExtraStartupCommands (const Args &args)
+{
+    const uint32_t idx = ePropertyExtraStartCommand;
+    m_collection_sp->SetPropertyAtIndexFromArgs(NULL, idx, args);
+}
+
 void
 ProcessInstanceInfo::Dump (Stream &s, Platform *platform) const
 {
@@ -270,9 +373,9 @@
             // (lldb) settings set target.input-path
             // (lldb) settings set target.output-path
             // (lldb) settings set target.error-path
-            const char *in_path = NULL;
-            const char *out_path = NULL;
-            const char *err_path = NULL;
+            FileSpec in_path;
+            FileSpec out_path;
+            FileSpec err_path;
             if (target)
             {
                 in_path = target->GetStandardInputPath();
@@ -280,23 +383,28 @@
                 err_path = target->GetStandardErrorPath();
             }
             
-            if (default_to_use_pty && (!in_path && !out_path && !err_path))
+            if (in_path || out_path || err_path)
+            {
+                char path[PATH_MAX];
+                if (in_path && in_path.GetPath(path, sizeof(path)))
+                    AppendOpenFileAction(STDIN_FILENO, path, true, false);
+                
+                if (out_path && out_path.GetPath(path, sizeof(path)))
+                    AppendOpenFileAction(STDOUT_FILENO, path, false, true);
+                
+                if (err_path && err_path.GetPath(path, sizeof(path)))
+                    AppendOpenFileAction(STDERR_FILENO, path, false, true);
+            }
+            else if (default_to_use_pty)
             {
                 if (m_pty.OpenFirstAvailableMaster (O_RDWR|O_NOCTTY, NULL, 0))
                 {
-                    in_path = out_path = err_path = m_pty.GetSlaveName (NULL, 0);
+                    const char *slave_path = m_pty.GetSlaveName (NULL, 0);
+                    AppendOpenFileAction(STDIN_FILENO, slave_path, true, false);
+                    AppendOpenFileAction(STDOUT_FILENO, slave_path, false, true);
+                    AppendOpenFileAction(STDERR_FILENO, slave_path, false, true);
                 }
             }
-
-            if (in_path)
-                AppendOpenFileAction(STDIN_FILENO, in_path, true, false);
-            
-            if (out_path)
-                AppendOpenFileAction(STDOUT_FILENO, out_path, false, true);
-
-            if (err_path)
-                AppendOpenFileAction(STDERR_FILENO, err_path, false, true);
-
         }
     }
 }
@@ -779,9 +887,9 @@
 // Process constructor
 //----------------------------------------------------------------------
 Process::Process(Target &target, Listener &listener) :
+    ProcessProperties (false),
     UserID (LLDB_INVALID_PROCESS_ID),
     Broadcaster (&(target.GetDebugger()), "lldb.process"),
-    ProcessInstanceSettings (GetSettingsController()),
     m_target (target),
     m_public_state (eStateUnloaded),
     m_private_state (eStateUnloaded),
@@ -815,8 +923,6 @@
     m_currently_handling_event(false),
     m_can_jit(eCanJITDontKnow)
 {
-    UpdateInstanceName();
-    
     CheckInWithManager ();
 
     LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_OBJECT));
@@ -855,6 +961,15 @@
     StopPrivateStateThread();
 }
 
+const ProcessPropertiesSP &
+Process::GetGlobalProperties()
+{
+    static ProcessPropertiesSP g_settings_sp;
+    if (!g_settings_sp)
+        g_settings_sp.reset (new ProcessProperties (true));
+    return g_settings_sp;
+}
+
 void
 Process::Finalize()
 {
@@ -1945,9 +2060,6 @@
 
 }
 
-// Comment out line below to disable memory caching, overriding the process setting
-// target.process.disable-memory-cache
-#define ENABLE_MEMORY_CACHING
 // Uncomment to verify memory caching works after making changes to caching code
 //#define VERIFY_MEMORY_READS
 
@@ -3921,88 +4033,66 @@
 void
 Process::SettingsInitialize ()
 {
-    static std::vector<OptionEnumValueElement> g_plugins;
-    
-    int i=0; 
-    const char *name;
-    OptionEnumValueElement option_enum;
-    while ((name = PluginManager::GetProcessPluginNameAtIndex (i)) != NULL)
-    {
-        if (name)
-        {
-            option_enum.value = i;
-            option_enum.string_value = name;
-            option_enum.usage = PluginManager::GetProcessPluginDescriptionAtIndex (i);
-            g_plugins.push_back (option_enum);
-        }
-        ++i;
-    }
-    option_enum.value = 0;
-    option_enum.string_value = NULL;
-    option_enum.usage = NULL;
-    g_plugins.push_back (option_enum);
-    
-    for (i=0; (name = SettingsController::instance_settings_table[i].var_name); ++i)
-    {
-        if (::strcmp (name, "plugin") == 0)
-        {
-            SettingsController::instance_settings_table[i].enum_values = &g_plugins[0];
-            break;
-        }
-    }
-    UserSettingsControllerSP &usc = GetSettingsController();
-    UserSettingsController::InitializeSettingsController (usc,
-                                                          SettingsController::global_settings_table,
-                                                          SettingsController::instance_settings_table);
-                                                          
-    // Now call SettingsInitialize() for each 'child' of Process settings
-    Thread::SettingsInitialize ();
+//    static std::vector<OptionEnumValueElement> g_plugins;
+//    
+//    int i=0; 
+//    const char *name;
+//    OptionEnumValueElement option_enum;
+//    while ((name = PluginManager::GetProcessPluginNameAtIndex (i)) != NULL)
+//    {
+//        if (name)
+//        {
+//            option_enum.value = i;
+//            option_enum.string_value = name;
+//            option_enum.usage = PluginManager::GetProcessPluginDescriptionAtIndex (i);
+//            g_plugins.push_back (option_enum);
+//        }
+//        ++i;
+//    }
+//    option_enum.value = 0;
+//    option_enum.string_value = NULL;
+//    option_enum.usage = NULL;
+//    g_plugins.push_back (option_enum);
+//    
+//    for (i=0; (name = SettingsController::instance_settings_table[i].var_name); ++i)
+//    {
+//        if (::strcmp (name, "plugin") == 0)
+//        {
+//            SettingsController::instance_settings_table[i].enum_values = &g_plugins[0];
+//            break;
+//        }
+//    }
+//    UserSettingsControllerSP &usc = GetSettingsController();
+//    UserSettingsController::InitializeSettingsController (usc,
+//                                                          SettingsController::global_settings_table,
+//                                                          SettingsController::instance_settings_table);
+//                                                          
+//    // Now call SettingsInitialize() for each 'child' of Process settings
+//    Thread::SettingsInitialize ();
 }
 
 void
 Process::SettingsTerminate ()
 {
-    // Must call SettingsTerminate() on each 'child' of Process settings before terminating Process settings.
-    
-    Thread::SettingsTerminate ();
-    
-    // Now terminate Process Settings.
-    
-    UserSettingsControllerSP &usc = GetSettingsController();
-    UserSettingsController::FinalizeSettingsController (usc);
-    usc.reset();
-}
-
-UserSettingsControllerSP &
-Process::GetSettingsController ()
-{
-    static UserSettingsControllerSP g_settings_controller_sp;
-    if (!g_settings_controller_sp)
-    {
-        g_settings_controller_sp.reset (new Process::SettingsController);
-        // The first shared pointer to Process::SettingsController in
-        // g_settings_controller_sp must be fully created above so that 
-        // the TargetInstanceSettings can use a weak_ptr to refer back 
-        // to the master setttings controller
-        InstanceSettingsSP default_instance_settings_sp (new ProcessInstanceSettings (g_settings_controller_sp, 
-                                                                                      false,
-                                                                                      InstanceSettings::GetDefaultName().AsCString()));
-        g_settings_controller_sp->SetDefaultInstanceSettings (default_instance_settings_sp);
-    }
-    return g_settings_controller_sp;
-
+//    // Must call SettingsTerminate() on each 'child' of Process settings before terminating Process settings.
+//    
+//    Thread::SettingsTerminate ();
+//    
+//    // Now terminate Process Settings.
+//    
+//    UserSettingsControllerSP &usc = GetSettingsController();
+//    UserSettingsController::FinalizeSettingsController (usc);
+//    usc.reset();
 }
 
-void
-Process::UpdateInstanceName ()
-{
-    Module *module = GetTarget().GetExecutableModulePointer();
-    if (module && module->GetFileSpec().GetFilename())
-    {
-        GetSettingsController()->RenameInstanceSettings (GetInstanceName().AsCString(),
-                                                         module->GetFileSpec().GetFilename().AsCString());
-    }
-}
+//PropertiesSP &
+//Process::GetProperties ()
+//{
+//    static PropertiesSP g_settings_sp;
+//    if (!g_settings_sp)
+//        g_settings_sp.reset (new ProcessProperties());
+//    return g_settings_sp;
+//}
 
 ExecutionResults
 Process::RunThreadPlan (ExecutionContext &exe_ctx,
@@ -4840,217 +4930,217 @@
 // class Process::SettingsController
 //--------------------------------------------------------------
 
-Process::SettingsController::SettingsController () :
-    UserSettingsController ("process", Target::GetSettingsController())
-{
-}
-
-Process::SettingsController::~SettingsController ()
-{
-}
-
-lldb::InstanceSettingsSP
-Process::SettingsController::CreateInstanceSettings (const char *instance_name)
-{
-    lldb::InstanceSettingsSP new_settings_sp (new ProcessInstanceSettings (GetSettingsController(),
-                                                                           false, 
-                                                                           instance_name));
-    return new_settings_sp;
-}
+//Process::SettingsController::SettingsController () :
+//    UserSettingsController ("process", Target::GetSettingsController())
+//{
+//}
+//
+//Process::SettingsController::~SettingsController ()
+//{
+//}
+//
+//lldb::InstanceSettingsSP
+//Process::SettingsController::CreateInstanceSettings (const char *instance_name)
+//{
+//    lldb::InstanceSettingsSP new_settings_sp (new ProcessInstanceSettings (GetSettingsController(),
+//                                                                           false, 
+//                                                                           instance_name));
+//    return new_settings_sp;
+//}
 
 //--------------------------------------------------------------
 // class ProcessInstanceSettings
 //--------------------------------------------------------------
-
-ProcessInstanceSettings::ProcessInstanceSettings
-(
-    const UserSettingsControllerSP &owner_sp, 
-    bool live_instance, 
-    const char *name
-) :
-    InstanceSettings (owner_sp, name ? name : InstanceSettings::InvalidName().AsCString(), live_instance)
-{
-    // CopyInstanceSettings is a pure virtual function in InstanceSettings; it therefore cannot be called
-    // until the vtables for ProcessInstanceSettings are properly set up, i.e. AFTER all the initializers.
-    // For this reason it has to be called here, rather than in the initializer or in the parent constructor.
-    // This is true for CreateInstanceName() too.
-    
-    if (GetInstanceName () == InstanceSettings::InvalidName())
-    {
-        ChangeInstanceName (std::string (CreateInstanceName().AsCString()));
-        owner_sp->RegisterInstanceSettings (this);
-    }
-    
-    if (live_instance)
-    {
-        const lldb::InstanceSettingsSP &pending_settings = owner_sp->FindPendingSettings (m_instance_name);
-        CopyInstanceSettings (pending_settings,false);
-    }
-}
-
-ProcessInstanceSettings::ProcessInstanceSettings (const ProcessInstanceSettings &rhs) :
-    InstanceSettings (Process::GetSettingsController(), CreateInstanceName().AsCString()),
-    m_disable_memory_cache(rhs.m_disable_memory_cache),
-    m_extra_startup_commands (rhs.m_extra_startup_commands)
-{
-    if (m_instance_name != InstanceSettings::GetDefaultName())
-    {
-        UserSettingsControllerSP owner_sp (m_owner_wp.lock());
-        if (owner_sp)
-        {
-            CopyInstanceSettings (owner_sp->FindPendingSettings (m_instance_name), false);
-            owner_sp->RemovePendingSettings (m_instance_name);
-        }
-    }
-}
-
-ProcessInstanceSettings::~ProcessInstanceSettings ()
-{
-}
-
-ProcessInstanceSettings&
-ProcessInstanceSettings::operator= (const ProcessInstanceSettings &rhs)
-{
-    if (this != &rhs)
-    {
-        m_disable_memory_cache = rhs.m_disable_memory_cache;
-        m_extra_startup_commands = rhs.m_extra_startup_commands;
-    }
-
-    return *this;
-}
-
-
-void
-ProcessInstanceSettings::UpdateInstanceSettingsVariable (const ConstString &var_name,
-                                                         const char *index_value,
-                                                         const char *value,
-                                                         const ConstString &instance_name,
-                                                         const SettingEntry &entry,
-                                                         VarSetOperationType op,
-                                                         Error &err,
-                                                         bool pending)
-{
-    if (var_name == GetDisableMemoryCacheVarName())
-    {
-        bool success;
-        bool result = Args::StringToBoolean(value, false, &success);
-        
-        if (success)
-        {
-            m_disable_memory_cache = result;
-        }
-        else
-        {
-            err.SetErrorStringWithFormat ("Bad value \"%s\" for %s, should be Boolean.", value, GetDisableMemoryCacheVarName().AsCString());
-        }
-        
-    }
-    else if (var_name == GetExtraStartupCommandVarName())
-    {
-        UserSettingsController::UpdateStringArrayVariable (op, index_value, m_extra_startup_commands, value, err);
-    }
-}
-
-void
-ProcessInstanceSettings::CopyInstanceSettings (const lldb::InstanceSettingsSP &new_settings,
-                                               bool pending)
-{
-    if (new_settings.get() == NULL)
-        return;
-    
-    ProcessInstanceSettings *new_settings_ptr = static_cast <ProcessInstanceSettings *> (new_settings.get());
-    
-    if (!new_settings_ptr)
-        return;
-    
-    *this = *new_settings_ptr;
-}
-
-bool
-ProcessInstanceSettings::GetInstanceSettingsValue (const SettingEntry &entry,
-                                                   const ConstString &var_name,
-                                                   StringList &value,
-                                                   Error *err)
-{
-    if (var_name == GetDisableMemoryCacheVarName())
-    {
-        value.AppendString(m_disable_memory_cache ? "true" : "false");
-        return true;
-    }
-    else if (var_name == GetExtraStartupCommandVarName())
-    {
-        if (m_extra_startup_commands.GetArgumentCount() > 0)
-        {
-            for (int i = 0; i < m_extra_startup_commands.GetArgumentCount(); ++i)
-                value.AppendString (m_extra_startup_commands.GetArgumentAtIndex (i));
-        }
-        return true;
-    }
-    else
-    {
-        if (err)
-            err->SetErrorStringWithFormat ("unrecognized variable name '%s'", var_name.AsCString());
-        return false;
-    }
-}
-
-const ConstString
-ProcessInstanceSettings::CreateInstanceName ()
-{
-    static int instance_count = 1;
-    StreamString sstr;
-
-    sstr.Printf ("process_%d", instance_count);
-    ++instance_count;
-
-    const ConstString ret_val (sstr.GetData());
-    return ret_val;
-}
-
-const ConstString &
-ProcessInstanceSettings::GetDisableMemoryCacheVarName () const
-{
-    static ConstString disable_memory_cache_var_name ("disable-memory-cache");
-    
-    return disable_memory_cache_var_name;
-}
-
-const ConstString &
-ProcessInstanceSettings::GetExtraStartupCommandVarName () const
-{
-    static ConstString extra_startup_command_var_name ("extra-startup-command");
-    
-    return extra_startup_command_var_name;
-}
-
-//--------------------------------------------------
-// SettingsController Variable Tables
-//--------------------------------------------------
-
-SettingEntry
-Process::SettingsController::global_settings_table[] =
-{
-  //{ "var-name",    var-type  ,        "default", enum-table, init'd, hidden, "help-text"},
-    {  NULL, eSetVarTypeNone, NULL, NULL, 0, 0, NULL }
-};
-
-
-SettingEntry
-Process::SettingsController::instance_settings_table[] =
-{
-  //{ "var-name",       var-type,              "default",       enum-table, init'd, hidden, "help-text"},
-    {  "disable-memory-cache", eSetVarTypeBoolean,
-#ifdef ENABLE_MEMORY_CACHING
-        "false",
-#else
-        "true",
-#endif
-        NULL,       false,  false,  "Disable reading and caching of memory in fixed-size units." },
-    { "extra-startup-command", eSetVarTypeArray, NULL, NULL, false,  false,  "A list containing extra commands understood by the particular process plugin used." },
-    {  NULL,            eSetVarTypeNone,        NULL,           NULL,       false,  false,  NULL }
-};
-
-
+//
+//ProcessInstanceSettings::ProcessInstanceSettings
+//(
+//    const UserSettingsControllerSP &owner_sp, 
+//    bool live_instance, 
+//    const char *name
+//) :
+//    InstanceSettings (owner_sp, name ? name : InstanceSettings::InvalidName().AsCString(), live_instance)
+//{
+//    // CopyInstanceSettings is a pure virtual function in InstanceSettings; it therefore cannot be called
+//    // until the vtables for ProcessInstanceSettings are properly set up, i.e. AFTER all the initializers.
+//    // For this reason it has to be called here, rather than in the initializer or in the parent constructor.
+//    // This is true for CreateInstanceName() too.
+//    
+//    if (GetInstanceName () == InstanceSettings::InvalidName())
+//    {
+//        ChangeInstanceName (std::string (CreateInstanceName().AsCString()));
+//        owner_sp->RegisterInstanceSettings (this);
+//    }
+//    
+//    if (live_instance)
+//    {
+//        const lldb::InstanceSettingsSP &pending_settings = owner_sp->FindPendingSettings (m_instance_name);
+//        CopyInstanceSettings (pending_settings,false);
+//    }
+//}
+//
+//ProcessInstanceSettings::ProcessInstanceSettings (const ProcessInstanceSettings &rhs) :
+//    InstanceSettings (Process::GetSettingsController(), CreateInstanceName().AsCString()),
+//    m_disable_memory_cache(rhs.m_disable_memory_cache),
+//    m_extra_startup_commands (rhs.m_extra_startup_commands)
+//{
+//    if (m_instance_name != InstanceSettings::GetDefaultName())
+//    {
+//        UserSettingsControllerSP owner_sp (m_owner_wp.lock());
+//        if (owner_sp)
+//        {
+//            CopyInstanceSettings (owner_sp->FindPendingSettings (m_instance_name), false);
+//            owner_sp->RemovePendingSettings (m_instance_name);
+//        }
+//    }
+//}
+//
+//ProcessInstanceSettings::~ProcessInstanceSettings ()
+//{
+//}
+//
+//ProcessInstanceSettings&
+//ProcessInstanceSettings::operator= (const ProcessInstanceSettings &rhs)
+//{
+//    if (this != &rhs)
+//    {
+//        m_disable_memory_cache = rhs.m_disable_memory_cache;
+//        m_extra_startup_commands = rhs.m_extra_startup_commands;
+//    }
+//
+//    return *this;
+//}
+//
+//
+//void
+//ProcessInstanceSettings::UpdateInstanceSettingsVariable (const ConstString &var_name,
+//                                                         const char *index_value,
+//                                                         const char *value,
+//                                                         const ConstString &instance_name,
+//                                                         const SettingEntry &entry,
+//                                                         VarSetOperationType op,
+//                                                         Error &err,
+//                                                         bool pending)
+//{
+//    if (var_name == GetDisableMemoryCacheVarName())
+//    {
+//        bool success;
+//        bool result = Args::StringToBoolean(value, false, &success);
+//        
+//        if (success)
+//        {
+//            m_disable_memory_cache = result;
+//        }
+//        else
+//        {
+//            err.SetErrorStringWithFormat ("Bad value \"%s\" for %s, should be Boolean.", value, GetDisableMemoryCacheVarName().AsCString());
+//        }
+//        
+//    }
+//    else if (var_name == GetExtraStartupCommandVarName())
+//    {
+//        UserSettingsController::UpdateStringArrayVariable (op, index_value, m_extra_startup_commands, value, err);
+//    }
+//}
+//
+//void
+//ProcessInstanceSettings::CopyInstanceSettings (const lldb::InstanceSettingsSP &new_settings,
+//                                               bool pending)
+//{
+//    if (new_settings.get() == NULL)
+//        return;
+//    
+//    ProcessInstanceSettings *new_settings_ptr = static_cast <ProcessInstanceSettings *> (new_settings.get());
+//    
+//    if (!new_settings_ptr)
+//        return;
+//    
+//    *this = *new_settings_ptr;
+//}
+//
+//bool
+//ProcessInstanceSettings::GetInstanceSettingsValue (const SettingEntry &entry,
+//                                                   const ConstString &var_name,
+//                                                   StringList &value,
+//                                                   Error *err)
+//{
+//    if (var_name == GetDisableMemoryCacheVarName())
+//    {
+//        value.AppendString(m_disable_memory_cache ? "true" : "false");
+//        return true;
+//    }
+//    else if (var_name == GetExtraStartupCommandVarName())
+//    {
+//        if (m_extra_startup_commands.GetArgumentCount() > 0)
+//        {
+//            for (int i = 0; i < m_extra_startup_commands.GetArgumentCount(); ++i)
+//                value.AppendString (m_extra_startup_commands.GetArgumentAtIndex (i));
+//        }
+//        return true;
+//    }
+//    else
+//    {
+//        if (err)
+//            err->SetErrorStringWithFormat ("unrecognized variable name '%s'", var_name.AsCString());
+//        return false;
+//    }
+//}
+//
+//const ConstString
+//ProcessInstanceSettings::CreateInstanceName ()
+//{
+//    static int instance_count = 1;
+//    StreamString sstr;
+//
+//    sstr.Printf ("process_%d", instance_count);
+//    ++instance_count;
+//
+//    const ConstString ret_val (sstr.GetData());
+//    return ret_val;
+//}
+//
+//const ConstString &
+//ProcessInstanceSettings::GetDisableMemoryCacheVarName () const
+//{
+//    static ConstString disable_memory_cache_var_name ("disable-memory-cache");
+//    
+//    return disable_memory_cache_var_name;
+//}
+//
+//const ConstString &
+//ProcessInstanceSettings::GetExtraStartupCommandVarName () const
+//{
+//    static ConstString extra_startup_command_var_name ("extra-startup-command");
+//    
+//    return extra_startup_command_var_name;
+//}
+//
+////--------------------------------------------------
+//// SettingsController Variable Tables
+////--------------------------------------------------
+//
+//SettingEntry
+//Process::SettingsController::global_settings_table[] =
+//{
+//  //{ "var-name",    var-type  ,        "default", enum-table, init'd, hidden, "help-text"},
+//    {  NULL, eSetVarTypeNone, NULL, NULL, 0, 0, NULL }
+//};
+//
+//
+//SettingEntry
+//Process::SettingsController::instance_settings_table[] =
+//{
+//  //{ "var-name",       var-type,              "default",       enum-table, init'd, hidden, "help-text"},
+//    {  "disable-memory-cache", eSetVarTypeBoolean,
+//#ifdef ENABLE_MEMORY_CACHING
+//        "false",
+//#else
+//        "true",
+//#endif
+//        NULL,       false,  false,  "Disable reading and caching of memory in fixed-size units." },
+//    { "extra-startup-command", eSetVarTypeArray, NULL, NULL, false,  false,  "A list containing extra commands understood by the particular process plugin used." },
+//    {  NULL,            eSetVarTypeNone,        NULL,           NULL,       false,  false,  NULL }
+//};
+//
+//
 
 

Modified: lldb/trunk/source/Target/StackFrame.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/StackFrame.cpp?rev=162366&r1=162365&r2=162366&view=diff
==============================================================================
--- lldb/trunk/source/Target/StackFrame.cpp (original)
+++ lldb/trunk/source/Target/StackFrame.cpp Wed Aug 22 12:17:09 2012
@@ -1350,7 +1350,7 @@
     {
         ExecutionContext exe_ctx (shared_from_this());
         bool have_source = false;
-        DebuggerInstanceSettings::StopDisassemblyType disasm_display = DebuggerInstanceSettings::eStopDisassemblyTypeNever;
+        Debugger::StopDisassemblyType disasm_display = Debugger::eStopDisassemblyTypeNever;
         Target *target = exe_ctx.GetTargetPtr();
         if (target)
         {
@@ -1378,14 +1378,14 @@
             }
             switch (disasm_display)
             {
-            case DebuggerInstanceSettings::eStopDisassemblyTypeNever:
+            case Debugger::eStopDisassemblyTypeNever:
                 break;
                 
-            case DebuggerInstanceSettings::eStopDisassemblyTypeNoSource:
+            case Debugger::eStopDisassemblyTypeNoSource:
                 if (have_source)
                     break;
                 // Fall through to next case
-            case DebuggerInstanceSettings::eStopDisassemblyTypeAlways:
+            case Debugger::eStopDisassemblyTypeAlways:
                 if (target)
                 {
                     const uint32_t disasm_lines = debugger.GetDisassemblyLineCount();

Modified: lldb/trunk/source/Target/Target.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Target.cpp?rev=162366&r1=162365&r2=162366&view=diff
==============================================================================
--- lldb/trunk/source/Target/Target.cpp (original)
+++ lldb/trunk/source/Target/Target.cpp Wed Aug 22 12:17:09 2012
@@ -31,6 +31,8 @@
 #include "lldb/Interpreter/CommandInterpreter.h"
 #include "lldb/Interpreter/CommandReturnObject.h"
 #include "lldb/Interpreter/OptionGroupWatchpoint.h"
+#include "lldb/Interpreter/OptionValues.h"
+#include "lldb/Interpreter/Property.h"
 #include "lldb/lldb-private-log.h"
 #include "lldb/Symbol/ObjectFile.h"
 #include "lldb/Target/Process.h"
@@ -52,9 +54,10 @@
 // Target constructor
 //----------------------------------------------------------------------
 Target::Target(Debugger &debugger, const ArchSpec &target_arch, const lldb::PlatformSP &platform_sp) :
+    TargetProperties (this),
     Broadcaster (&debugger, "lldb.target"),
+//TargetInstanceSettings (GetSettingsController()),
     ExecutionContextScope (),
-    TargetInstanceSettings (GetSettingsController()),
     m_debugger (debugger),
     m_platform_sp (platform_sp),
     m_mutex (Mutex::eMutexTypeRecursive), 
@@ -964,7 +967,7 @@
         }
     }
 
-    UpdateInstanceName();
+//    UpdateInstanceName();
 }
 
 
@@ -996,7 +999,7 @@
             ModuleSpec module_spec (executable_sp->GetFileSpec(), arch_spec);
             Error error = ModuleList::GetSharedModule (module_spec, 
                                                        executable_sp, 
-                                                       &GetExecutableSearchPaths(),
+                                                       NULL, // &GetExecutableSearchPaths(),        // TODO: SETTINGS
                                                        NULL, 
                                                        NULL);
                                           
@@ -1051,9 +1054,7 @@
 Target::ModuleIsExcludedForNonModuleSpecificSearches (const FileSpec &module_file_spec)
 {
 
-    if (!m_breakpoints_use_platform_avoid)
-        return false;
-    else
+    if (GetBreakpointsConsultPlatformAvoidList())
     {
         ModuleList matchingModules;
         ModuleSpec module_spec (module_file_spec);
@@ -1070,22 +1071,19 @@
             }
             return true;
         }
-        else
-            return false;
     }
+    return false;
 }
 
 bool
 Target::ModuleIsExcludedForNonModuleSpecificSearches (const lldb::ModuleSP &module_sp)
 {
-    if (!m_breakpoints_use_platform_avoid)
-        return false;
-    else if (GetPlatform())
+    if (GetBreakpointsConsultPlatformAvoidList())
     {
-        return GetPlatform()->ModuleIsExcludedForNonModuleSpecificSearches (*this, module_sp);
+        if (m_platform_sp)
+            return m_platform_sp->ModuleIsExcludedForNonModuleSpecificSearches (*this, module_sp);
     }
-    else
-        return false;
+    return false;
 }
 
 size_t
@@ -1352,7 +1350,7 @@
                 transformed_spec.GetFileSpec().GetFilename() = module_spec.GetFileSpec().GetFilename();
                 error = ModuleList::GetSharedModule (transformed_spec, 
                                                      module_sp, 
-                                                     &GetExecutableSearchPaths(),
+                                                     NULL, // TODO: SETTINGS &GetExecutableSearchPaths(),
                                                      &old_module_sp, 
                                                      &did_create_module);
             }
@@ -1373,8 +1371,8 @@
                 // We have a UUID, it is OK to check the global module list...
                 error = ModuleList::GetSharedModule (module_spec,
                                                      module_sp, 
-                                                     &GetExecutableSearchPaths(),
-                                                     &old_module_sp, 
+                                                     NULL, // TODO: SETTINGS &GetExecutableSearchPaths(),
+                                                     &old_module_sp,
                                                      &did_create_module);
             }
 
@@ -1387,8 +1385,8 @@
                     FileSpec platform_file_spec;        
                     error = m_platform_sp->GetSharedModule (module_spec, 
                                                             module_sp, 
-                                                            &GetExecutableSearchPaths(),
-                                                            &old_module_sp, 
+                                                            NULL, // TODO: SETTINGS &GetExecutableSearchPaths(),
+                                                            &old_module_sp,
                                                             &did_create_module);
                 }
                 else
@@ -1529,12 +1527,12 @@
 void
 Target::SettingsInitialize ()
 {
-    UserSettingsController::InitializeSettingsController (GetSettingsController(),
-                                                          SettingsController::global_settings_table,
-                                                          SettingsController::instance_settings_table);
-                                                          
-    // Now call SettingsInitialize() on each 'child' setting of Target
-    Process::SettingsInitialize ();
+//    UserSettingsController::InitializeSettingsController (GetSettingsController(),
+//                                                          SettingsController::global_settings_table,
+//                                                          SettingsController::instance_settings_table);
+//                                                          
+//    // Now call SettingsInitialize() on each 'child' setting of Target
+//    Process::SettingsInitialize ();
 }
 
 void
@@ -1542,65 +1540,59 @@
 {
 
     // Must call SettingsTerminate() on each settings 'child' of Target, before terminating Target's Settings.
-    
-    Process::SettingsTerminate ();
-    
-    // Now terminate Target Settings.
-    
-    UserSettingsControllerSP &usc = GetSettingsController();
-    UserSettingsController::FinalizeSettingsController (usc);
-    usc.reset();
-}
-
-UserSettingsControllerSP &
-Target::GetSettingsController ()
-{
-    static UserSettingsControllerSP g_settings_controller_sp;
-    if (!g_settings_controller_sp)
-    {
-        g_settings_controller_sp.reset (new Target::SettingsController);
-        // The first shared pointer to Target::SettingsController in
-        // g_settings_controller_sp must be fully created above so that 
-        // the TargetInstanceSettings can use a weak_ptr to refer back 
-        // to the master setttings controller
-        InstanceSettingsSP default_instance_settings_sp (new TargetInstanceSettings (g_settings_controller_sp, 
-                                                                                     false,
-                                                                                     InstanceSettings::GetDefaultName().AsCString()));
-        g_settings_controller_sp->SetDefaultInstanceSettings (default_instance_settings_sp);
-    }
-    return g_settings_controller_sp;
-}
+//    
+//    Process::SettingsTerminate ();
+//    
+//    // Now terminate Target Settings.
+//    
+//    UserSettingsControllerSP &usc = GetSettingsController();
+//    UserSettingsController::FinalizeSettingsController (usc);
+//    usc.reset();
+}
+
+//UserSettingsControllerSP &
+//Target::GetSettingsController ()
+//{
+//    static UserSettingsControllerSP g_settings_controller_sp;
+//    if (!g_settings_controller_sp)
+//    {
+//        g_settings_controller_sp.reset (new Target::SettingsController);
+//        // The first shared pointer to Target::SettingsController in
+//        // g_settings_controller_sp must be fully created above so that 
+//        // the TargetInstanceSettings can use a weak_ptr to refer back 
+//        // to the master setttings controller
+//        InstanceSettingsSP default_instance_settings_sp (new TargetInstanceSettings (g_settings_controller_sp, 
+//                                                                                     false,
+//                                                                                     InstanceSettings::GetDefaultName().AsCString()));
+//        g_settings_controller_sp->SetDefaultInstanceSettings (default_instance_settings_sp);
+//    }
+//    return g_settings_controller_sp;
+//}
 
 FileSpecList
 Target::GetDefaultExecutableSearchPaths ()
 {
-    lldb::UserSettingsControllerSP settings_controller_sp (GetSettingsController());
-    if (settings_controller_sp)
-    {
-        lldb::InstanceSettingsSP instance_settings_sp (settings_controller_sp->GetDefaultInstanceSettings ());
-        if (instance_settings_sp)
-            return static_cast<TargetInstanceSettings *>(instance_settings_sp.get())->GetExecutableSearchPaths ();
-    }
+    TargetPropertiesSP properties_sp(Target::GetGlobalProperties());
+    if (properties_sp)
+        return properties_sp->GetExecutableSearchPaths();
     return FileSpecList();
 }
 
-
 ArchSpec
 Target::GetDefaultArchitecture ()
 {
-    lldb::UserSettingsControllerSP settings_controller_sp (GetSettingsController());
-    if (settings_controller_sp)
-        return static_cast<Target::SettingsController *>(settings_controller_sp.get())->GetArchitecture ();
+    TargetPropertiesSP properties_sp(Target::GetGlobalProperties());
+    if (properties_sp)
+        return properties_sp->GetDefaultArchitecture();
     return ArchSpec();
 }
 
 void
-Target::SetDefaultArchitecture (const ArchSpec& arch)
+Target::SetDefaultArchitecture (const ArchSpec &arch)
 {
-    lldb::UserSettingsControllerSP settings_controller_sp (GetSettingsController());
-
-    if (settings_controller_sp)
-        static_cast<Target::SettingsController *>(settings_controller_sp.get())->GetArchitecture () = arch;
+    TargetPropertiesSP properties_sp(Target::GetGlobalProperties());
+    if (properties_sp)
+        return properties_sp->SetDefaultArchitecture(arch);
 }
 
 Target *
@@ -1619,26 +1611,27 @@
 }
 
 
-void
-Target::UpdateInstanceName ()
-{
-    StreamString sstr;
-    
-    Module *exe_module = GetExecutableModulePointer();
-    if (exe_module)
-    {
-        sstr.Printf ("%s_%s", 
-                     exe_module->GetFileSpec().GetFilename().AsCString(), 
-                     exe_module->GetArchitecture().GetArchitectureName());
-        GetSettingsController()->RenameInstanceSettings (GetInstanceName().AsCString(), sstr.GetData());
-    }
-}
-
+//void
+//Target::UpdateInstanceName ()
+//{
+//    StreamString sstr;
+//    
+//    Module *exe_module = GetExecutableModulePointer();
+//    if (exe_module)
+//    {
+//        sstr.Printf ("%s_%s", 
+//                     exe_module->GetFileSpec().GetFilename().AsCString(), 
+//                     exe_module->GetArchitecture().GetArchitectureName());
+//        GetSettingsController()->RenameInstanceSettings (GetInstanceName().AsCString(), sstr.GetData());
+//    }
+//}
+//
 const char *
 Target::GetExpressionPrefixContentsAsCString ()
 {
-    if (!m_expr_prefix_contents.empty())
-        return m_expr_prefix_contents.c_str();
+    // TODO: SETTINGS
+//    if (!m_expr_prefix_contents.empty())
+//        return m_expr_prefix_contents.c_str();
     return NULL;
 }
 
@@ -2152,795 +2145,1174 @@
 // class Target::SettingsController
 //--------------------------------------------------------------
 
-Target::SettingsController::SettingsController () :
-    UserSettingsController ("target", Debugger::GetSettingsController()),
-    m_default_architecture ()
-{
-}
+//Target::SettingsController::SettingsController () :
+//    UserSettingsController ("target", Debugger::GetSettingsController()),
+//    m_default_architecture ()
+//{
+//}
+//
+//Target::SettingsController::~SettingsController ()
+//{
+//}
+//
+//lldb::InstanceSettingsSP
+//Target::SettingsController::CreateInstanceSettings (const char *instance_name)
+//{
+//    lldb::InstanceSettingsSP new_settings_sp (new TargetInstanceSettings (GetSettingsController(),
+//                                                                          false, 
+//                                                                          instance_name));
+//    return new_settings_sp;
+//}
+//
+//
+//#define TSC_DEFAULT_ARCH        "default-arch"
+//#define TSC_EXPR_PREFIX         "expr-prefix"
+//#define TSC_PREFER_DYNAMIC      "prefer-dynamic-value"
+//#define TSC_ENABLE_SYNTHETIC    "enable-synthetic-value"
+//#define TSC_SKIP_PROLOGUE       "skip-prologue"
+//#define TSC_SOURCE_MAP          "source-map"
+//#define TSC_EXE_SEARCH_PATHS    "exec-search-paths"
+//#define TSC_MAX_CHILDREN        "max-children-count"
+//#define TSC_MAX_STRLENSUMMARY   "max-string-summary-length"
+//#define TSC_PLATFORM_AVOID      "breakpoints-use-platform-avoid-list"
+//#define TSC_RUN_ARGS            "run-args"
+//#define TSC_ENV_VARS            "env-vars"
+//#define TSC_INHERIT_ENV         "inherit-env"
+//#define TSC_STDIN_PATH          "input-path"
+//#define TSC_STDOUT_PATH         "output-path"
+//#define TSC_STDERR_PATH         "error-path"
+//#define TSC_DISABLE_ASLR        "disable-aslr"
+//#define TSC_DISABLE_STDIO       "disable-stdio"
+//
+//
+//static const ConstString &
+//GetSettingNameForDefaultArch ()
+//{
+//    static ConstString g_const_string (TSC_DEFAULT_ARCH);
+//    return g_const_string;
+//}
+//
+//static const ConstString &
+//GetSettingNameForExpressionPrefix ()
+//{
+//    static ConstString g_const_string (TSC_EXPR_PREFIX);
+//    return g_const_string;
+//}
+//
+//static const ConstString &
+//GetSettingNameForPreferDynamicValue ()
+//{
+//    static ConstString g_const_string (TSC_PREFER_DYNAMIC);
+//    return g_const_string;
+//}
+//
+//static const ConstString &
+//GetSettingNameForEnableSyntheticValue ()
+//{
+//    static ConstString g_const_string (TSC_ENABLE_SYNTHETIC);
+//    return g_const_string;
+//}
+//
+//static const ConstString &
+//GetSettingNameForSourcePathMap ()
+//{
+//    static ConstString g_const_string (TSC_SOURCE_MAP);
+//    return g_const_string;
+//}
+//
+//static const ConstString &
+//GetSettingNameForExecutableSearchPaths ()
+//{
+//    static ConstString g_const_string (TSC_EXE_SEARCH_PATHS);
+//    return g_const_string;
+//}
+//
+//static const ConstString &
+//GetSettingNameForSkipPrologue ()
+//{
+//    static ConstString g_const_string (TSC_SKIP_PROLOGUE);
+//    return g_const_string;
+//}
+//
+//static const ConstString &
+//GetSettingNameForMaxChildren ()
+//{
+//    static ConstString g_const_string (TSC_MAX_CHILDREN);
+//    return g_const_string;
+//}
+//
+//static const ConstString &
+//GetSettingNameForMaxStringSummaryLength ()
+//{
+//    static ConstString g_const_string (TSC_MAX_STRLENSUMMARY);
+//    return g_const_string;
+//}
+//
+//static const ConstString &
+//GetSettingNameForPlatformAvoid ()
+//{
+//    static ConstString g_const_string (TSC_PLATFORM_AVOID);
+//    return g_const_string;
+//}
+//
+//const ConstString &
+//GetSettingNameForRunArgs ()
+//{
+//    static ConstString g_const_string (TSC_RUN_ARGS);
+//    return g_const_string;
+//}
+//
+//const ConstString &
+//GetSettingNameForEnvVars ()
+//{
+//    static ConstString g_const_string (TSC_ENV_VARS);
+//    return g_const_string;
+//}
+//
+//const ConstString &
+//GetSettingNameForInheritHostEnv ()
+//{
+//    static ConstString g_const_string (TSC_INHERIT_ENV);
+//    return g_const_string;
+//}
+//
+//const ConstString &
+//GetSettingNameForInputPath ()
+//{
+//    static ConstString g_const_string (TSC_STDIN_PATH);
+//    return g_const_string;
+//}
+//
+//const ConstString &
+//GetSettingNameForOutputPath ()
+//{
+//    static ConstString g_const_string (TSC_STDOUT_PATH);
+//    return g_const_string;
+//}
+//
+//const ConstString &
+//GetSettingNameForErrorPath ()
+//{
+//    static ConstString g_const_string (TSC_STDERR_PATH);
+//    return g_const_string;
+//}
+//
+//const ConstString &
+//GetSettingNameForDisableASLR ()
+//{
+//    static ConstString g_const_string (TSC_DISABLE_ASLR);
+//    return g_const_string;
+//}
+//
+//const ConstString &
+//GetSettingNameForDisableSTDIO ()
+//{
+//    static ConstString g_const_string (TSC_DISABLE_STDIO);
+//    return g_const_string;
+//}
+//
+//bool
+//Target::SettingsController::SetGlobalVariable (const ConstString &var_name,
+//                                               const char *index_value,
+//                                               const char *value,
+//                                               const SettingEntry &entry,
+//                                               const VarSetOperationType op,
+//                                               Error&err)
+//{
+//    if (var_name == GetSettingNameForDefaultArch())
+//    {
+//        m_default_architecture.SetTriple (value);
+//        if (!m_default_architecture.IsValid())
+//            err.SetErrorStringWithFormat ("'%s' is not a valid architecture or triple.", value);
+//    }
+//    return true;
+//}
+//
+//
+//bool
+//Target::SettingsController::GetGlobalVariable (const ConstString &var_name,
+//                                               StringList &value,
+//                                               Error &err)
+//{
+//    if (var_name == GetSettingNameForDefaultArch())
+//    {
+//        // If the arch is invalid (the default), don't show a string for it
+//        if (m_default_architecture.IsValid())
+//            value.AppendString (m_default_architecture.GetArchitectureName());
+//        return true;
+//    }
+//    else
+//        err.SetErrorStringWithFormat ("unrecognized variable name '%s'", var_name.AsCString());
+//
+//    return false;
+//}
+
 
-Target::SettingsController::~SettingsController ()
+//--------------------------------------------------------------
+// class TargetProperties
+//--------------------------------------------------------------
+
+OptionEnumValueElement
+lldb_private::g_dynamic_value_types[] =
 {
-}
+    { eNoDynamicValues,      "no-dynamic-values", "Don't calculate the dynamic type of values"},
+    { eDynamicCanRunTarget,  "run-target",        "Calculate the dynamic type of values even if you have to run the target."},
+    { eDynamicDontRunTarget, "no-run-target",     "Calculate the dynamic type of values, but don't run the target."},
+    { 0, NULL, NULL }
+};
 
-lldb::InstanceSettingsSP
-Target::SettingsController::CreateInstanceSettings (const char *instance_name)
+static PropertyDefinition
+g_properties[] =
 {
-    lldb::InstanceSettingsSP new_settings_sp (new TargetInstanceSettings (GetSettingsController(),
-                                                                          false, 
-                                                                          instance_name));
-    return new_settings_sp;
-}
+    { "default-arch"                       , OptionValue::eTypeArch      , true , 0                         , NULL, NULL, "Default architecture to choose, when there's a choice." },
+    { "expr-prefix"                        , OptionValue::eTypeFileSpec  , false, 0                         , NULL, NULL, "Path to a file containing expressions to be prepended to all expressions." },
+    { "prefer-dynamic-value"               , OptionValue::eTypeEnum      , false, eNoDynamicValues          , NULL, g_dynamic_value_types, "Should printed values be shown as their dynamic value." },
+    { "enable-synthetic-value"             , OptionValue::eTypeBoolean   , false, true                      , NULL, NULL, "Should synthetic values be used by default whenever available." },
+    { "skip-prologue"                      , OptionValue::eTypeBoolean   , false, true                      , NULL, NULL, "Skip function prologues when setting breakpoints by name." },
+    { "source-map"                         , OptionValue::eTypePathMap   , false, 0                         , NULL, NULL, "Source path remappings used to track the change of location between a source file when built, and "
+      "where it exists on the current system.  It consists of an array of duples, the first element of each duple is "
+      "some part (starting at the root) of the path to the file when it was built, "
+      "and the second is where the remainder of the original build hierarchy is rooted on the local system.  "
+      "Each element of the array is checked in order and the first one that results in a match wins." },
+    { "exec-search-paths"                  , OptionValue::eTypeFileSpecList, false, 0                       , NULL, NULL, "Executable search paths to use when locating executable files whose paths don't match the local file system." },
+    { "max-children-count"                 , OptionValue::eTypeSInt64    , false, 256                       , NULL, NULL, "Maximum number of children to expand in any level of depth." },
+    { "max-string-summary-length"          , OptionValue::eTypeSInt64    , false, 1024                      , NULL, NULL, "Maximum number of characters to show when using %s in summary strings." },
+    { "breakpoints-use-platform-avoid-list", OptionValue::eTypeBoolean   , false, true                      , NULL, NULL, "Consult the platform module avoid list when setting non-module specific breakpoints." },
+    { "run-args"                           , OptionValue::eTypeArgs      , false, 0                         , NULL, NULL, "A list containing all the arguments to be passed to the executable when it is run." },
+    { "env-vars"                           , OptionValue::eTypeDictionary, false, OptionValue::eTypeString  , NULL, NULL, "A list of all the environment variables to be passed to the executable's environment, and their values." },
+    { "inherit-env"                        , OptionValue::eTypeBoolean   , false, true                      , NULL, NULL, "Inherit the environment from the process that is running LLDB." },
+    { "input-path"                         , OptionValue::eTypeFileSpec  , false, 0                         , NULL, NULL, "The file/path to be used by the executable program for reading its standard input." },
+    { "output-path"                        , OptionValue::eTypeFileSpec  , false, 0                         , NULL, NULL, "The file/path to be used by the executable program for writing its standard output." },
+    { "error-path"                         , OptionValue::eTypeFileSpec  , false, 0                         , NULL, NULL, "The file/path to be used by the executable program for writing its standard error." },
+    { "disable-aslr"                       , OptionValue::eTypeBoolean   , false, true                      , NULL, NULL, "Disable Address Space Layout Randomization (ASLR)" },
+    { "disable-stdio"                      , OptionValue::eTypeBoolean   , false, false                     , NULL, NULL, "Disable stdin/stdout for process (e.g. for a GUI application)" },
+    { NULL                                 , OptionValue::eTypeInvalid   , false, 0                         , NULL, NULL, NULL }
+};
+enum
+{
+    ePropertyDefaultArch,
+    ePropertyExprPrefix,
+    ePropertyPreferDynamic,
+    ePropertyEnableSynthetic,
+    ePropertySkipPrologue,
+    ePropertySourceMap,
+    ePropertyExecutableSearchPaths,
+    ePropertyMaxChildrenCount,
+    ePropertyMaxSummaryLength,
+    ePropertyBreakpointUseAvoidList,
+    ePropertyRunArgs,
+    ePropertyEnvVars,
+    ePropertyInheritEnv,
+    ePropertyInputPath,
+    ePropertyOutputPath,
+    ePropertyErrorPath,
+    ePropertyDisableASLR,
+    ePropertyDisableSTDIO
+};
 
 
-#define TSC_DEFAULT_ARCH        "default-arch"
-#define TSC_EXPR_PREFIX         "expr-prefix"
-#define TSC_PREFER_DYNAMIC      "prefer-dynamic-value"
-#define TSC_ENABLE_SYNTHETIC    "enable-synthetic-value"
-#define TSC_SKIP_PROLOGUE       "skip-prologue"
-#define TSC_SOURCE_MAP          "source-map"
-#define TSC_EXE_SEARCH_PATHS    "exec-search-paths"
-#define TSC_MAX_CHILDREN        "max-children-count"
-#define TSC_MAX_STRLENSUMMARY   "max-string-summary-length"
-#define TSC_PLATFORM_AVOID      "breakpoints-use-platform-avoid-list"
-#define TSC_RUN_ARGS            "run-args"
-#define TSC_ENV_VARS            "env-vars"
-#define TSC_INHERIT_ENV         "inherit-env"
-#define TSC_STDIN_PATH          "input-path"
-#define TSC_STDOUT_PATH         "output-path"
-#define TSC_STDERR_PATH         "error-path"
-#define TSC_DISABLE_ASLR        "disable-aslr"
-#define TSC_DISABLE_STDIO       "disable-stdio"
+class TargetOptionValueProperties : public OptionValueProperties
+{
+public:
+    TargetOptionValueProperties (const ConstString &name) :
+        OptionValueProperties (name),
+        m_target (NULL),
+        m_got_host_env (false)
+    {
+    }
 
+    // This constructor is used when creating TargetOptionValueProperties when it
+    // is part of a new lldb_private::Target instance. It will copy all current
+    // global property values as needed
+    TargetOptionValueProperties (Target *target, const TargetPropertiesSP &target_properties_sp) :
+        OptionValueProperties(*target_properties_sp->GetValueProperties()),
+        m_target (target),
+        m_got_host_env (false)
+    {
+    }
 
-static const ConstString &
-GetSettingNameForDefaultArch ()
+    virtual const Property *
+    GetPropertyAtIndex (const ExecutionContext *exe_ctx, bool will_modify, uint32_t idx) const
+    {
+        // When gettings the value for a key from the target options, we will always
+        // try and grab the setting from the current target if there is one. Else we just
+        // use the one from this instance.
+        if (idx == ePropertyEnvVars)
+            GetHostEnvironmentIfNeeded ();
+            
+        if (exe_ctx)
+        {
+            Target *target = exe_ctx->GetTargetPtr();
+            if (target)
+            {
+                TargetOptionValueProperties *target_properties = static_cast<TargetOptionValueProperties *>(target->GetValueProperties().get());
+                if (this != target_properties)
+                    return target_properties->ProtectedGetPropertyAtIndex (idx);
+            }
+        }
+        return ProtectedGetPropertyAtIndex (idx);
+    }
+protected:
+    
+    void
+    GetHostEnvironmentIfNeeded () const
+    {
+        if (!m_got_host_env)
+        {
+            if (m_target)
+            {
+                m_got_host_env = true;
+                const uint32_t idx = ePropertyInheritEnv;
+                if (GetPropertyAtIndexAsBoolean (NULL, idx, g_properties[idx].default_uint_value != 0))
+                {
+                    PlatformSP platform_sp (m_target->GetPlatform());
+                    if (platform_sp)
+                    {
+                        StringList env;
+                        if (platform_sp->GetEnvironment(env))
+                        {
+                            OptionValueDictionary *env_dict = GetPropertyAtIndexAsOptionValueDictionary (NULL, ePropertyEnvVars);
+                            if (env_dict)
+                            {
+                                const bool can_replace = false;
+                                const size_t envc = env.GetSize();
+                                for (size_t idx=0; idx<envc; idx++)
+                                {
+                                    const char *env_entry = env.GetStringAtIndex (idx);
+                                    if (env_entry)
+                                    {
+                                        const char *equal_pos = ::strchr(env_entry, '=');
+                                        ConstString key;
+                                        // It is ok to have environment variables with no values
+                                        const char *value = NULL;
+                                        if (equal_pos)
+                                        {
+                                            key.SetCStringWithLength(env_entry, equal_pos - env_entry);
+                                            if (equal_pos[1])
+                                                value = equal_pos + 1;
+                                        }
+                                        else
+                                        {
+                                            key.SetCString(env_entry);
+                                        }
+                                        // Don't allow existing keys to be replaced with ones we get from the platform environment
+                                        env_dict->SetValueForKey(key, OptionValueSP(new OptionValueString(value)), can_replace);
+                                    }
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+        }
+    }
+    Target *m_target;
+    mutable bool m_got_host_env;
+};
+
+TargetProperties::TargetProperties (Target *target) :
+    Properties ()
 {
-    static ConstString g_const_string (TSC_DEFAULT_ARCH);
-    return g_const_string;
+    if (target)
+    {
+        m_collection_sp.reset (new TargetOptionValueProperties(target, Target::GetGlobalProperties()));
+    }
+    else
+    {
+        m_collection_sp.reset (new TargetOptionValueProperties(ConstString("target")));
+        m_collection_sp->Initialize(g_properties);
+        m_collection_sp->AppendProperty(ConstString("process"),
+                                        ConstString("Settings specify to processes."),
+                                        true,
+                                        Process::GetGlobalProperties()->GetValueProperties());
+    }
 }
 
-static const ConstString &
-GetSettingNameForExpressionPrefix ()
+TargetProperties::~TargetProperties ()
 {
-    static ConstString g_const_string (TSC_EXPR_PREFIX);
-    return g_const_string;
 }
-
-static const ConstString &
-GetSettingNameForPreferDynamicValue ()
+ArchSpec
+TargetProperties::GetDefaultArchitecture () const
 {
-    static ConstString g_const_string (TSC_PREFER_DYNAMIC);
-    return g_const_string;
+    OptionValueArch *value = m_collection_sp->GetPropertyAtIndexAsOptionValueArch (NULL, ePropertyDefaultArch);
+    if (value)
+        return value->GetCurrentValue();
+    return ArchSpec();
 }
 
-static const ConstString &
-GetSettingNameForEnableSyntheticValue ()
+void
+TargetProperties::SetDefaultArchitecture (const ArchSpec& arch)
 {
-    static ConstString g_const_string (TSC_ENABLE_SYNTHETIC);
-    return g_const_string;
+    OptionValueArch *value = m_collection_sp->GetPropertyAtIndexAsOptionValueArch (NULL, ePropertyDefaultArch);
+    if (value)
+        return value->SetCurrentValue(arch, true);
 }
 
-static const ConstString &
-GetSettingNameForSourcePathMap ()
+lldb::DynamicValueType
+TargetProperties::GetPreferDynamicValue() const
 {
-    static ConstString g_const_string (TSC_SOURCE_MAP);
-    return g_const_string;
+    const uint32_t idx = ePropertyPreferDynamic;
+    return (lldb::DynamicValueType)m_collection_sp->GetPropertyAtIndexAsEnumeration (NULL, idx, g_properties[idx].default_uint_value);
 }
 
-static const ConstString &
-GetSettingNameForExecutableSearchPaths ()
+bool
+TargetProperties::GetDisableASLR () const
 {
-    static ConstString g_const_string (TSC_EXE_SEARCH_PATHS);
-    return g_const_string;
+    const uint32_t idx = ePropertyDisableASLR;
+    return m_collection_sp->GetPropertyAtIndexAsBoolean (NULL, idx, g_properties[idx].default_uint_value != 0);
 }
 
-static const ConstString &
-GetSettingNameForSkipPrologue ()
+void
+TargetProperties::SetDisableASLR (bool b)
 {
-    static ConstString g_const_string (TSC_SKIP_PROLOGUE);
-    return g_const_string;
+    const uint32_t idx = ePropertyDisableASLR;
+    m_collection_sp->SetPropertyAtIndexAsBoolean (NULL, idx, b);
 }
 
-static const ConstString &
-GetSettingNameForMaxChildren ()
+bool
+TargetProperties::GetDisableSTDIO () const
 {
-    static ConstString g_const_string (TSC_MAX_CHILDREN);
-    return g_const_string;
+    const uint32_t idx = ePropertyDisableSTDIO;
+    return m_collection_sp->GetPropertyAtIndexAsBoolean (NULL, idx, g_properties[idx].default_uint_value != 0);
 }
 
-static const ConstString &
-GetSettingNameForMaxStringSummaryLength ()
+void
+TargetProperties::SetDisableSTDIO (bool b)
 {
-    static ConstString g_const_string (TSC_MAX_STRLENSUMMARY);
-    return g_const_string;
+    const uint32_t idx = ePropertyDisableSTDIO;
+    m_collection_sp->SetPropertyAtIndexAsBoolean (NULL, idx, b);
 }
 
-static const ConstString &
-GetSettingNameForPlatformAvoid ()
+bool
+TargetProperties::GetRunArguments (Args &args) const
 {
-    static ConstString g_const_string (TSC_PLATFORM_AVOID);
-    return g_const_string;
+    const uint32_t idx = ePropertyRunArgs;
+    return m_collection_sp->GetPropertyAtIndexAsArgs (NULL, idx, args);
 }
 
-const ConstString &
-GetSettingNameForRunArgs ()
+void
+TargetProperties::SetRunArguments (const Args &args)
 {
-    static ConstString g_const_string (TSC_RUN_ARGS);
-    return g_const_string;
+    const uint32_t idx = ePropertyRunArgs;
+    m_collection_sp->SetPropertyAtIndexFromArgs (NULL, idx, args);
 }
 
-const ConstString &
-GetSettingNameForEnvVars ()
+size_t
+TargetProperties::GetEnvironmentAsArgs (Args &env) const
 {
-    static ConstString g_const_string (TSC_ENV_VARS);
-    return g_const_string;
+    const uint32_t idx = ePropertyEnvVars;
+    return m_collection_sp->GetPropertyAtIndexAsArgs (NULL, idx, env);
 }
 
-const ConstString &
-GetSettingNameForInheritHostEnv ()
+bool
+TargetProperties::GetSkipPrologue() const
 {
-    static ConstString g_const_string (TSC_INHERIT_ENV);
-    return g_const_string;
+    const uint32_t idx = ePropertySkipPrologue;
+    return m_collection_sp->GetPropertyAtIndexAsBoolean (NULL, idx, g_properties[idx].default_uint_value != 0);
 }
 
-const ConstString &
-GetSettingNameForInputPath ()
+PathMappingList &
+TargetProperties::GetSourcePathMap () const
 {
-    static ConstString g_const_string (TSC_STDIN_PATH);
-    return g_const_string;
+    const uint32_t idx = ePropertySourceMap;
+    OptionValuePathMappings *option_value = m_collection_sp->GetPropertyAtIndexAsOptionValuePathMappings (NULL, false, idx);
+    assert(option_value);
+    return option_value->GetCurrentValue();
 }
 
-const ConstString &
-GetSettingNameForOutputPath ()
+FileSpecList &
+TargetProperties::GetExecutableSearchPaths () const
 {
-    static ConstString g_const_string (TSC_STDOUT_PATH);
-    return g_const_string;
+    const uint32_t idx = ePropertyExecutableSearchPaths;
+    OptionValueFileSpecList *option_value = m_collection_sp->GetPropertyAtIndexAsOptionValueFileSpecList (NULL, false, idx);
+    assert(option_value);
+    return option_value->GetCurrentValue();
 }
 
-const ConstString &
-GetSettingNameForErrorPath ()
+bool
+TargetProperties::GetEnableSyntheticValue () const
 {
-    static ConstString g_const_string (TSC_STDERR_PATH);
-    return g_const_string;
+    const uint32_t idx = ePropertyEnableSynthetic;
+    return m_collection_sp->GetPropertyAtIndexAsBoolean (NULL, idx, g_properties[idx].default_uint_value != 0);
 }
 
-const ConstString &
-GetSettingNameForDisableASLR ()
+uint32_t
+TargetProperties::GetMaximumNumberOfChildrenToDisplay() const
 {
-    static ConstString g_const_string (TSC_DISABLE_ASLR);
-    return g_const_string;
+    const uint32_t idx = ePropertyMaxChildrenCount;
+    return m_collection_sp->GetPropertyAtIndexAsSInt64 (NULL, idx, g_properties[idx].default_uint_value);
 }
 
-const ConstString &
-GetSettingNameForDisableSTDIO ()
+uint32_t
+TargetProperties::GetMaximumSizeOfStringSummary() const
 {
-    static ConstString g_const_string (TSC_DISABLE_STDIO);
-    return g_const_string;
+    const uint32_t idx = ePropertyMaxSummaryLength;
+    return m_collection_sp->GetPropertyAtIndexAsSInt64 (NULL, idx, g_properties[idx].default_uint_value);
 }
 
-bool
-Target::SettingsController::SetGlobalVariable (const ConstString &var_name,
-                                               const char *index_value,
-                                               const char *value,
-                                               const SettingEntry &entry,
-                                               const VarSetOperationType op,
-                                               Error&err)
+FileSpec
+TargetProperties::GetStandardInputPath () const
 {
-    if (var_name == GetSettingNameForDefaultArch())
-    {
-        m_default_architecture.SetTriple (value);
-        if (!m_default_architecture.IsValid())
-            err.SetErrorStringWithFormat ("'%s' is not a valid architecture or triple.", value);
-    }
-    return true;
+    const uint32_t idx = ePropertyInputPath;
+    return m_collection_sp->GetPropertyAtIndexAsFileSpec (NULL, idx);
 }
 
-
-bool
-Target::SettingsController::GetGlobalVariable (const ConstString &var_name,
-                                               StringList &value,
-                                               Error &err)
-{
-    if (var_name == GetSettingNameForDefaultArch())
-    {
-        // If the arch is invalid (the default), don't show a string for it
-        if (m_default_architecture.IsValid())
-            value.AppendString (m_default_architecture.GetArchitectureName());
-        return true;
-    }
-    else
-        err.SetErrorStringWithFormat ("unrecognized variable name '%s'", var_name.AsCString());
-
-    return false;
+void
+TargetProperties::SetStandardInputPath (const char *p)
+{
+    const uint32_t idx = ePropertyInputPath;
+    m_collection_sp->SetPropertyAtIndexAsString (NULL, idx, p);
 }
 
-//--------------------------------------------------------------
-// class TargetInstanceSettings
-//--------------------------------------------------------------
-
-TargetInstanceSettings::TargetInstanceSettings
-(
-    const lldb::UserSettingsControllerSP &owner_sp, 
-    bool live_instance, 
-    const char *name
-) :
-    InstanceSettings (owner_sp, name ? name : InstanceSettings::InvalidName().AsCString(), live_instance),
-    m_expr_prefix_file (),
-    m_expr_prefix_contents (),
-    m_prefer_dynamic_value (2),
-    m_enable_synthetic_value(true, true),
-    m_skip_prologue (true, true),
-    m_source_map (NULL, NULL),
-    m_exe_search_paths (),
-    m_max_children_display(256),
-    m_max_strlen_length(1024),
-    m_breakpoints_use_platform_avoid (true, true),
-    m_run_args (),
-    m_env_vars (),
-    m_input_path (),
-    m_output_path (),
-    m_error_path (),
-    m_disable_aslr (true),
-    m_disable_stdio (false),
-    m_inherit_host_env (true),
-    m_got_host_env (false)
-{
-    // CopyInstanceSettings is a pure virtual function in InstanceSettings; it therefore cannot be called
-    // until the vtables for TargetInstanceSettings are properly set up, i.e. AFTER all the initializers.
-    // For this reason it has to be called here, rather than in the initializer or in the parent constructor.
-    // This is true for CreateInstanceName() too.
-
-    if (GetInstanceName () == InstanceSettings::InvalidName())
-    {
-        ChangeInstanceName (std::string (CreateInstanceName().AsCString()));
-        owner_sp->RegisterInstanceSettings (this);
-    }
-
-    if (live_instance)
-    {
-        const lldb::InstanceSettingsSP &pending_settings = owner_sp->FindPendingSettings (m_instance_name);
-        CopyInstanceSettings (pending_settings,false);
-    }
-}
-
-TargetInstanceSettings::TargetInstanceSettings (const TargetInstanceSettings &rhs) :
-    InstanceSettings (Target::GetSettingsController(), CreateInstanceName().AsCString()),
-    m_expr_prefix_file (rhs.m_expr_prefix_file),
-    m_expr_prefix_contents (rhs.m_expr_prefix_contents),
-    m_prefer_dynamic_value (rhs.m_prefer_dynamic_value),
-    m_enable_synthetic_value(rhs.m_enable_synthetic_value),
-    m_skip_prologue (rhs.m_skip_prologue),
-    m_source_map (rhs.m_source_map),
-    m_exe_search_paths (rhs.m_exe_search_paths),
-    m_max_children_display (rhs.m_max_children_display),
-    m_max_strlen_length (rhs.m_max_strlen_length),
-    m_breakpoints_use_platform_avoid (rhs.m_breakpoints_use_platform_avoid),
-    m_run_args (rhs.m_run_args),
-    m_env_vars (rhs.m_env_vars),
-    m_input_path (rhs.m_input_path),
-    m_output_path (rhs.m_output_path),
-    m_error_path (rhs.m_error_path),
-    m_disable_aslr (rhs.m_disable_aslr),
-    m_disable_stdio (rhs.m_disable_stdio),
-    m_inherit_host_env (rhs.m_inherit_host_env)
-{
-    if (m_instance_name != InstanceSettings::GetDefaultName())
-    {
-        UserSettingsControllerSP owner_sp (m_owner_wp.lock());
-        if (owner_sp)
-            CopyInstanceSettings (owner_sp->FindPendingSettings (m_instance_name),false);
-    }
-}
-
-TargetInstanceSettings::~TargetInstanceSettings ()
-{
-}
-
-TargetInstanceSettings&
-TargetInstanceSettings::operator= (const TargetInstanceSettings &rhs)
-{
-    if (this != &rhs)
-    {
-        m_expr_prefix_file = rhs.m_expr_prefix_file;
-        m_expr_prefix_contents = rhs.m_expr_prefix_contents;
-        m_prefer_dynamic_value = rhs.m_prefer_dynamic_value;
-        m_enable_synthetic_value = rhs.m_enable_synthetic_value;
-        m_skip_prologue = rhs.m_skip_prologue;
-        m_source_map = rhs.m_source_map;
-        m_exe_search_paths = rhs.m_exe_search_paths;
-        m_max_children_display = rhs.m_max_children_display;
-        m_max_strlen_length = rhs.m_max_strlen_length;
-        m_breakpoints_use_platform_avoid = rhs.m_breakpoints_use_platform_avoid;
-        m_run_args = rhs.m_run_args;
-        m_env_vars = rhs.m_env_vars;
-        m_input_path = rhs.m_input_path;
-        m_output_path = rhs.m_output_path;
-        m_error_path = rhs.m_error_path;
-        m_disable_aslr = rhs.m_disable_aslr;
-        m_disable_stdio = rhs.m_disable_stdio;
-        m_inherit_host_env = rhs.m_inherit_host_env;
-    }
-
-    return *this;
-}
-
-void
-TargetInstanceSettings::UpdateInstanceSettingsVariable (const ConstString &var_name,
-                                                        const char *index_value,
-                                                        const char *value,
-                                                        const ConstString &instance_name,
-                                                        const SettingEntry &entry,
-                                                        VarSetOperationType op,
-                                                        Error &err,
-                                                        bool pending)
+FileSpec
+TargetProperties::GetStandardOutputPath () const
 {
-    if (var_name == GetSettingNameForExpressionPrefix ())
-    {
-        err = UserSettingsController::UpdateFileSpecOptionValue (value, op, m_expr_prefix_file);
-        if (err.Success())
-        {
-            switch (op)
-            {
-            default:
-                break;
-            case eVarSetOperationAssign:
-            case eVarSetOperationAppend:
-                {
-                    m_expr_prefix_contents.clear();
-
-                    if (!m_expr_prefix_file.GetCurrentValue().Exists())
-                    {
-                        err.SetErrorToGenericError ();
-                        err.SetErrorStringWithFormat ("%s does not exist", value);
-                        return;
-                    }
-            
-                    DataBufferSP file_data_sp (m_expr_prefix_file.GetCurrentValue().ReadFileContents(0, SIZE_MAX, &err));
-                    
-                    if (err.Success())
-                    {
-                        if (file_data_sp && file_data_sp->GetByteSize() > 0)
-                        {
-                            m_expr_prefix_contents.assign((const char*)file_data_sp->GetBytes(), file_data_sp->GetByteSize());
-                        }
-                        else
-                        {
-                            err.SetErrorStringWithFormat ("couldn't read data from '%s'", value);
-                        }
-                    }
-                }
-                break;
-            case eVarSetOperationClear:
-                m_expr_prefix_contents.clear();
-            }
-        }
-    }
-    else if (var_name == GetSettingNameForPreferDynamicValue())
-    {
-        int new_value;
-        UserSettingsController::UpdateEnumVariable (g_dynamic_value_types, &new_value, value, err);
-        if (err.Success())
-            m_prefer_dynamic_value = new_value;
-    }
-    else if (var_name == GetSettingNameForEnableSyntheticValue())
-    {
-        bool ok;
-        bool new_value = Args::StringToBoolean(value, true, &ok);
-        if (ok)
-            m_enable_synthetic_value.SetCurrentValue(new_value);
-    }
-    else if (var_name == GetSettingNameForSkipPrologue())
-    {
-        err = UserSettingsController::UpdateBooleanOptionValue (value, op, m_skip_prologue);
-    }
-    else if (var_name == GetSettingNameForMaxChildren())
-    {
-        bool ok;
-        uint32_t new_value = Args::StringToUInt32(value, 0, 10, &ok);
-        if (ok)
-            m_max_children_display = new_value;
-    }
-    else if (var_name == GetSettingNameForMaxStringSummaryLength())
-    {
-        bool ok;
-        uint32_t new_value = Args::StringToUInt32(value, 0, 10, &ok);
-        if (ok)
-            m_max_strlen_length = new_value;
-    }
-    else if (var_name == GetSettingNameForExecutableSearchPaths())
-    {
-        switch (op)
-        {
-            case eVarSetOperationReplace:
-            case eVarSetOperationInsertBefore:
-            case eVarSetOperationInsertAfter:
-            case eVarSetOperationRemove:
-            default:
-                break;
-            case eVarSetOperationAssign:
-                m_exe_search_paths.Clear();
-                // Fall through to append....
-            case eVarSetOperationAppend:
-            {   
-                Args args(value);
-                const uint32_t argc = args.GetArgumentCount();
-                if (argc > 0)
-                {
-                    const char *exe_search_path_dir;
-                    for (uint32_t idx = 0; (exe_search_path_dir = args.GetArgumentAtIndex(idx)) != NULL; ++idx)
-                    {
-                        FileSpec file_spec;
-                        file_spec.GetDirectory().SetCString(exe_search_path_dir);
-                        FileSpec::FileType file_type = file_spec.GetFileType();
-                        if (file_type == FileSpec::eFileTypeDirectory || file_type == FileSpec::eFileTypeInvalid)
-                        {
-                            m_exe_search_paths.Append(file_spec);
-                        }
-                        else
-                        {
-                            err.SetErrorStringWithFormat("executable search path '%s' exists, but it does not resolve to a directory", exe_search_path_dir);
-                        }
-                    }
-                }
-            }
-                break;
-                
-            case eVarSetOperationClear:
-                m_exe_search_paths.Clear();
-                break;
-        }
-    }
-    else if (var_name == GetSettingNameForSourcePathMap ())
-    {
-        switch (op)
-        {
-            case eVarSetOperationReplace:
-            case eVarSetOperationInsertBefore:
-            case eVarSetOperationInsertAfter:
-            case eVarSetOperationRemove:
-            default:
-                break;
-            case eVarSetOperationAssign:
-                m_source_map.Clear(true);
-                // Fall through to append....
-            case eVarSetOperationAppend:
-                {   
-                    Args args(value);
-                    const uint32_t argc = args.GetArgumentCount();
-                    if (argc & 1 || argc == 0)
-                    {
-                        err.SetErrorStringWithFormat ("an even number of paths must be supplied to to the source-map setting: %u arguments given", argc);
-                    }
-                    else
-                    {
-                        char resolved_new_path[PATH_MAX];
-                        FileSpec file_spec;
-                        const char *old_path;
-                        for (uint32_t idx = 0; (old_path = args.GetArgumentAtIndex(idx)) != NULL; idx += 2)
-                        {
-                            const char *new_path = args.GetArgumentAtIndex(idx+1);
-                            assert (new_path); // We have an even number of paths, this shouldn't happen!
-
-                            file_spec.SetFile(new_path, true);
-                            if (file_spec.Exists())
-                            {
-                                if (file_spec.GetPath (resolved_new_path, sizeof(resolved_new_path)) >= sizeof(resolved_new_path))
-                                {
-                                    err.SetErrorStringWithFormat("new path '%s' is too long", new_path);
-                                    return;
-                                }
-                            }
-                            else
-                            {
-                                err.SetErrorStringWithFormat("new path '%s' doesn't exist", new_path);
-                                return;
-                            }
-                            m_source_map.Append(ConstString (old_path), ConstString (resolved_new_path), true);
-                        }
-                    }
-                }
-                break;
-
-            case eVarSetOperationClear:
-                m_source_map.Clear(true);
-                break;
-        }        
-    }
-    else if (var_name == GetSettingNameForPlatformAvoid ())
-    {
-        err = UserSettingsController::UpdateBooleanOptionValue (value, op, m_breakpoints_use_platform_avoid);
-    }
-    else if (var_name == GetSettingNameForRunArgs())
-    {
-        UserSettingsController::UpdateStringArrayVariable (op, index_value, m_run_args, value, err);
-    }
-    else if (var_name == GetSettingNameForEnvVars())
-    {
-        // This is nice for local debugging, but it is isn't correct for
-        // remote debugging. We need to stop process.env-vars from being 
-        // populated with the host environment and add this as a launch option
-        // and get the correct environment from the Target's platform.
-        // GetHostEnvironmentIfNeeded ();
-        UserSettingsController::UpdateDictionaryVariable (op, index_value, m_env_vars, value, err);
-    }
-    else if (var_name == GetSettingNameForInputPath())
-    {
-        UserSettingsController::UpdateStringVariable (op, m_input_path, value, err);
-    }
-    else if (var_name == GetSettingNameForOutputPath())
-    {
-        UserSettingsController::UpdateStringVariable (op, m_output_path, value, err);
-    }
-    else if (var_name == GetSettingNameForErrorPath())
-    {
-        UserSettingsController::UpdateStringVariable (op, m_error_path, value, err);
-    }
-    else if (var_name == GetSettingNameForDisableASLR())
-    {
-        UserSettingsController::UpdateBooleanVariable (op, m_disable_aslr, value, true, err);
-    }
-    else if (var_name == GetSettingNameForDisableSTDIO ())
-    {
-        UserSettingsController::UpdateBooleanVariable (op, m_disable_stdio, value, false, err);
-    }
+    const uint32_t idx = ePropertyOutputPath;
+    return m_collection_sp->GetPropertyAtIndexAsFileSpec (NULL, idx);
 }
 
 void
-TargetInstanceSettings::CopyInstanceSettings (const lldb::InstanceSettingsSP &new_settings, bool pending)
+TargetProperties::SetStandardOutputPath (const char *p)
 {
-    TargetInstanceSettings *new_settings_ptr = static_cast <TargetInstanceSettings *> (new_settings.get());
-    
-    if (!new_settings_ptr)
-        return;
-    
-    *this = *new_settings_ptr;
+    const uint32_t idx = ePropertyOutputPath;
+    m_collection_sp->SetPropertyAtIndexAsString (NULL, idx, p);
 }
 
-bool
-TargetInstanceSettings::GetInstanceSettingsValue (const SettingEntry &entry,
-                                                  const ConstString &var_name,
-                                                  StringList &value,
-                                                  Error *err)
+FileSpec
+TargetProperties::GetStandardErrorPath () const
 {
-    if (var_name == GetSettingNameForExpressionPrefix ())
-    {
-        char path[PATH_MAX];
-        const size_t path_len = m_expr_prefix_file.GetCurrentValue().GetPath (path, sizeof(path));
-        if (path_len > 0)
-            value.AppendString (path, path_len);
-    }
-    else if (var_name == GetSettingNameForPreferDynamicValue())
-    {
-        value.AppendString (g_dynamic_value_types[m_prefer_dynamic_value].string_value);
-    }
-    else if (var_name == GetSettingNameForEnableSyntheticValue())
-    {
-        if (m_skip_prologue)
-            value.AppendString ("true");
-        else
-            value.AppendString ("false");
-    }
-    else if (var_name == GetSettingNameForSkipPrologue())
-    {
-        if (m_skip_prologue)
-            value.AppendString ("true");
-        else
-            value.AppendString ("false");
-    }
-    else if (var_name == GetSettingNameForExecutableSearchPaths())
-    {
-        if (m_exe_search_paths.GetSize())
-        {
-            for (size_t i = 0, n = m_exe_search_paths.GetSize(); i < n; ++i) 
-            {
-                value.AppendString(m_exe_search_paths.GetFileSpecAtIndex (i).GetDirectory().AsCString());
-            }
-        }
-    }
-    else if (var_name == GetSettingNameForSourcePathMap ())
-    {
-        if (m_source_map.GetSize())
-        {
-            size_t i;
-            for (i = 0; i < m_source_map.GetSize(); ++i) {
-                StreamString sstr;
-                m_source_map.Dump(&sstr, i);
-                value.AppendString(sstr.GetData());
-            }
-        }
-    }
-    else if (var_name == GetSettingNameForMaxChildren())
-    {
-        StreamString count_str;
-        count_str.Printf ("%d", m_max_children_display);
-        value.AppendString (count_str.GetData());
-    }
-    else if (var_name == GetSettingNameForMaxStringSummaryLength())
-    {
-        StreamString count_str;
-        count_str.Printf ("%d", m_max_strlen_length);
-        value.AppendString (count_str.GetData());
-    }
-    else if (var_name == GetSettingNameForPlatformAvoid())
-    {
-        if (m_breakpoints_use_platform_avoid)
-            value.AppendString ("true");
-        else
-            value.AppendString ("false");
-    }
-    else if (var_name == GetSettingNameForRunArgs())
-    {
-        if (m_run_args.GetArgumentCount() > 0)
-        {
-            for (int i = 0; i < m_run_args.GetArgumentCount(); ++i)
-                value.AppendString (m_run_args.GetArgumentAtIndex (i));
-        }
-    }
-    else if (var_name == GetSettingNameForEnvVars())
-    {
-        GetHostEnvironmentIfNeeded ();
-        
-        if (m_env_vars.size() > 0)
-        {
-            std::map<std::string, std::string>::iterator pos;
-            for (pos = m_env_vars.begin(); pos != m_env_vars.end(); ++pos)
-            {
-                StreamString value_str;
-                value_str.Printf ("%s=%s", pos->first.c_str(), pos->second.c_str());
-                value.AppendString (value_str.GetData());
-            }
-        }
-    }
-    else if (var_name == GetSettingNameForInputPath())
-    {
-        value.AppendString (m_input_path.c_str());
-    }
-    else if (var_name == GetSettingNameForOutputPath())
-    {
-        value.AppendString (m_output_path.c_str());
-    }
-    else if (var_name == GetSettingNameForErrorPath())
-    {
-        value.AppendString (m_error_path.c_str());
-    }
-    else if (var_name == GetSettingNameForInheritHostEnv())
-    {
-        if (m_inherit_host_env)
-            value.AppendString ("true");
-        else
-            value.AppendString ("false");
-    }
-    else if (var_name == GetSettingNameForDisableASLR())
-    {
-        if (m_disable_aslr)
-            value.AppendString ("true");
-        else
-            value.AppendString ("false");
-    }
-    else if (var_name == GetSettingNameForDisableSTDIO())
-    {
-        if (m_disable_stdio)
-            value.AppendString ("true");
-        else
-            value.AppendString ("false");
-    }
-    else 
-    {
-        if (err)
-            err->SetErrorStringWithFormat ("unrecognized variable name '%s'", var_name.AsCString());
-        return false;
-    }
-    return true;
+    const uint32_t idx = ePropertyErrorPath;
+    return m_collection_sp->GetPropertyAtIndexAsFileSpec(NULL, idx);
 }
 
 void
-Target::TargetInstanceSettings::GetHostEnvironmentIfNeeded ()
+TargetProperties::SetStandardErrorPath (const char *p)
 {
-    if (m_inherit_host_env && !m_got_host_env)
-    {
-        m_got_host_env = true;
-        StringList host_env;
-        const size_t host_env_count = Host::GetEnvironment (host_env);
-        for (size_t idx=0; idx<host_env_count; idx++)
-        {
-            const char *env_entry = host_env.GetStringAtIndex (idx);
-            if (env_entry)
-            {
-                const char *equal_pos = ::strchr(env_entry, '=');
-                if (equal_pos)
-                {
-                    std::string key (env_entry, equal_pos - env_entry);
-                    std::string value (equal_pos + 1);
-                    if (m_env_vars.find (key) == m_env_vars.end())
-                        m_env_vars[key] = value;
-                }
-            }
-        }
-    }
+    const uint32_t idx = ePropertyErrorPath;
+    m_collection_sp->SetPropertyAtIndexAsString (NULL, idx, p);
 }
 
-
-size_t
-Target::TargetInstanceSettings::GetEnvironmentAsArgs (Args &env)
+bool
+TargetProperties::GetBreakpointsConsultPlatformAvoidList ()
 {
-    GetHostEnvironmentIfNeeded ();
-    
-    dictionary::const_iterator pos, end = m_env_vars.end();
-    for (pos = m_env_vars.begin(); pos != end; ++pos)
-    {
-        std::string env_var_equal_value (pos->first);
-        env_var_equal_value.append(1, '=');
-        env_var_equal_value.append (pos->second);
-        env.AppendArgument (env_var_equal_value.c_str());
-    }
-    return env.GetArgumentCount();
+    const uint32_t idx = ePropertyBreakpointUseAvoidList;
+    return m_collection_sp->GetPropertyAtIndexAsBoolean (NULL, idx, g_properties[idx].default_uint_value != 0);
 }
 
-
-const ConstString
-TargetInstanceSettings::CreateInstanceName ()
+const TargetPropertiesSP &
+Target::GetGlobalProperties()
 {
-    StreamString sstr;
-    static int instance_count = 1;
-    
-    sstr.Printf ("target_%d", instance_count);
-    ++instance_count;
-
-    const ConstString ret_val (sstr.GetData());
-    return ret_val;
+    static TargetPropertiesSP g_settings_sp;
+    if (!g_settings_sp)
+    {
+        g_settings_sp.reset (new TargetProperties (NULL));
+    }
+    return g_settings_sp;
 }
 
-//--------------------------------------------------
-// Target::SettingsController Variable Tables
-//--------------------------------------------------
-OptionEnumValueElement
-TargetInstanceSettings::g_dynamic_value_types[] =
-{
-{ eNoDynamicValues,      "no-dynamic-values", "Don't calculate the dynamic type of values"},
-{ eDynamicCanRunTarget,  "run-target",        "Calculate the dynamic type of values even if you have to run the target."},
-{ eDynamicDontRunTarget, "no-run-target",     "Calculate the dynamic type of values, but don't run the target."},
-{ 0, NULL, NULL }
-};
+// TODO: SETTINGS
+//bool
+//TargetProperties::GetRunArguments (Args &args) const
+//{
+//    if (m_run_args)
+//    {
+//        m_run_args->GetArgs(args);
+//        return true;
+//    }
+//    else if (m_parent_sp)
+//    {
+//        return m_parent_sp->GetRunArguments(args);
+//    }
+//    return false;
+//}
+//
+//void
+//TargetProperties::SetRunArguments (const Args &args)
+//{
+//    // TODO: SETTINGS
+//}
 
-SettingEntry
-Target::SettingsController::global_settings_table[] =
-{
-    // var-name           var-type           default      enum  init'd hidden help-text
-    // =================  ================== ===========  ====  ====== ====== =========================================================================
-    { TSC_DEFAULT_ARCH  , eSetVarTypeString , NULL      , NULL, false, false, "Default architecture to choose, when there's a choice." },
-    { NULL              , eSetVarTypeNone   , NULL      , NULL, false, false, NULL }
-};
 
-SettingEntry
-Target::SettingsController::instance_settings_table[] =
-{
-    // var-name             var-type            default         enum                    init'd hidden help-text
-    // =================    ==================  =============== ======================= ====== ====== =========================================================================
-    { TSC_EXPR_PREFIX       , eSetVarTypeString , NULL          , NULL,                  false, false, "Path to a file containing expressions to be prepended to all expressions." },
-    { TSC_PREFER_DYNAMIC    , eSetVarTypeEnum   , NULL          , g_dynamic_value_types, false, false, "Should printed values be shown as their dynamic value." },
-    { TSC_ENABLE_SYNTHETIC  , eSetVarTypeBoolean, "true"        , NULL,                  false, false, "Should synthetic values be used by default whenever available." },
-    { TSC_SKIP_PROLOGUE     , eSetVarTypeBoolean, "true"        , NULL,                  false, false, "Skip function prologues when setting breakpoints by name." },
-    { TSC_SOURCE_MAP        , eSetVarTypeArray  , NULL          , NULL,                  false, false, "Source path remappings used to track the change of location between a source file when built, and "
-                                                                                                       "where it exists on the current system.  It consists of an array of duples, the first element of each duple is "
-                                                                                                       "some part (starting at the root) of the path to the file when it was built, "
-                                                                                                       "and the second is where the remainder of the original build hierarchy is rooted on the local system.  "
-                                                                                                       "Each element of the array is checked in order and the first one that results in a match wins." },
-    { TSC_EXE_SEARCH_PATHS  , eSetVarTypeArray  , NULL          , NULL,                  false, false, "Executable search paths to use when locating executable files whose paths don't match the local file system." },
-    { TSC_MAX_CHILDREN      , eSetVarTypeInt    , "256"         , NULL,                  true,  false, "Maximum number of children to expand in any level of depth." },
-    { TSC_MAX_STRLENSUMMARY , eSetVarTypeInt    , "1024"        , NULL,                  true,  false, "Maximum number of characters to show when using %s in summary strings." },
-    { TSC_PLATFORM_AVOID    , eSetVarTypeBoolean, "true"        , NULL,                  false, false, "Consult the platform module avoid list when setting non-module specific breakpoints." },
-    { TSC_RUN_ARGS          , eSetVarTypeArray  , NULL          , NULL,                  false,  false,  "A list containing all the arguments to be passed to the executable when it is run." },
-    { TSC_ENV_VARS          , eSetVarTypeDictionary, NULL       , NULL,                  false,  false,  "A list of all the environment variables to be passed to the executable's environment, and their values." },
-    { TSC_INHERIT_ENV       , eSetVarTypeBoolean, "true"        , NULL,                  false,  false,  "Inherit the environment from the process that is running LLDB." },
-    { TSC_STDIN_PATH        , eSetVarTypeString , NULL          , NULL,                  false,  false,  "The file/path to be used by the executable program for reading its standard input." },
-    { TSC_STDOUT_PATH       , eSetVarTypeString , NULL          , NULL,                  false,  false,  "The file/path to be used by the executable program for writing its standard output." },
-    { TSC_STDERR_PATH       , eSetVarTypeString , NULL          , NULL,                  false,  false,  "The file/path to be used by the executable program for writing its standard error." },
-//    { "plugin",         eSetVarTypeEnum,        NULL,           NULL,                  false,  false,  "The plugin to be used to run the process." }, 
-    { TSC_DISABLE_ASLR      , eSetVarTypeBoolean, "true"        , NULL,                  false,  false,  "Disable Address Space Layout Randomization (ASLR)" },
-    { TSC_DISABLE_STDIO     , eSetVarTypeBoolean, "false"       , NULL,                  false,  false,  "Disable stdin/stdout for process (e.g. for a GUI application)" },
-    { NULL                  , eSetVarTypeNone   , NULL          , NULL,                  false, false, NULL }
-};
+//--------------------------------------------------------------
+// class TargetInstanceSettings
+//--------------------------------------------------------------
 
+//TargetInstanceSettings::TargetInstanceSettings
+//(
+//    const lldb::UserSettingsControllerSP &owner_sp, 
+//    bool live_instance, 
+//    const char *name
+//) :
+//    InstanceSettings (owner_sp, name ? name : InstanceSettings::InvalidName().AsCString(), live_instance),
+//    m_expr_prefix_file (),
+//    m_expr_prefix_contents (),
+//    m_prefer_dynamic_value (2),
+//    m_enable_synthetic_value(true, true),
+//    m_skip_prologue (true, true),
+//    m_source_map (NULL, NULL),
+//    m_exe_search_paths (),
+//    m_max_children_display(256),
+//    m_max_strlen_length(1024),
+//    m_breakpoints_use_platform_avoid (true, true),
+//    m_run_args (),
+//    m_env_vars (),
+//    m_input_path (),
+//    m_output_path (),
+//    m_error_path (),
+//    m_disable_aslr (true),
+//    m_disable_stdio (false),
+//    m_inherit_host_env (true),
+//    m_got_host_env (false)
+//{
+//    // CopyInstanceSettings is a pure virtual function in InstanceSettings; it therefore cannot be called
+//    // until the vtables for TargetInstanceSettings are properly set up, i.e. AFTER all the initializers.
+//    // For this reason it has to be called here, rather than in the initializer or in the parent constructor.
+//    // This is true for CreateInstanceName() too.
+//
+//    if (GetInstanceName () == InstanceSettings::InvalidName())
+//    {
+//        ChangeInstanceName (std::string (CreateInstanceName().AsCString()));
+//        owner_sp->RegisterInstanceSettings (this);
+//    }
+//
+//    if (live_instance)
+//    {
+//        const lldb::InstanceSettingsSP &pending_settings = owner_sp->FindPendingSettings (m_instance_name);
+//        CopyInstanceSettings (pending_settings,false);
+//    }
+//}
+//
+//TargetInstanceSettings::TargetInstanceSettings (const TargetInstanceSettings &rhs) :
+//    InstanceSettings (Target::GetSettingsController(), CreateInstanceName().AsCString()),
+//    m_expr_prefix_file (rhs.m_expr_prefix_file),
+//    m_expr_prefix_contents (rhs.m_expr_prefix_contents),
+//    m_prefer_dynamic_value (rhs.m_prefer_dynamic_value),
+//    m_enable_synthetic_value(rhs.m_enable_synthetic_value),
+//    m_skip_prologue (rhs.m_skip_prologue),
+//    m_source_map (rhs.m_source_map),
+//    m_exe_search_paths (rhs.m_exe_search_paths),
+//    m_max_children_display (rhs.m_max_children_display),
+//    m_max_strlen_length (rhs.m_max_strlen_length),
+//    m_breakpoints_use_platform_avoid (rhs.m_breakpoints_use_platform_avoid),
+//    m_run_args (rhs.m_run_args),
+//    m_env_vars (rhs.m_env_vars),
+//    m_input_path (rhs.m_input_path),
+//    m_output_path (rhs.m_output_path),
+//    m_error_path (rhs.m_error_path),
+//    m_disable_aslr (rhs.m_disable_aslr),
+//    m_disable_stdio (rhs.m_disable_stdio),
+//    m_inherit_host_env (rhs.m_inherit_host_env)
+//{
+//    if (m_instance_name != InstanceSettings::GetDefaultName())
+//    {
+//        UserSettingsControllerSP owner_sp (m_owner_wp.lock());
+//        if (owner_sp)
+//            CopyInstanceSettings (owner_sp->FindPendingSettings (m_instance_name),false);
+//    }
+//}
+//
+//TargetInstanceSettings::~TargetInstanceSettings ()
+//{
+//}
+//
+//TargetInstanceSettings&
+//TargetInstanceSettings::operator= (const TargetInstanceSettings &rhs)
+//{
+//    if (this != &rhs)
+//    {
+//        m_expr_prefix_file = rhs.m_expr_prefix_file;
+//        m_expr_prefix_contents = rhs.m_expr_prefix_contents;
+//        m_prefer_dynamic_value = rhs.m_prefer_dynamic_value;
+//        m_enable_synthetic_value = rhs.m_enable_synthetic_value;
+//        m_skip_prologue = rhs.m_skip_prologue;
+//        m_source_map = rhs.m_source_map;
+//        m_exe_search_paths = rhs.m_exe_search_paths;
+//        m_max_children_display = rhs.m_max_children_display;
+//        m_max_strlen_length = rhs.m_max_strlen_length;
+//        m_breakpoints_use_platform_avoid = rhs.m_breakpoints_use_platform_avoid;
+//        m_run_args = rhs.m_run_args;
+//        m_env_vars = rhs.m_env_vars;
+//        m_input_path = rhs.m_input_path;
+//        m_output_path = rhs.m_output_path;
+//        m_error_path = rhs.m_error_path;
+//        m_disable_aslr = rhs.m_disable_aslr;
+//        m_disable_stdio = rhs.m_disable_stdio;
+//        m_inherit_host_env = rhs.m_inherit_host_env;
+//    }
+//
+//    return *this;
+//}
+//
+//void
+//TargetInstanceSettings::UpdateInstanceSettingsVariable (const ConstString &var_name,
+//                                                        const char *index_value,
+//                                                        const char *value,
+//                                                        const ConstString &instance_name,
+//                                                        const SettingEntry &entry,
+//                                                        VarSetOperationType op,
+//                                                        Error &err,
+//                                                        bool pending)
+//{
+//    if (var_name == GetSettingNameForExpressionPrefix ())
+//    {
+//        err = UserSettingsController::UpdateFileSpecOptionValue (value, op, m_expr_prefix_file);
+//        if (err.Success())
+//        {
+//            switch (op)
+//            {
+//            default:
+//                break;
+//            case eVarSetOperationAssign:
+//            case eVarSetOperationAppend:
+//                {
+//                    m_expr_prefix_contents.clear();
+//
+//                    if (!m_expr_prefix_file.GetCurrentValue().Exists())
+//                    {
+//                        err.SetErrorToGenericError ();
+//                        err.SetErrorStringWithFormat ("%s does not exist", value);
+//                        return;
+//                    }
+//            
+//                    DataBufferSP file_data_sp (m_expr_prefix_file.GetCurrentValue().ReadFileContents(0, SIZE_MAX, &err));
+//                    
+//                    if (err.Success())
+//                    {
+//                        if (file_data_sp && file_data_sp->GetByteSize() > 0)
+//                        {
+//                            m_expr_prefix_contents.assign((const char*)file_data_sp->GetBytes(), file_data_sp->GetByteSize());
+//                        }
+//                        else
+//                        {
+//                            err.SetErrorStringWithFormat ("couldn't read data from '%s'", value);
+//                        }
+//                    }
+//                }
+//                break;
+//            case eVarSetOperationClear:
+//                m_expr_prefix_contents.clear();
+//            }
+//        }
+//    }
+//    else if (var_name == GetSettingNameForPreferDynamicValue())
+//    {
+//        int new_value;
+//        UserSettingsController::UpdateEnumVariable (g_dynamic_value_types, &new_value, value, err);
+//        if (err.Success())
+//            m_prefer_dynamic_value = new_value;
+//    }
+//    else if (var_name == GetSettingNameForEnableSyntheticValue())
+//    {
+//        bool ok;
+//        bool new_value = Args::StringToBoolean(value, true, &ok);
+//        if (ok)
+//            m_enable_synthetic_value.SetCurrentValue(new_value);
+//    }
+//    else if (var_name == GetSettingNameForSkipPrologue())
+//    {
+//        err = UserSettingsController::UpdateBooleanOptionValue (value, op, m_skip_prologue);
+//    }
+//    else if (var_name == GetSettingNameForMaxChildren())
+//    {
+//        bool ok;
+//        uint32_t new_value = Args::StringToUInt32(value, 0, 10, &ok);
+//        if (ok)
+//            m_max_children_display = new_value;
+//    }
+//    else if (var_name == GetSettingNameForMaxStringSummaryLength())
+//    {
+//        bool ok;
+//        uint32_t new_value = Args::StringToUInt32(value, 0, 10, &ok);
+//        if (ok)
+//            m_max_strlen_length = new_value;
+//    }
+//    else if (var_name == GetSettingNameForExecutableSearchPaths())
+//    {
+//        switch (op)
+//        {
+//            case eVarSetOperationReplace:
+//            case eVarSetOperationInsertBefore:
+//            case eVarSetOperationInsertAfter:
+//            case eVarSetOperationRemove:
+//            default:
+//                break;
+//            case eVarSetOperationAssign:
+//                m_exe_search_paths.Clear();
+//                // Fall through to append....
+//            case eVarSetOperationAppend:
+//            {   
+//                Args args(value);
+//                const uint32_t argc = args.GetArgumentCount();
+//                if (argc > 0)
+//                {
+//                    const char *exe_search_path_dir;
+//                    for (uint32_t idx = 0; (exe_search_path_dir = args.GetArgumentAtIndex(idx)) != NULL; ++idx)
+//                    {
+//                        FileSpec file_spec;
+//                        file_spec.GetDirectory().SetCString(exe_search_path_dir);
+//                        FileSpec::FileType file_type = file_spec.GetFileType();
+//                        if (file_type == FileSpec::eFileTypeDirectory || file_type == FileSpec::eFileTypeInvalid)
+//                        {
+//                            m_exe_search_paths.Append(file_spec);
+//                        }
+//                        else
+//                        {
+//                            err.SetErrorStringWithFormat("executable search path '%s' exists, but it does not resolve to a directory", exe_search_path_dir);
+//                        }
+//                    }
+//                }
+//            }
+//                break;
+//                
+//            case eVarSetOperationClear:
+//                m_exe_search_paths.Clear();
+//                break;
+//        }
+//    }
+//    else if (var_name == GetSettingNameForSourcePathMap ())
+//    {
+//        switch (op)
+//        {
+//            case eVarSetOperationReplace:
+//            case eVarSetOperationInsertBefore:
+//            case eVarSetOperationInsertAfter:
+//            case eVarSetOperationRemove:
+//            default:
+//                break;
+//            case eVarSetOperationAssign:
+//                m_source_map.Clear(true);
+//                // Fall through to append....
+//            case eVarSetOperationAppend:
+//                {   
+//                    Args args(value);
+//                    const uint32_t argc = args.GetArgumentCount();
+//                    if (argc & 1 || argc == 0)
+//                    {
+//                        err.SetErrorStringWithFormat ("an even number of paths must be supplied to to the source-map setting: %u arguments given", argc);
+//                    }
+//                    else
+//                    {
+//                        char resolved_new_path[PATH_MAX];
+//                        FileSpec file_spec;
+//                        const char *old_path;
+//                        for (uint32_t idx = 0; (old_path = args.GetArgumentAtIndex(idx)) != NULL; idx += 2)
+//                        {
+//                            const char *new_path = args.GetArgumentAtIndex(idx+1);
+//                            assert (new_path); // We have an even number of paths, this shouldn't happen!
+//
+//                            file_spec.SetFile(new_path, true);
+//                            if (file_spec.Exists())
+//                            {
+//                                if (file_spec.GetPath (resolved_new_path, sizeof(resolved_new_path)) >= sizeof(resolved_new_path))
+//                                {
+//                                    err.SetErrorStringWithFormat("new path '%s' is too long", new_path);
+//                                    return;
+//                                }
+//                            }
+//                            else
+//                            {
+//                                err.SetErrorStringWithFormat("new path '%s' doesn't exist", new_path);
+//                                return;
+//                            }
+//                            m_source_map.Append(ConstString (old_path), ConstString (resolved_new_path), true);
+//                        }
+//                    }
+//                }
+//                break;
+//
+//            case eVarSetOperationClear:
+//                m_source_map.Clear(true);
+//                break;
+//        }        
+//    }
+//    else if (var_name == GetSettingNameForPlatformAvoid ())
+//    {
+//        err = UserSettingsController::UpdateBooleanOptionValue (value, op, m_breakpoints_use_platform_avoid);
+//    }
+//    else if (var_name == GetSettingNameForRunArgs())
+//    {
+//        UserSettingsController::UpdateStringArrayVariable (op, index_value, m_run_args, value, err);
+//    }
+//    else if (var_name == GetSettingNameForEnvVars())
+//    {
+//        // This is nice for local debugging, but it is isn't correct for
+//        // remote debugging. We need to stop process.env-vars from being 
+//        // populated with the host environment and add this as a launch option
+//        // and get the correct environment from the Target's platform.
+//        // GetHostEnvironmentIfNeeded ();
+//        UserSettingsController::UpdateDictionaryVariable (op, index_value, m_env_vars, value, err);
+//    }
+//    else if (var_name == GetSettingNameForInputPath())
+//    {
+//        UserSettingsController::UpdateStringVariable (op, m_input_path, value, err);
+//    }
+//    else if (var_name == GetSettingNameForOutputPath())
+//    {
+//        UserSettingsController::UpdateStringVariable (op, m_output_path, value, err);
+//    }
+//    else if (var_name == GetSettingNameForErrorPath())
+//    {
+//        UserSettingsController::UpdateStringVariable (op, m_error_path, value, err);
+//    }
+//    else if (var_name == GetSettingNameForDisableASLR())
+//    {
+//        UserSettingsController::UpdateBooleanVariable (op, m_disable_aslr, value, true, err);
+//    }
+//    else if (var_name == GetSettingNameForDisableSTDIO ())
+//    {
+//        UserSettingsController::UpdateBooleanVariable (op, m_disable_stdio, value, false, err);
+//    }
+//}
+//
+//void
+//TargetInstanceSettings::CopyInstanceSettings (const lldb::InstanceSettingsSP &new_settings, bool pending)
+//{
+//    TargetInstanceSettings *new_settings_ptr = static_cast <TargetInstanceSettings *> (new_settings.get());
+//    
+//    if (!new_settings_ptr)
+//        return;
+//    
+//    *this = *new_settings_ptr;
+//}
+//
+//bool
+//TargetInstanceSettings::GetInstanceSettingsValue (const SettingEntry &entry,
+//                                                  const ConstString &var_name,
+//                                                  StringList &value,
+//                                                  Error *err)
+//{
+//    if (var_name == GetSettingNameForExpressionPrefix ())
+//    {
+//        char path[PATH_MAX];
+//        const size_t path_len = m_expr_prefix_file.GetCurrentValue().GetPath (path, sizeof(path));
+//        if (path_len > 0)
+//            value.AppendString (path, path_len);
+//    }
+//    else if (var_name == GetSettingNameForPreferDynamicValue())
+//    {
+//        value.AppendString (g_dynamic_value_types[m_prefer_dynamic_value].string_value);
+//    }
+//    else if (var_name == GetSettingNameForEnableSyntheticValue())
+//    {
+//        if (m_skip_prologue)
+//            value.AppendString ("true");
+//        else
+//            value.AppendString ("false");
+//    }
+//    else if (var_name == GetSettingNameForSkipPrologue())
+//    {
+//        if (m_skip_prologue)
+//            value.AppendString ("true");
+//        else
+//            value.AppendString ("false");
+//    }
+//    else if (var_name == GetSettingNameForExecutableSearchPaths())
+//    {
+//        if (m_exe_search_paths.GetSize())
+//        {
+//            for (size_t i = 0, n = m_exe_search_paths.GetSize(); i < n; ++i) 
+//            {
+//                value.AppendString(m_exe_search_paths.GetFileSpecAtIndex (i).GetDirectory().AsCString());
+//            }
+//        }
+//    }
+//    else if (var_name == GetSettingNameForSourcePathMap ())
+//    {
+//        if (m_source_map.GetSize())
+//        {
+//            size_t i;
+//            for (i = 0; i < m_source_map.GetSize(); ++i) {
+//                StreamString sstr;
+//                m_source_map.Dump(&sstr, i);
+//                value.AppendString(sstr.GetData());
+//            }
+//        }
+//    }
+//    else if (var_name == GetSettingNameForMaxChildren())
+//    {
+//        StreamString count_str;
+//        count_str.Printf ("%d", m_max_children_display);
+//        value.AppendString (count_str.GetData());
+//    }
+//    else if (var_name == GetSettingNameForMaxStringSummaryLength())
+//    {
+//        StreamString count_str;
+//        count_str.Printf ("%d", m_max_strlen_length);
+//        value.AppendString (count_str.GetData());
+//    }
+//    else if (var_name == GetSettingNameForPlatformAvoid())
+//    {
+//        if (m_breakpoints_use_platform_avoid)
+//            value.AppendString ("true");
+//        else
+//            value.AppendString ("false");
+//    }
+//    else if (var_name == GetSettingNameForRunArgs())
+//    {
+//        if (m_run_args.GetArgumentCount() > 0)
+//        {
+//            for (int i = 0; i < m_run_args.GetArgumentCount(); ++i)
+//                value.AppendString (m_run_args.GetArgumentAtIndex (i));
+//        }
+//    }
+//    else if (var_name == GetSettingNameForEnvVars())
+//    {
+//        GetHostEnvironmentIfNeeded ();
+//        
+//        if (m_env_vars.size() > 0)
+//        {
+//            std::map<std::string, std::string>::iterator pos;
+//            for (pos = m_env_vars.begin(); pos != m_env_vars.end(); ++pos)
+//            {
+//                StreamString value_str;
+//                value_str.Printf ("%s=%s", pos->first.c_str(), pos->second.c_str());
+//                value.AppendString (value_str.GetData());
+//            }
+//        }
+//    }
+//    else if (var_name == GetSettingNameForInputPath())
+//    {
+//        value.AppendString (m_input_path.c_str());
+//    }
+//    else if (var_name == GetSettingNameForOutputPath())
+//    {
+//        value.AppendString (m_output_path.c_str());
+//    }
+//    else if (var_name == GetSettingNameForErrorPath())
+//    {
+//        value.AppendString (m_error_path.c_str());
+//    }
+//    else if (var_name == GetSettingNameForInheritHostEnv())
+//    {
+//        if (m_inherit_host_env)
+//            value.AppendString ("true");
+//        else
+//            value.AppendString ("false");
+//    }
+//    else if (var_name == GetSettingNameForDisableASLR())
+//    {
+//        if (m_disable_aslr)
+//            value.AppendString ("true");
+//        else
+//            value.AppendString ("false");
+//    }
+//    else if (var_name == GetSettingNameForDisableSTDIO())
+//    {
+//        if (m_disable_stdio)
+//            value.AppendString ("true");
+//        else
+//            value.AppendString ("false");
+//    }
+//    else 
+//    {
+//        if (err)
+//            err->SetErrorStringWithFormat ("unrecognized variable name '%s'", var_name.AsCString());
+//        return false;
+//    }
+//    return true;
+//}
+//
+//void
+//Target::TargetInstanceSettings::GetHostEnvironmentIfNeeded ()
+//{
+//    if (m_inherit_host_env && !m_got_host_env)
+//    {
+//        m_got_host_env = true;
+//        StringList host_env;
+//        const size_t host_env_count = Host::GetEnvironment (host_env);
+//        for (size_t idx=0; idx<host_env_count; idx++)
+//        {
+//            const char *env_entry = host_env.GetStringAtIndex (idx);
+//            if (env_entry)
+//            {
+//                const char *equal_pos = ::strchr(env_entry, '=');
+//                if (equal_pos)
+//                {
+//                    std::string key (env_entry, equal_pos - env_entry);
+//                    std::string value (equal_pos + 1);
+//                    if (m_env_vars.find (key) == m_env_vars.end())
+//                        m_env_vars[key] = value;
+//                }
+//            }
+//        }
+//    }
+//}
+//
+//
+//size_t
+//Target::TargetInstanceSettings::GetEnvironmentAsArgs (Args &env)
+//{
+//    GetHostEnvironmentIfNeeded ();
+//    
+//    dictionary::const_iterator pos, end = m_env_vars.end();
+//    for (pos = m_env_vars.begin(); pos != end; ++pos)
+//    {
+//        std::string env_var_equal_value (pos->first);
+//        env_var_equal_value.append(1, '=');
+//        env_var_equal_value.append (pos->second);
+//        env.AppendArgument (env_var_equal_value.c_str());
+//    }
+//    return env.GetArgumentCount();
+//}
+//
+//
+//const ConstString
+//TargetInstanceSettings::CreateInstanceName ()
+//{
+//    StreamString sstr;
+//    static int instance_count = 1;
+//    
+//    sstr.Printf ("target_%d", instance_count);
+//    ++instance_count;
+//
+//    const ConstString ret_val (sstr.GetData());
+//    return ret_val;
+//}
+//
+////--------------------------------------------------
+//// Target::SettingsController Variable Tables
+////--------------------------------------------------
+//
+//
+//SettingEntry
+//Target::SettingsController::global_settings_table[] =
+//{
+//    // var-name           var-type           default      enum  init'd hidden help-text
+//    // =================  ================== ===========  ====  ====== ====== =========================================================================
+//    { TSC_DEFAULT_ARCH  , eSetVarTypeString , NULL      , NULL, false, false, "Default architecture to choose, when there's a choice." },
+//    { NULL              , eSetVarTypeNone   , NULL      , NULL, false, false, NULL }
+//};
+//
+//SettingEntry
+//Target::SettingsController::instance_settings_table[] =
+//{
+//    // var-name             var-type            default         enum                    init'd hidden help-text
+//    // =================    ==================  =============== ======================= ====== ====== =========================================================================
+//    { TSC_EXPR_PREFIX       , eSetVarTypeString , NULL          , NULL,                  false, false, "Path to a file containing expressions to be prepended to all expressions." },
+//    { TSC_PREFER_DYNAMIC    , eSetVarTypeEnum   , NULL          , g_dynamic_value_types, false, false, "Should printed values be shown as their dynamic value." },
+//    { TSC_ENABLE_SYNTHETIC  , eSetVarTypeBoolean, "true"        , NULL,                  false, false, "Should synthetic values be used by default whenever available." },
+//    { TSC_SKIP_PROLOGUE     , eSetVarTypeBoolean, "true"        , NULL,                  false, false, "Skip function prologues when setting breakpoints by name." },
+//    { TSC_SOURCE_MAP        , eSetVarTypeArray  , NULL          , NULL,                  false, false, "Source path remappings used to track the change of location between a source file when built, and "
+//                                                                                                       "where it exists on the current system.  It consists of an array of duples, the first element of each duple is "
+//                                                                                                       "some part (starting at the root) of the path to the file when it was built, "
+//                                                                                                       "and the second is where the remainder of the original build hierarchy is rooted on the local system.  "
+//                                                                                                       "Each element of the array is checked in order and the first one that results in a match wins." },
+//    { TSC_EXE_SEARCH_PATHS  , eSetVarTypeArray  , NULL          , NULL,                  false, false, "Executable search paths to use when locating executable files whose paths don't match the local file system." },
+//    { TSC_MAX_CHILDREN      , eSetVarTypeInt    , "256"         , NULL,                  true,  false, "Maximum number of children to expand in any level of depth." },
+//    { TSC_MAX_STRLENSUMMARY , eSetVarTypeInt    , "1024"        , NULL,                  true,  false, "Maximum number of characters to show when using %s in summary strings." },
+//    { TSC_PLATFORM_AVOID    , eSetVarTypeBoolean, "true"        , NULL,                  false, false, "Consult the platform module avoid list when setting non-module specific breakpoints." },
+//    { TSC_RUN_ARGS          , eSetVarTypeArray  , NULL          , NULL,                  false,  false,  "A list containing all the arguments to be passed to the executable when it is run." },
+//    { TSC_ENV_VARS          , eSetVarTypeDictionary, NULL       , NULL,                  false,  false,  "A list of all the environment variables to be passed to the executable's environment, and their values." },
+//    { TSC_INHERIT_ENV       , eSetVarTypeBoolean, "true"        , NULL,                  false,  false,  "Inherit the environment from the process that is running LLDB." },
+//    { TSC_STDIN_PATH        , eSetVarTypeString , NULL          , NULL,                  false,  false,  "The file/path to be used by the executable program for reading its standard input." },
+//    { TSC_STDOUT_PATH       , eSetVarTypeString , NULL          , NULL,                  false,  false,  "The file/path to be used by the executable program for writing its standard output." },
+//    { TSC_STDERR_PATH       , eSetVarTypeString , NULL          , NULL,                  false,  false,  "The file/path to be used by the executable program for writing its standard error." },
+////    { "plugin",         eSetVarTypeEnum,        NULL,           NULL,                  false,  false,  "The plugin to be used to run the process." }, 
+//    { TSC_DISABLE_ASLR      , eSetVarTypeBoolean, "true"        , NULL,                  false,  false,  "Disable Address Space Layout Randomization (ASLR)" },
+//    { TSC_DISABLE_STDIO     , eSetVarTypeBoolean, "false"       , NULL,                  false,  false,  "Disable stdin/stdout for process (e.g. for a GUI application)" },
+//    { NULL                  , eSetVarTypeNone   , NULL          , NULL,                  false, false, NULL }
+//};
+//
 const ConstString &
 Target::TargetEventData::GetFlavorString ()
 {

Modified: lldb/trunk/source/Target/TargetList.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/TargetList.cpp?rev=162366&r1=162365&r2=162366&view=diff
==============================================================================
--- lldb/trunk/source/Target/TargetList.cpp (original)
+++ lldb/trunk/source/Target/TargetList.cpp Wed Aug 22 12:17:09 2012
@@ -216,7 +216,7 @@
 
     if (target_sp)
     {
-        target_sp->UpdateInstanceName();        
+        //target_sp->UpdateInstanceName();
 
         Mutex::Locker locker(m_target_list_mutex);
         m_selected_target_idx = m_target_list.size();

Modified: lldb/trunk/source/Target/Thread.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Thread.cpp?rev=162366&r1=162365&r2=162366&view=diff
==============================================================================
--- lldb/trunk/source/Target/Thread.cpp (original)
+++ lldb/trunk/source/Target/Thread.cpp Wed Aug 22 12:17:09 2012
@@ -43,9 +43,103 @@
 using namespace lldb;
 using namespace lldb_private;
 
+
+const ThreadPropertiesSP &
+Thread::GetGlobalProperties()
+{
+    static ThreadPropertiesSP g_settings_sp;
+    if (!g_settings_sp)
+        g_settings_sp.reset (new ThreadProperties (true));
+    return g_settings_sp;
+}
+
+static PropertyDefinition
+g_properties[] =
+{
+    { "step-avoid-regexp",  OptionValue::eTypeRegex  , true , REG_EXTENDED, "^std::", NULL, "A regular expression defining functions step-in won't stop in." },
+    { "trace-thread",       OptionValue::eTypeBoolean, false, false, NULL, NULL, "If true, this thread will single-step and log execution." },
+    {  NULL               , OptionValue::eTypeInvalid, false, 0    , NULL, NULL, NULL  }
+};
+
+enum {
+    ePropertyStepAvoidRegex,
+    ePropertyEnableThreadTrace
+};
+
+
+class ThreadOptionValueProperties : public OptionValueProperties
+{
+public:
+    ThreadOptionValueProperties (const ConstString &name) :
+        OptionValueProperties (name)
+    {
+    }
+    
+    // This constructor is used when creating ThreadOptionValueProperties when it
+    // is part of a new lldb_private::Thread instance. It will copy all current
+    // global property values as needed
+    ThreadOptionValueProperties (ThreadProperties *global_properties) :
+    OptionValueProperties(*global_properties->GetValueProperties())
+    {
+    }
+    
+    virtual const Property *
+    GetPropertyAtIndex (const ExecutionContext *exe_ctx, bool will_modify, uint32_t idx) const
+    {
+        // When gettings the value for a key from the thread options, we will always
+        // try and grab the setting from the current thread if there is one. Else we just
+        // use the one from this instance.
+        if (exe_ctx)
+        {
+            Thread *thread = exe_ctx->GetThreadPtr();
+            if (thread)
+            {
+                ThreadOptionValueProperties *instance_properties = static_cast<ThreadOptionValueProperties *>(thread->GetValueProperties().get());
+                if (this != instance_properties)
+                    return instance_properties->ProtectedGetPropertyAtIndex (idx);
+            }
+        }
+        return ProtectedGetPropertyAtIndex (idx);
+    }
+};
+
+
+
+ThreadProperties::ThreadProperties (bool is_global) :
+    Properties ()
+{
+    if (is_global)
+    {
+        m_collection_sp.reset (new ThreadOptionValueProperties(ConstString("thread")));
+        m_collection_sp->Initialize(g_properties);
+    }
+    else
+        m_collection_sp.reset (new ThreadOptionValueProperties(Thread::GetGlobalProperties().get()));
+}
+
+ThreadProperties::~ThreadProperties()
+{
+}
+
+const RegularExpression *
+ThreadProperties::GetSymbolsToAvoidRegexp()
+{
+    const uint32_t idx = ePropertyStepAvoidRegex;
+    return m_collection_sp->GetPropertyAtIndexAsOptionValueRegex (NULL, idx);
+}
+
+bool
+ThreadProperties::GetTraceEnabledState() const
+{
+    const uint32_t idx = ePropertyEnableThreadTrace;
+    return m_collection_sp->GetPropertyAtIndexAsBoolean (NULL, idx, g_properties[idx].default_uint_value != 0);
+}
+
+
 Thread::Thread (const ProcessSP &process_sp, lldb::tid_t tid) :
+    ThreadProperties (false),
     UserID (tid),
-    ThreadInstanceSettings (GetSettingsController()),
+//ThreadInstanceSettings (GetSettingsController()),
     m_process_wp (process_sp),
     m_actual_stop_info_sp (),
     m_index_id (process_sp->GetNextThreadIndexID ()),
@@ -70,7 +164,7 @@
         log->Printf ("%p Thread::Thread(tid = 0x%4.4llx)", this, GetID());
 
     QueueFundamentalPlan(true);
-    UpdateInstanceName();
+    //UpdateInstanceName();
 }
 
 
@@ -1196,10 +1290,10 @@
 void
 Thread::SettingsInitialize ()
 {
-    UserSettingsController::InitializeSettingsController (GetSettingsController(),
-                                                          SettingsController::global_settings_table,
-                                                          SettingsController::instance_settings_table);
-                                                          
+//    UserSettingsController::InitializeSettingsController (GetSettingsController(),
+//                                                          SettingsController::global_settings_table,
+//                                                          SettingsController::instance_settings_table);
+//                                                          
     // Now call SettingsInitialize() on each 'child' setting of Thread.
     // Currently there are none.
 }
@@ -1211,46 +1305,46 @@
     // Currently there are none.
     
     // Now terminate Thread Settings.
-    
-    UserSettingsControllerSP &usc = GetSettingsController();
-    UserSettingsController::FinalizeSettingsController (usc);
-    usc.reset();
-}
-
-UserSettingsControllerSP &
-Thread::GetSettingsController ()
-{
-    static UserSettingsControllerSP g_settings_controller_sp;
-    if (!g_settings_controller_sp)
-    {
-        g_settings_controller_sp.reset (new Thread::SettingsController);
-        // The first shared pointer to Target::SettingsController in
-        // g_settings_controller_sp must be fully created above so that 
-        // the TargetInstanceSettings can use a weak_ptr to refer back 
-        // to the master setttings controller
-        InstanceSettingsSP default_instance_settings_sp (new ThreadInstanceSettings (g_settings_controller_sp, 
-                                                                                     false, 
-                                                                                     InstanceSettings::GetDefaultName().AsCString()));
-
-        g_settings_controller_sp->SetDefaultInstanceSettings (default_instance_settings_sp);
-    }
-    return g_settings_controller_sp;
-}
-
-void
-Thread::UpdateInstanceName ()
-{
-    StreamString sstr;
-    const char *name = GetName();
-
-    if (name && name[0] != '\0')
-        sstr.Printf ("%s", name);
-    else if ((GetIndexID() != 0) || (GetID() != 0))
-        sstr.Printf ("0x%4.4x", GetIndexID());
-
-    if (sstr.GetSize() > 0)
-	Thread::GetSettingsController()->RenameInstanceSettings (GetInstanceName().AsCString(), sstr.GetData());
-}
+//    
+//    UserSettingsControllerSP &usc = GetSettingsController();
+//    UserSettingsController::FinalizeSettingsController (usc);
+//    usc.reset();
+}
+
+//UserSettingsControllerSP &
+//Thread::GetSettingsController ()
+//{
+//    static UserSettingsControllerSP g_settings_controller_sp;
+//    if (!g_settings_controller_sp)
+//    {
+//        g_settings_controller_sp.reset (new Thread::SettingsController);
+//        // The first shared pointer to Target::SettingsController in
+//        // g_settings_controller_sp must be fully created above so that 
+//        // the TargetInstanceSettings can use a weak_ptr to refer back 
+//        // to the master setttings controller
+//        InstanceSettingsSP default_instance_settings_sp (new ThreadInstanceSettings (g_settings_controller_sp, 
+//                                                                                     false, 
+//                                                                                     InstanceSettings::GetDefaultName().AsCString()));
+//
+//        g_settings_controller_sp->SetDefaultInstanceSettings (default_instance_settings_sp);
+//    }
+//    return g_settings_controller_sp;
+//}
+
+//void
+//Thread::UpdateInstanceName ()
+//{
+//    StreamString sstr;
+//    const char *name = GetName();
+//
+//    if (name && name[0] != '\0')
+//        sstr.Printf ("%s", name);
+//    else if ((GetIndexID() != 0) || (GetID() != 0))
+//        sstr.Printf ("0x%4.4x", GetIndexID());
+//
+//    if (sstr.GetSize() > 0)
+//	Thread::GetSettingsController()->RenameInstanceSettings (GetInstanceName().AsCString(), sstr.GetData());
+//}
 
 lldb::StackFrameSP
 Thread::GetStackFrameSPForStackFramePtr (StackFrame *stack_frame_ptr)
@@ -1422,225 +1516,225 @@
 //--------------------------------------------------------------
 // class Thread::SettingsController
 //--------------------------------------------------------------
-
-Thread::SettingsController::SettingsController () :
-    UserSettingsController ("thread", Process::GetSettingsController())
-{
-}
-
-Thread::SettingsController::~SettingsController ()
-{
-}
-
-lldb::InstanceSettingsSP
-Thread::SettingsController::CreateInstanceSettings (const char *instance_name)
-{
-    lldb::InstanceSettingsSP new_settings_sp (new ThreadInstanceSettings (GetSettingsController(),
-                                                                          false, 
-                                                                          instance_name));
-    return new_settings_sp;
-}
-
-#pragma mark "ThreadInstanceSettings"
-//--------------------------------------------------------------
-// class ThreadInstanceSettings
-//--------------------------------------------------------------
-
-ThreadInstanceSettings::ThreadInstanceSettings (const UserSettingsControllerSP &owner_sp, bool live_instance, const char *name) :
-    InstanceSettings (owner_sp, name ? name : InstanceSettings::InvalidName().AsCString(), live_instance), 
-    m_avoid_regexp_ap (),
-    m_trace_enabled (false)
-{
-    // CopyInstanceSettings is a pure virtual function in InstanceSettings; it therefore cannot be called
-    // until the vtables for ThreadInstanceSettings are properly set up, i.e. AFTER all the initializers.
-    // For this reason it has to be called here, rather than in the initializer or in the parent constructor.
-    // This is true for CreateInstanceName() too.
-   
-    if (GetInstanceName() == InstanceSettings::InvalidName())
-    {
-        ChangeInstanceName (std::string (CreateInstanceName().AsCString()));
-        owner_sp->RegisterInstanceSettings (this);
-    }
-
-    if (live_instance)
-    {
-        CopyInstanceSettings (owner_sp->FindPendingSettings (m_instance_name),false);
-    }
-}
-
-ThreadInstanceSettings::ThreadInstanceSettings (const ThreadInstanceSettings &rhs) :
-    InstanceSettings (Thread::GetSettingsController(), CreateInstanceName().AsCString()),
-    m_avoid_regexp_ap (),
-    m_trace_enabled (rhs.m_trace_enabled)
-{
-    if (m_instance_name != InstanceSettings::GetDefaultName())
-    {
-        UserSettingsControllerSP owner_sp (m_owner_wp.lock());
-        if (owner_sp)
-        {
-            CopyInstanceSettings (owner_sp->FindPendingSettings (m_instance_name), false);
-            owner_sp->RemovePendingSettings (m_instance_name);
-        }
-    }
-    if (rhs.m_avoid_regexp_ap.get() != NULL)
-        m_avoid_regexp_ap.reset(new RegularExpression(rhs.m_avoid_regexp_ap->GetText()));
-}
-
-ThreadInstanceSettings::~ThreadInstanceSettings ()
-{
-}
-
-ThreadInstanceSettings&
-ThreadInstanceSettings::operator= (const ThreadInstanceSettings &rhs)
-{
-    if (this != &rhs)
-    {
-        if (rhs.m_avoid_regexp_ap.get() != NULL)
-            m_avoid_regexp_ap.reset(new RegularExpression(rhs.m_avoid_regexp_ap->GetText()));
-        else
-            m_avoid_regexp_ap.reset(NULL);
-    }
-    m_trace_enabled = rhs.m_trace_enabled;
-    return *this;
-}
-
-
-void
-ThreadInstanceSettings::UpdateInstanceSettingsVariable (const ConstString &var_name,
-                                                         const char *index_value,
-                                                         const char *value,
-                                                         const ConstString &instance_name,
-                                                         const SettingEntry &entry,
-                                                         VarSetOperationType op,
-                                                         Error &err,
-                                                         bool pending)
-{
-    if (var_name == StepAvoidRegexpVarName())
-    {
-        std::string regexp_text;
-        if (m_avoid_regexp_ap.get() != NULL)
-            regexp_text.append (m_avoid_regexp_ap->GetText());
-        UserSettingsController::UpdateStringVariable (op, regexp_text, value, err);
-        if (regexp_text.empty())
-            m_avoid_regexp_ap.reset();
-        else
-        {
-            m_avoid_regexp_ap.reset(new RegularExpression(regexp_text.c_str()));
-            
-        }
-    }
-    else if (var_name == GetTraceThreadVarName())
-    {
-        bool success;
-        bool result = Args::StringToBoolean(value, false, &success);
-
-        if (success)
-        {
-            m_trace_enabled = result;
-            if (!pending)
-            {
-                Thread *myself = static_cast<Thread *> (this);
-                myself->EnableTracer(m_trace_enabled, true);
-            }
-        }
-        else
-        {
-            err.SetErrorStringWithFormat ("Bad value \"%s\" for trace-thread, should be Boolean.", value);
-        }
-
-    }
-}
-
-void
-ThreadInstanceSettings::CopyInstanceSettings (const lldb::InstanceSettingsSP &new_settings,
-                                               bool pending)
-{
-    if (new_settings.get() == NULL)
-        return;
-
-    ThreadInstanceSettings *new_process_settings = (ThreadInstanceSettings *) new_settings.get();
-    if (new_process_settings->GetSymbolsToAvoidRegexp() != NULL)
-        m_avoid_regexp_ap.reset (new RegularExpression (new_process_settings->GetSymbolsToAvoidRegexp()->GetText()));
-    else 
-        m_avoid_regexp_ap.reset ();
-}
-
-bool
-ThreadInstanceSettings::GetInstanceSettingsValue (const SettingEntry &entry,
-                                                  const ConstString &var_name,
-                                                  StringList &value,
-                                                  Error *err)
-{
-    if (var_name == StepAvoidRegexpVarName())
-    {
-        if (m_avoid_regexp_ap.get() != NULL)
-        {
-            std::string regexp_text("\"");
-            regexp_text.append(m_avoid_regexp_ap->GetText());
-            regexp_text.append ("\"");
-            value.AppendString (regexp_text.c_str());
-        }
-
-    }
-    else if (var_name == GetTraceThreadVarName())
-    {
-        value.AppendString(m_trace_enabled ? "true" : "false");
-    }
-    else
-    {
-        if (err)
-            err->SetErrorStringWithFormat ("unrecognized variable name '%s'", var_name.AsCString());
-        return false;
-    }
-    return true;
-}
-
-const ConstString
-ThreadInstanceSettings::CreateInstanceName ()
-{
-    static int instance_count = 1;
-    StreamString sstr;
-
-    sstr.Printf ("thread_%d", instance_count);
-    ++instance_count;
-
-    const ConstString ret_val (sstr.GetData());
-    return ret_val;
-}
-
-const ConstString &
-ThreadInstanceSettings::StepAvoidRegexpVarName ()
-{
-    static ConstString step_avoid_var_name ("step-avoid-regexp");
-
-    return step_avoid_var_name;
-}
-
-const ConstString &
-ThreadInstanceSettings::GetTraceThreadVarName ()
-{
-    static ConstString trace_thread_var_name ("trace-thread");
-
-    return trace_thread_var_name;
-}
-
+//
+//Thread::SettingsController::SettingsController () :
+//    UserSettingsController ("thread", Process::GetSettingsController())
+//{
+//}
+//
+//Thread::SettingsController::~SettingsController ()
+//{
+//}
+//
+//lldb::InstanceSettingsSP
+//Thread::SettingsController::CreateInstanceSettings (const char *instance_name)
+//{
+//    lldb::InstanceSettingsSP new_settings_sp (new ThreadInstanceSettings (GetSettingsController(),
+//                                                                          false, 
+//                                                                          instance_name));
+//    return new_settings_sp;
+//}
+
+//#pragma mark "ThreadInstanceSettings"
+////--------------------------------------------------------------
+//// class ThreadInstanceSettings
+////--------------------------------------------------------------
+//
+//ThreadInstanceSettings::ThreadInstanceSettings (const UserSettingsControllerSP &owner_sp, bool live_instance, const char *name) :
+//    InstanceSettings (owner_sp, name ? name : InstanceSettings::InvalidName().AsCString(), live_instance), 
+//    m_avoid_regexp_ap (),
+//    m_trace_enabled (false)
+//{
+//    // CopyInstanceSettings is a pure virtual function in InstanceSettings; it therefore cannot be called
+//    // until the vtables for ThreadInstanceSettings are properly set up, i.e. AFTER all the initializers.
+//    // For this reason it has to be called here, rather than in the initializer or in the parent constructor.
+//    // This is true for CreateInstanceName() too.
+//   
+//    if (GetInstanceName() == InstanceSettings::InvalidName())
+//    {
+//        ChangeInstanceName (std::string (CreateInstanceName().AsCString()));
+//        owner_sp->RegisterInstanceSettings (this);
+//    }
+//
+//    if (live_instance)
+//    {
+//        CopyInstanceSettings (owner_sp->FindPendingSettings (m_instance_name),false);
+//    }
+//}
+//
+//ThreadInstanceSettings::ThreadInstanceSettings (const ThreadInstanceSettings &rhs) :
+//    InstanceSettings (Thread::GetSettingsController(), CreateInstanceName().AsCString()),
+//    m_avoid_regexp_ap (),
+//    m_trace_enabled (rhs.m_trace_enabled)
+//{
+//    if (m_instance_name != InstanceSettings::GetDefaultName())
+//    {
+//        UserSettingsControllerSP owner_sp (m_owner_wp.lock());
+//        if (owner_sp)
+//        {
+//            CopyInstanceSettings (owner_sp->FindPendingSettings (m_instance_name), false);
+//            owner_sp->RemovePendingSettings (m_instance_name);
+//        }
+//    }
+//    if (rhs.m_avoid_regexp_ap.get() != NULL)
+//        m_avoid_regexp_ap.reset(new RegularExpression(rhs.m_avoid_regexp_ap->GetText()));
+//}
+//
+//ThreadInstanceSettings::~ThreadInstanceSettings ()
+//{
+//}
+//
+//ThreadInstanceSettings&
+//ThreadInstanceSettings::operator= (const ThreadInstanceSettings &rhs)
+//{
+//    if (this != &rhs)
+//    {
+//        if (rhs.m_avoid_regexp_ap.get() != NULL)
+//            m_avoid_regexp_ap.reset(new RegularExpression(rhs.m_avoid_regexp_ap->GetText()));
+//        else
+//            m_avoid_regexp_ap.reset(NULL);
+//    }
+//    m_trace_enabled = rhs.m_trace_enabled;
+//    return *this;
+//}
+//
+//
+//void
+//ThreadInstanceSettings::UpdateInstanceSettingsVariable (const ConstString &var_name,
+//                                                         const char *index_value,
+//                                                         const char *value,
+//                                                         const ConstString &instance_name,
+//                                                         const SettingEntry &entry,
+//                                                         VarSetOperationType op,
+//                                                         Error &err,
+//                                                         bool pending)
+//{
+//    if (var_name == StepAvoidRegexpVarName())
+//    {
+//        std::string regexp_text;
+//        if (m_avoid_regexp_ap.get() != NULL)
+//            regexp_text.append (m_avoid_regexp_ap->GetText());
+//        UserSettingsController::UpdateStringVariable (op, regexp_text, value, err);
+//        if (regexp_text.empty())
+//            m_avoid_regexp_ap.reset();
+//        else
+//        {
+//            m_avoid_regexp_ap.reset(new RegularExpression(regexp_text.c_str()));
+//            
+//        }
+//    }
+//    else if (var_name == GetTraceThreadVarName())
+//    {
+//        bool success;
+//        bool result = Args::StringToBoolean(value, false, &success);
+//
+//        if (success)
+//        {
+//            m_trace_enabled = result;
+//            if (!pending)
+//            {
+//                Thread *myself = static_cast<Thread *> (this);
+//                myself->EnableTracer(m_trace_enabled, true);
+//            }
+//        }
+//        else
+//        {
+//            err.SetErrorStringWithFormat ("Bad value \"%s\" for trace-thread, should be Boolean.", value);
+//        }
+//
+//    }
+//}
+//
+//void
+//ThreadInstanceSettings::CopyInstanceSettings (const lldb::InstanceSettingsSP &new_settings,
+//                                               bool pending)
+//{
+//    if (new_settings.get() == NULL)
+//        return;
+//
+//    ThreadInstanceSettings *new_process_settings = (ThreadInstanceSettings *) new_settings.get();
+//    if (new_process_settings->GetSymbolsToAvoidRegexp() != NULL)
+//        m_avoid_regexp_ap.reset (new RegularExpression (new_process_settings->GetSymbolsToAvoidRegexp()->GetText()));
+//    else 
+//        m_avoid_regexp_ap.reset ();
+//}
+//
+//bool
+//ThreadInstanceSettings::GetInstanceSettingsValue (const SettingEntry &entry,
+//                                                  const ConstString &var_name,
+//                                                  StringList &value,
+//                                                  Error *err)
+//{
+//    if (var_name == StepAvoidRegexpVarName())
+//    {
+//        if (m_avoid_regexp_ap.get() != NULL)
+//        {
+//            std::string regexp_text("\"");
+//            regexp_text.append(m_avoid_regexp_ap->GetText());
+//            regexp_text.append ("\"");
+//            value.AppendString (regexp_text.c_str());
+//        }
+//
+//    }
+//    else if (var_name == GetTraceThreadVarName())
+//    {
+//        value.AppendString(m_trace_enabled ? "true" : "false");
+//    }
+//    else
+//    {
+//        if (err)
+//            err->SetErrorStringWithFormat ("unrecognized variable name '%s'", var_name.AsCString());
+//        return false;
+//    }
+//    return true;
+//}
+//
+//const ConstString
+//ThreadInstanceSettings::CreateInstanceName ()
+//{
+//    static int instance_count = 1;
+//    StreamString sstr;
+//
+//    sstr.Printf ("thread_%d", instance_count);
+//    ++instance_count;
+//
+//    const ConstString ret_val (sstr.GetData());
+//    return ret_val;
+//}
+//
+//const ConstString &
+//ThreadInstanceSettings::StepAvoidRegexpVarName ()
+//{
+//    static ConstString step_avoid_var_name ("step-avoid-regexp");
+//
+//    return step_avoid_var_name;
+//}
+//
+//const ConstString &
+//ThreadInstanceSettings::GetTraceThreadVarName ()
+//{
+//    static ConstString trace_thread_var_name ("trace-thread");
+//
+//    return trace_thread_var_name;
+//}
+//
 //--------------------------------------------------
 // SettingsController Variable Tables
 //--------------------------------------------------
-
-SettingEntry
-Thread::SettingsController::global_settings_table[] =
-{
-  //{ "var-name",    var-type  ,        "default", enum-table, init'd, hidden, "help-text"},
-    {  NULL, eSetVarTypeNone, NULL, NULL, 0, 0, NULL }
-};
-
-
-SettingEntry
-Thread::SettingsController::instance_settings_table[] =
-{
-  //{ "var-name",    var-type,              "default",      enum-table, init'd, hidden, "help-text"},
-    { "step-avoid-regexp",  eSetVarTypeString,      "",  NULL,       false,  false,  "A regular expression defining functions step-in won't stop in." },
-    { "trace-thread",  eSetVarTypeBoolean,      "false",  NULL,       false,  false,  "If true, this thread will single-step and log execution." },
-    {  NULL, eSetVarTypeNone, NULL, NULL, 0, 0, NULL }
-};
+//
+//SettingEntry
+//Thread::SettingsController::global_settings_table[] =
+//{
+//  //{ "var-name",    var-type  ,        "default", enum-table, init'd, hidden, "help-text"},
+//    {  NULL, eSetVarTypeNone, NULL, NULL, 0, 0, NULL }
+//};
+//
+//
+//SettingEntry
+//Thread::SettingsController::instance_settings_table[] =
+//{
+//  //{ "var-name",    var-type,              "default",      enum-table, init'd, hidden, "help-text"},
+//    { "step-avoid-regexp",  eSetVarTypeString,      "",  NULL,       false,  false,  "A regular expression defining functions step-in won't stop in." },
+//    { "trace-thread",  eSetVarTypeBoolean,      "false",  NULL,       false,  false,  "If true, this thread will single-step and log execution." },
+//    {  NULL, eSetVarTypeNone, NULL, NULL, 0, 0, NULL }
+//};

Modified: lldb/trunk/source/Target/ThreadPlanStepInRange.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ThreadPlanStepInRange.cpp?rev=162366&r1=162365&r2=162366&view=diff
==============================================================================
--- lldb/trunk/source/Target/ThreadPlanStepInRange.cpp (original)
+++ lldb/trunk/source/Target/ThreadPlanStepInRange.cpp Wed Aug 22 12:17:09 2012
@@ -234,9 +234,7 @@
 {
     StackFrame *frame = GetThread().GetStackFrameAtIndex(0).get();
 
-    RegularExpression *avoid_regexp_to_use;
-    
-    avoid_regexp_to_use = m_avoid_regexp_ap.get();
+    const RegularExpression *avoid_regexp_to_use = m_avoid_regexp_ap.get();
     if (avoid_regexp_to_use == NULL)
         avoid_regexp_to_use = GetThread().GetSymbolsToAvoidRegexp();
         

Modified: lldb/trunk/test/functionalities/abbreviation/TestAbbreviations.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/abbreviation/TestAbbreviations.py?rev=162366&r1=162365&r2=162366&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/abbreviation/TestAbbreviations.py (original)
+++ lldb/trunk/test/functionalities/abbreviation/TestAbbreviations.py Wed Aug 22 12:17:09 2012
@@ -47,7 +47,7 @@
                     startstr = 'prompt (string) = "[with-three-trailing-spaces]   "')
 
 
-        self.runCmd("settings set -r prompt")
+        self.runCmd("settings clear prompt")
         self.expect("settings show prompt",
                     startstr = 'prompt (string) = "(lldb) "')
 
@@ -59,7 +59,7 @@
         self.expect("se sh prompt",
                     startstr = 'prompt (string) = "Sycamore> "')
 
-        self.runCmd("se se -r prompt")
+        self.runCmd("se cl prompt")
         self.expect("set sh prompt",
                     startstr = 'prompt (string) = "(lldb) "')
 

Modified: lldb/trunk/test/functionalities/completion/TestCompletion.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/completion/TestCompletion.py?rev=162366&r1=162365&r2=162366&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/completion/TestCompletion.py (original)
+++ lldb/trunk/test/functionalities/completion/TestCompletion.py Wed Aug 22 12:17:09 2012
@@ -85,12 +85,12 @@
         self.complete_from_to('settings set th', 'settings set thread-format')
 
     def test_settings_s_dash(self):
-        """Test that 'settings set -' completes to ['Available completions:', '-n', '-r']."""
-        self.complete_from_to('settings set -', ['Available completions:', '-n', '-r'])
+        """Test that 'settings set -' completes to 'settings set -g'."""
+        self.complete_from_to('settings set -', 'settings set -g')
 
-    def test_settings_set_dash_r_th(self):
-        """Test that 'settings set -r th' completes to 'settings set -r thread-format'."""
-        self.complete_from_to('settings set -r th', 'settings set -r thread-format')
+    def test_settings_clear_th(self):
+        """Test that 'settings clear th' completes to 'settings clear thread-format'."""
+        self.complete_from_to('settings clear th', 'settings clear thread-format')
 
     def test_settings_set_ta(self):
         """Test that 'settings set ta' completes to 'settings set target.'."""
@@ -98,7 +98,7 @@
 
     def test_settings_set_target_exec(self):
         """Test that 'settings set target.exec' completes to 'settings set target.exec-search-paths '."""
-        self.complete_from_to('settings set target.exec', 'settings set target.exec-search-paths ')
+        self.complete_from_to('settings set target.exec', 'settings set target.exec-search-paths')
 
     def test_settings_set_target_pr(self):
         """Test that 'settings set target.pr' completes to ['Available completions:',

Modified: lldb/trunk/test/functionalities/stop-hook/TestStopHookCmd.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/stop-hook/TestStopHookCmd.py?rev=162366&r1=162365&r2=162366&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/stop-hook/TestStopHookCmd.py (original)
+++ lldb/trunk/test/functionalities/stop-hook/TestStopHookCmd.py Wed Aug 22 12:17:09 2012
@@ -71,7 +71,7 @@
                        'expr ptr'])
 
         self.runCmd("settings set auto-confirm true")
-        self.addTearDownHook(lambda: self.runCmd("settings set -r auto-confirm"))
+        self.addTearDownHook(lambda: self.runCmd("settings clear auto-confirm"))
 
         self.runCmd('target stop-hook delete')
 

Modified: lldb/trunk/test/functionalities/watchpoint/watchpoint_commands/TestWatchpointCommands.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/watchpoint/watchpoint_commands/TestWatchpointCommands.py?rev=162366&r1=162365&r2=162366&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/watchpoint/watchpoint_commands/TestWatchpointCommands.py (original)
+++ lldb/trunk/test/functionalities/watchpoint/watchpoint_commands/TestWatchpointCommands.py Wed Aug 22 12:17:09 2012
@@ -187,7 +187,7 @@
         self.expect("watchpoint delete",
             substrs = ['All watchpoints removed.'])
         # Restore the original setting of auto-confirm.
-        self.runCmd("settings set -r auto-confirm")
+        self.runCmd("settings clear auto-confirm")
 
         # Use the '-v' option to do verbose listing of the watchpoint.
         self.runCmd("watchpoint list -v")

Modified: lldb/trunk/test/help/TestHelp.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/help/TestHelp.py?rev=162366&r1=162365&r2=162366&view=diff
==============================================================================
--- lldb/trunk/test/help/TestHelp.py (original)
+++ lldb/trunk/test/help/TestHelp.py Wed Aug 22 12:17:09 2012
@@ -87,7 +87,10 @@
 
     def test_help_should_not_hang_emacsshell(self):
         """Command 'settings set term-width 0' should not hang the help command."""
-        self.runCmd("settings set term-width 0")
+        self.expect("settings set term-width 0",
+                    COMMAND_FAILED_AS_EXPECTED, error=True,
+            substrs = ['error: 0 is out of range, valid values must be between'])
+        # self.runCmd("settings set term-width 0")
         self.expect("help",
             startstr = 'The following is a list of built-in, permanent debugger commands')
 

Modified: lldb/trunk/test/settings/TestSettings.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/settings/TestSettings.py?rev=162366&r1=162365&r2=162366&view=diff
==============================================================================
--- lldb/trunk/test/settings/TestSettings.py (original)
+++ lldb/trunk/test/settings/TestSettings.py Wed Aug 22 12:17:09 2012
@@ -28,12 +28,12 @@
                        "executable's environment"])
 
     def test_append_target_env_vars(self):
-        """Test that 'replace target.run-args' works."""
+        """Test that 'append target.run-args' works."""
         # Append the env-vars.
         self.runCmd('settings append target.env-vars MY_ENV_VAR=YES')
         # And add hooks to restore the settings during tearDown().
         self.addTearDownHook(
-            lambda: self.runCmd("settings set -r target.env-vars"))
+            lambda: self.runCmd("settings clear target.env-vars"))
 
         # Check it immediately!
         self.expect('settings show target.env-vars',
@@ -45,7 +45,7 @@
         self.runCmd('settings set target.run-args a b c')
         # And add hooks to restore the settings during tearDown().
         self.addTearDownHook(
-            lambda: self.runCmd("settings set -r target.run-args"))
+            lambda: self.runCmd("settings clear target.run-args"))
 
         # Now insert-before the index-0 element with '__a__'.
         self.runCmd('settings insert-before target.run-args 0 __a__')
@@ -53,7 +53,7 @@
         self.runCmd('settings insert-after target.run-args 1 __A__')
         # Check it immediately!
         self.expect('settings show target.run-args',
-            substrs = ['target.run-args (array) = ',
+            substrs = ['target.run-args',
                        '[0]: "__a__"',
                        '[1]: "a"',
                        '[2]: "__A__"',
@@ -66,13 +66,13 @@
         self.runCmd('settings set target.run-args a b c')
         # And add hooks to restore the settings during tearDown().
         self.addTearDownHook(
-            lambda: self.runCmd("settings set -r target.run-args"))
+            lambda: self.runCmd("settings clear target.run-args"))
 
         # Now replace the index-0 element with 'A', instead.
         self.runCmd('settings replace target.run-args 0 A')
         # Check it immediately!
         self.expect('settings show target.run-args',
-            substrs = ['target.run-args (array) = ',
+            substrs = ['target.run-args (arguments) =',
                        '[0]: "A"',
                        '[1]: "b"',
                        '[2]: "c"'])
@@ -92,7 +92,7 @@
             substrs = ['prompt (string) = "lldb2"'])
 
         # Use '-r' option to reset to the original default prompt.
-        self.runCmd("settings set -r prompt")
+        self.runCmd("settings clear prompt")
 
     def test_set_term_width(self):
         """Test that 'set term-width' actually changes the term-width."""
@@ -118,7 +118,6 @@
         def cleanup():
             format_string = "frame #${frame.index}: ${frame.pc}{ ${module.file.basename}{`${function.name}${function.pc-offset}}}{ at ${line.file.basename}:${line.number}}\n"
             self.runCmd("settings set frame-format %s" % format_string, check=False)
-            self.runCmd('command unalias hello', check=False)
 
         # Execute the cleanup function during test case tear down.
         self.addTearDownHook(cleanup)
@@ -155,7 +154,7 @@
             startstr = "All breakpoints removed")
 
         # Restore the original setting of auto-confirm.
-        self.runCmd("settings set -r auto-confirm")
+        self.runCmd("settings clear auto-confirm")
         self.expect("settings show auto-confirm", SETTING_MSG("auto-confirm"),
             startstr = "auto-confirm (boolean) = false")
 
@@ -181,10 +180,10 @@
         # And add hooks to restore the settings during tearDown().
         self.runCmd('settings set target.run-args A B C')
         self.addTearDownHook(
-            lambda: self.runCmd("settings set -r target.run-args"))
+            lambda: self.runCmd("settings clear target.run-args"))
         self.runCmd('settings set target.env-vars ["MY_ENV_VAR"]=YES')
         self.addTearDownHook(
-            lambda: self.runCmd("settings set -r target.env-vars"))
+            lambda: self.runCmd("settings clear target.env-vars"))
 
         self.runCmd("run", RUN_SUCCEEDED)
 
@@ -241,17 +240,17 @@
         self.runCmd("settings set target.output-path stdout.txt")
         # And add hooks to restore the original settings during tearDown().
         self.addTearDownHook(
-            lambda: self.runCmd("settings set -r target.output-path"))
+            lambda: self.runCmd("settings clear target.output-path"))
         self.addTearDownHook(
-            lambda: self.runCmd("settings set -r target.error-path"))
+            lambda: self.runCmd("settings clear target.error-path"))
 
         self.expect("settings show target.error-path",
                     SETTING_MSG("target.error-path"),
-            startstr = 'target.error-path (string) = "stderr.txt"')
+            startstr = 'target.error-path (file) = "stderr.txt"')
 
         self.expect("settings show target.output-path",
                     SETTING_MSG("target.output-path"),
-            startstr = 'target.output-path (string) = "stdout.txt"')
+            startstr = 'target.output-path (file) = "stdout.txt"')
 
         self.runCmd("run", RUN_SUCCEEDED)
 
@@ -278,21 +277,21 @@
             startstr = "This message should go to standard out.")
 
     def test_print_dictionary_setting(self):
-        self.runCmd ("settings set -r target.env-vars")
+        self.runCmd ("settings clear target.env-vars")
         self.runCmd ("settings set target.env-vars [\"MY_VAR\"]=some-value")
         self.expect ("settings show target.env-vars",
                      substrs = [ "MY_VAR=some-value" ])
-        self.runCmd ("settings set -r target.env-vars")
+        self.runCmd ("settings clear target.env-vars")
 
     def test_print_array_setting(self):
-        self.runCmd ("settings set -r target.run-args")
+        self.runCmd ("settings clear target.run-args")
         self.runCmd ("settings set target.run-args gobbledy-gook")
         self.expect ("settings show target.run-args",
                      substrs = [ '[0]: "gobbledy-gook"' ])
-        self.runCmd ("settings set -r target.run-args")
+        self.runCmd ("settings clear target.run-args")
 
     def test_settings_with_quotes (self):
-        self.runCmd ("settings set -r target.run-args")
+        self.runCmd ("settings clear target.run-args")
         self.runCmd ("settings set target.run-args a b c")
         self.expect ("settings show target.run-args",
                      substrs = [ '[0]: "a"',
@@ -301,35 +300,51 @@
         self.runCmd ("settings set target.run-args 'a b c'")
         self.expect ("settings show target.run-args",
                      substrs = [ '[0]: "a b c"' ])
-        self.runCmd ("settings set -r target.run-args")
-        self.runCmd ("settings set -r target.env-vars")
+        self.runCmd ("settings clear target.run-args")
+        self.runCmd ("settings clear target.env-vars")
         self.runCmd ('settings set target.env-vars ["MY_FILE"]="this is a file name with spaces.txt"')
         self.expect ("settings show target.env-vars",
                      substrs = [ 'MY_FILE=this is a file name with spaces.txt' ])
-        self.runCmd ("settings set -r target.env-vars")
+        self.runCmd ("settings clear target.env-vars")
 
 
     def test_all_settings_exist (self):
         self.expect ("settings show",
-                     substrs = [ "frame-format (string) = ",
-                                 "prompt (string) = ",
-                                 "script-lang (string) = ",
-                                 "term-width (int) = ",
-                                 "thread-format (string) = ",
-                                 "use-external-editor (boolean) = ",
-                                 "auto-confirm (boolean) = ",
-                                 "target.default-arch (string) =",
-                                 "target.expr-prefix (string) = ",
-                                 "target.run-args (array) =",
-                                 "target.env-vars (dictionary) =",
-                                 "target.inherit-env (boolean) = ",
-                                 "target.input-path (string) = ",
-                                 "target.output-path (string) = ",
-                                 "target.error-path (string) = ",
-                                 "target.disable-aslr (boolean) = ",
-                                 "target.disable-stdio (boolean) = ",
-                                 "target.process.thread.step-avoid-regexp (string) =",
-                                 "target.process.thread.trace-thread (boolean) =" ])
+                     substrs = [ "auto-confirm",
+                                 "frame-format",
+                                 "notify-void",
+                                 "prompt",
+                                 "script-lang",
+                                 "stop-disassembly-count",
+                                 "stop-disassembly-display",
+                                 "stop-line-count-after",
+                                 "stop-line-count-before",
+                                 "term-width",
+                                 "thread-format",
+                                 "use-external-editor",
+                                 "target.default-arch",
+                                 "target.expr-prefix",
+                                 "target.prefer-dynamic-value",
+                                 "target.enable-synthetic-value",
+                                 "target.skip-prologue",
+                                 "target.source-map",
+                                 "target.exec-search-paths",
+                                 "target.max-children-count",
+                                 "target.max-string-summary-length",
+                                 "target.breakpoints-use-platform-avoid-list",
+                                 "target.run-args",
+                                 "target.env-vars",
+                                 "target.inherit-env",
+                                 "target.input-path",
+                                 "target.output-path",
+                                 "target.error-path",
+                                 "target.disable-aslr",
+                                 "target.disable-stdio",
+                                 "target.process.disable-memory-cache",
+                                 "target.process.extra-startup-command",
+                                 "target.process.thread.step-avoid-regexp",
+                                 "target.process.thread.trace-thread"])
+                                 
         
 
 if __name__ == '__main__':





More information about the lldb-commits mailing list