[Lldb-commits] [lldb] r150558 - in /lldb/trunk: include/lldb/ include/lldb/API/ include/lldb/Core/ include/lldb/Interpreter/ lldb.xcodeproj/ scripts/ scripts/Python/ scripts/Python/interface/ source/API/ source/Commands/ source/Core/ source/Interpreter/

Enrico Granata granata.enrico at gmail.com
Tue Feb 14 18:34:21 PST 2012


Author: enrico
Date: Tue Feb 14 20:34:21 2012
New Revision: 150558

URL: http://llvm.org/viewvc/llvm-project?rev=150558&view=rev
Log:
<rdar://problem/10062621>
New public API for handling formatters: creating, deleting, modifying categories, and formatters, and managing type/formatter association.
This provides SB classes for each of the main object types involved in providing formatter support:
 SBTypeCategory
 SBTypeFilter
 SBTypeFormat
 SBTypeSummary
 SBTypeSynthetic
plus, an SBTypeNameSpecifier class that is used on the public API layer to abstract the notion that formatters can be applied to plain type-names as well as to regular expressions
For naming consistency, this patch also renames a lot of formatters-related classes.
Plus, the changes in how flags are handled that started with summaries is now extended to other classes as well. A new enum (lldb::eTypeOption) is meant to support this on the public side.
The patch also adds several new calls to the formatter infrastructure that are used to implement by-index accessing and several other design changes required to accommodate the new API layer.
An architectural change is introduced in that backing objects for formatters now become writable. On the public API layer, CoW is implemented to prevent unwanted propagation of changes.
Lastly, there are some modifications in how the "default" category is constructed and managed in relation to other categories.

Added:
    lldb/trunk/include/lldb/API/SBTypeCategory.h
    lldb/trunk/include/lldb/API/SBTypeFilter.h
    lldb/trunk/include/lldb/API/SBTypeFormat.h
    lldb/trunk/include/lldb/API/SBTypeNameSpecifier.h
    lldb/trunk/include/lldb/API/SBTypeSummary.h
    lldb/trunk/include/lldb/API/SBTypeSynthetic.h
    lldb/trunk/scripts/Python/interface/SBTypeCategory.i
    lldb/trunk/scripts/Python/interface/SBTypeFilter.i
    lldb/trunk/scripts/Python/interface/SBTypeFormat.i
    lldb/trunk/scripts/Python/interface/SBTypeNameSpecifier.i
    lldb/trunk/scripts/Python/interface/SBTypeSummary.i
    lldb/trunk/scripts/Python/interface/SBTypeSynthetic.i
    lldb/trunk/source/API/SBTypeCategory.cpp
    lldb/trunk/source/API/SBTypeFilter.cpp
    lldb/trunk/source/API/SBTypeFormat.cpp
    lldb/trunk/source/API/SBTypeNameSpecifier.cpp
    lldb/trunk/source/API/SBTypeSummary.cpp
    lldb/trunk/source/API/SBTypeSynthetic.cpp
Modified:
    lldb/trunk/include/lldb/API/SBDebugger.h
    lldb/trunk/include/lldb/API/SBDefines.h
    lldb/trunk/include/lldb/Core/DataVisualization.h
    lldb/trunk/include/lldb/Core/Debugger.h
    lldb/trunk/include/lldb/Core/FormatClasses.h
    lldb/trunk/include/lldb/Core/FormatManager.h
    lldb/trunk/include/lldb/Core/FormatNavigator.h
    lldb/trunk/include/lldb/Core/ValueObject.h
    lldb/trunk/include/lldb/Interpreter/ScriptInterpreter.h
    lldb/trunk/include/lldb/Interpreter/ScriptInterpreterPython.h
    lldb/trunk/include/lldb/lldb-enumerations.h
    lldb/trunk/include/lldb/lldb-forward.h
    lldb/trunk/lldb.xcodeproj/project.pbxproj
    lldb/trunk/scripts/Python/build-swig-Python.sh
    lldb/trunk/scripts/Python/interface/SBDebugger.i
    lldb/trunk/scripts/Python/python-extensions.swig
    lldb/trunk/scripts/lldb.swig
    lldb/trunk/source/API/SBDebugger.cpp
    lldb/trunk/source/Commands/CommandObjectFrame.cpp
    lldb/trunk/source/Commands/CommandObjectType.cpp
    lldb/trunk/source/Core/DataVisualization.cpp
    lldb/trunk/source/Core/Debugger.cpp
    lldb/trunk/source/Core/FormatClasses.cpp
    lldb/trunk/source/Core/FormatManager.cpp
    lldb/trunk/source/Core/ValueObject.cpp
    lldb/trunk/source/Interpreter/ScriptInterpreterPython.cpp

Modified: lldb/trunk/include/lldb/API/SBDebugger.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBDebugger.h?rev=150558&r1=150557&r2=150558&view=diff
==============================================================================
--- lldb/trunk/include/lldb/API/SBDebugger.h (original)
+++ lldb/trunk/include/lldb/API/SBDebugger.h Tue Feb 14 20:34:21 2012
@@ -241,6 +241,36 @@
     void
     SetCloseInputOnEOF (bool b);
 
+    SBTypeCategory
+    GetCategory (const char* category_name);
+
+    SBTypeCategory
+    CreateCategory (const char* category_name);
+    
+    bool
+    DeleteCategory (const char* category_name);
+    
+    uint32_t
+    GetNumCategories ();
+    
+    SBTypeCategory
+    GetCategoryAtIndex (uint32_t);
+    
+    SBTypeCategory
+    GetDefaultCategory();
+    
+    SBTypeFormat
+    GetFormatForType (SBTypeNameSpecifier);
+
+    SBTypeSummary
+    GetSummaryForType (SBTypeNameSpecifier);
+
+    SBTypeFilter
+    GetFilterForType (SBTypeNameSpecifier);
+
+    SBTypeSynthetic
+    GetSyntheticForType (SBTypeNameSpecifier);
+
 private:
 
     friend class SBInputReader;

Modified: lldb/trunk/include/lldb/API/SBDefines.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBDefines.h?rev=150558&r1=150557&r2=150558&view=diff
==============================================================================
--- lldb/trunk/include/lldb/API/SBDefines.h (original)
+++ lldb/trunk/include/lldb/API/SBDefines.h Tue Feb 14 20:34:21 2012
@@ -59,6 +59,12 @@
 class SBTarget;
 class SBThread;
 class SBType;
+class SBTypeCategory;
+class SBTypeFilter;
+class SBTypeFormat;
+class SBTypeNameSpecifier;
+class SBTypeSummary;
+class SBTypeSynthetic;    
 class SBTypeList;
 class SBValue;
 class SBValueList;

Added: lldb/trunk/include/lldb/API/SBTypeCategory.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBTypeCategory.h?rev=150558&view=auto
==============================================================================
--- lldb/trunk/include/lldb/API/SBTypeCategory.h (added)
+++ lldb/trunk/include/lldb/API/SBTypeCategory.h Tue Feb 14 20:34:21 2012
@@ -0,0 +1,150 @@
+//===-- SBTypeCategory.h --------------------------------------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLDB_SBTypeCategory_h_
+#define LLDB_SBTypeCategory_h_
+
+#include "lldb/API/SBDefines.h"
+
+namespace lldb {
+    
+    class SBTypeCategory
+    {
+    public:
+        
+        SBTypeCategory();
+        
+        SBTypeCategory (const lldb::SBTypeCategory &rhs);
+        
+        ~SBTypeCategory ();
+        
+        bool
+        IsValid() const;
+        
+        bool
+        GetEnabled ();
+        
+        void
+        SetEnabled (bool);
+        
+        const char*
+        GetName();
+        
+        bool
+        GetDescription (lldb::SBStream &description, 
+                        lldb::DescriptionLevel description_level);
+        
+        uint32_t
+        GetNumFormats ();
+        
+        uint32_t
+        GetNumSummaries ();
+        
+        uint32_t
+        GetNumFilters ();
+        
+        uint32_t
+        GetNumSynthetics ();
+        
+        SBTypeNameSpecifier
+        GetTypeNameSpecifierForFilterAtIndex (uint32_t);
+        
+        SBTypeNameSpecifier
+        GetTypeNameSpecifierForFormatAtIndex (uint32_t);
+        
+        SBTypeNameSpecifier
+        GetTypeNameSpecifierForSummaryAtIndex (uint32_t);
+
+        SBTypeNameSpecifier
+        GetTypeNameSpecifierForSyntheticAtIndex (uint32_t);
+        
+        SBTypeFilter
+        GetFilterForType (SBTypeNameSpecifier);
+
+        SBTypeFormat
+        GetFormatForType (SBTypeNameSpecifier);
+        
+        SBTypeSummary
+        GetSummaryForType (SBTypeNameSpecifier);
+
+        SBTypeSynthetic
+        GetSyntheticForType (SBTypeNameSpecifier);
+        
+        SBTypeFilter
+        GetFilterAtIndex (uint32_t);
+        
+        SBTypeFormat
+        GetFormatAtIndex (uint32_t);
+        
+        SBTypeSummary
+        GetSummaryAtIndex (uint32_t);
+        
+        SBTypeSynthetic
+        GetSyntheticAtIndex (uint32_t);
+        
+        bool
+        AddTypeFormat (SBTypeNameSpecifier,
+                       SBTypeFormat);
+        
+        bool
+        DeleteTypeFormat (SBTypeNameSpecifier);
+        
+        bool
+        AddTypeSummary (SBTypeNameSpecifier,
+                        SBTypeSummary);
+        
+        bool
+        DeleteTypeSummary (SBTypeNameSpecifier);
+        
+        bool
+        AddTypeFilter (SBTypeNameSpecifier,
+                       SBTypeFilter);
+        
+        bool
+        DeleteTypeFilter (SBTypeNameSpecifier);
+        
+        bool
+        AddTypeSynthetic (SBTypeNameSpecifier,
+                          SBTypeSynthetic);
+        
+        bool
+        DeleteTypeSynthetic (SBTypeNameSpecifier);
+        
+        lldb::SBTypeCategory &
+        operator = (const lldb::SBTypeCategory &rhs);
+        
+        bool
+        operator == (lldb::SBTypeCategory &rhs);
+        
+        bool
+        operator != (lldb::SBTypeCategory &rhs);
+        
+    protected:
+        friend class SBDebugger;
+        
+        lldb::TypeCategoryImplSP
+        GetSP ();
+        
+        void
+        SetSP (const lldb::TypeCategoryImplSP &typecategory_impl_sp);    
+        
+        TypeCategoryImplSP m_opaque_sp;
+        
+        SBTypeCategory (const lldb::TypeCategoryImplSP &);
+        
+        SBTypeCategory (const char*);
+        
+        bool
+        IsDefaultCategory();
+        
+    };
+    
+} // namespace lldb
+
+#endif // LLDB_SBTypeCategory_h_

Added: lldb/trunk/include/lldb/API/SBTypeFilter.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBTypeFilter.h?rev=150558&view=auto
==============================================================================
--- lldb/trunk/include/lldb/API/SBTypeFilter.h (added)
+++ lldb/trunk/include/lldb/API/SBTypeFilter.h Tue Feb 14 20:34:21 2012
@@ -0,0 +1,91 @@
+//===-- SBTypeFilter.h --------------------------------------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLDB_SBTypeFilter_h_
+#define LLDB_SBTypeFilter_h_
+
+#include "lldb/API/SBDefines.h"
+
+namespace lldb {
+    
+    class SBTypeFilter
+    {
+    public:
+        
+        SBTypeFilter();
+        
+        SBTypeFilter (uint32_t options); // see lldb::eTypeOption values
+        
+        SBTypeFilter (const lldb::SBTypeFilter &rhs);
+        
+        ~SBTypeFilter ();
+        
+        bool
+        IsValid() const;
+
+        uint32_t
+        GetNumberOfExpressionPaths ();
+        
+        const char*
+        GetExpressionPathAtIndex (uint32_t i);
+        
+        bool
+        ReplaceExpressionPathAtIndex (uint32_t i, const char* item);
+        
+        void
+        AppendExpressionPath (const char* item);
+        
+        void
+        Clear();
+                
+        uint32_t
+        GetOptions();
+        
+        void
+        SetOptions (uint32_t);
+        
+        bool
+        GetDescription (lldb::SBStream &description, 
+                        lldb::DescriptionLevel description_level);
+        
+        lldb::SBTypeFilter &
+        operator = (const lldb::SBTypeFilter &rhs);
+        
+        bool
+        IsEqualTo (lldb::SBTypeFilter &rhs);
+        
+        bool
+        operator == (lldb::SBTypeFilter &rhs);
+
+        bool
+        operator != (lldb::SBTypeFilter &rhs);
+        
+    protected:
+        friend class SBDebugger;
+        friend class SBTypeCategory;
+        
+        lldb::TypeFilterImplSP
+        GetSP ();
+        
+        void
+        SetSP (const lldb::TypeFilterImplSP &typefilter_impl_sp);    
+        
+        lldb::TypeFilterImplSP m_opaque_sp;
+        
+        SBTypeFilter (const lldb::TypeFilterImplSP &);
+        
+        bool
+        CopyOnWrite_Impl();
+        
+    };
+    
+    
+} // namespace lldb
+
+#endif // LLDB_SBTypeFilter_h_

Added: lldb/trunk/include/lldb/API/SBTypeFormat.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBTypeFormat.h?rev=150558&view=auto
==============================================================================
--- lldb/trunk/include/lldb/API/SBTypeFormat.h (added)
+++ lldb/trunk/include/lldb/API/SBTypeFormat.h Tue Feb 14 20:34:21 2012
@@ -0,0 +1,83 @@
+//===-- SBTypeFormat.h --------------------------------------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLDB_SBTypeFormat_h_
+#define LLDB_SBTypeFormat_h_
+
+#include "lldb/API/SBDefines.h"
+
+namespace lldb {
+
+class SBTypeFormat
+{
+public:
+    
+    SBTypeFormat();
+    
+    SBTypeFormat (lldb::Format format,
+                  uint32_t options = 0); // see lldb::eTypeOption values
+    
+    SBTypeFormat (const lldb::SBTypeFormat &rhs);
+    
+    ~SBTypeFormat ();
+    
+    bool
+    IsValid() const;
+    
+    lldb::Format
+    GetFormat ();
+    
+    uint32_t
+    GetOptions();
+    
+    void
+    SetFormat (lldb::Format);
+    
+    void
+    SetOptions (uint32_t);
+    
+    bool
+    GetDescription (lldb::SBStream &description, 
+                    lldb::DescriptionLevel description_level);
+    
+    lldb::SBTypeFormat &
+    operator = (const lldb::SBTypeFormat &rhs);
+    
+    bool
+    IsEqualTo (lldb::SBTypeFormat &rhs);
+
+    bool
+    operator == (lldb::SBTypeFormat &rhs);
+    
+    bool
+    operator != (lldb::SBTypeFormat &rhs);
+    
+protected:
+    friend class SBDebugger;
+    friend class SBTypeCategory;
+    
+    lldb::TypeFormatImplSP
+    GetSP ();
+    
+    void
+    SetSP (const lldb::TypeFormatImplSP &typeformat_impl_sp);    
+    
+    lldb::TypeFormatImplSP m_opaque_sp;
+    
+    SBTypeFormat (const lldb::TypeFormatImplSP &);
+    
+    bool
+    CopyOnWrite_Impl();
+    
+};
+
+    
+} // namespace lldb
+
+#endif // LLDB_SBTypeFormat_h_

Added: lldb/trunk/include/lldb/API/SBTypeNameSpecifier.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBTypeNameSpecifier.h?rev=150558&view=auto
==============================================================================
--- lldb/trunk/include/lldb/API/SBTypeNameSpecifier.h (added)
+++ lldb/trunk/include/lldb/API/SBTypeNameSpecifier.h Tue Feb 14 20:34:21 2012
@@ -0,0 +1,71 @@
+//===-- SBTypeNameSpecifier.h --------------------------------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLDB_SBTypeNameSpecifier_h_
+#define LLDB_SBTypeNameSpecifier_h_
+
+#include "lldb/API/SBDefines.h"
+
+namespace lldb {
+    
+    class SBTypeNameSpecifier
+    {
+    public:
+        
+        SBTypeNameSpecifier();
+        
+        SBTypeNameSpecifier (const char* name,
+                             bool is_regex = false);
+        
+        SBTypeNameSpecifier (const lldb::SBTypeNameSpecifier &rhs);
+        
+        ~SBTypeNameSpecifier ();
+        
+        bool
+        IsValid() const;
+        
+        const char*
+        GetName();
+        
+        bool
+        IsRegex();
+        
+        bool
+        GetDescription (lldb::SBStream &description, 
+                        lldb::DescriptionLevel description_level);
+        
+        lldb::SBTypeNameSpecifier &
+        operator = (const lldb::SBTypeNameSpecifier &rhs);
+        
+        bool
+        IsEqualTo (lldb::SBTypeNameSpecifier &rhs);
+
+        bool
+        operator == (lldb::SBTypeNameSpecifier &rhs);
+        
+        bool
+        operator != (lldb::SBTypeNameSpecifier &rhs);
+        
+    protected:
+        friend class SBTypeCategory;
+        
+        lldb::TypeNameSpecifierImplSP
+        GetSP ();
+        
+        void
+        SetSP (const lldb::TypeNameSpecifierImplSP &type_namespec_sp);    
+        
+        lldb::TypeNameSpecifierImplSP m_opaque_sp;
+        
+        SBTypeNameSpecifier (const lldb::TypeNameSpecifierImplSP &);
+    };
+    
+} // namespace lldb
+
+#endif // LLDB_SBTypeNameSpecifier_h_

Added: lldb/trunk/include/lldb/API/SBTypeSummary.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBTypeSummary.h?rev=150558&view=auto
==============================================================================
--- lldb/trunk/include/lldb/API/SBTypeSummary.h (added)
+++ lldb/trunk/include/lldb/API/SBTypeSummary.h Tue Feb 14 20:34:21 2012
@@ -0,0 +1,110 @@
+//===-- SBTypeSummary.h -------------------------------------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLDB_SBTypeSummary_h_
+#define LLDB_SBTypeSummary_h_
+
+#include "lldb/API/SBDefines.h"
+
+namespace lldb {
+    
+    class SBTypeSummary
+    {
+    public:
+        
+        SBTypeSummary();
+        
+        static SBTypeSummary
+        CreateWithSummaryString (const char* data,
+                                 uint32_t options = 0); // see lldb::eTypeOption values
+        
+        static SBTypeSummary
+        CreateWithFunctionName (const char* data,
+                                uint32_t options = 0); // see lldb::eTypeOption values
+        
+        static SBTypeSummary
+        CreateWithScriptCode (const char* data,
+                              uint32_t options = 0); // see lldb::eTypeOption values
+        
+        SBTypeSummary (const lldb::SBTypeSummary &rhs);
+        
+        ~SBTypeSummary ();
+        
+        bool
+        IsValid() const;
+        
+        bool
+        IsFunctionCode();
+        
+        bool
+        IsFunctionName();
+        
+        bool
+        IsSummaryString();
+        
+        const char*
+        GetData ();
+        
+        void
+        SetSummaryString (const char* data);
+        
+        void
+        SetFunctionName (const char* data);
+        
+        void
+        SetFunctionCode (const char* data);
+        
+        uint32_t
+        GetOptions ();
+        
+        void
+        SetOptions (uint32_t);
+        
+        bool
+        GetDescription (lldb::SBStream &description, 
+                        lldb::DescriptionLevel description_level);
+        
+        lldb::SBTypeSummary &
+        operator = (const lldb::SBTypeSummary &rhs);
+        
+        bool
+        IsEqualTo (lldb::SBTypeSummary &rhs);
+
+        bool
+        operator == (lldb::SBTypeSummary &rhs);
+        
+        bool
+        operator != (lldb::SBTypeSummary &rhs);
+        
+    protected:
+        friend class SBDebugger;
+        friend class SBTypeCategory;
+        
+        lldb::TypeSummaryImplSP
+        GetSP ();
+        
+        void
+        SetSP (const lldb::TypeSummaryImplSP &typefilter_impl_sp);    
+        
+        lldb::TypeSummaryImplSP m_opaque_sp;
+        
+        SBTypeSummary (const lldb::TypeSummaryImplSP &);
+        
+        bool
+        CopyOnWrite_Impl();
+        
+        bool
+        ChangeSummaryType (bool want_script);
+        
+    };
+    
+    
+} // namespace lldb
+
+#endif // LLDB_SBTypeSummary_h_

Added: lldb/trunk/include/lldb/API/SBTypeSynthetic.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBTypeSynthetic.h?rev=150558&view=auto
==============================================================================
--- lldb/trunk/include/lldb/API/SBTypeSynthetic.h (added)
+++ lldb/trunk/include/lldb/API/SBTypeSynthetic.h Tue Feb 14 20:34:21 2012
@@ -0,0 +1,97 @@
+//===-- SBTypeSynthetic.h -----------------------------------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLDB_SBTypeSynthetic_h_
+#define LLDB_SBTypeSynthetic_h_
+
+#include "lldb/API/SBDefines.h"
+
+namespace lldb {
+    
+    class SBTypeSynthetic
+    {
+    public:
+        
+        SBTypeSynthetic();
+        
+        static SBTypeSynthetic
+        CreateWithClassName (const char* data,
+                             uint32_t options = 0); // see lldb::eTypeOption values
+        
+        static SBTypeSynthetic
+        CreateWithScriptCode (const char* data,
+                              uint32_t options = 0); // see lldb::eTypeOption values
+        
+        SBTypeSynthetic (const lldb::SBTypeSynthetic &rhs);
+        
+        ~SBTypeSynthetic ();
+        
+        bool
+        IsValid() const;
+        
+        bool
+        IsClassCode();
+
+        bool
+        IsClassName();
+        
+        const char*
+        GetData ();
+        
+        void
+        SetClassName (const char* data);
+        
+        void
+        SetClassCode (const char* data);
+                
+        uint32_t
+        GetOptions ();
+        
+        void
+        SetOptions (uint32_t);
+        
+        bool
+        GetDescription (lldb::SBStream &description, 
+                        lldb::DescriptionLevel description_level);
+        
+        lldb::SBTypeSynthetic &
+        operator = (const lldb::SBTypeSynthetic &rhs);
+
+        bool
+        IsEqualTo (lldb::SBTypeSynthetic &rhs);
+        
+        bool
+        operator == (lldb::SBTypeSynthetic &rhs);
+        
+        bool
+        operator != (lldb::SBTypeSynthetic &rhs);
+        
+    protected:
+        friend class SBDebugger;
+        friend class SBTypeCategory;
+        
+        lldb::TypeSyntheticImplSP
+        GetSP ();
+        
+        void
+        SetSP (const lldb::TypeSyntheticImplSP &typefilter_impl_sp);    
+        
+        lldb::TypeSyntheticImplSP m_opaque_sp;
+        
+        SBTypeSynthetic (const lldb::TypeSyntheticImplSP &);
+        
+        bool
+        CopyOnWrite_Impl();
+        
+    };
+    
+    
+} // namespace lldb
+
+#endif // LLDB_SBTypeSynthetic_h_

Modified: lldb/trunk/include/lldb/Core/DataVisualization.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/DataVisualization.h?rev=150558&r1=150557&r2=150558&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/DataVisualization.h (original)
+++ lldb/trunk/include/lldb/Core/DataVisualization.h Tue Feb 14 20:34:21 2012
@@ -47,11 +47,14 @@
     class ValueFormats
     {
     public:
-        static lldb::ValueFormatSP
+        static lldb::TypeFormatImplSP
         GetFormat (ValueObject& valobj, lldb::DynamicValueType use_dynamic);
         
+        static lldb::TypeFormatImplSP
+        GetFormat (const ConstString &type);
+        
         static void
-        Add (const ConstString &type, const lldb::ValueFormatSP &entry);
+        Add (const ConstString &type, const lldb::TypeFormatImplSP &entry);
         
         static bool
         Delete (const ConstString &type);
@@ -60,13 +63,19 @@
         Clear ();
         
         static void
-        LoopThrough (ValueFormat::ValueCallback callback, void* callback_baton);
+        LoopThrough (TypeFormatImpl::ValueCallback callback, void* callback_baton);
         
         static uint32_t
         GetCount ();
+        
+        static lldb::TypeNameSpecifierImplSP
+        GetTypeNameSpecifierForFormatAtIndex (uint32_t);
+        
+        static lldb::TypeFormatImplSP
+        GetFormatAtIndex (uint32_t);
     };
     
-    static lldb::SummaryFormatSP
+    static lldb::TypeSummaryImplSP
     GetSummaryFormat(ValueObject& valobj,
                      lldb::DynamicValueType use_dynamic);
     
@@ -76,19 +85,19 @@
     
     static bool
     AnyMatches(ConstString type_name,
-               FormatCategory::FormatCategoryItems items = FormatCategory::ALL_ITEM_TYPES,
+               TypeCategoryImpl::FormatCategoryItems items = TypeCategoryImpl::ALL_ITEM_TYPES,
                bool only_enabled = true,
                const char** matching_category = NULL,
-               FormatCategory::FormatCategoryItems* matching_type = NULL);
+               TypeCategoryImpl::FormatCategoryItems* matching_type = NULL);
     
     class NamedSummaryFormats
     {
     public:
         static bool
-        GetSummaryFormat (const ConstString &type, lldb::SummaryFormatSP &entry);
+        GetSummaryFormat (const ConstString &type, lldb::TypeSummaryImplSP &entry);
         
         static void
-        Add (const ConstString &type, const lldb::SummaryFormatSP &entry);
+        Add (const ConstString &type, const lldb::TypeSummaryImplSP &entry);
         
         static bool
         Delete (const ConstString &type);
@@ -97,7 +106,7 @@
         Clear ();
         
         static void
-        LoopThrough (SummaryFormat::SummaryCallback callback, void* callback_baton);
+        LoopThrough (TypeSummaryImpl::SummaryCallback callback, void* callback_baton);
         
         static uint32_t
         GetCount ();
@@ -108,8 +117,10 @@
     public:
         
         static bool
-        GetCategory (const ConstString &category, lldb::FormatCategorySP &entry);
-        
+        GetCategory (const ConstString &category,
+                     lldb::TypeCategoryImplSP &entry,
+                     bool allow_create = true);
+
         static void
         Add (const ConstString &category);
         
@@ -120,19 +131,30 @@
         Clear ();
         
         static void
-        Clear (ConstString &category);
+        Clear (const ConstString &category);
         
         static void
-        Enable (ConstString& category);
+        Enable (const ConstString& category,
+                CategoryMap::Position = CategoryMap::Default);
         
         static void
-        Disable (ConstString& category);
+        Disable (const ConstString& category);
+
+        static void
+        Enable (const lldb::TypeCategoryImplSP& category,
+                CategoryMap::Position = CategoryMap::Default);
+        
+        static void
+        Disable (const lldb::TypeCategoryImplSP& category);
         
         static void
         LoopThrough (FormatManager::CategoryCallback callback, void* callback_baton);
         
         static uint32_t
         GetCount ();
+        
+        static lldb::TypeCategoryImplSP
+        GetCategoryAtIndex (uint32_t);
     };
 };
 

Modified: lldb/trunk/include/lldb/Core/Debugger.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Debugger.h?rev=150558&r1=150557&r2=150558&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/Debugger.h (original)
+++ lldb/trunk/include/lldb/Core/Debugger.h Tue Feb 14 20:34:21 2012
@@ -450,6 +450,12 @@
     
     static lldb::DebuggerSP
     FindDebuggerWithInstanceName (const ConstString &instance_name);
+    
+    static uint32_t
+    GetNumDebuggers();
+    
+    static lldb::DebuggerSP
+    GetDebuggerAtIndex (uint32_t);
 
     static bool
     FormatPrompt (const char *format,

Modified: lldb/trunk/include/lldb/Core/FormatClasses.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/FormatClasses.h?rev=150558&r1=150557&r2=150558&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/FormatClasses.h (original)
+++ lldb/trunk/include/lldb/Core/FormatClasses.h Tue Feb 14 20:34:21 2012
@@ -45,47 +45,193 @@
 
 namespace lldb_private {
 
-struct ValueFormat
+class TypeFormatImpl
 {
-    uint32_t m_my_revision;
-    bool m_cascades;
-    bool m_skip_pointers;
-    bool m_skip_references;
-    lldb::Format m_format;
-    ValueFormat (lldb::Format f = lldb::eFormatInvalid,
-                 bool casc = false,
-                 bool skipptr = false,
-                 bool skipref = false);
+public:
+    class Flags
+    {
+    public:
+        
+        Flags () :
+        m_flags (lldb::eTypeOptionCascade)
+        {}
+        
+        Flags (const Flags& other) :
+        m_flags (other.m_flags)
+        {}
+        
+        Flags (uint32_t value) :
+        m_flags (value)
+        {}
+        
+        Flags&
+        operator = (const Flags& rhs)
+        {
+            if (&rhs != this)
+                m_flags = rhs.m_flags;
+            
+            return *this;
+        }
+        
+        Flags&
+        operator = (const uint32_t& rhs)
+        {
+            m_flags = rhs;
+            return *this;
+        }
+        
+        Flags&
+        Clear()
+        {
+            m_flags = 0;
+            return *this;
+        }
+        
+        bool
+        GetCascades () const
+        {
+            return (m_flags & lldb::eTypeOptionCascade) == lldb::eTypeOptionCascade;
+        }
+        
+        Flags&
+        SetCascades (bool value = true)
+        {
+            if (value)
+                m_flags |= lldb::eTypeOptionCascade;
+            else
+                m_flags &= ~lldb::eTypeOptionCascade;
+            return *this;
+        }
+        
+        bool
+        GetSkipPointers () const
+        {
+            return (m_flags & lldb::eTypeOptionSkipPointers) == lldb::eTypeOptionSkipPointers;
+        }
+        
+        Flags&
+        SetSkipPointers (bool value = true)
+        {
+            if (value)
+                m_flags |= lldb::eTypeOptionSkipPointers;
+            else
+                m_flags &= ~lldb::eTypeOptionSkipPointers;
+            return *this;
+        }
+        
+        bool
+        GetSkipReferences () const
+        {
+            return (m_flags & lldb::eTypeOptionSkipReferences) == lldb::eTypeOptionSkipReferences;
+        }
+        
+        Flags&
+        SetSkipReferences (bool value = true)
+        {
+            if (value)
+                m_flags |= lldb::eTypeOptionSkipReferences;
+            else
+                m_flags &= ~lldb::eTypeOptionSkipReferences;
+            return *this;
+        }
+        
+        uint32_t
+        GetValue ()
+        {
+            return m_flags;
+        }
+        
+        void
+        SetValue (uint32_t value)
+        {
+            m_flags = value;
+        }
+
+    private:
+        uint32_t m_flags;
+    };
+    
+    TypeFormatImpl (lldb::Format f = lldb::eFormatInvalid,
+                 const Flags& flags = Flags());
     
-    typedef SHARED_PTR(ValueFormat) SharedPointer;
-    typedef bool(*ValueCallback)(void*, ConstString, const lldb::ValueFormatSP&);
+    typedef SHARED_PTR(TypeFormatImpl) SharedPointer;
+    typedef bool(*ValueCallback)(void*, ConstString, const lldb::TypeFormatImplSP&);
     
-    ~ValueFormat()
+    ~TypeFormatImpl ()
     {
     }
     
     bool
-    Cascades() const
+    Cascades () const
     {
-        return m_cascades;
+        return m_flags.GetCascades();
     }
     bool
-    SkipsPointers() const
+    SkipsPointers () const
     {
-        return m_skip_pointers;
+        return m_flags.GetSkipPointers();
     }
     bool
-    SkipsReferences() const
+    SkipsReferences () const
     {
-        return m_skip_references;
+        return m_flags.GetSkipReferences();
+    }
+    
+    void
+    SetCascades (bool value)
+    {
+        m_flags.SetCascades(value);
+    }
+    
+    void
+    SetSkipsPointers (bool value)
+    {
+        m_flags.SetSkipPointers(value);
+    }
+    
+    void
+    SetSkipsReferences (bool value)
+    {
+        m_flags.SetSkipReferences(value);
     }
     
     lldb::Format
-    GetFormat() const
+    GetFormat () const
     {
         return m_format;
     }
-        
+    
+    void
+    SetFormat (lldb::Format fmt)
+    {
+        m_format = fmt;
+    }
+    
+    uint32_t
+    GetOptions ()
+    {
+        return m_flags.GetValue();
+    }
+    
+    void
+    SetOptions (uint32_t value)
+    {
+        m_flags.SetValue(value);
+    }
+    
+    uint32_t&
+    GetRevision ()
+    {
+        return m_my_revision;
+    }
+    
+    std::string
+    GetDescription();
+    
+protected:
+    Flags m_flags;
+    lldb::Format m_format;
+    uint32_t m_my_revision;
 };
     
 class SyntheticChildrenFrontEnd
@@ -122,69 +268,231 @@
 class SyntheticChildren
 {
 public:
-    uint32_t m_my_revision;
-    bool m_cascades;
-    bool m_skip_pointers;
-    bool m_skip_references;
-public:
-    SyntheticChildren(bool casc = false,
-                      bool skipptr = false,
-                      bool skipref = false) :
-    m_cascades(casc),
-    m_skip_pointers(skipptr),
-    m_skip_references(skipref)
+    
+    class Flags
+    {
+    public:
+        
+        Flags () :
+        m_flags (lldb::eTypeOptionCascade)
+        {}
+        
+        Flags (const Flags& other) :
+        m_flags (other.m_flags)
+        {}
+        
+        Flags (uint32_t value) :
+        m_flags (value)
+        {}
+        
+        Flags&
+        operator = (const Flags& rhs)
+        {
+            if (&rhs != this)
+                m_flags = rhs.m_flags;
+            
+            return *this;
+        }
+        
+        Flags&
+        operator = (const uint32_t& rhs)
+        {
+            m_flags = rhs;
+            return *this;
+        }
+        
+        Flags&
+        Clear()
+        {
+            m_flags = 0;
+            return *this;
+        }
+        
+        bool
+        GetCascades () const
+        {
+            return (m_flags & lldb::eTypeOptionCascade) == lldb::eTypeOptionCascade;
+        }
+        
+        Flags&
+        SetCascades (bool value = true)
+        {
+            if (value)
+                m_flags |= lldb::eTypeOptionCascade;
+            else
+                m_flags &= ~lldb::eTypeOptionCascade;
+            return *this;
+        }
+        
+        bool
+        GetSkipPointers () const
+        {
+            return (m_flags & lldb::eTypeOptionSkipPointers) == lldb::eTypeOptionSkipPointers;
+        }
+        
+        Flags&
+        SetSkipPointers (bool value = true)
+        {
+            if (value)
+                m_flags |= lldb::eTypeOptionSkipPointers;
+            else
+                m_flags &= ~lldb::eTypeOptionSkipPointers;
+            return *this;
+        }
+        
+        bool
+        GetSkipReferences () const
+        {
+            return (m_flags & lldb::eTypeOptionSkipReferences) == lldb::eTypeOptionSkipReferences;
+        }
+        
+        Flags&
+        SetSkipReferences (bool value = true)
+        {
+            if (value)
+                m_flags |= lldb::eTypeOptionSkipReferences;
+            else
+                m_flags &= ~lldb::eTypeOptionSkipReferences;
+            return *this;
+        }
+        
+        uint32_t
+        GetValue ()
+        {
+            return m_flags;
+        }
+        
+        void
+        SetValue (uint32_t value)
+        {
+            m_flags = value;
+        }
+        
+    private:
+        uint32_t m_flags;
+    };
+    
+    SyntheticChildren (const Flags& flags) :
+        m_flags(flags)
     {
     }
     
     virtual
-    ~SyntheticChildren()
+    ~SyntheticChildren ()
     {
     }
     
     bool
-    Cascades() const
+    Cascades () const
     {
-        return m_cascades;
+        return m_flags.GetCascades();
     }
     bool
-    SkipsPointers() const
+    SkipsPointers () const
     {
-        return m_skip_pointers;
+        return m_flags.GetSkipPointers();
     }
     bool
-    SkipsReferences() const
+    SkipsReferences () const
+    {
+        return m_flags.GetSkipReferences();
+    }
+    
+    void
+    SetCascades (bool value)
     {
-        return m_skip_references;
+        m_flags.SetCascades(value);
+    }
+    
+    void
+    SetSkipsPointers (bool value)
+    {
+        m_flags.SetSkipPointers(value);
+    }
+    
+    void
+    SetSkipsReferences (bool value)
+    {
+        m_flags.SetSkipReferences(value);
+    }
+    
+    uint32_t
+    GetOptions ()
+    {
+        return m_flags.GetValue();
+    }
+    
+    void
+    SetOptions (uint32_t value)
+    {
+        m_flags.SetValue(value);
     }
     
     virtual bool
-    IsScripted() = 0;
+    IsScripted () = 0;
     
     virtual std::string
-    GetDescription() = 0;
+    GetDescription () = 0;
     
     virtual SyntheticChildrenFrontEnd::SharedPointer
-    GetFrontEnd(lldb::ValueObjectSP backend) = 0;
+    GetFrontEnd (lldb::ValueObjectSP backend) = 0;
     
     typedef SHARED_PTR(SyntheticChildren) SharedPointer;
     typedef bool(*SyntheticChildrenCallback)(void*, ConstString, const SyntheticChildren::SharedPointer&);
     
+    uint32_t&
+    GetRevision ()
+    {
+        return m_my_revision;
+    }
+    
+protected:
+    uint32_t m_my_revision;
+    Flags m_flags;
 };
 
-class SyntheticFilter : public SyntheticChildren
+class TypeFilterImpl : public SyntheticChildren
 {
     std::vector<std::string> m_expression_paths;
 public:
-    SyntheticFilter(bool casc = false,
-                    bool skipptr = false,
-                    bool skipref = false) :
-    SyntheticChildren(casc, skipptr, skipref),
-    m_expression_paths()
+    TypeFilterImpl(const SyntheticChildren::Flags& flags) :
+        SyntheticChildren(flags),
+        m_expression_paths()
+    {
+    }
+    
+    void
+    AddExpressionPath (const char* path)
+    {
+        AddExpressionPath(std::string(path));
+    }
+        
+    void
+    Clear()
+    {
+        m_expression_paths.clear();
+    }
+    
+    int
+    GetCount() const
+    {
+        return m_expression_paths.size();
+    }
+    
+    const char*
+    GetExpressionPathAtIndex(int i) const
+    {
+        return m_expression_paths[i].c_str();
+    }
+    
+    bool
+    SetExpressionPathAtIndex (int i, const char* path)
     {
+        return SetExpressionPathAtIndex(i, std::string(path));
     }
     
     void
-    AddExpressionPath(std::string path)
+    AddExpressionPath (std::string path)
     {
         bool need_add_dot = true;
         if (path[0] == '.' ||
@@ -197,17 +505,23 @@
         else
             m_expression_paths.push_back(std::string(".") + path);
     }
-        
-    int
-    GetCount() const
-    {
-        return m_expression_paths.size();
-    }
     
-    const std::string&
-    GetExpressionPathAtIndex(int i) const
+    bool
+    SetExpressionPathAtIndex (int i, std::string path)
     {
-        return m_expression_paths[i];
+        if (i >= GetCount())
+            return false;
+        bool need_add_dot = true;
+        if (path[0] == '.' ||
+            (path[0] == '-' && path[1] == '>') ||
+            path[0] == '[')
+            need_add_dot = false;
+        // add a '.' symbol to help forgetful users
+        if(!need_add_dot)
+            m_expression_paths[i] = path;
+        else
+            m_expression_paths[i] = std::string(".") + path;
+        return true;
     }
     
     bool
@@ -222,10 +536,10 @@
     class FrontEnd : public SyntheticChildrenFrontEnd
     {
     private:
-        SyntheticFilter* filter;
+        TypeFilterImpl* filter;
     public:
         
-        FrontEnd(SyntheticFilter* flt,
+        FrontEnd(TypeFilterImpl* flt,
                  lldb::ValueObjectSP be) :
         SyntheticChildrenFrontEnd(be),
         filter(flt)
@@ -247,7 +561,7 @@
         {
             if (idx >= filter->GetCount())
                 return lldb::ValueObjectSP();
-            return m_backend->GetSyntheticExpressionPathChild(filter->GetExpressionPathAtIndex(idx).c_str(), can_create);
+            return m_backend->GetSyntheticExpressionPathChild(filter->GetExpressionPathAtIndex(idx), can_create);
         }
         
         virtual void
@@ -259,7 +573,7 @@
             const char* name_cstr = name.GetCString();
             for (int i = 0; i < filter->GetCount(); i++)
             {
-                const char* expr_cstr = filter->GetExpressionPathAtIndex(i).c_str();
+                const char* expr_cstr = filter->GetExpressionPathAtIndex(i);
                 if (::strcmp(name_cstr, expr_cstr))
                     return i;
             }
@@ -280,24 +594,48 @@
 
 #ifndef LLDB_DISABLE_PYTHON
 
-class SyntheticScriptProvider : public SyntheticChildren
+class TypeSyntheticImpl : public SyntheticChildren
 {
     std::string m_python_class;
+    std::string m_python_code;
 public:
-    SyntheticScriptProvider(bool casc = false,
-                            bool skipptr = false,
-                            bool skipref = false,
-                            std::string pclass = "") :
-    SyntheticChildren(casc, skipptr, skipref),
-    m_python_class(pclass)
+    
+    TypeSyntheticImpl(const SyntheticChildren::Flags& flags,
+                      const char* pclass,
+                      const char* pcode = NULL) :
+        SyntheticChildren(flags),
+        m_python_class(),
+        m_python_code()
+    {
+        if (pclass)
+                m_python_class = pclass;
+        if (pcode)
+                m_python_code = pcode;
+    }
+
+    const char*
+    GetPythonClassName()
     {
+        return m_python_class.c_str();
+    }
+
+    const char*
+    GetPythonCode()
+    {
+        return m_python_code.c_str();
     }
     
+    void
+    SetPythonClassName (const char* fname)
+    {
+        m_python_class.assign(fname);
+        m_python_code.clear();
+    }
     
-    std::string
-    GetPythonClassName()
+    void
+    SetPythonCode (const char* script)
     {
-        return m_python_class;
+        m_python_code.assign(script);
     }
     
     std::string
@@ -477,12 +815,10 @@
         
     };
     
-    SyntheticArrayView(bool casc = false,
-                       bool skipptr = false,
-                       bool skipref = false) :
-    SyntheticChildren(casc, skipptr, skipref),
-    m_head(),
-    m_tail(&m_head)
+    SyntheticArrayView(const SyntheticChildren::Flags& flags) :
+        SyntheticChildren(flags),
+        m_head(),
+        m_tail(&m_head)
     {
     }
     
@@ -566,7 +902,7 @@
 };
 
 
-class SummaryFormat
+class TypeSummaryImpl
 {
 public:
     class Flags
@@ -574,13 +910,17 @@
     public:
         
         Flags () :
-            m_flags (FVCascades)
+            m_flags (lldb::eTypeOptionCascade)
         {}
         
         Flags (const Flags& other) :
             m_flags (other.m_flags)
         {}
         
+        Flags (uint32_t value) :
+            m_flags (value)
+        {}
+        
         Flags&
         operator = (const Flags& rhs)
         {
@@ -591,6 +931,13 @@
         }
         
         Flags&
+        operator = (const uint32_t& rhs)
+        {
+            m_flags = rhs;
+            return *this;
+        }
+        
+        Flags&
         Clear()
         {
             m_flags = 0;
@@ -600,203 +947,278 @@
         bool
         GetCascades () const
         {
-            return (m_flags & FVCascades) == FVCascades;
+            return (m_flags & lldb::eTypeOptionCascade) == lldb::eTypeOptionCascade;
         }
         
         Flags&
         SetCascades (bool value = true)
         {
             if (value)
-                m_flags |= FVCascades;
+                m_flags |= lldb::eTypeOptionCascade;
             else
-                m_flags &= ~FVCascades;
+                m_flags &= ~lldb::eTypeOptionCascade;
             return *this;
         }
 
         bool
         GetSkipPointers () const
         {
-            return (m_flags & FVSkipPointers) == FVSkipPointers;
+            return (m_flags & lldb::eTypeOptionSkipPointers) == lldb::eTypeOptionSkipPointers;
         }
 
         Flags&
         SetSkipPointers (bool value = true)
         {
             if (value)
-                m_flags |= FVSkipPointers;
+                m_flags |= lldb::eTypeOptionSkipPointers;
             else
-                m_flags &= ~FVSkipPointers;
+                m_flags &= ~lldb::eTypeOptionSkipPointers;
             return *this;
         }
         
         bool
         GetSkipReferences () const
         {
-            return (m_flags & FVSkipReferences) == FVSkipReferences;
+            return (m_flags & lldb::eTypeOptionSkipReferences) == lldb::eTypeOptionSkipReferences;
         }
         
         Flags&
         SetSkipReferences (bool value = true)
         {
             if (value)
-                m_flags |= FVSkipReferences;
+                m_flags |= lldb::eTypeOptionSkipReferences;
             else
-                m_flags &= ~FVSkipReferences;
+                m_flags &= ~lldb::eTypeOptionSkipReferences;
             return *this;
         }
         
         bool
         GetDontShowChildren () const
         {
-            return (m_flags & FVDontShowChildren) == FVDontShowChildren;
+            return (m_flags & lldb::eTypeOptionHideChildren) == lldb::eTypeOptionHideChildren;
         }
         
         Flags&
         SetDontShowChildren (bool value = true)
         {
             if (value)
-                m_flags |= FVDontShowChildren;
+                m_flags |= lldb::eTypeOptionHideChildren;
             else
-                m_flags &= ~FVDontShowChildren;
+                m_flags &= ~lldb::eTypeOptionHideChildren;
             return *this;
         }
         
         bool
         GetDontShowValue () const
         {
-            return (m_flags & FVDontShowValue) == FVDontShowValue;
+            return (m_flags & lldb::eTypeOptionHideValue) == lldb::eTypeOptionHideValue;
         }
         
         Flags&
         SetDontShowValue (bool value = true)
         {
             if (value)
-                m_flags |= FVDontShowValue;
+                m_flags |= lldb::eTypeOptionHideValue;
             else
-                m_flags &= ~FVDontShowValue;
+                m_flags &= ~lldb::eTypeOptionHideValue;
             return *this;
         }
         
         bool
         GetShowMembersOneLiner () const
         {
-            return (m_flags & FVShowMembersOneLiner) == FVShowMembersOneLiner;
+            return (m_flags & lldb::eTypeOptionShowOneLiner) == lldb::eTypeOptionShowOneLiner;
         }
         
         Flags&
         SetShowMembersOneLiner (bool value = true)
         {
             if (value)
-                m_flags |= FVShowMembersOneLiner;
+                m_flags |= lldb::eTypeOptionShowOneLiner;
             else
-                m_flags &= ~FVShowMembersOneLiner;
+                m_flags &= ~lldb::eTypeOptionShowOneLiner;
             return *this;
         }
         
         bool
         GetHideItemNames () const
         {
-            return (m_flags & FVHideItemNames) == FVHideItemNames;
+            return (m_flags & lldb::eTypeOptionHideNames) == lldb::eTypeOptionHideNames;
         }
         
         Flags&
         SetHideItemNames (bool value = true)
         {
             if (value)
-                m_flags |= FVHideItemNames;
+                m_flags |= lldb::eTypeOptionHideNames;
             else
-                m_flags &= ~FVHideItemNames;
+                m_flags &= ~lldb::eTypeOptionHideNames;
             return *this;
         }
+        
+        uint32_t
+        GetValue ()
+        {
+            return m_flags;
+        }
+        
+        void
+        SetValue (uint32_t value)
+        {
+            m_flags = value;
+        }
                 
     private:
         uint32_t m_flags;
-        enum FlagValues
-        {
-            FVCascades            = 0x0001u,
-            FVSkipPointers        = 0x0002u,
-            FVSkipReferences      = 0x0004u,
-            FVDontShowChildren    = 0x0008u,
-            FVDontShowValue       = 0x0010u,
-            FVShowMembersOneLiner = 0x0020u,
-            FVHideItemNames       = 0x0040u
-        };
     };
     
-    uint32_t m_my_revision;
-    Flags m_flags;
-    
-    SummaryFormat(const SummaryFormat::Flags& flags);
+    TypeSummaryImpl (const TypeSummaryImpl::Flags& flags);
     
     bool
-    Cascades() const
+    Cascades () const
     {
         return m_flags.GetCascades();
     }
     bool
-    SkipsPointers() const
+    SkipsPointers () const
     {
         return m_flags.GetSkipPointers();
     }
     bool
-    SkipsReferences() const
+    SkipsReferences () const
     {
         return m_flags.GetSkipReferences();
     }
     
     bool
-    DoesPrintChildren() const
+    DoesPrintChildren () const
     {
         return !m_flags.GetDontShowChildren();
     }
     
     bool
-    DoesPrintValue() const
+    DoesPrintValue () const
     {
         return !m_flags.GetDontShowValue();
     }
     
     bool
-    IsOneliner() const
+    IsOneliner () const
     {
         return m_flags.GetShowMembersOneLiner();
     }
     
     bool
-    HideNames() const
+    HideNames () const
     {
         return m_flags.GetHideItemNames();
     }
-            
+    
+    void
+    SetCascades (bool value)
+    {
+        m_flags.SetCascades(value);
+    }
+    
+    void
+    SetSkipsPointers (bool value)
+    {
+        m_flags.SetSkipPointers(value);
+    }
+    
+    void
+    SetSkipsReferences (bool value)
+    {
+        m_flags.SetSkipReferences(value);
+    }
+    
+    void
+    SetDoesPrintChildren (bool value)
+    {
+        m_flags.SetDontShowChildren(!value);
+    }
+    
+    void
+    SetDoesPrintValue (bool value)
+    {
+        m_flags.SetDontShowValue(!value);
+    }
+    
+    void
+    SetIsOneliner (bool value)
+    {
+        m_flags.SetShowMembersOneLiner(value);
+    }
+    
+    void
+    SetHideNames (bool value)
+    {
+        m_flags.SetHideItemNames(value);
+    }
+    
+    uint32_t
+    GetOptions ()
+    {
+        return m_flags.GetValue();
+    }
+    
+    void
+    SetOptions (uint32_t value)
+    {
+        m_flags.SetValue(value);
+    }
+    
     virtual
-    ~SummaryFormat()
+    ~TypeSummaryImpl ()
     {
     }
     
     virtual std::string
-    FormatObject(lldb::ValueObjectSP object) = 0;
+    FormatObject (lldb::ValueObjectSP object) = 0;
     
     virtual std::string
-    GetDescription() = 0;
+    GetDescription () = 0;
+    
+    virtual bool
+    IsScripted() = 0;
     
-    typedef SHARED_PTR(SummaryFormat) SharedPointer;
-    typedef bool(*SummaryCallback)(void*, ConstString, const lldb::SummaryFormatSP&);
-    typedef bool(*RegexSummaryCallback)(void*, lldb::RegularExpressionSP, const lldb::SummaryFormatSP&);
+    uint32_t&
+    GetRevision ()
+    {
+        return m_my_revision;
+    }
     
+    typedef SHARED_PTR(TypeSummaryImpl) SharedPointer;
+    typedef bool(*SummaryCallback)(void*, ConstString, const lldb::TypeSummaryImplSP&);
+    typedef bool(*RegexSummaryCallback)(void*, lldb::RegularExpressionSP, const lldb::TypeSummaryImplSP&);
+
+protected:
+    uint32_t m_my_revision;
+    Flags m_flags;
+
 };
 
 // simple string-based summaries, using ${var to show data
-struct StringSummaryFormat : public SummaryFormat
+struct StringSummaryFormat : public TypeSummaryImpl
 {
     std::string m_format;
     
-    StringSummaryFormat(const SummaryFormat::Flags& flags,
-                        std::string f);
+    StringSummaryFormat(const TypeSummaryImpl::Flags& flags,
+                        const char* f);
     
-    std::string
-    GetFormat() const
+    const char*
+    GetSummaryString () const
     {
-        return m_format;
+        return m_format.c_str();
+    }
+    
+    void
+    SetSummaryString (const char* data)
+    {
+        if (data)
+                m_format.assign(data);
+        else
+                m_format.clear();
     }
     
     virtual
@@ -809,31 +1231,56 @@
     
     virtual std::string
     GetDescription();
+    
+    virtual bool
+    IsScripted()
+    {
+        return false;
+    }
         
 };
     
 #ifndef LLDB_DISABLE_PYTHON
 
 // Python-based summaries, running script code to show data
-struct ScriptSummaryFormat : public SummaryFormat
+struct ScriptSummaryFormat : public TypeSummaryImpl
 {
     std::string m_function_name;
     std::string m_python_script;
     
-    ScriptSummaryFormat(const SummaryFormat::Flags& flags,
-                        std::string fname,
-                        std::string pscri);
+    ScriptSummaryFormat(const TypeSummaryImpl::Flags& flags,
+                        const char *function_name,
+                        const char* python_script = NULL);
     
-    std::string
-    GetFunctionName() const
+    const char*
+    GetFunctionName () const
     {
-        return m_function_name;
+        return m_function_name.c_str();
     }
     
-    std::string
-    GetPythonScript() const
+    const char*
+    GetPythonScript () const
+    {
+        return m_python_script.c_str();
+    }
+    
+    void
+    SetFunctionName (const char* function_name)
     {
-        return m_python_script;
+        if (function_name)
+                m_function_name.assign(function_name);
+        else
+                m_function_name.clear();
+        m_python_script.clear();
+    }
+    
+    void
+    SetPythonScript (const char* script)
+    {
+        if (script)
+                m_python_script.assign(script);
+        else
+                m_python_script.clear();
     }
     
     virtual
@@ -847,12 +1294,56 @@
     virtual std::string
     GetDescription();
     
+    virtual bool
+    IsScripted()
+    {
+        return true;
+    }
+    
     typedef SHARED_PTR(ScriptSummaryFormat) SharedPointer;
 
 };
 
 #endif // #ifndef LLDB_DISABLE_PYTHON
 
+// TODO: at the moment, this class is only used as a backing store for SBTypeNameSpecifier in the public API
+// In the future, this might be used as the basic unit for typename-to-formatter matching, replacing
+// the current plain/regexp distinction in FormatNavigator<>
+class TypeNameSpecifierImpl
+{
+public:
+    
+    TypeNameSpecifierImpl() :
+    m_name(),
+    m_is_regex(false)
+    {
+    }
+    
+    TypeNameSpecifierImpl (const char* name, bool is_regex) :
+    m_name(),
+    m_is_regex(is_regex)
+    {
+        if (name)
+                m_name.assign(name);
+    }
+    
+    const char*
+    GetName()
+    {
+        return m_name.c_str();
+    }
+    
+    bool
+    IsRegex()
+    {
+        return m_is_regex;
+    }
+    
+private:
+    std::string m_name;
+    bool m_is_regex;
+};
+    
 } // namespace lldb_private
 
 #endif	// lldb_FormatClasses_h_

Modified: lldb/trunk/include/lldb/Core/FormatManager.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/FormatManager.h?rev=150558&r1=150557&r2=150558&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/FormatManager.h (original)
+++ lldb/trunk/include/lldb/Core/FormatManager.h Tue Feb 14 20:34:21 2012
@@ -34,19 +34,19 @@
     
 class CategoryMap;
     
-class FormatCategory
+class TypeCategoryImpl
 {
 private:
     
-    typedef FormatNavigator<ConstString, SummaryFormat> SummaryNavigator;
-    typedef FormatNavigator<lldb::RegularExpressionSP, SummaryFormat> RegexSummaryNavigator;
+    typedef FormatNavigator<ConstString, TypeSummaryImpl> SummaryNavigator;
+    typedef FormatNavigator<lldb::RegularExpressionSP, TypeSummaryImpl> RegexSummaryNavigator;
     
-    typedef FormatNavigator<ConstString, SyntheticFilter> FilterNavigator;
-    typedef FormatNavigator<lldb::RegularExpressionSP, SyntheticFilter> RegexFilterNavigator;
+    typedef FormatNavigator<ConstString, TypeFilterImpl> FilterNavigator;
+    typedef FormatNavigator<lldb::RegularExpressionSP, TypeFilterImpl> RegexFilterNavigator;
     
 #ifndef LLDB_DISABLE_PYTHON
-    typedef FormatNavigator<ConstString, SyntheticScriptProvider> SynthNavigator;
-    typedef FormatNavigator<lldb::RegularExpressionSP, SyntheticScriptProvider> RegexSynthNavigator;
+    typedef FormatNavigator<ConstString, TypeSyntheticImpl> SynthNavigator;
+    typedef FormatNavigator<lldb::RegularExpressionSP, TypeSyntheticImpl> RegexSynthNavigator;
 #endif // #ifndef LLDB_DISABLE_PYTHON
 
     typedef SummaryNavigator::MapType SummaryMap;
@@ -61,7 +61,7 @@
 public:
         
     typedef uint16_t FormatCategoryItems;
-    static const uint16_t ALL_ITEM_TYPES = 0xFFFF;
+    static const uint16_t ALL_ITEM_TYPES = UINT16_MAX;
     
     typedef SummaryNavigator::SharedPointer SummaryNavigatorSP;
     typedef RegexSummaryNavigator::SharedPointer RegexSummaryNavigatorSP;
@@ -72,8 +72,8 @@
     typedef RegexSynthNavigator::SharedPointer RegexSynthNavigatorSP;
 #endif // #ifndef LLDB_DISABLE_PYTHON
 
-    FormatCategory (IFormatChangeListener* clist,
-                    std::string name);
+    TypeCategoryImpl (IFormatChangeListener* clist,
+                      ConstString name);
     
     SummaryNavigatorSP
     GetSummaryNavigator ()
@@ -98,6 +98,42 @@
     {
         return RegexFilterNavigatorSP(m_regex_filter_nav);
     }
+    
+    lldb::TypeNameSpecifierImplSP
+    GetTypeNameSpecifierForSummaryAtIndex (uint32_t index)
+    {
+        if (index < m_summary_nav->GetCount())
+            return m_summary_nav->GetTypeNameSpecifierAtIndex(index);
+        else
+            return m_regex_summary_nav->GetTypeNameSpecifierAtIndex(index-m_summary_nav->GetCount());
+    }
+    
+    SummaryNavigator::MapValueType
+    GetSummaryAtIndex (uint32_t index)
+    {
+        if (index < m_summary_nav->GetCount())
+            return m_summary_nav->GetAtIndex(index);
+        else
+            return m_regex_summary_nav->GetAtIndex(index-m_summary_nav->GetCount());
+    }
+
+    FilterNavigator::MapValueType
+    GetFilterAtIndex (uint32_t index)
+    {
+        if (index < m_filter_nav->GetCount())
+            return m_filter_nav->GetAtIndex(index);
+        else
+            return m_regex_filter_nav->GetAtIndex(index-m_filter_nav->GetCount());
+    }
+    
+    lldb::TypeNameSpecifierImplSP
+    GetTypeNameSpecifierForFilterAtIndex (uint32_t index)
+    {
+        if (index < m_filter_nav->GetCount())
+            return m_filter_nav->GetTypeNameSpecifierAtIndex(index);
+        else
+            return m_regex_filter_nav->GetTypeNameSpecifierAtIndex(index-m_filter_nav->GetCount());
+    }
 
 #ifndef LLDB_DISABLE_PYTHON
     SynthNavigatorSP
@@ -111,6 +147,25 @@
     {
         return RegexSynthNavigatorSP(m_regex_synth_nav);
     }
+    
+    SynthNavigator::MapValueType
+    GetSyntheticAtIndex (uint32_t index)
+    {
+        if (index < m_synth_nav->GetCount())
+            return m_synth_nav->GetAtIndex(index);
+        else
+            return m_regex_synth_nav->GetAtIndex(index-m_synth_nav->GetCount());
+    }
+    
+    lldb::TypeNameSpecifierImplSP
+    GetTypeNameSpecifierForSyntheticAtIndex (uint32_t index)
+    {
+        if (index < m_synth_nav->GetCount())
+            return m_synth_nav->GetTypeNameSpecifierAtIndex(index);
+        else
+            return m_regex_synth_nav->GetTypeNameSpecifierAtIndex(index - m_synth_nav->GetCount());
+    }
+    
 #endif // #ifndef LLDB_DISABLE_PYTHON
 
     bool
@@ -118,10 +173,19 @@
     {
         return m_enabled;
     }
-        
+    
+    uint32_t
+    GetEnabledPosition()
+    {
+        if (m_enabled == false)
+            return UINT32_MAX;
+        else
+            return m_enabled_position;
+    }
+    
     bool
     Get (ValueObject& valobj,
-         lldb::SummaryFormatSP& entry,
+         lldb::TypeSummaryImplSP& entry,
          lldb::DynamicValueType use_dynamic,
          uint32_t* reason = NULL);
     
@@ -141,10 +205,10 @@
     uint32_t
     GetCount (FormatCategoryItems items = ALL_ITEM_TYPES);
     
-    std::string
+    const char*
     GetName ()
     {
-        return m_name;
+        return m_name.GetCString();
     }
     
     bool
@@ -154,7 +218,7 @@
                 const char** matching_category = NULL,
                 FormatCategoryItems* matching_type = NULL);
     
-    typedef SHARED_PTR(FormatCategory) SharedPointer;
+    typedef SHARED_PTR(TypeCategoryImpl) SharedPointer;
     
 private:
     SummaryNavigator::SharedPointer m_summary_nav;
@@ -172,13 +236,17 @@
     
     Mutex m_mutex;
     
-    std::string m_name;
+    ConstString m_name;
+    
+    uint32_t m_enabled_position;
     
     void
-    Enable (bool value = true)
+    Enable (bool value,
+            uint32_t position)
     {
         Mutex::Locker(m_mutex);
-        m_enabled = value;        
+        m_enabled = value;
+        m_enabled_position = position;
         if (m_change_listener)
             m_change_listener->Changed();
     }
@@ -186,20 +254,20 @@
     void
     Disable ()
     {
-        Enable(false);
+        Enable(false, UINT32_MAX);
     }
     
     friend class CategoryMap;
     
-    friend class FormatNavigator<ConstString, SummaryFormat>;
-    friend class FormatNavigator<lldb::RegularExpressionSP, SummaryFormat>;
+    friend class FormatNavigator<ConstString, TypeSummaryImpl>;
+    friend class FormatNavigator<lldb::RegularExpressionSP, TypeSummaryImpl>;
     
-    friend class FormatNavigator<ConstString, SyntheticFilter>;
-    friend class FormatNavigator<lldb::RegularExpressionSP, SyntheticFilter>;
+    friend class FormatNavigator<ConstString, TypeFilterImpl>;
+    friend class FormatNavigator<lldb::RegularExpressionSP, TypeFilterImpl>;
     
 #ifndef LLDB_DISABLE_PYTHON
-    friend class FormatNavigator<ConstString, SyntheticScriptProvider>;
-    friend class FormatNavigator<lldb::RegularExpressionSP, SyntheticScriptProvider>;
+    friend class FormatNavigator<ConstString, TypeSyntheticImpl>;
+    friend class FormatNavigator<lldb::RegularExpressionSP, TypeSyntheticImpl>;
 #endif // #ifndef LLDB_DISABLE_PYTHON
     
 
@@ -209,15 +277,20 @@
 {
 private:
     typedef ConstString KeyType;
-    typedef FormatCategory ValueType;
+    typedef TypeCategoryImpl ValueType;
     typedef ValueType::SharedPointer ValueSP;
-    typedef std::list<lldb::FormatCategorySP> ActiveCategoriesList;
+    typedef std::list<lldb::TypeCategoryImplSP> ActiveCategoriesList;
     typedef ActiveCategoriesList::iterator ActiveCategoriesIterator;
         
 public:
     typedef std::map<KeyType, ValueSP> MapType;
     typedef MapType::iterator MapIterator;
     typedef bool(*CallbackType)(void*, const ValueSP&);
+    typedef uint32_t Position;
+    
+    static const Position First = 0;
+    static const Position Default = 1;
+    static const Position Last = UINT32_MAX;
     
     CategoryMap (IFormatChangeListener* lst) :
         m_map_mutex(Mutex::eMutexTypeRecursive),
@@ -225,6 +298,10 @@
         m_map(),
         m_active_categories()
     {
+        ConstString default_cs("default");
+        lldb::TypeCategoryImplSP default_sp = lldb::TypeCategoryImplSP(new TypeCategoryImpl(listener, default_cs));
+        Add(default_cs,default_sp);
+        Enable(default_cs,First);
     }
     
     void
@@ -251,26 +328,68 @@
         return true;
     }
     
-    void
-    Enable (KeyType category_name)
+    bool
+    Enable (KeyType category_name,
+            Position pos = Default)
     {
         Mutex::Locker(m_map_mutex);
         ValueSP category;
         if (!Get(category_name,category))
-            return;
-        category->Enable();
-        m_active_categories.push_front(category);
+            return false;
+        return Enable(category, pos);
     }
     
-    void
+    bool
     Disable (KeyType category_name)
     {
         Mutex::Locker(m_map_mutex);
         ValueSP category;
         if (!Get(category_name,category))
-            return;
-        category->Disable();
-        m_active_categories.remove_if(delete_matching_categories(category));
+            return false;
+        return Disable(category);
+    }
+    
+    bool
+    Enable (ValueSP category,
+            Position pos = Default)
+    {
+        Mutex::Locker(m_map_mutex);
+        if (category.get())
+        {
+            Position pos_w = pos;
+            if (pos == First)
+                m_active_categories.push_front(category);
+            else if (pos == Last || pos == m_active_categories.size())
+                m_active_categories.push_back(category);
+            else if (pos < m_active_categories.size())
+            {
+                ActiveCategoriesList::iterator iter = m_active_categories.begin();
+                while (pos_w)
+                {
+                    pos_w--,iter++;
+                }
+                m_active_categories.insert(iter,category);
+            }
+            else
+                return false;
+            category->Enable(true,
+                             pos);
+            return true;
+        }
+        return false;
+    }
+    
+    bool
+    Disable (ValueSP category)
+    {
+        Mutex::Locker(m_map_mutex);
+        if (category.get())
+        {
+            m_active_categories.remove_if(delete_matching_categories(category));
+            category->Disable();
+            return true;
+        }
+        return false;
     }
     
     void
@@ -295,15 +414,36 @@
         return true;
     }
     
+    bool
+    Get (uint32_t pos,
+         ValueSP& entry)
+    {
+        Mutex::Locker(m_map_mutex);
+        MapIterator iter = m_map.begin();
+        MapIterator end = m_map.end();
+        while (pos > 0)
+        {
+            iter++;
+            pos--;
+            if (iter == end)
+                return false;
+        }
+        entry = iter->second;
+        return false;
+    }
+    
     void
     LoopThrough (CallbackType callback, void* param);
     
+    lldb::TypeCategoryImplSP
+    GetAtIndex (uint32_t);
+    
     bool
     AnyMatches (ConstString type_name,
-                FormatCategory::FormatCategoryItems items = FormatCategory::ALL_ITEM_TYPES,
+                TypeCategoryImpl::FormatCategoryItems items = TypeCategoryImpl::ALL_ITEM_TYPES,
                 bool only_enabled = true,
                 const char** matching_category = NULL,
-                FormatCategory::FormatCategoryItems* matching_type = NULL);
+                TypeCategoryImpl::FormatCategoryItems* matching_type = NULL);
     
     uint32_t
     GetCount ()
@@ -311,7 +451,7 @@
         return m_map.size();
     }
     
-    lldb::SummaryFormatSP
+    lldb::TypeSummaryImplSP
     GetSummaryFormat (ValueObject& valobj,
          lldb::DynamicValueType use_dynamic);
     
@@ -323,12 +463,12 @@
     
     class delete_matching_categories
     {
-        lldb::FormatCategorySP ptr;
+        lldb::TypeCategoryImplSP ptr;
     public:
-        delete_matching_categories(lldb::FormatCategorySP p) : ptr(p)
+        delete_matching_categories(lldb::TypeCategoryImplSP p) : ptr(p)
         {}
         
-        bool operator()(const lldb::FormatCategorySP& other)
+        bool operator()(const lldb::TypeCategoryImplSP& other)
         {
             return ptr.get() == other.get();
         }
@@ -361,9 +501,9 @@
 
 class FormatManager : public IFormatChangeListener
 {
-    typedef FormatNavigator<ConstString, ValueFormat> ValueNavigator;
+    typedef FormatNavigator<ConstString, TypeFormatImpl> ValueNavigator;
     typedef ValueNavigator::MapType ValueMap;
-    typedef FormatMap<ConstString, SummaryFormat> NamedSummariesMap;
+    typedef FormatMap<ConstString, TypeSummaryImpl> NamedSummariesMap;
     typedef CategoryMap::MapType::iterator CategoryMapIterator;
 public:
     
@@ -384,9 +524,11 @@
     }
     
     void
-    EnableCategory (const ConstString& category_name)
+    EnableCategory (const ConstString& category_name,
+                    CategoryMap::Position pos = CategoryMap::Default)
     {
-        m_categories_map.Enable(category_name);
+        m_categories_map.Enable(category_name,
+                                pos);
     }
     
     void
@@ -395,6 +537,20 @@
         m_categories_map.Disable(category_name);
     }
     
+    void
+    EnableCategory (const lldb::TypeCategoryImplSP& category,
+                    CategoryMap::Position pos = CategoryMap::Default)
+    {
+        m_categories_map.Enable(category,
+                                pos);
+    }
+    
+    void
+    DisableCategory (const lldb::TypeCategoryImplSP& category)
+    {
+        m_categories_map.Disable(category);
+    }
+    
     bool
     DeleteCategory (const ConstString& category_name)
     {
@@ -413,13 +569,19 @@
         return m_categories_map.GetCount();
     }
     
+    lldb::TypeCategoryImplSP
+    GetCategoryAtIndex (uint32_t index)
+    {
+        return m_categories_map.GetAtIndex(index);
+    }
+    
     void
     LoopThroughCategories (CategoryCallback callback, void* param)
     {
         m_categories_map.LoopThrough(callback, param);
     }
     
-    lldb::FormatCategorySP
+    lldb::TypeCategoryImplSP
     GetCategory (const char* category_name = NULL,
                  bool can_create = true)
     {
@@ -428,11 +590,11 @@
         return GetCategory(ConstString(category_name));
     }
     
-    lldb::FormatCategorySP
+    lldb::TypeCategoryImplSP
     GetCategory (const ConstString& category_name,
                  bool can_create = true);
     
-    lldb::SummaryFormatSP
+    lldb::TypeSummaryImplSP
     GetSummaryFormat (ValueObject& valobj,
                       lldb::DynamicValueType use_dynamic)
     {
@@ -448,10 +610,10 @@
     
     bool
     AnyMatches (ConstString type_name,
-                FormatCategory::FormatCategoryItems items = FormatCategory::ALL_ITEM_TYPES,
+                TypeCategoryImpl::FormatCategoryItems items = TypeCategoryImpl::ALL_ITEM_TYPES,
                 bool only_enabled = true,
                 const char** matching_category = NULL,
-                FormatCategory::FormatCategoryItems* matching_type = NULL)
+                TypeCategoryImpl::FormatCategoryItems* matching_type = NULL)
     {
         return m_categories_map.AnyMatches(type_name,
                                            items,

Modified: lldb/trunk/include/lldb/Core/FormatNavigator.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/FormatNavigator.h?rev=150558&r1=150557&r2=150558&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/FormatNavigator.h (original)
+++ lldb/trunk/include/lldb/Core/FormatNavigator.h Tue Feb 14 20:34:21 2012
@@ -128,9 +128,9 @@
         const ValueSP& entry)
     {
         if (listener)
-            entry->m_my_revision = listener->GetCurrentRevision();
+            entry->GetRevision() = listener->GetCurrentRevision();
         else
-            entry->m_my_revision = 0;
+            entry->GetRevision() = 0;
 
         Mutex::Locker(m_map_mutex);
         m_map[name] = entry;
@@ -194,6 +194,38 @@
         return m_map.size();
     }
     
+    ValueSP
+    GetValueAtIndex (uint32_t index)
+    {
+        Mutex::Locker(m_map_mutex);
+        MapIterator iter = m_map.begin();
+        MapIterator end = m_map.end();
+        while (index > 0)
+        {
+            iter++;
+            index--;
+            if (end == iter)
+                return ValueSP();
+        }
+        return iter->second;
+    }
+    
+    KeyType
+    GetKeyAtIndex (uint32_t index)
+    {
+        Mutex::Locker(m_map_mutex);
+        MapIterator iter = m_map.begin();
+        MapIterator end = m_map.end();
+        while (index > 0)
+        {
+            iter++;
+            index--;
+            if (end == iter)
+                return KeyType();
+        }
+        return iter->first;
+    }
+    
 protected:
     MapType m_map;    
     Mutex m_map_mutex;
@@ -234,7 +266,7 @@
         
     typedef typename std::tr1::shared_ptr<FormatNavigator<KeyType, ValueType> > SharedPointer;
     
-    friend class FormatCategory;
+    friend class TypeCategoryImpl;
 
     FormatNavigator(std::string name,
                     IFormatChangeListener* lst) :
@@ -274,6 +306,30 @@
         return ret;
     }
     
+    bool
+    Get (ConstString type, MapValueType& entry)
+    {
+        return Get_Impl(type, entry, Types<KeyType,ValueType>());
+    }
+    
+    bool
+    GetExact (ConstString type, MapValueType& entry)
+    {
+        return GetExact_Impl(type, entry, Types<KeyType,ValueType>());
+    }
+    
+    MapValueType
+    GetAtIndex (uint32_t index)
+    {
+        return m_format_map.GetValueAtIndex(index);
+    }
+    
+    lldb::TypeNameSpecifierImplSP
+    GetTypeNameSpecifierAtIndex (uint32_t index)
+    {
+        return GetTypeNameSpecifierAtIndex_Impl(index, Types<KeyType,ValueType>());
+    }
+    
     void
     Clear ()
     {
@@ -350,12 +406,42 @@
        return m_format_map.Get(type, entry);
     }
 
+    template<typename K, typename V>
+    bool
+    GetExact_Impl (ConstString type, MapValueType& entry, Types<K,V> dummy)
+    {
+        return Get_Impl(type,entry,dummy);
+    }
+    
+    template<typename K, typename V>
+    lldb::TypeNameSpecifierImplSP
+    GetTypeNameSpecifierAtIndex_Impl (uint32_t index, Types<K,V> dummy)
+    {
+        ConstString key = m_format_map.GetKeyAtIndex(index);
+        if (key)
+            return lldb::TypeNameSpecifierImplSP(new TypeNameSpecifierImpl(key.AsCString(),
+                                                                           false));
+        else
+            return lldb::TypeNameSpecifierImplSP();
+    }
+    
+    template<typename V>
+    lldb::TypeNameSpecifierImplSP
+    GetTypeNameSpecifierAtIndex_Impl (uint32_t index, Types<lldb::RegularExpressionSP,V> dummy)
+    {
+        lldb::RegularExpressionSP regex = m_format_map.GetKeyAtIndex(index);
+        if (regex.get() == NULL)
+            return lldb::TypeNameSpecifierImplSP();
+        return lldb::TypeNameSpecifierImplSP(new TypeNameSpecifierImpl(regex->GetText(),
+                                                                       true));
+    }
+
     template<typename V>
     bool
     Get_Impl (ConstString key, MapValueType& value, Types<lldb::RegularExpressionSP,V>)
     {
-        Mutex& x_mutex = m_format_map.mutex();
-        lldb_private::Mutex::Locker locker(x_mutex);
+       Mutex& x_mutex = m_format_map.mutex();
+       lldb_private::Mutex::Locker locker(x_mutex);
        MapIterator pos, end = m_format_map.map().end();
        for (pos = m_format_map.map().begin(); pos != end; pos++)
        {
@@ -368,11 +454,24 @@
        }
        return false;
     }
-
+    
+    template<typename V>
     bool
-    Get (ConstString type, MapValueType& entry)
+    GetExact_Impl (ConstString key, MapValueType& value, Types<lldb::RegularExpressionSP,V>)
     {
-        return Get_Impl(type, entry, Types<KeyType,ValueType>());
+        Mutex& x_mutex = m_format_map.mutex();
+        lldb_private::Mutex::Locker locker(x_mutex);
+        MapIterator pos, end = m_format_map.map().end();
+        for (pos = m_format_map.map().begin(); pos != end; pos++)
+        {
+            lldb::RegularExpressionSP regex = pos->first;
+            if (strcmp(regex->GetText(),key.AsCString()) == 0)
+            {
+                value = pos->second;
+                return true;
+            }
+        }
+        return false;
     }
     
     #define LLDB_MAX_REASONABLE_OBJC_CLASS_DEPTH 100

Modified: lldb/trunk/include/lldb/Core/ValueObject.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObject.h?rev=150558&r1=150557&r2=150558&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/ValueObject.h (original)
+++ lldb/trunk/include/lldb/Core/ValueObject.h Tue Feb 14 20:34:21 2012
@@ -963,7 +963,7 @@
     }
     
     void
-    SetCustomSummaryFormat(lldb::SummaryFormatSP format)
+    SetCustomSummaryFormat(lldb::TypeSummaryImplSP format)
     {
         m_forced_summary_format = format;
         m_user_id_of_forced_summary = m_update_point.GetModID();
@@ -971,7 +971,7 @@
         m_is_getting_summary = false;
     }
     
-    lldb::SummaryFormatSP
+    lldb::TypeSummaryImplSP
     GetCustomSummaryFormat()
     {
         return m_forced_summary_format;
@@ -990,7 +990,7 @@
         return (m_forced_summary_format.get());
     }
     
-    lldb::SummaryFormatSP
+    lldb::TypeSummaryImplSP
     GetSummaryFormat()
     {
         UpdateFormatsIfNeeded(m_last_format_mgr_dynamic);
@@ -1000,7 +1000,7 @@
     }
     
     void
-    SetSummaryFormat(lldb::SummaryFormatSP format)
+    SetSummaryFormat(lldb::TypeSummaryImplSP format)
     {
         m_last_summary_format = format;
         m_summary_str.clear();
@@ -1008,13 +1008,13 @@
     }
     
     void
-    SetValueFormat(lldb::ValueFormatSP format)
+    SetValueFormat(lldb::TypeFormatImplSP format)
     {
         m_last_value_format = format;
         m_value_str.clear();
     }
     
-    lldb::ValueFormatSP
+    lldb::TypeFormatImplSP
     GetValueFormat()
     {
         UpdateFormatsIfNeeded(m_last_format_mgr_dynamic);
@@ -1110,9 +1110,9 @@
     lldb::Format                m_format;
     uint32_t                    m_last_format_mgr_revision;
     lldb::DynamicValueType      m_last_format_mgr_dynamic;
-    lldb::SummaryFormatSP       m_last_summary_format;
-    lldb::SummaryFormatSP       m_forced_summary_format;
-    lldb::ValueFormatSP         m_last_value_format;
+    lldb::TypeSummaryImplSP     m_last_summary_format;
+    lldb::TypeSummaryImplSP     m_forced_summary_format;
+    lldb::TypeFormatImplSP      m_last_value_format;
     lldb::SyntheticChildrenSP   m_last_synthetic_filter;
     ProcessModID                m_user_id_of_forced_summary;
     AddressType                 m_address_type_of_ptr_or_ref_children;

Modified: lldb/trunk/include/lldb/Interpreter/ScriptInterpreter.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/ScriptInterpreter.h?rev=150558&r1=150557&r2=150558&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Interpreter/ScriptInterpreter.h (original)
+++ lldb/trunk/include/lldb/Interpreter/ScriptInterpreter.h Tue Feb 14 20:34:21 2012
@@ -109,37 +109,42 @@
     }
     
     virtual bool
-    GenerateTypeScriptFunction (StringList &input, StringList &output)
+    GenerateTypeScriptFunction (const char* oneliner, StringList &output, void* name_token = NULL)
     {
         return false;
     }
     
     virtual bool
-    GenerateScriptAliasFunction (StringList &input, StringList &output)
+    GenerateTypeScriptFunction (StringList &input, StringList &output, void* name_token = NULL)
     {
         return false;
     }
     
     virtual bool
-    GenerateTypeSynthClass (StringList &input, StringList &output)
+    GenerateScriptAliasFunction (StringList &input, StringList &output)
     {
         return false;
     }
     
-    virtual void*
-    CreateSyntheticScriptedProvider (std::string class_name,
-                                     lldb::ValueObjectSP valobj)
+    virtual bool
+    GenerateTypeSynthClass (StringList &input, StringList &output, void* name_token = NULL)
     {
-        return NULL;
+        return false;
     }
     
-    // use this if the function code is just a one-liner script
     virtual bool
-    GenerateTypeScriptFunction (const char* oneliner, StringList &output)
+    GenerateTypeSynthClass (const char* oneliner, StringList &output, void* name_token = NULL)
     {
         return false;
     }
     
+    virtual void*
+    CreateSyntheticScriptedProvider (std::string class_name,
+                                     lldb::ValueObjectSP valobj)
+    {
+        return NULL;
+    }
+    
     virtual bool
     GenerateFunction(std::string& signature, StringList &input, StringList &output)
     {

Modified: lldb/trunk/include/lldb/Interpreter/ScriptInterpreterPython.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/ScriptInterpreterPython.h?rev=150558&r1=150557&r2=150558&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Interpreter/ScriptInterpreterPython.h (original)
+++ lldb/trunk/include/lldb/Interpreter/ScriptInterpreterPython.h Tue Feb 14 20:34:21 2012
@@ -56,14 +56,17 @@
     ExportFunctionDefinitionToInterpreter (StringList &function_def);
 
     bool
-    GenerateTypeScriptFunction (StringList &input, StringList &output);
+    GenerateTypeScriptFunction (StringList &input, StringList &output, void* name_token = NULL);
     
     bool
-    GenerateTypeSynthClass (StringList &input, StringList &output);
+    GenerateTypeSynthClass (StringList &input, StringList &output, void* name_token = NULL);
+    
+    bool
+    GenerateTypeSynthClass (const char* oneliner, StringList &output, void* name_token = NULL);
     
     // use this if the function code is just a one-liner script
     bool
-    GenerateTypeScriptFunction (const char* oneliner, StringList &output);
+    GenerateTypeScriptFunction (const char* oneliner, StringList &output, void* name_token = NULL);
     
     virtual bool
     GenerateScriptAliasFunction (StringList &input, StringList &output);

Modified: lldb/trunk/include/lldb/lldb-enumerations.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/lldb-enumerations.h?rev=150558&r1=150557&r2=150558&view=diff
==============================================================================
--- lldb/trunk/include/lldb/lldb-enumerations.h (original)
+++ lldb/trunk/include/lldb/lldb-enumerations.h Tue Feb 14 20:34:21 2012
@@ -600,6 +600,22 @@
 
     } TemplateArgumentKind;
 
+    //----------------------------------------------------------------------
+    // Options that can be set for a formatter to alter its behavior
+    // Not all of these are applicable to all formatter types
+    //----------------------------------------------------------------------
+    typedef enum TypeOptions
+    {
+        eTypeOptionNone            = (0u),
+        eTypeOptionCascade         = (1u << 0),
+        eTypeOptionSkipPointers    = (1u << 1),
+        eTypeOptionSkipReferences  = (1u << 2),
+        eTypeOptionHideChildren    = (1u << 3),
+        eTypeOptionHideValue       = (1u << 4),
+        eTypeOptionShowOneLiner    = (1u << 5),
+        eTypeOptionHideNames       = (1u << 6)
+    } TypeOptions;
+    
 } // namespace lldb
 
 

Modified: lldb/trunk/include/lldb/lldb-forward.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/lldb-forward.h?rev=150558&r1=150557&r2=150558&view=diff
==============================================================================
--- lldb/trunk/include/lldb/lldb-forward.h (original)
+++ lldb/trunk/include/lldb/lldb-forward.h Tue Feb 14 20:34:21 2012
@@ -86,7 +86,7 @@
 class   FileSpec;
 class   FileSpecList;
 class   Flags;
-class   FormatCategory;
+class   TypeCategoryImpl;
 class   FormatManager;
 class   FuncUnwinders;
 class   Function;
@@ -154,8 +154,8 @@
 class   StreamFile;
 class   StreamString;
 class   StringList;
-struct  StringSummaryFormat;
-struct  SummaryFormat;
+class   StringSummaryFormat;
+class   TypeSummaryImpl;
 class   Symbol;
 class   SymbolContext;
 class   SymbolContextList;
@@ -167,8 +167,9 @@
 class   Symtab;
 class   SyntheticChildren;
 class   SyntheticChildrenFrontEnd;
+class   TypeFilterImpl;
 #ifndef LLDB_DISABLE_PYTHON
-class   SyntheticScriptProvider;
+class   TypeSyntheticImpl;
 #endif
 class   Target;
 class   TargetList;
@@ -190,7 +191,8 @@
 class   TypeAndOrName;
 class   TypeList;
 class   TypeListImpl;
-class   TypeMemberImpl;    
+class   TypeMemberImpl;
+class   TypeNameSpecifierImpl;
 class   UUID;
 class   Unwind;
 class   UnwindAssembly;
@@ -199,7 +201,7 @@
 class   UserSettingsController;
 class   VMRange;
 class   Value;
-struct  ValueFormat;
+struct  TypeFormatImpl;
 class   ValueList;
 class   ValueObject;
 class   ValueObjectChild;
@@ -243,7 +245,7 @@
     typedef std::tr1::shared_ptr<lldb_private::Disassembler> DisassemblerSP;
     typedef std::tr1::shared_ptr<lldb_private::DynamicLoader> DynamicLoaderSP;
     typedef std::tr1::shared_ptr<lldb_private::Event> EventSP;
-    typedef std::tr1::shared_ptr<lldb_private::FormatCategory> FormatCategorySP;
+    typedef std::tr1::shared_ptr<lldb_private::TypeCategoryImpl> TypeCategoryImplSP;
     typedef std::tr1::shared_ptr<lldb_private::Function> FunctionSP;
     typedef std::tr1::shared_ptr<lldb_private::InlineFunctionInfo> InlineFunctionInfoSP;
     typedef std::tr1::shared_ptr<lldb_private::InputReader> InputReaderSP;
@@ -267,7 +269,7 @@
     typedef std::tr1::shared_ptr<lldb_private::Section> SectionSP;
     typedef std::tr1::shared_ptr<lldb_private::SearchFilter> SearchFilterSP;
 #ifndef LLDB_DISABLE_PYTHON
-    typedef std::tr1::shared_ptr<lldb_private::ScriptSummaryFormat> ScriptFormatSP;
+    typedef std::tr1::shared_ptr<lldb_private::ScriptSummaryFormat> ScriptSummaryFormatSP;
 #endif // #ifndef LLDB_DISABLE_PYTHON
     typedef std::tr1::shared_ptr<lldb_private::StackFrame> StackFrameSP;
     typedef std::tr1::weak_ptr<lldb_private::StackFrame> StackFrameWP;
@@ -275,14 +277,17 @@
     typedef std::tr1::shared_ptr<lldb_private::StopInfo> StopInfoSP;
     typedef std::tr1::shared_ptr<lldb_private::StoppointLocation> StoppointLocationSP;
     typedef std::tr1::shared_ptr<lldb_private::Stream> StreamSP;
-    typedef std::tr1::shared_ptr<lldb_private::StringSummaryFormat> StringSummaryFormatSP;
-    typedef std::tr1::shared_ptr<lldb_private::SummaryFormat> SummaryFormatSP;
+    typedef std::tr1::shared_ptr<lldb_private::StringSummaryFormat> StringTypeSummaryImplSP;
+    typedef std::tr1::shared_ptr<lldb_private::TypeSummaryImpl> TypeSummaryImplSP;
+    typedef std::tr1::shared_ptr<lldb_private::TypeNameSpecifierImpl> TypeNameSpecifierImplSP;
     typedef std::tr1::shared_ptr<lldb_private::SymbolFile> SymbolFileSP;
     typedef std::tr1::shared_ptr<lldb_private::SymbolFileType> SymbolFileTypeSP;
     typedef std::tr1::weak_ptr<lldb_private::SymbolFileType> SymbolFileTypeWP;
     typedef std::tr1::shared_ptr<lldb_private::SymbolContextSpecifier> SymbolContextSpecifierSP;
     typedef std::tr1::shared_ptr<lldb_private::SyntheticChildren> SyntheticChildrenSP;
     typedef std::tr1::shared_ptr<lldb_private::SyntheticChildrenFrontEnd> SyntheticChildrenFrontEndSP;
+    typedef std::tr1::shared_ptr<lldb_private::TypeFilterImpl> TypeFilterImplSP;
+    typedef std::tr1::shared_ptr<lldb_private::TypeSyntheticImpl> TypeSyntheticImplSP;
     typedef std::tr1::shared_ptr<lldb_private::Target> TargetSP;
     typedef std::tr1::weak_ptr<lldb_private::Target> TargetWP;
     typedef std::tr1::shared_ptr<lldb_private::Thread> ThreadSP;
@@ -298,7 +303,7 @@
     typedef std::tr1::shared_ptr<lldb_private::UnwindPlan> UnwindPlanSP;
     typedef lldb_private::SharingPtr<lldb_private::ValueObject> ValueObjectSP;
     typedef std::tr1::shared_ptr<lldb_private::Value> ValueSP;
-    typedef std::tr1::shared_ptr<lldb_private::ValueFormat> ValueFormatSP;
+    typedef std::tr1::shared_ptr<lldb_private::TypeFormatImpl> TypeFormatImplSP;
     typedef std::tr1::shared_ptr<lldb_private::ValueList> ValueListSP;
     typedef std::tr1::shared_ptr<lldb_private::Variable> VariableSP;
     typedef std::tr1::shared_ptr<lldb_private::VariableList> VariableListSP;

Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=150558&r1=150557&r2=150558&view=diff
==============================================================================
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Tue Feb 14 20:34:21 2012
@@ -408,12 +408,24 @@
 		4CF52AF8142829390051E832 /* SBFileSpecList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CF52AF7142829390051E832 /* SBFileSpecList.cpp */; };
 		94031A9E13CF486700DCFF3C /* InputReaderEZ.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94031A9D13CF486600DCFF3C /* InputReaderEZ.cpp */; };
 		9415F61813B2C0EF00A52B36 /* FormatManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9415F61713B2C0EF00A52B36 /* FormatManager.cpp */; };
+		941BCC7F14E48C4000BB969C /* SBTypeFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 9461568614E355F2003A195C /* SBTypeFilter.h */; settings = {ATTRIBUTES = (Public, ); }; };
+		941BCC8014E48C4000BB969C /* SBTypeFormat.h in Headers */ = {isa = PBXBuildFile; fileRef = 9461568714E355F2003A195C /* SBTypeFormat.h */; settings = {ATTRIBUTES = (Public, ); }; };
+		941BCC8114E48C4000BB969C /* SBTypeSummary.h in Headers */ = {isa = PBXBuildFile; fileRef = 9461568814E355F2003A195C /* SBTypeSummary.h */; settings = {ATTRIBUTES = (Public, ); }; };
+		941BCC8214E48C4000BB969C /* SBTypeSynthetic.h in Headers */ = {isa = PBXBuildFile; fileRef = 9461568914E355F2003A195C /* SBTypeSynthetic.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		9443B122140C18C40013457C /* SBData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9443B121140C18C10013457C /* SBData.cpp */; };
 		9443B123140C26AB0013457C /* SBData.h in Headers */ = {isa = PBXBuildFile; fileRef = 9443B120140C18A90013457C /* SBData.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		94611EB213CCA4A4003A22AF /* RefCounter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94611EB113CCA4A4003A22AF /* RefCounter.cpp */; };
+		9461569A14E358A6003A195C /* SBTypeFilter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9461568A14E35621003A195C /* SBTypeFilter.cpp */; };
+		9461569B14E358A6003A195C /* SBTypeFormat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9461568B14E35621003A195C /* SBTypeFormat.cpp */; };
+		9461569C14E358A6003A195C /* SBTypeSummary.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9461568C14E35621003A195C /* SBTypeSummary.cpp */; };
+		9461569D14E358A6003A195C /* SBTypeSynthetic.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9461568D14E35621003A195C /* SBTypeSynthetic.cpp */; };
 		9463D4CD13B1798800C230D4 /* CommandObjectType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9463D4CC13B1798800C230D4 /* CommandObjectType.cpp */; };
 		9467E65213C3D97600B3B6F3 /* TypeHierarchyNavigator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9467E65113C3D97600B3B6F3 /* TypeHierarchyNavigator.cpp */; };
 		9470A8F01402DFFB0056FF61 /* DataVisualization.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9470A8EF1402DFFB0056FF61 /* DataVisualization.cpp */; };
+		9475C18814E5E9FA001BFC6D /* SBTypeCategory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9475C18714E5E9FA001BFC6D /* SBTypeCategory.cpp */; };
+		9475C18914E5EA08001BFC6D /* SBTypeCategory.h in Headers */ = {isa = PBXBuildFile; fileRef = 9475C18514E5E9C5001BFC6D /* SBTypeCategory.h */; settings = {ATTRIBUTES = (Public, ); }; };
+		9475C18E14E5F834001BFC6D /* SBTypeNameSpecifier.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9475C18D14E5F834001BFC6D /* SBTypeNameSpecifier.cpp */; };
+		9475C18F14E5F858001BFC6D /* SBTypeNameSpecifier.h in Headers */ = {isa = PBXBuildFile; fileRef = 9475C18C14E5F826001BFC6D /* SBTypeNameSpecifier.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		949ADF031406F648004833E1 /* ValueObjectConstResultImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 949ADF021406F648004833E1 /* ValueObjectConstResultImpl.cpp */; };
 		94B6E76213D88365005F417F /* ValueObjectSyntheticFilter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94B6E76113D88362005F417F /* ValueObjectSyntheticFilter.cpp */; };
 		94FA3DE01405D50400833217 /* ValueObjectConstResultChild.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94FA3DDF1405D50300833217 /* ValueObjectConstResultChild.cpp */; };
@@ -1259,12 +1271,30 @@
 		9443B121140C18C10013457C /* SBData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBData.cpp; path = source/API/SBData.cpp; sourceTree = "<group>"; };
 		94611EAF13CCA363003A22AF /* RefCounter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = RefCounter.h; path = include/lldb/Utility/RefCounter.h; sourceTree = "<group>"; };
 		94611EB113CCA4A4003A22AF /* RefCounter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RefCounter.cpp; path = source/Utility/RefCounter.cpp; sourceTree = "<group>"; };
+		9461568614E355F2003A195C /* SBTypeFilter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SBTypeFilter.h; path = include/lldb/API/SBTypeFilter.h; sourceTree = "<group>"; };
+		9461568714E355F2003A195C /* SBTypeFormat.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SBTypeFormat.h; path = include/lldb/API/SBTypeFormat.h; sourceTree = "<group>"; };
+		9461568814E355F2003A195C /* SBTypeSummary.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SBTypeSummary.h; path = include/lldb/API/SBTypeSummary.h; sourceTree = "<group>"; };
+		9461568914E355F2003A195C /* SBTypeSynthetic.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SBTypeSynthetic.h; path = include/lldb/API/SBTypeSynthetic.h; sourceTree = "<group>"; };
+		9461568A14E35621003A195C /* SBTypeFilter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBTypeFilter.cpp; path = source/API/SBTypeFilter.cpp; sourceTree = "<group>"; };
+		9461568B14E35621003A195C /* SBTypeFormat.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBTypeFormat.cpp; path = source/API/SBTypeFormat.cpp; sourceTree = "<group>"; };
+		9461568C14E35621003A195C /* SBTypeSummary.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBTypeSummary.cpp; path = source/API/SBTypeSummary.cpp; sourceTree = "<group>"; };
+		9461568D14E35621003A195C /* SBTypeSynthetic.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBTypeSynthetic.cpp; path = source/API/SBTypeSynthetic.cpp; sourceTree = "<group>"; };
+		9461569214E3567F003A195C /* SBTypeFilter.i */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBTypeFilter.i; sourceTree = "<group>"; };
+		9461569314E3567F003A195C /* SBTypeFormat.i */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBTypeFormat.i; sourceTree = "<group>"; };
+		9461569414E3567F003A195C /* SBTypeSummary.i */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBTypeSummary.i; sourceTree = "<group>"; };
+		9461569514E3567F003A195C /* SBTypeSynthetic.i */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBTypeSynthetic.i; sourceTree = "<group>"; };
 		9463D4CC13B1798800C230D4 /* CommandObjectType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; name = CommandObjectType.cpp; path = source/Commands/CommandObjectType.cpp; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };
 		9463D4CE13B179A500C230D4 /* CommandObjectType.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = CommandObjectType.h; path = source/Commands/CommandObjectType.h; sourceTree = "<group>"; };
 		9467E65113C3D97600B3B6F3 /* TypeHierarchyNavigator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TypeHierarchyNavigator.cpp; path = source/Symbol/TypeHierarchyNavigator.cpp; sourceTree = "<group>"; };
 		9467E65413C3D98900B3B6F3 /* TypeHierarchyNavigator.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = TypeHierarchyNavigator.h; path = include/lldb/Symbol/TypeHierarchyNavigator.h; sourceTree = "<group>"; };
-		9470A8EE1402DF940056FF61 /* DataVisualization.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = DataVisualization.h; path = include/lldb/Core/DataVisualization.h; sourceTree = "<group>"; };
-		9470A8EF1402DFFB0056FF61 /* DataVisualization.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DataVisualization.cpp; path = source/Core/DataVisualization.cpp; sourceTree = "<group>"; };
+		9470A8EE1402DF940056FF61 /* DataVisualization.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; lineEnding = 0; name = DataVisualization.h; path = include/lldb/Core/DataVisualization.h; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
+		9470A8EF1402DFFB0056FF61 /* DataVisualization.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; name = DataVisualization.cpp; path = source/Core/DataVisualization.cpp; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };
+		9475C18514E5E9C5001BFC6D /* SBTypeCategory.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SBTypeCategory.h; path = include/lldb/API/SBTypeCategory.h; sourceTree = "<group>"; };
+		9475C18714E5E9FA001BFC6D /* SBTypeCategory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBTypeCategory.cpp; path = source/API/SBTypeCategory.cpp; sourceTree = "<group>"; };
+		9475C18A14E5EA1C001BFC6D /* SBTypeCategory.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBTypeCategory.i; sourceTree = "<group>"; };
+		9475C18B14E5F818001BFC6D /* SBTypeNameSpecifier.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBTypeNameSpecifier.i; sourceTree = "<group>"; };
+		9475C18C14E5F826001BFC6D /* SBTypeNameSpecifier.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SBTypeNameSpecifier.h; path = include/lldb/API/SBTypeNameSpecifier.h; sourceTree = "<group>"; };
+		9475C18D14E5F834001BFC6D /* SBTypeNameSpecifier.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBTypeNameSpecifier.cpp; path = source/API/SBTypeNameSpecifier.cpp; sourceTree = "<group>"; };
 		949ADF001406F62E004833E1 /* ValueObjectConstResultImpl.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ValueObjectConstResultImpl.h; path = include/lldb/Core/ValueObjectConstResultImpl.h; sourceTree = "<group>"; };
 		949ADF021406F648004833E1 /* ValueObjectConstResultImpl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ValueObjectConstResultImpl.cpp; path = source/Core/ValueObjectConstResultImpl.cpp; sourceTree = "<group>"; };
 		94A8287514031D05006C37A8 /* FormatNavigator.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = FormatNavigator.h; path = include/lldb/Core/FormatNavigator.h; sourceTree = "<group>"; };
@@ -1715,6 +1745,12 @@
 				2611FF0F142D83060017FEA3 /* SBTarget.i */,
 				2611FF10142D83060017FEA3 /* SBThread.i */,
 				2611FF11142D83060017FEA3 /* SBType.i */,
+				9475C18A14E5EA1C001BFC6D /* SBTypeCategory.i */,
+				9461569214E3567F003A195C /* SBTypeFilter.i */,
+				9461569314E3567F003A195C /* SBTypeFormat.i */,
+				9475C18B14E5F818001BFC6D /* SBTypeNameSpecifier.i */,
+				9461569414E3567F003A195C /* SBTypeSummary.i */,
+				9461569514E3567F003A195C /* SBTypeSynthetic.i */,
 				2611FF12142D83060017FEA3 /* SBValue.i */,
 				2611FF13142D83060017FEA3 /* SBValueList.i */,
 				B2A5872514313B480092BFBA /* SBWatchpoint.i */,
@@ -1822,6 +1858,18 @@
 				9A9831091125FC5800A56CB0 /* SBThread.cpp */,
 				2617447911685869005ADD65 /* SBType.h */,
 				261744771168585B005ADD65 /* SBType.cpp */,
+				9475C18514E5E9C5001BFC6D /* SBTypeCategory.h */,
+				9475C18714E5E9FA001BFC6D /* SBTypeCategory.cpp */,
+				9461568614E355F2003A195C /* SBTypeFilter.h */,
+				9461568A14E35621003A195C /* SBTypeFilter.cpp */,
+				9461568714E355F2003A195C /* SBTypeFormat.h */,
+				9461568B14E35621003A195C /* SBTypeFormat.cpp */,
+				9475C18C14E5F826001BFC6D /* SBTypeNameSpecifier.h */,
+				9475C18D14E5F834001BFC6D /* SBTypeNameSpecifier.cpp */,
+				9461568814E355F2003A195C /* SBTypeSummary.h */,
+				9461568C14E35621003A195C /* SBTypeSummary.cpp */,
+				9461568914E355F2003A195C /* SBTypeSynthetic.h */,
+				9461568D14E35621003A195C /* SBTypeSynthetic.cpp */,
 				9A19A6A51163BB7E00E0D453 /* SBValue.h */,
 				9A19A6AD1163BB9800E0D453 /* SBValue.cpp */,
 				9A357582116CFDEE00E8ED2F /* SBValueList.h */,
@@ -2876,6 +2924,12 @@
 				2668022C115FD13D008E1FE4 /* SBTarget.h in Headers */,
 				2668022E115FD13D008E1FE4 /* SBThread.h in Headers */,
 				2617447A11685869005ADD65 /* SBType.h in Headers */,
+				9475C18914E5EA08001BFC6D /* SBTypeCategory.h in Headers */,
+				941BCC7F14E48C4000BB969C /* SBTypeFilter.h in Headers */,
+				941BCC8014E48C4000BB969C /* SBTypeFormat.h in Headers */,
+				9475C18F14E5F858001BFC6D /* SBTypeNameSpecifier.h in Headers */,
+				941BCC8114E48C4000BB969C /* SBTypeSummary.h in Headers */,
+				941BCC8214E48C4000BB969C /* SBTypeSynthetic.h in Headers */,
 				9A19A6AF1163BBB200E0D453 /* SBValue.h in Headers */,
 				9A357583116CFDEE00E8ED2F /* SBValueList.h in Headers */,
 				26D265A2136B40EE002EEE45 /* SharingPtr.h in Headers */,
@@ -3177,6 +3231,10 @@
 			isa = PBXSourcesBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
+				9461569A14E358A6003A195C /* SBTypeFilter.cpp in Sources */,
+				9461569B14E358A6003A195C /* SBTypeFormat.cpp in Sources */,
+				9461569C14E358A6003A195C /* SBTypeSummary.cpp in Sources */,
+				9461569D14E358A6003A195C /* SBTypeSynthetic.cpp in Sources */,
 				26680324116005D9008E1FE4 /* SBThread.cpp in Sources */,
 				26680326116005DB008E1FE4 /* SBTarget.cpp in Sources */,
 				26680327116005DC008E1FE4 /* SBSourceManager.cpp in Sources */,
@@ -3217,6 +3275,8 @@
 				26B82840142D020F002DBC64 /* SBSection.cpp in Sources */,
 				B2A58724143119D50092BFBA /* SBWatchpoint.cpp in Sources */,
 				2660AAB914622483003A9694 /* LLDBWrapPython.cpp in Sources */,
+				9475C18814E5E9FA001BFC6D /* SBTypeCategory.cpp in Sources */,
+				9475C18E14E5F834001BFC6D /* SBTypeNameSpecifier.cpp in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};

Modified: lldb/trunk/scripts/Python/build-swig-Python.sh
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/build-swig-Python.sh?rev=150558&r1=150557&r2=150558&view=diff
==============================================================================
--- lldb/trunk/scripts/Python/build-swig-Python.sh (original)
+++ lldb/trunk/scripts/Python/build-swig-Python.sh Tue Feb 14 20:34:21 2012
@@ -73,6 +73,12 @@
 " ${SRC_ROOT}/include/lldb/API/SBTarget.h"\
 " ${SRC_ROOT}/include/lldb/API/SBThread.h"\
 " ${SRC_ROOT}/include/lldb/API/SBType.h"\
+" ${SRC_ROOT}/include/lldb/API/SBTypeCategory.h"\
+" ${SRC_ROOT}/include/lldb/API/SBTypeFilter.h"\
+" ${SRC_ROOT}/include/lldb/API/SBTypeFormat.h"\
+" ${SRC_ROOT}/include/lldb/API/SBTypeNameSpecifier.h"\
+" ${SRC_ROOT}/include/lldb/API/SBTypeSummary.h"\
+" ${SRC_ROOT}/include/lldb/API/SBTypeSynthetic.h"\
 " ${SRC_ROOT}/include/lldb/API/SBValue.h"\
 " ${SRC_ROOT}/include/lldb/API/SBValueList.h"\
 " ${SRC_ROOT}/include/lldb/API/SBWatchpoint.h"\
@@ -109,6 +115,12 @@
 " ${SRC_ROOT}/scripts/Python/interface/SBTarget.i"\
 " ${SRC_ROOT}/scripts/Python/interface/SBThread.i"\
 " ${SRC_ROOT}/scripts/Python/interface/SBType.i"\
+" ${SRC_ROOT}/scripts/Python/interface/SBTypeCategory.i"\
+" ${SRC_ROOT}/scripts/Python/interface/SBTypeFilter.i"\
+" ${SRC_ROOT}/scripts/Python/interface/SBTypeFormat.i"\
+" ${SRC_ROOT}/scripts/Python/interface/SBTypeNameSpecifier.i"\
+" ${SRC_ROOT}/scripts/Python/interface/SBTypeSummary.i"\
+" ${SRC_ROOT}/scripts/Python/interface/SBTypeSynthetic.i"\
 " ${SRC_ROOT}/scripts/Python/interface/SBValue.i"\
 " ${SRC_ROOT}/scripts/Python/interface/SBValueList.i"\
 " ${SRC_ROOT}/scripts/Python/interface/SBWatchpoint.i"

Modified: lldb/trunk/scripts/Python/interface/SBDebugger.i
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/interface/SBDebugger.i?rev=150558&r1=150557&r2=150558&view=diff
==============================================================================
--- lldb/trunk/scripts/Python/interface/SBDebugger.i (original)
+++ lldb/trunk/scripts/Python/interface/SBDebugger.i Tue Feb 14 20:34:21 2012
@@ -321,6 +321,37 @@
     
     void
     SetCloseInputOnEOF (bool b);
+    
+    lldb::SBTypeCategory
+    GetCategory (const char* category_name);
+    
+    lldb::SBTypeCategory
+    CreateCategory (const char* category_name);
+    
+    bool
+    DeleteCategory (const char* category_name);
+    
+    uint32_t
+    GetNumCategories ();
+    
+    lldb::SBTypeCategory
+    GetCategoryAtIndex (uint32_t);
+    
+    lldb::SBTypeCategory
+    GetDefaultCategory();
+    
+    lldb::SBTypeFormat
+    GetFormatForType (lldb::SBTypeNameSpecifier);
+
+    lldb::SBTypeSummary
+    GetSummaryForType (lldb::SBTypeNameSpecifier);
+
+    lldb::SBTypeFilter
+    GetFilterForType (lldb::SBTypeNameSpecifier);
+
+    lldb::SBTypeSynthetic
+    GetSyntheticForType (lldb::SBTypeNameSpecifier);
+                
 }; // class SBDebugger
 
 } // namespace lldb

Added: lldb/trunk/scripts/Python/interface/SBTypeCategory.i
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/interface/SBTypeCategory.i?rev=150558&view=auto
==============================================================================
--- lldb/trunk/scripts/Python/interface/SBTypeCategory.i (added)
+++ lldb/trunk/scripts/Python/interface/SBTypeCategory.i Tue Feb 14 20:34:21 2012
@@ -0,0 +1,140 @@
+//===-- SWIG Interface for SBTypeCategory---------------------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+namespace lldb {
+    
+    %feature("docstring",
+    "Represents a category that can contain formatters for types.
+    ") SBTypeCategory;
+    
+    class SBTypeCategory
+    {
+    public:
+        
+        SBTypeCategory();
+        
+        SBTypeCategory (const lldb::SBTypeCategory &rhs);
+        
+        ~SBTypeCategory ();
+        
+        bool
+        IsValid() const;
+        
+        bool
+        GetEnabled ();
+        
+        void
+        SetEnabled (bool);
+        
+        const char*
+        GetName();
+        
+        bool
+        GetDescription (lldb::SBStream &description, 
+                        lldb::DescriptionLevel description_level);
+        
+        uint32_t
+        GetNumFormats ();
+        
+        uint32_t
+        GetNumSummaries ();
+        
+        uint32_t
+        GetNumFilters ();
+        
+        uint32_t
+        GetNumSynthetics ();
+        
+        lldb::SBTypeNameSpecifier
+        GetTypeNameSpecifierForFilterAtIndex (uint32_t);
+        
+        lldb::SBTypeNameSpecifier
+        GetTypeNameSpecifierForFormatAtIndex (uint32_t);
+        
+        lldb::SBTypeNameSpecifier
+        GetTypeNameSpecifierForSummaryAtIndex (uint32_t);
+
+        lldb::SBTypeNameSpecifier
+        GetTypeNameSpecifierForSyntheticAtIndex (uint32_t);
+        
+        lldb::SBTypeFilter
+        GetFilterForType (lldb::SBTypeNameSpecifier);
+
+        lldb::SBTypeFormat
+        GetFormatForType (lldb::SBTypeNameSpecifier);
+        
+        lldb::SBTypeSummary
+        GetSummaryForType (lldb::SBTypeNameSpecifier);
+
+        lldb::SBTypeSynthetic
+        GetSyntheticForType (lldb::SBTypeNameSpecifier);
+        
+        lldb::SBTypeFilter
+        GetFilterAtIndex (uint32_t);
+        
+        lldb::SBTypeFormat
+        GetFormatAtIndex (uint32_t);
+        
+        lldb::SBTypeSummary
+        GetSummaryAtIndex (uint32_t);
+        
+        lldb::SBTypeSynthetic
+        GetSyntheticAtIndex (uint32_t);
+        
+        bool
+        AddTypeFormat (lldb::SBTypeNameSpecifier,
+                       lldb::SBTypeFormat);
+        
+        bool
+        DeleteTypeFormat (lldb::SBTypeNameSpecifier);
+        
+        bool
+        AddTypeSummary (lldb::SBTypeNameSpecifier,
+                        lldb::SBTypeSummary);
+        
+        bool
+        DeleteTypeSummary (lldb::SBTypeNameSpecifier);
+        
+        bool
+        AddTypeFilter (lldb::SBTypeNameSpecifier,
+                       lldb::SBTypeFilter);
+        
+        bool
+        DeleteTypeFilter (lldb::SBTypeNameSpecifier);
+        
+        bool
+        AddTypeSynthetic (lldb::SBTypeNameSpecifier,
+                          lldb::SBTypeSynthetic);
+        
+        bool
+        DeleteTypeSynthetic (lldb::SBTypeNameSpecifier);
+        
+        %pythoncode %{
+            __swig_getmethods__["num_formats"] = GetNumFormats
+            if _newclass: x = property(GetNumFormats, None)
+            __swig_getmethods__["num_summaries"] = GetNumSummaries
+            if _newclass: x = property(GetNumSummaries, None)
+            __swig_getmethods__["num_filters"] = GetNumFilters
+            if _newclass: x = property(GetNumFilters, None)
+            __swig_getmethods__["num_synthetics"] = GetNumSynthetics
+            if _newclass: x = property(GetNumSynthetics, None)
+            
+            __swig_getmethods__["name"] = GetName
+            if _newclass: x = property(GetName, None)
+            
+            __swig_getmethods__["enabled"] = GetEnabled
+            __swig_setmethods__["enabled"] = SetEnabled
+            if _newclass: x = property(GetEnabled, SetEnabled)
+        %}
+
+    };
+
+    
+} // namespace lldb
+

Added: lldb/trunk/scripts/Python/interface/SBTypeFilter.i
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/interface/SBTypeFilter.i?rev=150558&view=auto
==============================================================================
--- lldb/trunk/scripts/Python/interface/SBTypeFilter.i (added)
+++ lldb/trunk/scripts/Python/interface/SBTypeFilter.i Tue Feb 14 20:34:21 2012
@@ -0,0 +1,69 @@
+//===-- SWIG Interface for SBTypeFilter----------------------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+namespace lldb {
+    
+    %feature("docstring",
+    "Represents a filter that can be associated to one or more types.
+    ") SBTypeFilter;
+    
+    class SBTypeFilter
+    {
+        public:
+        
+        SBTypeFilter();
+        
+        SBTypeFilter (uint32_t options);
+        
+        SBTypeFilter (const lldb::SBTypeFilter &rhs);
+        
+        ~SBTypeFilter ();
+        
+        bool
+        IsValid() const;
+        
+        bool
+        IsEqualTo (lldb::SBTypeFilter &rhs);
+        
+        uint32_t
+        GetNumberOfExpressionPaths ();
+        
+        const char*
+        GetExpressionPathAtIndex (uint32_t i);
+        
+        bool
+        ReplaceExpressionPathAtIndex (uint32_t i, const char* item);
+        
+        void
+        AppendExpressionPath (const char* item);
+        
+        void
+        Clear();
+        
+        uint32_t
+        GetOptions();
+        
+        void
+        SetOptions (uint32_t);
+        
+        bool
+        GetDescription (lldb::SBStream &description, lldb::DescriptionLevel description_level);
+        
+        %pythoncode %{
+            __swig_getmethods__["options"] = GetOptions
+            __swig_setmethods__["options"] = SetOptions
+            if _newclass: x = property(GetOptions, SetOptions)        
+            
+            __swig_getmethods__["count"] = GetNumberOfExpressionPaths
+            if _newclass: x = property(GetNumberOfExpressionPaths, None)
+        %}
+                
+    };
+
+} // namespace lldb

Added: lldb/trunk/scripts/Python/interface/SBTypeFormat.i
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/interface/SBTypeFormat.i?rev=150558&view=auto
==============================================================================
--- lldb/trunk/scripts/Python/interface/SBTypeFormat.i (added)
+++ lldb/trunk/scripts/Python/interface/SBTypeFormat.i Tue Feb 14 20:34:21 2012
@@ -0,0 +1,64 @@
+//===-- SWIG Interface for SBTypeFormat----------------------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+namespace lldb {
+    
+    %feature("docstring",
+             "Represents a format that can be associated to one or more types.
+             ") SBTypeFormat;
+    
+    class SBTypeFormat
+    {
+    public:
+        
+        SBTypeFormat();
+        
+        SBTypeFormat (lldb::Format format, uint32_t options = 0);
+        
+        SBTypeFormat (const lldb::SBTypeFormat &rhs);
+        
+        ~SBTypeFormat ();
+        
+        bool
+        IsValid() const;
+        
+        bool
+        IsEqualTo (lldb::SBTypeFormat &rhs);
+        
+        lldb::Format
+        GetFormat ();
+        
+        uint32_t
+        GetOptions();
+        
+        void
+        SetFormat (lldb::Format);
+        
+        void
+        SetOptions (uint32_t);        
+        
+        bool
+        GetDescription (lldb::SBStream &description, 
+                        lldb::DescriptionLevel description_level);
+                
+        %pythoncode %{
+            __swig_getmethods__["format"] = GetFormat
+            __swig_setmethods__["format"] = SetFormat
+            if _newclass: x = property(GetFormat, SetFormat)
+            
+            __swig_getmethods__["options"] = GetOptions
+            __swig_setmethods__["options"] = SetOptions
+            if _newclass: x = property(GetOptions, SetOptions)            
+        %}
+
+    };
+    
+    
+} // namespace lldb
+

Added: lldb/trunk/scripts/Python/interface/SBTypeNameSpecifier.i
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/interface/SBTypeNameSpecifier.i?rev=150558&view=auto
==============================================================================
--- lldb/trunk/scripts/Python/interface/SBTypeNameSpecifier.i (added)
+++ lldb/trunk/scripts/Python/interface/SBTypeNameSpecifier.i Tue Feb 14 20:34:21 2012
@@ -0,0 +1,57 @@
+//===-- SWIG Interface for SBTypeNameSpecifier---------------------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+namespace lldb {
+    
+    %feature("docstring",
+    "Represents a general way to provide a type name to LLDB APIs.
+    ") SBTypeNameSpecifier;
+    
+    class SBTypeNameSpecifier
+    {
+    public:
+        
+        SBTypeNameSpecifier();
+        
+        SBTypeNameSpecifier (const char* name,
+                             bool is_regex = false);
+        
+        SBTypeNameSpecifier (const lldb::SBTypeNameSpecifier &rhs);
+        
+        ~SBTypeNameSpecifier ();
+        
+        bool
+        IsValid() const;
+        
+        bool
+        IsEqualTo (lldb::SBTypeNameSpecifier &rhs);
+        
+        const char*
+        GetName();
+        
+        bool
+        IsRegex();
+        
+        bool
+        GetDescription (lldb::SBStream &description, 
+                        lldb::DescriptionLevel description_level);
+                        
+        %pythoncode %{
+            __swig_getmethods__["name"] = GetName
+            if _newclass: x = property(GetName, None)
+            
+            __swig_getmethods__["is_regex"] = IsRegex
+            if _newclass: x = property(IsRegex, None)
+        %}
+
+        
+    };
+    
+} // namespace lldb
+

Added: lldb/trunk/scripts/Python/interface/SBTypeSummary.i
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/interface/SBTypeSummary.i?rev=150558&view=auto
==============================================================================
--- lldb/trunk/scripts/Python/interface/SBTypeSummary.i (added)
+++ lldb/trunk/scripts/Python/interface/SBTypeSummary.i Tue Feb 14 20:34:21 2012
@@ -0,0 +1,93 @@
+//===-- SWIG Interface for SBTypeSummary---------------------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+namespace lldb {
+    
+    %feature("docstring",
+    "Represents a summary that can be associated to one or more types.
+    ") SBTypeSummary;
+    
+    class SBTypeSummary
+    {
+    public:
+        
+        SBTypeSummary();
+        
+        static SBTypeSummary
+        CreateWithSummaryString (const char* data, uint32_t options = 0);
+        
+        static SBTypeSummary
+        CreateWithFunctionName (const char* data, uint32_t options = 0);
+        
+        static SBTypeSummary
+        CreateWithScriptCode (const char* data, uint32_t options = 0);
+        
+        SBTypeSummary (const lldb::SBTypeSummary &rhs);
+        
+        ~SBTypeSummary ();
+        
+        bool
+        IsValid() const;
+        
+        bool
+        IsEqualTo (lldb::SBTypeSummary &rhs);
+        
+        bool
+        IsFunctionCode();
+        
+        bool
+        IsFunctionName();
+        
+        bool
+        IsSummaryString();
+        
+        const char*
+        GetData ();
+        
+        void
+        SetSummaryString (const char* data);
+        
+        void
+        SetFunctionName (const char* data);
+        
+        void
+        SetFunctionCode (const char* data);
+        
+        uint32_t
+        GetOptions ();
+
+        void
+        SetOptions (uint32_t);
+        
+        bool
+        GetDescription (lldb::SBStream &description, 
+                        lldb::DescriptionLevel description_level);
+        
+        %pythoncode %{
+            __swig_getmethods__["options"] = GetOptions
+            __swig_setmethods__["options"] = SetOptions
+            if _newclass: x = property(GetOptions, SetOptions)        
+            
+            __swig_getmethods__["is_summary_string"] = IsSummaryString
+            if _newclass: x = property(IsSummaryString, None)        
+
+            __swig_getmethods__["is_function_name"] = IsFunctionName
+            if _newclass: x = property(IsFunctionName, None)        
+
+            __swig_getmethods__["is_function_code"] = IsFunctionCode
+            if _newclass: x = property(IsFunctionCode, None)        
+
+            __swig_getmethods__["summary_data"] = GetData
+            if _newclass: x = property(GetData, None)
+        %}
+        
+    };
+
+} // namespace lldb
+

Added: lldb/trunk/scripts/Python/interface/SBTypeSynthetic.i
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/interface/SBTypeSynthetic.i?rev=150558&view=auto
==============================================================================
--- lldb/trunk/scripts/Python/interface/SBTypeSynthetic.i (added)
+++ lldb/trunk/scripts/Python/interface/SBTypeSynthetic.i Tue Feb 14 20:34:21 2012
@@ -0,0 +1,74 @@
+//===-- SWIG Interface for SBTypeSynthetic-------------------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+namespace lldb {
+    
+    %feature("docstring",
+    "Represents a summary that can be associated to one or more types.
+    ") SBTypeSynthetic;
+    
+    class SBTypeSynthetic
+    {
+    public:
+        
+        SBTypeSynthetic();
+        
+        static lldb::SBTypeSynthetic
+        CreateWithClassName (const char* data, uint32_t options = 0);
+        
+        static lldb::SBTypeSynthetic
+        CreateWithScriptCode (const char* data, uint32_t options = 0);
+        
+        SBTypeSynthetic (const lldb::SBTypeSynthetic &rhs);
+        
+        ~SBTypeSynthetic ();
+        
+        bool
+        IsValid() const;
+        
+        bool
+        IsEqualTo (lldb::SBTypeSynthetic &rhs);
+        
+        bool
+        IsClassCode();
+        
+        const char*
+        GetData ();
+        
+        void
+        SetClassName (const char* data);
+        
+        void
+        SetClassCode (const char* data);
+
+        uint32_t
+        GetOptions ();
+        
+        void
+        SetOptions (uint32_t);
+        
+        bool
+        GetDescription (lldb::SBStream &description, 
+                        lldb::DescriptionLevel description_level);
+        
+        %pythoncode %{
+            __swig_getmethods__["options"] = GetOptions
+            __swig_setmethods__["options"] = SetOptions
+            if _newclass: x = property(GetOptions, SetOptions)        
+            
+            __swig_getmethods__["contains_code"] = IsClassCode
+            if _newclass: x = property(IsClassCode, None)        
+            
+            __swig_getmethods__["synthetic_data"] = GetData
+            if _newclass: x = property(GetData, None)
+        %}
+        
+    };
+    
+} // namespace lldb

Modified: lldb/trunk/scripts/Python/python-extensions.swig
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/python-extensions.swig?rev=150558&r1=150557&r2=150558&view=diff
==============================================================================
--- lldb/trunk/scripts/Python/python-extensions.swig (original)
+++ lldb/trunk/scripts/Python/python-extensions.swig Tue Feb 14 20:34:21 2012
@@ -322,6 +322,48 @@
                     return PyString_FromString("");
         }
 }
+%extend lldb::SBTypeCategory {
+        PyObject *lldb::SBTypeCategory::__str__ (){
+                lldb::SBStream description;
+                $self->GetDescription (description, lldb::eDescriptionLevelBrief);
+                const char *desc = description.GetData();
+                size_t desc_len = description.GetSize();
+                if (desc_len > 0 && (desc[desc_len-1] == '\n' || desc[desc_len-1] == '\r'))
+                    --desc_len;
+                if (desc_len > 0)
+                    return PyString_FromStringAndSize (desc, desc_len);
+                else
+                    return PyString_FromString("");
+        }
+}
+%extend lldb::SBTypeFilter {
+        PyObject *lldb::SBTypeFilter::__str__ (){
+                lldb::SBStream description;
+                $self->GetDescription (description, lldb::eDescriptionLevelBrief);
+                const char *desc = description.GetData();
+                size_t desc_len = description.GetSize();
+                if (desc_len > 0 && (desc[desc_len-1] == '\n' || desc[desc_len-1] == '\r'))
+                    --desc_len;
+                if (desc_len > 0)
+                    return PyString_FromStringAndSize (desc, desc_len);
+                else
+                    return PyString_FromString("");
+        }
+}
+%extend lldb::SBTypeFormat {
+        PyObject *lldb::SBTypeFormat::__str__ (){
+                lldb::SBStream description;
+                $self->GetDescription (description, lldb::eDescriptionLevelBrief);
+                const char *desc = description.GetData();
+                size_t desc_len = description.GetSize();
+                if (desc_len > 0 && (desc[desc_len-1] == '\n' || desc[desc_len-1] == '\r'))
+                    --desc_len;
+                if (desc_len > 0)
+                    return PyString_FromStringAndSize (desc, desc_len);
+                else
+                    return PyString_FromString("");
+        }
+}
 %extend lldb::SBTypeMember {
         PyObject *lldb::SBTypeMember::__str__ (){
                 lldb::SBStream description;
@@ -336,6 +378,48 @@
                     return PyString_FromString("");
         }
 }
+%extend lldb::SBTypeNameSpecifier {
+        PyObject *lldb::SBTypeNameSpecifier::__str__ (){
+                lldb::SBStream description;
+                $self->GetDescription (description, lldb::eDescriptionLevelBrief);
+                const char *desc = description.GetData();
+                size_t desc_len = description.GetSize();
+                if (desc_len > 0 && (desc[desc_len-1] == '\n' || desc[desc_len-1] == '\r'))
+                    --desc_len;
+                if (desc_len > 0)
+                    return PyString_FromStringAndSize (desc, desc_len);
+                else
+                    return PyString_FromString("");
+        }
+}
+%extend lldb::SBTypeSummary {
+        PyObject *lldb::SBTypeSummary::__str__ (){
+                lldb::SBStream description;
+                $self->GetDescription (description, lldb::eDescriptionLevelBrief);
+                const char *desc = description.GetData();
+                size_t desc_len = description.GetSize();
+                if (desc_len > 0 && (desc[desc_len-1] == '\n' || desc[desc_len-1] == '\r'))
+                    --desc_len;
+                if (desc_len > 0)
+                    return PyString_FromStringAndSize (desc, desc_len);
+                else
+                    return PyString_FromString("");
+        }
+}
+%extend lldb::SBTypeSynthetic {
+        PyObject *lldb::SBTypeSynthetic::__str__ (){
+                lldb::SBStream description;
+                $self->GetDescription (description, lldb::eDescriptionLevelBrief);
+                const char *desc = description.GetData();
+                size_t desc_len = description.GetSize();
+                if (desc_len > 0 && (desc[desc_len-1] == '\n' || desc[desc_len-1] == '\r'))
+                    --desc_len;
+                if (desc_len > 0)
+                    return PyString_FromStringAndSize (desc, desc_len);
+                else
+                    return PyString_FromString("");
+        }
+}
 %extend lldb::SBThread {
         PyObject *lldb::SBThread::__str__ (){
                 lldb::SBStream description;

Modified: lldb/trunk/scripts/lldb.swig
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/lldb.swig?rev=150558&r1=150557&r2=150558&view=diff
==============================================================================
--- lldb/trunk/scripts/lldb.swig (original)
+++ lldb/trunk/scripts/lldb.swig Tue Feb 14 20:34:21 2012
@@ -82,6 +82,12 @@
 #include "lldb/API/SBTarget.h"
 #include "lldb/API/SBThread.h"
 #include "lldb/API/SBType.h"
+#include "lldb/API/SBTypeCategory.h"
+#include "lldb/API/SBTypeFilter.h"
+#include "lldb/API/SBTypeFormat.h"
+#include "lldb/API/SBTypeNameSpecifier.h"
+#include "lldb/API/SBTypeSummary.h"
+#include "lldb/API/SBTypeSynthetic.h"
 #include "lldb/API/SBValue.h"
 #include "lldb/API/SBValueList.h"
 #include "lldb/API/SBWatchpoint.h"
@@ -134,6 +140,12 @@
 %include "./Python/interface/SBTarget.i"
 %include "./Python/interface/SBThread.i"
 %include "./Python/interface/SBType.i"
+%include "./Python/interface/SBTypeCategory.i"
+%include "./Python/interface/SBTypeFilter.i"
+%include "./Python/interface/SBTypeFormat.i"
+%include "./Python/interface/SBTypeNameSpecifier.i"
+%include "./Python/interface/SBTypeSummary.i"
+%include "./Python/interface/SBTypeSynthetic.i"
 %include "./Python/interface/SBValue.i"
 %include "./Python/interface/SBValueList.i"
 %include "./Python/interface/SBWatchpoint.i"

Modified: lldb/trunk/source/API/SBDebugger.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBDebugger.cpp?rev=150558&r1=150557&r2=150558&view=diff
==============================================================================
--- lldb/trunk/source/API/SBDebugger.cpp (original)
+++ lldb/trunk/source/API/SBDebugger.cpp Tue Feb 14 20:34:21 2012
@@ -25,6 +25,15 @@
 #include "lldb/API/SBStringList.h"
 #include "lldb/API/SBTarget.h"
 #include "lldb/API/SBThread.h"
+#include "lldb/API/SBTypeCategory.h"
+#include "lldb/API/SBTypeFormat.h"
+#include "lldb/API/SBTypeFilter.h"
+#include "lldb/API/SBTypeNameSpecifier.h"
+#include "lldb/API/SBTypeSummary.h"
+#include "lldb/API/SBTypeSynthetic.h"
+
+
+#include "lldb/Core/DataVisualization.h"
 #include "lldb/Core/Debugger.h"
 #include "lldb/Core/State.h"
 #include "lldb/Interpreter/Args.h"
@@ -1054,3 +1063,140 @@
     if (m_opaque_sp)
         m_opaque_sp->SetCloseInputOnEOF (b);
 }
+
+SBTypeCategory
+SBDebugger::GetCategory (const char* category_name)
+{
+    if (!category_name || *category_name == 0)
+        return SBTypeCategory();
+    
+    TypeCategoryImplSP category_sp;
+    
+    if (DataVisualization::Categories::GetCategory(ConstString(category_name), category_sp, false))
+        return SBTypeCategory(category_sp);
+    else
+        return SBTypeCategory();
+}
+
+SBTypeCategory
+SBDebugger::CreateCategory (const char* category_name)
+{
+    if (!category_name || *category_name == 0)
+        return SBTypeCategory();
+    
+    TypeCategoryImplSP category_sp;
+    
+    if (DataVisualization::Categories::GetCategory(ConstString(category_name), category_sp, true))
+        return SBTypeCategory(category_sp);
+    else
+        return SBTypeCategory();
+}
+
+bool
+SBDebugger::DeleteCategory (const char* category_name)
+{
+    if (!category_name || *category_name == 0)
+        return false;
+    
+    return DataVisualization::Categories::Delete(ConstString(category_name));
+}
+
+uint32_t
+SBDebugger::GetNumCategories()
+{
+    return DataVisualization::Categories::GetCount();
+}
+
+SBTypeCategory
+SBDebugger::GetCategoryAtIndex (uint32_t index)
+{
+    return SBTypeCategory(DataVisualization::Categories::GetCategoryAtIndex(index));
+}
+
+SBTypeCategory
+SBDebugger::GetDefaultCategory()
+{
+    return GetCategory("default");
+}
+
+SBTypeFormat
+SBDebugger::GetFormatForType (SBTypeNameSpecifier type_name)
+{
+    SBTypeCategory default_category_sb = GetDefaultCategory();
+    if (default_category_sb.GetEnabled())
+        return default_category_sb.GetFormatForType(type_name);
+    return SBTypeFormat();
+}
+
+SBTypeSummary
+SBDebugger::GetSummaryForType (SBTypeNameSpecifier type_name)
+{
+    SBTypeSummary summary_chosen;
+    uint32_t num_categories = GetNumCategories();
+    SBTypeCategory category_sb;
+    uint32_t prio_category = UINT32_MAX;
+    for (uint32_t category_id = 0;
+         category_id < num_categories;
+         category_id++)
+    {
+        category_sb = GetCategoryAtIndex(category_id);
+        if (category_sb.GetEnabled() == false)
+            continue;
+        SBTypeSummary summary_current = category_sb.GetSummaryForType(type_name);
+        if (summary_current.IsValid() && (summary_chosen.IsValid() == false || (prio_category > category_sb.m_opaque_sp->GetEnabledPosition())))
+        {
+            prio_category = category_sb.m_opaque_sp->GetEnabledPosition();
+            summary_chosen = summary_current;
+        }
+    }
+    return summary_chosen;
+}
+
+SBTypeFilter
+SBDebugger::GetFilterForType (SBTypeNameSpecifier type_name)
+{
+    SBTypeFilter filter_chosen;
+    uint32_t num_categories = GetNumCategories();
+    SBTypeCategory category_sb;
+    uint32_t prio_category = UINT32_MAX;
+    for (uint32_t category_id = 0;
+         category_id < num_categories;
+         category_id++)
+    {
+        category_sb = GetCategoryAtIndex(category_id);
+        if (category_sb.GetEnabled() == false)
+            continue;
+        SBTypeFilter filter_current = category_sb.GetFilterForType(type_name);
+        if (filter_current.IsValid() && (filter_chosen.IsValid() == false || (prio_category > category_sb.m_opaque_sp->GetEnabledPosition())))
+        {
+            prio_category = category_sb.m_opaque_sp->GetEnabledPosition();
+            filter_chosen = filter_current;
+        }
+    }
+    return filter_chosen;
+}
+
+SBTypeSynthetic
+SBDebugger::GetSyntheticForType (SBTypeNameSpecifier type_name)
+{
+    SBTypeSynthetic synth_chosen;
+    uint32_t num_categories = GetNumCategories();
+    SBTypeCategory category_sb;
+    uint32_t prio_category = UINT32_MAX;
+    for (uint32_t category_id = 0;
+         category_id < num_categories;
+         category_id++)
+    {
+        category_sb = GetCategoryAtIndex(category_id);
+        if (category_sb.GetEnabled() == false)
+            continue;
+        SBTypeSynthetic synth_current = category_sb.GetSyntheticForType(type_name);
+        if (synth_current.IsValid() && (synth_chosen.IsValid() == false || (prio_category > category_sb.m_opaque_sp->GetEnabledPosition())))
+        {
+            prio_category = category_sb.m_opaque_sp->GetEnabledPosition();
+            synth_chosen = synth_current;
+        }
+    }
+    return synth_chosen;
+}
+

Added: lldb/trunk/source/API/SBTypeCategory.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBTypeCategory.cpp?rev=150558&view=auto
==============================================================================
--- lldb/trunk/source/API/SBTypeCategory.cpp (added)
+++ lldb/trunk/source/API/SBTypeCategory.cpp Tue Feb 14 20:34:21 2012
@@ -0,0 +1,556 @@
+//===-- SBTypeCategory.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/API/SBTypeCategory.h"
+
+#include "lldb/API/SBTypeFilter.h"
+#include "lldb/API/SBTypeFormat.h"
+#include "lldb/API/SBTypeSummary.h"
+#include "lldb/API/SBTypeSynthetic.h"
+#include "lldb/API/SBTypeNameSpecifier.h"
+#include "lldb/API/SBStream.h"
+
+#include "lldb/Core/DataVisualization.h"
+#include "lldb/Core/Debugger.h"
+#include "lldb/Interpreter/CommandInterpreter.h"
+#include "lldb/Interpreter/ScriptInterpreter.h"
+
+using namespace lldb;
+using namespace lldb_private;
+
+typedef std::pair<lldb::TypeCategoryImplSP,user_id_t> ImplType;
+
+SBTypeCategory::SBTypeCategory() :
+m_opaque_sp()
+{
+}
+
+SBTypeCategory::SBTypeCategory (const char* name) :
+m_opaque_sp()
+{
+    DataVisualization::Categories::GetCategory(ConstString(name), m_opaque_sp);
+}
+
+SBTypeCategory::SBTypeCategory (const lldb::SBTypeCategory &rhs) :
+m_opaque_sp(rhs.m_opaque_sp)
+{
+}
+
+SBTypeCategory::~SBTypeCategory ()
+{
+}
+
+bool
+SBTypeCategory::IsValid() const
+{
+    return (m_opaque_sp.get() != NULL);
+}
+
+bool
+SBTypeCategory::GetEnabled ()
+{
+    if (!IsValid())
+        return false;
+    return m_opaque_sp->IsEnabled();
+}
+
+void
+SBTypeCategory::SetEnabled (bool enabled)
+{
+    if (!IsValid())
+        return;
+    if (enabled)
+        DataVisualization::Categories::Enable(m_opaque_sp);
+    else
+        DataVisualization::Categories::Disable(m_opaque_sp);
+}
+
+const char*
+SBTypeCategory::GetName()
+{
+    if (!IsValid())
+        return false;
+    return m_opaque_sp->GetName();
+}
+
+uint32_t
+SBTypeCategory::GetNumFormats ()
+{
+    if (!IsDefaultCategory())
+        return 0;
+    
+    return DataVisualization::ValueFormats::GetCount();
+}
+
+uint32_t
+SBTypeCategory::GetNumSummaries ()
+{
+    if (!IsValid())
+        return 0;
+    return m_opaque_sp->GetSummaryNavigator()->GetCount() + m_opaque_sp->GetRegexSummaryNavigator()->GetCount();
+}
+
+uint32_t
+SBTypeCategory::GetNumFilters ()
+{
+    if (!IsValid())
+        return 0;
+    return m_opaque_sp->GetFilterNavigator()->GetCount() + m_opaque_sp->GetRegexFilterNavigator()->GetCount();
+}
+
+uint32_t
+SBTypeCategory::GetNumSynthetics ()
+{
+    if (!IsValid())
+        return 0;
+    return m_opaque_sp->GetSyntheticNavigator()->GetCount() + m_opaque_sp->GetRegexSyntheticNavigator()->GetCount();
+}
+
+lldb::SBTypeNameSpecifier
+SBTypeCategory::GetTypeNameSpecifierForFilterAtIndex (uint32_t index)
+{
+    if (!IsValid())
+        return SBTypeNameSpecifier();
+    return SBTypeNameSpecifier(m_opaque_sp->GetTypeNameSpecifierForFilterAtIndex(index));
+}
+
+lldb::SBTypeNameSpecifier
+SBTypeCategory::GetTypeNameSpecifierForFormatAtIndex (uint32_t index)
+{
+    if (!IsDefaultCategory())
+        return SBTypeNameSpecifier();
+    return SBTypeNameSpecifier(DataVisualization::ValueFormats::GetTypeNameSpecifierForFormatAtIndex(index));
+}
+
+lldb::SBTypeNameSpecifier
+SBTypeCategory::GetTypeNameSpecifierForSummaryAtIndex (uint32_t index)
+{
+    if (!IsValid())
+        return SBTypeNameSpecifier();
+    return SBTypeNameSpecifier(m_opaque_sp->GetTypeNameSpecifierForSummaryAtIndex(index));
+}
+
+lldb::SBTypeNameSpecifier
+SBTypeCategory::GetTypeNameSpecifierForSyntheticAtIndex (uint32_t index)
+{
+    if (!IsValid())
+        return SBTypeNameSpecifier();
+    return SBTypeNameSpecifier(m_opaque_sp->GetTypeNameSpecifierForSyntheticAtIndex(index));
+}
+
+SBTypeFilter
+SBTypeCategory::GetFilterForType (SBTypeNameSpecifier spec)
+{
+    if (!IsValid())
+        return SBTypeFilter();
+    
+    if (!spec.IsValid())
+        return SBTypeFilter();
+    
+    lldb::SyntheticChildrenSP children_sp;
+    
+    if (spec.IsRegex())
+        m_opaque_sp->GetRegexFilterNavigator()->GetExact(ConstString(spec.GetName()), children_sp);
+    else
+        m_opaque_sp->GetFilterNavigator()->GetExact(ConstString(spec.GetName()), children_sp);
+        
+    if (!children_sp)
+        return lldb::SBTypeFilter();
+    
+    TypeFilterImplSP filter_sp = std::tr1::static_pointer_cast<TypeFilterImpl>(children_sp);
+    
+    return lldb::SBTypeFilter(filter_sp);
+
+}
+SBTypeFormat
+SBTypeCategory::GetFormatForType (SBTypeNameSpecifier spec)
+{
+    if (!IsDefaultCategory())
+        return SBTypeFormat();
+        
+    if (!spec.IsValid())
+        return SBTypeFormat();
+    
+    if (spec.IsRegex())
+        return SBTypeFormat();
+    
+    return SBTypeFormat(DataVisualization::ValueFormats::GetFormat(ConstString(spec.GetName())));
+}
+
+SBTypeSummary
+SBTypeCategory::GetSummaryForType (SBTypeNameSpecifier spec)
+{
+    if (!IsValid())
+        return SBTypeSummary();
+    
+    if (!spec.IsValid())
+        return SBTypeSummary();
+    
+    lldb::TypeSummaryImplSP summary_sp;
+    
+    if (spec.IsRegex())
+        m_opaque_sp->GetRegexSummaryNavigator()->GetExact(ConstString(spec.GetName()), summary_sp);
+    else
+        m_opaque_sp->GetSummaryNavigator()->GetExact(ConstString(spec.GetName()), summary_sp);
+    
+    if (!summary_sp)
+        return lldb::SBTypeSummary();
+    
+    return lldb::SBTypeSummary(summary_sp);
+}
+
+SBTypeSynthetic
+SBTypeCategory::GetSyntheticForType (SBTypeNameSpecifier spec)
+{
+    if (!IsValid())
+        return SBTypeSynthetic();
+    
+    if (!spec.IsValid())
+        return SBTypeSynthetic();
+    
+    lldb::SyntheticChildrenSP children_sp;
+    
+    if (spec.IsRegex())
+        m_opaque_sp->GetRegexSyntheticNavigator()->GetExact(ConstString(spec.GetName()), children_sp);
+    else
+        m_opaque_sp->GetSyntheticNavigator()->GetExact(ConstString(spec.GetName()), children_sp);
+    
+    if (!children_sp)
+        return lldb::SBTypeSynthetic();
+    
+    TypeSyntheticImplSP synth_sp = std::tr1::static_pointer_cast<TypeSyntheticImpl>(children_sp);
+    
+    return lldb::SBTypeSynthetic(synth_sp);
+}
+
+SBTypeFilter
+SBTypeCategory::GetFilterAtIndex (uint32_t index)
+{
+    if (!IsValid())
+        return SBTypeFilter();
+    lldb::SyntheticChildrenSP children_sp = m_opaque_sp->GetSyntheticAtIndex((index));
+    
+    if (!children_sp.get())
+        return lldb::SBTypeFilter();
+    
+    TypeFilterImplSP filter_sp = std::tr1::static_pointer_cast<TypeFilterImpl>(children_sp);
+    
+    return lldb::SBTypeFilter(filter_sp);
+}
+
+SBTypeFormat
+SBTypeCategory::GetFormatAtIndex (uint32_t index)
+{
+    if (!IsDefaultCategory())
+        return SBTypeFormat();
+    return SBTypeFormat(DataVisualization::ValueFormats::GetFormatAtIndex((index)));
+}
+
+SBTypeSummary
+SBTypeCategory::GetSummaryAtIndex (uint32_t index)
+{
+    if (!IsValid())
+        return SBTypeSummary();
+    return SBTypeSummary(m_opaque_sp->GetSummaryAtIndex((index)));
+}
+
+SBTypeSynthetic
+SBTypeCategory::GetSyntheticAtIndex (uint32_t index)
+{
+    if (!IsValid())
+        return SBTypeSynthetic();
+    lldb::SyntheticChildrenSP children_sp = m_opaque_sp->GetSyntheticAtIndex((index));
+    
+    if (!children_sp.get())
+        return lldb::SBTypeSynthetic();
+    
+    TypeSyntheticImplSP synth_sp = std::tr1::static_pointer_cast<TypeSyntheticImpl>(children_sp);
+    
+    return lldb::SBTypeSynthetic(synth_sp);
+}
+
+bool
+SBTypeCategory::AddTypeFormat (SBTypeNameSpecifier type_name,
+                               SBTypeFormat format)
+{
+    if (!IsDefaultCategory())
+        return false;
+    
+    if (!type_name.IsValid())
+        return false;
+    
+    if (!format.IsValid())
+        return false;
+    
+    if (type_name.IsRegex())
+        return false;
+    
+    DataVisualization::ValueFormats::Add(ConstString(type_name.GetName()), format.GetSP());
+    
+    return true;
+}
+
+bool
+SBTypeCategory::DeleteTypeFormat (SBTypeNameSpecifier type_name)
+{
+    if (!IsDefaultCategory())
+        return false;
+    
+    if (!type_name.IsValid())
+        return false;
+    
+    if (type_name.IsRegex())
+        return false;
+
+    return DataVisualization::ValueFormats::Delete(ConstString(type_name.GetName()));
+}
+
+bool
+SBTypeCategory::AddTypeSummary (SBTypeNameSpecifier type_name,
+                                SBTypeSummary summary)
+{
+    if (!IsValid())
+        return false;
+    
+    if (!type_name.IsValid())
+        return false;
+    
+    if (!summary.IsValid())
+        return false;
+    
+    // FIXME: we need to iterate over all the Debugger objects and have each of them contain a copy of the function
+    // since we currently have formatters live in a global space, while Python code lives in a specific Debugger-related environment
+    // this should eventually be fixed by deciding a final location in the LLDB object space for formatters
+    if (summary.IsFunctionCode())
+    {
+        void *name_token = (void*)ConstString(type_name.GetName()).GetCString();
+        const char* script = summary.GetData();
+        StringList input; input.SplitIntoLines(script, strlen(script));
+        uint32_t num_debuggers = lldb_private::Debugger::GetNumDebuggers();
+        bool need_set = true;
+        for (uint32_t j = 0;
+             j < num_debuggers;
+             j++)
+        {
+            DebuggerSP debugger_sp = lldb_private::Debugger::GetDebuggerAtIndex(j);
+            if (debugger_sp)
+            {
+                ScriptInterpreter* interpreter_ptr = debugger_sp->GetCommandInterpreter().GetScriptInterpreter();
+                if (interpreter_ptr)
+                {
+                    StringList output;
+                    if (interpreter_ptr->GenerateTypeScriptFunction(input, output, name_token) && output.GetSize() > 0)
+                    {
+                        if (need_set)
+                        {
+                            need_set = false;
+                            summary.SetFunctionName(output.GetStringAtIndex(0));
+                        }
+                    }
+                }
+            }
+        }
+    }
+    
+    if (type_name.IsRegex())
+        m_opaque_sp->GetRegexSummaryNavigator()->Add(lldb::RegularExpressionSP(new RegularExpression(type_name.GetName())), summary.GetSP());
+    else
+        m_opaque_sp->GetSummaryNavigator()->Add(ConstString(type_name.GetName()), summary.GetSP());
+    
+    return true;
+}
+
+bool
+SBTypeCategory::DeleteTypeSummary (SBTypeNameSpecifier type_name)
+{
+    if (!IsValid())
+        return false;
+    
+    if (!type_name.IsValid())
+        return false;
+    
+    if (type_name.IsRegex())
+        return m_opaque_sp->GetRegexSummaryNavigator()->Delete(ConstString(type_name.GetName()));
+    else
+        return m_opaque_sp->GetSummaryNavigator()->Delete(ConstString(type_name.GetName()));
+}
+
+bool
+SBTypeCategory::AddTypeFilter (SBTypeNameSpecifier type_name,
+                               SBTypeFilter filter)
+{
+    if (!IsValid())
+        return false;
+    
+    if (!type_name.IsValid())
+        return false;
+    
+    if (!filter.IsValid())
+        return false;
+    
+    if (type_name.IsRegex())
+        m_opaque_sp->GetRegexFilterNavigator()->Add(lldb::RegularExpressionSP(new RegularExpression(type_name.GetName())), filter.GetSP());
+    else
+        m_opaque_sp->GetFilterNavigator()->Add(ConstString(type_name.GetName()), filter.GetSP());
+    
+    return true;
+}
+
+bool
+SBTypeCategory::DeleteTypeFilter (SBTypeNameSpecifier type_name)
+{
+    if (!IsValid())
+        return false;
+    
+    if (!type_name.IsValid())
+        return false;
+    
+    if (type_name.IsRegex())
+        return m_opaque_sp->GetRegexFilterNavigator()->Delete(ConstString(type_name.GetName()));
+    else
+        return m_opaque_sp->GetFilterNavigator()->Delete(ConstString(type_name.GetName()));
+}
+
+bool
+SBTypeCategory::AddTypeSynthetic (SBTypeNameSpecifier type_name,
+                                  SBTypeSynthetic synth)
+{
+    if (!IsValid())
+        return false;
+    
+    if (!type_name.IsValid())
+        return false;
+    
+    if (!synth.IsValid())
+        return false;
+
+    // FIXME: we need to iterate over all the Debugger objects and have each of them contain a copy of the function
+    // since we currently have formatters live in a global space, while Python code lives in a specific Debugger-related environment
+    // this should eventually be fixed by deciding a final location in the LLDB object space for formatters
+    if (synth.IsClassCode())
+    {
+        void *name_token = (void*)ConstString(type_name.GetName()).GetCString();
+        const char* script = synth.GetData();
+        StringList input; input.SplitIntoLines(script, strlen(script));
+        uint32_t num_debuggers = lldb_private::Debugger::GetNumDebuggers();
+        bool need_set = true;
+        for (uint32_t j = 0;
+             j < num_debuggers;
+             j++)
+        {
+            DebuggerSP debugger_sp = lldb_private::Debugger::GetDebuggerAtIndex(j);
+            if (debugger_sp)
+            {
+                ScriptInterpreter* interpreter_ptr = debugger_sp->GetCommandInterpreter().GetScriptInterpreter();
+                if (interpreter_ptr)
+                {
+                    StringList output;
+                    if (interpreter_ptr->GenerateTypeSynthClass(input, output, name_token) && output.GetSize() > 0)
+                    {
+                        if (need_set)
+                        {
+                            need_set = false;
+                            synth.SetClassName(output.GetStringAtIndex(0));
+                        }
+                    }
+                }
+            }
+        }
+    }
+    
+    if (type_name.IsRegex())
+        m_opaque_sp->GetRegexSyntheticNavigator()->Add(lldb::RegularExpressionSP(new RegularExpression(type_name.GetName())), synth.GetSP());
+    else
+        m_opaque_sp->GetSyntheticNavigator()->Add(ConstString(type_name.GetName()), synth.GetSP());
+    
+    return true;
+}
+
+bool
+SBTypeCategory::DeleteTypeSynthetic (SBTypeNameSpecifier type_name)
+{
+    if (!IsValid())
+        return false;
+    
+    if (!type_name.IsValid())
+        return false;
+    
+    if (type_name.IsRegex())
+        return m_opaque_sp->GetRegexSyntheticNavigator()->Delete(ConstString(type_name.GetName()));
+    else
+        return m_opaque_sp->GetSyntheticNavigator()->Delete(ConstString(type_name.GetName()));
+}
+
+bool
+SBTypeCategory::GetDescription (lldb::SBStream &description, 
+                lldb::DescriptionLevel description_level)
+{
+    if (!IsValid())
+        return false;
+    description.Printf("Category name: %s\n",GetName());
+    return true;
+}
+
+lldb::SBTypeCategory &
+SBTypeCategory::operator = (const lldb::SBTypeCategory &rhs)
+{
+    if (this != &rhs)
+    {
+        m_opaque_sp = rhs.m_opaque_sp;
+    }
+    return *this;
+}
+
+bool
+SBTypeCategory::operator == (lldb::SBTypeCategory &rhs)
+{
+    if (IsValid() == false)
+        return !rhs.IsValid();
+    
+    return m_opaque_sp.get() == rhs.m_opaque_sp.get();
+    
+}
+
+bool
+SBTypeCategory::operator != (lldb::SBTypeCategory &rhs)
+{
+    if (IsValid() == false)
+        return rhs.IsValid();
+    
+    return m_opaque_sp.get() != rhs.m_opaque_sp.get();
+}
+
+lldb::TypeCategoryImplSP
+SBTypeCategory::GetSP ()
+{
+    if (!IsValid())
+        return lldb::TypeCategoryImplSP();
+    return m_opaque_sp;
+}
+
+void
+SBTypeCategory::SetSP (const lldb::TypeCategoryImplSP &typecategory_impl_sp)
+{
+    m_opaque_sp = typecategory_impl_sp;
+}
+
+SBTypeCategory::SBTypeCategory (const lldb::TypeCategoryImplSP &typecategory_impl_sp) :
+m_opaque_sp(typecategory_impl_sp)
+{
+}
+
+bool
+SBTypeCategory::IsDefaultCategory()
+{
+    if (!IsValid())
+        return false;
+    
+    return (strcmp(m_opaque_sp->GetName(),"default") == 0);
+}
+

Added: lldb/trunk/source/API/SBTypeFilter.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBTypeFilter.cpp?rev=150558&view=auto
==============================================================================
--- lldb/trunk/source/API/SBTypeFilter.cpp (added)
+++ lldb/trunk/source/API/SBTypeFilter.cpp Tue Feb 14 20:34:21 2012
@@ -0,0 +1,197 @@
+//===-- SBTypeFilter.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/API/SBTypeFilter.h"
+
+#include "lldb/API/SBStream.h"
+
+#include "lldb/Core/DataVisualization.h"
+
+using namespace lldb;
+using namespace lldb_private;
+
+SBTypeFilter::SBTypeFilter() :
+m_opaque_sp()
+{
+}
+
+SBTypeFilter::SBTypeFilter (uint32_t options)
+: m_opaque_sp(TypeFilterImplSP(new TypeFilterImpl(options)))
+{
+}
+
+SBTypeFilter::SBTypeFilter (const lldb::SBTypeFilter &rhs) :
+m_opaque_sp(rhs.m_opaque_sp)
+{
+}
+
+SBTypeFilter::~SBTypeFilter ()
+{
+}
+
+bool
+SBTypeFilter::IsValid() const
+{
+    return m_opaque_sp.get() != NULL;
+}
+
+uint32_t
+SBTypeFilter::GetOptions()
+{
+    if (IsValid())
+        return m_opaque_sp->GetOptions();
+    return 0;
+}
+
+void
+SBTypeFilter::SetOptions (uint32_t value)
+{
+    if (CopyOnWrite_Impl())
+        m_opaque_sp->SetOptions(value);
+}
+
+bool
+SBTypeFilter::GetDescription (lldb::SBStream &description, 
+                              lldb::DescriptionLevel description_level)
+{
+    if (!IsValid())
+        return false;
+    else {
+        description.Printf("%s\n",
+                           m_opaque_sp->GetDescription().c_str());
+        return true;
+    }
+}
+
+void
+SBTypeFilter::Clear()
+{
+    if (CopyOnWrite_Impl())
+        m_opaque_sp->Clear();
+}
+
+uint32_t
+SBTypeFilter::GetNumberOfExpressionPaths()
+{
+    if (IsValid())
+        return m_opaque_sp->GetCount();
+    return 0;
+}
+
+const char*
+SBTypeFilter::GetExpressionPathAtIndex (uint32_t i)
+{
+    if (IsValid())
+    {
+        const char* item = m_opaque_sp->GetExpressionPathAtIndex(i);
+        if (item && *item == '.')
+            item++;
+        return item;
+    }
+    return NULL;
+}
+
+bool
+SBTypeFilter::ReplaceExpressionPathAtIndex (uint32_t i, const char* item)
+{
+    if (CopyOnWrite_Impl())
+        return m_opaque_sp->SetExpressionPathAtIndex(i, item);
+    else
+        return false;
+}
+
+void
+SBTypeFilter::AppendExpressionPath (const char* item)
+{
+    if (CopyOnWrite_Impl())
+        m_opaque_sp->AddExpressionPath(item);
+}
+
+lldb::SBTypeFilter &
+SBTypeFilter::operator = (const lldb::SBTypeFilter &rhs)
+{
+    if (this != &rhs)
+    {
+        m_opaque_sp = rhs.m_opaque_sp;
+    }
+    return *this;
+}
+
+bool
+SBTypeFilter::operator == (lldb::SBTypeFilter &rhs)
+{
+    if (IsValid() == false)
+        return !rhs.IsValid();
+    
+    return m_opaque_sp == rhs.m_opaque_sp;
+}
+
+bool
+SBTypeFilter::IsEqualTo (lldb::SBTypeFilter &rhs)
+{
+    if (IsValid() == false)
+        return !rhs.IsValid();
+    
+    if (GetNumberOfExpressionPaths() != rhs.GetNumberOfExpressionPaths())
+        return false;
+    
+    for (uint32_t j = 0;
+         j < GetNumberOfExpressionPaths();
+         j++)
+        if ( strcmp(GetExpressionPathAtIndex(j),rhs.GetExpressionPathAtIndex(j)) != 0)
+            return false;
+    
+    return GetOptions() == rhs.GetOptions();
+}
+
+bool
+SBTypeFilter::operator != (lldb::SBTypeFilter &rhs)
+{
+    if (IsValid() == false)
+        return !rhs.IsValid();
+    
+    return m_opaque_sp != rhs.m_opaque_sp;
+}
+
+lldb::TypeFilterImplSP
+SBTypeFilter::GetSP ()
+{
+    return m_opaque_sp;
+}
+
+void
+SBTypeFilter::SetSP (const lldb::TypeFilterImplSP &typefilter_impl_sp)
+{
+    m_opaque_sp = typefilter_impl_sp;
+}
+
+SBTypeFilter::SBTypeFilter (const lldb::TypeFilterImplSP &typefilter_impl_sp) :
+m_opaque_sp(typefilter_impl_sp)
+{
+}
+
+bool
+SBTypeFilter::CopyOnWrite_Impl()
+{
+    if (!IsValid())
+        return false;
+    if (m_opaque_sp.unique())
+        return true;
+
+    TypeFilterImplSP new_sp(new TypeFilterImpl(GetOptions()));
+    
+    for (uint32_t j = 0;
+         j < GetNumberOfExpressionPaths();
+         j++)
+        new_sp->AddExpressionPath(GetExpressionPathAtIndex(j));
+    
+    SetSP(new_sp);
+    
+    return true;
+}

Added: lldb/trunk/source/API/SBTypeFormat.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBTypeFormat.cpp?rev=150558&view=auto
==============================================================================
--- lldb/trunk/source/API/SBTypeFormat.cpp (added)
+++ lldb/trunk/source/API/SBTypeFormat.cpp Tue Feb 14 20:34:21 2012
@@ -0,0 +1,153 @@
+//===-- SBTypeFormat.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/API/SBTypeFormat.h"
+
+#include "lldb/API/SBStream.h"
+
+#include "lldb/Core/DataVisualization.h"
+
+using namespace lldb;
+using namespace lldb_private;
+
+SBTypeFormat::SBTypeFormat() :
+m_opaque_sp()
+{
+}
+
+SBTypeFormat::SBTypeFormat (lldb::Format format,
+                            uint32_t options)
+: m_opaque_sp(TypeFormatImplSP(new TypeFormatImpl(format,options)))
+{
+}
+
+SBTypeFormat::SBTypeFormat (const lldb::SBTypeFormat &rhs) :
+m_opaque_sp(rhs.m_opaque_sp)
+{
+}
+
+SBTypeFormat::~SBTypeFormat ()
+{
+}
+
+bool
+SBTypeFormat::IsValid() const
+{
+    return m_opaque_sp.get() != NULL;
+}
+
+lldb::Format
+SBTypeFormat::GetFormat ()
+{
+    if (IsValid())
+        return m_opaque_sp->GetFormat();
+    return lldb::eFormatInvalid;
+}
+
+uint32_t
+SBTypeFormat::GetOptions()
+{
+    if (IsValid())
+        return m_opaque_sp->GetOptions();
+    return 0;
+}
+
+void
+SBTypeFormat::SetFormat (lldb::Format fmt)
+{
+    if (CopyOnWrite_Impl())
+        m_opaque_sp->SetFormat(fmt);
+}
+
+void
+SBTypeFormat::SetOptions (uint32_t value)
+{
+    if (CopyOnWrite_Impl())
+        m_opaque_sp->SetOptions(value);
+}
+
+bool
+SBTypeFormat::GetDescription (lldb::SBStream &description, 
+                              lldb::DescriptionLevel description_level)
+{
+    if (!IsValid())
+        return false;
+    else {
+        description.Printf("%s\n",
+                           m_opaque_sp->GetDescription().c_str());
+        return true;
+    }
+}
+
+lldb::SBTypeFormat &
+SBTypeFormat::operator = (const lldb::SBTypeFormat &rhs)
+{
+    if (this != &rhs)
+    {
+        m_opaque_sp = rhs.m_opaque_sp;
+    }
+    return *this;
+}
+
+bool
+SBTypeFormat::operator == (lldb::SBTypeFormat &rhs)
+{
+    if (IsValid() == false)
+        return !rhs.IsValid();
+    return m_opaque_sp == rhs.m_opaque_sp;
+}
+
+bool
+SBTypeFormat::IsEqualTo (lldb::SBTypeFormat &rhs)
+{
+    if (IsValid() == false)
+        return !rhs.IsValid();
+    
+    if (GetFormat() == rhs.GetFormat())
+        return GetOptions() == rhs.GetOptions();
+    else
+        return false;
+}
+
+bool
+SBTypeFormat::operator != (lldb::SBTypeFormat &rhs)
+{
+    if (IsValid() == false)
+        return !rhs.IsValid();
+    return m_opaque_sp != rhs.m_opaque_sp;
+}
+
+lldb::TypeFormatImplSP
+SBTypeFormat::GetSP ()
+{
+    return m_opaque_sp;
+}
+
+void
+SBTypeFormat::SetSP (const lldb::TypeFormatImplSP &typeformat_impl_sp)
+{
+    m_opaque_sp = typeformat_impl_sp;
+}
+
+SBTypeFormat::SBTypeFormat (const lldb::TypeFormatImplSP &typeformat_impl_sp) :
+    m_opaque_sp(typeformat_impl_sp)
+{
+}
+
+bool
+SBTypeFormat::CopyOnWrite_Impl()
+{
+    if (!IsValid())
+        return false;
+    if (m_opaque_sp.unique())
+        return true;
+
+    SetSP(TypeFormatImplSP(new TypeFormatImpl(GetFormat(),GetOptions())));
+    return true;
+}

Added: lldb/trunk/source/API/SBTypeNameSpecifier.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBTypeNameSpecifier.cpp?rev=150558&view=auto
==============================================================================
--- lldb/trunk/source/API/SBTypeNameSpecifier.cpp (added)
+++ lldb/trunk/source/API/SBTypeNameSpecifier.cpp Tue Feb 14 20:34:21 2012
@@ -0,0 +1,127 @@
+//===-- SBTypeNameSpecifier.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/API/SBTypeNameSpecifier.h"
+
+#include "lldb/API/SBStream.h"
+
+#include "lldb/Core/DataVisualization.h"
+
+using namespace lldb;
+using namespace lldb_private;
+
+SBTypeNameSpecifier::SBTypeNameSpecifier() :
+m_opaque_sp()
+{
+}
+
+SBTypeNameSpecifier::SBTypeNameSpecifier (const char* name,
+                                          bool is_regex) :
+m_opaque_sp(new TypeNameSpecifierImpl(name, is_regex))
+{
+    if (name == NULL || (*name) == 0)
+        m_opaque_sp.reset();
+}
+
+SBTypeNameSpecifier::SBTypeNameSpecifier (const lldb::SBTypeNameSpecifier &rhs) :
+m_opaque_sp(rhs.m_opaque_sp)
+{}
+
+SBTypeNameSpecifier::~SBTypeNameSpecifier ()
+{
+}
+
+bool
+SBTypeNameSpecifier::IsValid() const
+{
+    return m_opaque_sp.get() != NULL;
+}
+
+const char*
+SBTypeNameSpecifier::GetName ()
+{
+    if (!IsValid())
+        return NULL;
+    
+    return m_opaque_sp->GetName();
+}
+
+bool
+SBTypeNameSpecifier::IsRegex ()
+{
+    if (!IsValid())
+        return false;
+
+    return m_opaque_sp->IsRegex();
+}
+
+bool
+SBTypeNameSpecifier::GetDescription (lldb::SBStream &description, 
+                                     lldb::DescriptionLevel description_level)
+{
+    if (!IsValid())
+        return false;
+    description.Printf("SBTypeNameSpecifier(%s,%s)", GetName(), IsRegex() ? "regex" : "plain");
+    return true;
+}
+
+lldb::SBTypeNameSpecifier &
+SBTypeNameSpecifier::operator = (const lldb::SBTypeNameSpecifier &rhs)
+{
+    if (this != &rhs)
+    {
+        m_opaque_sp = rhs.m_opaque_sp;
+    }
+    return *this;
+}
+
+bool
+SBTypeNameSpecifier::operator == (lldb::SBTypeNameSpecifier &rhs)
+{
+    if (IsValid() == false)
+        return !rhs.IsValid();
+    return m_opaque_sp == rhs.m_opaque_sp;
+}
+
+bool
+SBTypeNameSpecifier::IsEqualTo (lldb::SBTypeNameSpecifier &rhs)
+{
+    if (IsValid() == false)
+        return !rhs.IsValid();
+    
+    if (IsRegex() != rhs.IsRegex())
+        return false;
+    
+    return (strcmp(GetName(), rhs.GetName()) == 0);
+}
+
+bool
+SBTypeNameSpecifier::operator != (lldb::SBTypeNameSpecifier &rhs)
+{
+    if (IsValid() == false)
+        return !rhs.IsValid();
+    return m_opaque_sp != rhs.m_opaque_sp;
+}
+
+lldb::TypeNameSpecifierImplSP
+SBTypeNameSpecifier::GetSP ()
+{
+    return m_opaque_sp;
+}
+
+void
+SBTypeNameSpecifier::SetSP (const lldb::TypeNameSpecifierImplSP &type_namespec_sp)
+{
+    m_opaque_sp = type_namespec_sp;
+}
+
+SBTypeNameSpecifier::SBTypeNameSpecifier (const lldb::TypeNameSpecifierImplSP &type_namespec_sp) :
+m_opaque_sp(type_namespec_sp)
+{
+}

Added: lldb/trunk/source/API/SBTypeSummary.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBTypeSummary.cpp?rev=150558&view=auto
==============================================================================
--- lldb/trunk/source/API/SBTypeSummary.cpp (added)
+++ lldb/trunk/source/API/SBTypeSummary.cpp Tue Feb 14 20:34:21 2012
@@ -0,0 +1,298 @@
+//===-- SBTypeSummary.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/API/SBTypeSummary.h"
+
+#include "lldb/API/SBStream.h"
+
+#include "lldb/Core/DataVisualization.h"
+
+using namespace lldb;
+using namespace lldb_private;
+
+SBTypeSummary::SBTypeSummary() :
+m_opaque_sp()
+{
+}
+
+SBTypeSummary
+SBTypeSummary::CreateWithSummaryString (const char* data, uint32_t options)
+{
+    if (!data || data[0] == 0)
+        return SBTypeSummary();
+        
+    return SBTypeSummary(TypeSummaryImplSP(new StringSummaryFormat(options, data)));
+}
+
+SBTypeSummary
+SBTypeSummary::CreateWithFunctionName (const char* data, uint32_t options)
+{
+    if (!data || data[0] == 0)
+        return SBTypeSummary();
+    
+    return SBTypeSummary(TypeSummaryImplSP(new ScriptSummaryFormat(options, data)));
+}
+
+SBTypeSummary
+SBTypeSummary::CreateWithScriptCode (const char* data, uint32_t options)
+{
+    if (!data || data[0] == 0)
+        return SBTypeSummary();
+    
+    return SBTypeSummary(TypeSummaryImplSP(new ScriptSummaryFormat(options, "", data)));
+}
+
+SBTypeSummary::SBTypeSummary (const lldb::SBTypeSummary &rhs) :
+m_opaque_sp(rhs.m_opaque_sp)
+{
+}
+
+SBTypeSummary::~SBTypeSummary ()
+{
+}
+
+bool
+SBTypeSummary::IsValid() const
+{
+    return m_opaque_sp.get() != NULL;
+}
+
+bool
+SBTypeSummary::IsFunctionCode()
+{
+    if (!IsValid())
+        return false;
+    if (m_opaque_sp->IsScripted())
+    {
+        ScriptSummaryFormat* script_summary_ptr = (ScriptSummaryFormat*)m_opaque_sp.get();
+        const char* ftext = script_summary_ptr->GetPythonScript();
+        return (ftext && *ftext != 0);
+    }
+    return false;
+}
+
+bool
+SBTypeSummary::IsFunctionName()
+{
+    if (!IsValid())
+        return false;
+    if (m_opaque_sp->IsScripted())
+    {
+        ScriptSummaryFormat* script_summary_ptr = (ScriptSummaryFormat*)m_opaque_sp.get();
+        const char* ftext = script_summary_ptr->GetPythonScript();
+        return (!ftext || *ftext == 0);
+    }
+    return false;
+}
+
+bool
+SBTypeSummary::IsSummaryString()
+{
+    if (!IsValid())
+        return false;
+    
+    return !m_opaque_sp->IsScripted();
+}
+
+const char*
+SBTypeSummary::GetData ()
+{
+    if (!IsValid())
+        return NULL;
+    if (m_opaque_sp->IsScripted())
+    {
+        ScriptSummaryFormat* script_summary_ptr = (ScriptSummaryFormat*)m_opaque_sp.get();
+        const char* fname = script_summary_ptr->GetFunctionName();
+        const char* ftext = script_summary_ptr->GetPythonScript();
+        if (ftext && *ftext)
+            return ftext;
+        return fname;
+    }
+    else
+    {
+        StringSummaryFormat* string_summary_ptr = (StringSummaryFormat*)m_opaque_sp.get();
+        return string_summary_ptr->GetSummaryString();
+    }
+}
+
+uint32_t
+SBTypeSummary::GetOptions ()
+{
+    if (!IsValid())
+        return lldb::eTypeOptionNone;
+    return m_opaque_sp->GetOptions();
+}
+
+void
+SBTypeSummary::SetOptions (uint32_t value)
+{
+    if (!CopyOnWrite_Impl())
+        return;
+    m_opaque_sp->SetOptions(value);
+}
+
+void
+SBTypeSummary::SetSummaryString (const char* data)
+{
+    if (!IsValid())
+        return;
+    if (m_opaque_sp->IsScripted())
+        ChangeSummaryType(false);
+    ((StringSummaryFormat*)m_opaque_sp.get())->SetSummaryString(data);
+}
+
+void
+SBTypeSummary::SetFunctionName (const char* data)
+{
+    if (!IsValid())
+        return;
+    if (!m_opaque_sp->IsScripted())
+        ChangeSummaryType(true);
+    ((ScriptSummaryFormat*)m_opaque_sp.get())->SetFunctionName(data);
+}
+
+void
+SBTypeSummary::SetFunctionCode (const char* data)
+{
+    if (!IsValid())
+        return;
+    if (!m_opaque_sp->IsScripted())
+        ChangeSummaryType(true);
+    ((ScriptSummaryFormat*)m_opaque_sp.get())->SetPythonScript(data);
+}
+
+bool
+SBTypeSummary::GetDescription (lldb::SBStream &description, 
+                              lldb::DescriptionLevel description_level)
+{
+    if (!CopyOnWrite_Impl())
+        return false;
+    else {
+        description.Printf("%s\n",
+                           m_opaque_sp->GetDescription().c_str());
+        return true;
+    }
+}
+
+lldb::SBTypeSummary &
+SBTypeSummary::operator = (const lldb::SBTypeSummary &rhs)
+{
+    if (this != &rhs)
+    {
+        m_opaque_sp = rhs.m_opaque_sp;
+    }
+    return *this;
+}
+
+bool
+SBTypeSummary::operator == (lldb::SBTypeSummary &rhs)
+{
+    if (IsValid() == false)
+        return !rhs.IsValid();
+    return m_opaque_sp == rhs.m_opaque_sp;
+}
+
+bool
+SBTypeSummary::IsEqualTo (lldb::SBTypeSummary &rhs)
+{
+    if (IsValid() == false)
+        return !rhs.IsValid();
+    
+    if (m_opaque_sp->IsScripted() != rhs.m_opaque_sp->IsScripted())
+        return false;
+    
+    if (IsFunctionCode() != rhs.IsFunctionCode())
+        return false;
+
+    if (IsSummaryString() != rhs.IsSummaryString())
+        return false;
+
+    if (IsFunctionName() != rhs.IsFunctionName())
+        return false;
+    
+    if ( strcmp(GetData(), rhs.GetData()) )
+        return false;
+    
+    return GetOptions() == rhs.GetOptions();
+    
+}
+
+bool
+SBTypeSummary::operator != (lldb::SBTypeSummary &rhs)
+{
+    if (IsValid() == false)
+        return !rhs.IsValid();
+    return m_opaque_sp != rhs.m_opaque_sp;
+}
+
+lldb::TypeSummaryImplSP
+SBTypeSummary::GetSP ()
+{
+    return m_opaque_sp;
+}
+
+void
+SBTypeSummary::SetSP (const lldb::TypeSummaryImplSP &typesummary_impl_sp)
+{
+    m_opaque_sp = typesummary_impl_sp;
+}
+
+SBTypeSummary::SBTypeSummary (const lldb::TypeSummaryImplSP &typesummary_impl_sp) :
+m_opaque_sp(typesummary_impl_sp)
+{
+}
+
+bool
+SBTypeSummary::CopyOnWrite_Impl()
+{
+    if (!IsValid())
+        return false;
+    if (m_opaque_sp.unique())
+        return true;
+    
+    TypeSummaryImplSP new_sp;
+    
+    if (m_opaque_sp->IsScripted())
+    {
+        ScriptSummaryFormat* current_summary_ptr = (ScriptSummaryFormat*)m_opaque_sp.get();
+        new_sp = TypeSummaryImplSP(new ScriptSummaryFormat(GetOptions(),
+                                                           current_summary_ptr->GetFunctionName(),
+                                                           current_summary_ptr->GetPythonScript()));
+    }
+    else {
+        StringSummaryFormat* current_summary_ptr = (StringSummaryFormat*)m_opaque_sp.get();
+        new_sp = TypeSummaryImplSP(new StringSummaryFormat(GetOptions(),
+                                                           current_summary_ptr->GetSummaryString()));
+    }
+    
+    SetSP(new_sp);
+    
+    return true;
+}
+
+bool
+SBTypeSummary::ChangeSummaryType (bool want_script)
+{
+    if (!IsValid())
+        return false;
+    
+    if (want_script == m_opaque_sp->IsScripted())
+        return CopyOnWrite_Impl();
+    
+    TypeSummaryImplSP new_sp;
+    
+    if (want_script)
+        new_sp = TypeSummaryImplSP(new ScriptSummaryFormat(GetOptions(), "", ""));
+    else
+        new_sp = TypeSummaryImplSP(new StringSummaryFormat(GetOptions(), ""));
+    
+    SetSP(new_sp);
+    
+    return true;
+}

Added: lldb/trunk/source/API/SBTypeSynthetic.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBTypeSynthetic.cpp?rev=150558&view=auto
==============================================================================
--- lldb/trunk/source/API/SBTypeSynthetic.cpp (added)
+++ lldb/trunk/source/API/SBTypeSynthetic.cpp Tue Feb 14 20:34:21 2012
@@ -0,0 +1,203 @@
+//===-- SBTypeSynthetic.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/API/SBTypeSynthetic.h"
+
+#include "lldb/API/SBStream.h"
+
+#include "lldb/Core/DataVisualization.h"
+
+using namespace lldb;
+using namespace lldb_private;
+
+SBTypeSynthetic::SBTypeSynthetic() :
+m_opaque_sp()
+{
+}
+
+SBTypeSynthetic
+SBTypeSynthetic::CreateWithClassName (const char* data, uint32_t options)
+{
+    if (!data || data[0] == 0)
+        return SBTypeSynthetic();
+    return SBTypeSynthetic(TypeSyntheticImplSP(new TypeSyntheticImpl(options, data, "")));
+}
+
+SBTypeSynthetic
+SBTypeSynthetic::CreateWithScriptCode (const char* data, uint32_t options)
+{
+    if (!data || data[0] == 0)
+        return SBTypeSynthetic();
+    return SBTypeSynthetic(TypeSyntheticImplSP(new TypeSyntheticImpl(options, "", data)));
+}
+
+SBTypeSynthetic::SBTypeSynthetic (const lldb::SBTypeSynthetic &rhs) :
+m_opaque_sp(rhs.m_opaque_sp)
+{
+}
+
+SBTypeSynthetic::~SBTypeSynthetic ()
+{
+}
+
+bool
+SBTypeSynthetic::IsValid() const
+{
+    return m_opaque_sp.get() != NULL;
+}
+
+bool
+SBTypeSynthetic::IsClassCode()
+{
+    if (!IsValid())
+        return false;
+    const char* code = m_opaque_sp->GetPythonCode();
+    return (code && *code);
+}
+
+bool
+SBTypeSynthetic::IsClassName()
+{
+    if (!IsValid())
+        return false;
+    return !IsClassCode();
+}
+
+const char*
+SBTypeSynthetic::GetData ()
+{
+    if (!IsValid())
+        return NULL;
+    if (IsClassCode())
+        return m_opaque_sp->GetPythonCode();
+    else
+        return m_opaque_sp->GetPythonClassName();
+}
+
+void
+SBTypeSynthetic::SetClassName (const char* data)
+{
+    if (IsValid() && data && *data)
+        m_opaque_sp->SetPythonClassName(data);
+}
+
+void
+SBTypeSynthetic::SetClassCode (const char* data)
+{
+    if (IsValid() && data && *data)
+        m_opaque_sp->SetPythonCode(data);
+}
+
+uint32_t
+SBTypeSynthetic::GetOptions ()
+{
+    if (!IsValid())
+        return lldb::eTypeOptionNone;
+    return m_opaque_sp->GetOptions();
+}
+
+void
+SBTypeSynthetic::SetOptions (uint32_t value)
+{
+    if (!CopyOnWrite_Impl())
+        return;
+    m_opaque_sp->SetOptions(value);
+}
+
+bool
+SBTypeSynthetic::GetDescription (lldb::SBStream &description, 
+                               lldb::DescriptionLevel description_level)
+{
+    if (!CopyOnWrite_Impl())
+        return false;
+    else {
+        description.Printf("%s\n",
+                           m_opaque_sp->GetDescription().c_str());
+        return true;
+    }
+}
+
+lldb::SBTypeSynthetic &
+SBTypeSynthetic::operator = (const lldb::SBTypeSynthetic &rhs)
+{
+    if (this != &rhs)
+    {
+        m_opaque_sp = rhs.m_opaque_sp;
+    }
+    return *this;
+}
+
+bool
+SBTypeSynthetic::operator == (lldb::SBTypeSynthetic &rhs)
+{
+    if (IsValid() == false)
+        return !rhs.IsValid();
+    return m_opaque_sp == rhs.m_opaque_sp;
+}
+
+bool
+SBTypeSynthetic::IsEqualTo (lldb::SBTypeSynthetic &rhs)
+{
+    if (IsValid() == false)
+        return !rhs.IsValid();
+    
+    if (m_opaque_sp->IsScripted() != rhs.m_opaque_sp->IsScripted())
+        return false;
+    
+    if (IsClassCode() != rhs.IsClassCode())
+        return false;
+    
+    if ( strcmp(GetData(), rhs.GetData()) )
+        return false;
+    
+    return GetOptions() == rhs.GetOptions();
+    
+}
+
+bool
+SBTypeSynthetic::operator != (lldb::SBTypeSynthetic &rhs)
+{
+    if (IsValid() == false)
+        return !rhs.IsValid();
+    return m_opaque_sp != rhs.m_opaque_sp;
+}
+
+lldb::TypeSyntheticImplSP
+SBTypeSynthetic::GetSP ()
+{
+    return m_opaque_sp;
+}
+
+void
+SBTypeSynthetic::SetSP (const lldb::TypeSyntheticImplSP &TypeSynthetic_impl_sp)
+{
+    m_opaque_sp = TypeSynthetic_impl_sp;
+}
+
+SBTypeSynthetic::SBTypeSynthetic (const lldb::TypeSyntheticImplSP &TypeSynthetic_impl_sp) :
+m_opaque_sp(TypeSynthetic_impl_sp)
+{
+}
+
+bool
+SBTypeSynthetic::CopyOnWrite_Impl()
+{
+    if (!IsValid())
+        return false;
+    if (m_opaque_sp.unique())
+        return true;
+    
+    TypeSyntheticImplSP new_sp(new TypeSyntheticImpl(m_opaque_sp->GetOptions(),
+                                                     m_opaque_sp->GetPythonClassName(),
+                                                     m_opaque_sp->GetPythonCode()));
+    
+    SetSP(new_sp);
+    
+    return true;
+}

Modified: lldb/trunk/source/Commands/CommandObjectFrame.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectFrame.cpp?rev=150558&r1=150557&r2=150558&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectFrame.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectFrame.cpp Tue Feb 14 20:34:21 2012
@@ -399,7 +399,7 @@
         const char *name_cstr = NULL;
         size_t idx;
         
-        SummaryFormatSP summary_format_sp;
+        TypeSummaryImplSP summary_format_sp;
         if (!m_option_variable.summary.empty())
             DataVisualization::NamedSummaryFormats::GetSummaryFormat(ConstString(m_option_variable.summary.c_str()), summary_format_sp);
         

Modified: lldb/trunk/source/Commands/CommandObjectType.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectType.cpp?rev=150558&r1=150557&r2=150558&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectType.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectType.cpp Tue Feb 14 20:34:21 2012
@@ -37,7 +37,7 @@
     
 public:
     
-    SummaryFormat::Flags m_flags;
+    TypeSummaryImpl::Flags m_flags;
     
     StringList m_target_types;
     StringList m_user_source;
@@ -48,7 +48,7 @@
     
     std::string m_category;
     
-    ScriptAddOptions(const SummaryFormat::Flags& flags,
+    ScriptAddOptions(const TypeSummaryImpl::Flags& flags,
                      bool regx,
                      const ConstString& name,
                      std::string catg) :
@@ -133,7 +133,7 @@
         
         // Instance variables to hold the values for command options.
         
-        SummaryFormat::Flags m_flags;
+        TypeSummaryImpl::Flags m_flags;
         bool m_regex;
         std::string m_format_string;
         ConstString m_name;
@@ -181,7 +181,7 @@
     
     static bool
     AddSummary(const ConstString& type_name,
-               lldb::SummaryFormatSP entry,
+               lldb::TypeSummaryImplSP entry,
                SummaryFormatType type,
                std::string category,
                Error* error = NULL);
@@ -496,12 +496,12 @@
             return false;
         }
         
-        ValueFormatSP entry;
+        TypeFormatImplSP entry;
         
-        entry.reset(new ValueFormat(format,
-                                    m_command_options.m_cascade,
-                                    m_command_options.m_skip_pointers,
-                                    m_command_options.m_skip_references));
+        entry.reset(new TypeFormatImpl(format,
+                                    TypeFormatImpl::Flags().SetCascades(m_command_options.m_cascade).
+                                    SetSkipPointers(m_command_options.m_skip_pointers).
+                                    SetSkipReferences(m_command_options.m_skip_references)));
 
         // now I have a valid format, let's add it to every type
         
@@ -641,7 +641,7 @@
 // CommandObjectTypeFormatList
 //-------------------------------------------------------------------------
 
-bool CommandObjectTypeFormatList_LoopCallback(void* pt2self, ConstString type, const lldb::ValueFormatSP& entry);
+bool CommandObjectTypeFormatList_LoopCallback(void* pt2self, ConstString type, const lldb::TypeFormatImplSP& entry);
 
 class CommandObjectTypeFormatList;
 
@@ -702,22 +702,19 @@
     
     bool
     LoopCallback (ConstString type,
-                  const lldb::ValueFormatSP& entry,
+                  const lldb::TypeFormatImplSP& entry,
                   RegularExpression* regex,
                   CommandReturnObject *result)
     {
         if (regex == NULL || regex->Execute(type.AsCString())) 
         {
-            result->GetOutputStream().Printf ("%s: %s%s%s%s\n", type.AsCString(), 
-                                              FormatManager::GetFormatAsCString (entry->m_format),
-                                              entry->m_cascades ? "" : " (not cascading)",
-                                              entry->m_skip_pointers ? " (skip pointers)" : "",
-                                              entry->m_skip_references ? " (skip references)" : "");
+            result->GetOutputStream().Printf ("%s: %s\n", type.AsCString(), 
+                                              entry->GetDescription().c_str());
         }
         return true;
     }
     
-    friend bool CommandObjectTypeFormatList_LoopCallback(void* pt2self, ConstString type, const lldb::ValueFormatSP& entry);
+    friend bool CommandObjectTypeFormatList_LoopCallback(void* pt2self, ConstString type, const lldb::TypeFormatImplSP& entry);
     
 };
 
@@ -725,7 +722,7 @@
 CommandObjectTypeFormatList_LoopCallback (
                                     void* pt2self,
                                     ConstString type,
-                                    const lldb::ValueFormatSP& entry)
+                                    const lldb::TypeFormatImplSP& entry)
 {
     CommandObjectTypeFormatList_LoopCallbackParam* param = (CommandObjectTypeFormatList_LoopCallbackParam*)pt2self;
     return param->self->LoopCallback(type, entry, param->regex, param->result);
@@ -850,10 +847,10 @@
         }
         // now I have a valid function name, let's add this as script for every type in the list
         
-        SummaryFormatSP script_format;
+        TypeSummaryImplSP script_format;
         script_format.reset(new ScriptSummaryFormat(options->m_flags,
-                                                    std::string(funct_name),
-                                                    options->m_user_source.CopyList("     ")));
+                                                    funct_name,
+                                                    options->m_user_source.CopyList("     ").c_str()));
         
         Error error;
         
@@ -1035,7 +1032,7 @@
         return false;
     }
     
-    SummaryFormatSP script_format;
+    TypeSummaryImplSP script_format;
     
     if (!m_options.m_python_function.empty()) // we have a Python function ready to use
     {
@@ -1054,9 +1051,11 @@
             return false;
         }
         
+        std::string code = ("     " + m_options.m_python_function + "(valobj,dict)");
+        
         script_format.reset(new ScriptSummaryFormat(m_options.m_flags,
-                                                    std::string(funct_name),
-                                                    "     " + m_options.m_python_function + "(valobj,dict)"));
+                                                    funct_name,
+                                                    code.c_str()));
     }
     else if (!m_options.m_python_script.empty()) // we have a quick 1-line script, just use it
     {
@@ -1091,9 +1090,11 @@
             return false;
         }
         
+        std::string code = "     " + m_options.m_python_script;
+        
         script_format.reset(new ScriptSummaryFormat(m_options.m_flags,
-                                                    std::string(funct_name),
-                                                    "     " + m_options.m_python_script));
+                                                    funct_name,
+                                                    code.c_str()));
     }
     else // use an InputReader to grab Python code from the user
     {        
@@ -1189,7 +1190,7 @@
     
     Error error;
     
-    lldb::SummaryFormatSP entry(new StringSummaryFormat(m_options.m_flags,
+    lldb::TypeSummaryImplSP entry(new StringSummaryFormat(m_options.m_flags,
                                                         format_cstr));
     
     if (error.Fail())
@@ -1343,12 +1344,12 @@
 
 bool
 CommandObjectTypeSummaryAdd::AddSummary(const ConstString& type_name,
-                                        SummaryFormatSP entry,
+                                        TypeSummaryImplSP entry,
                                         SummaryFormatType type,
                                         std::string category_name,
                                         Error* error)
 {
-    lldb::FormatCategorySP category;
+    lldb::TypeCategoryImplSP category;
     DataVisualization::Categories::GetCategory(ConstString(category_name.c_str()), category);
     
     if (type == eRegexSummary)
@@ -1475,11 +1476,11 @@
     
     static bool
     PerCategoryCallback(void* param,
-                        const lldb::FormatCategorySP& cate)
+                        const lldb::TypeCategoryImplSP& category_sp)
     {
-        ConstString *name = (ConstString*)param;
-        cate->Delete(*name, eFormatCategoryItemSummary | eFormatCategoryItemRegexSummary);
-        return true;
+		ConstString *name = (ConstString*)param;
+		category_sp->Delete(*name, eFormatCategoryItemSummary | eFormatCategoryItemRegexSummary);
+		return true;
     }
 
 public:
@@ -1534,7 +1535,7 @@
             return result.Succeeded();
         }
         
-        lldb::FormatCategorySP category;
+        lldb::TypeCategoryImplSP category;
         DataVisualization::Categories::GetCategory(ConstString(m_options.m_category.c_str()), category);
         
         bool delete_category = category->Delete(typeCS,
@@ -1631,7 +1632,7 @@
     
     static bool
     PerCategoryCallback(void* param,
-                        const lldb::FormatCategorySP& cate)
+                        const lldb::TypeCategoryImplSP& cate)
     {
         cate->GetSummaryNavigator()->Clear();
         cate->GetRegexSummaryNavigator()->Clear();
@@ -1661,7 +1662,7 @@
         
         else
         {        
-            lldb::FormatCategorySP category;
+            lldb::TypeCategoryImplSP category;
             if (command.GetArgumentCount() > 0)
             {
                 const char* cat_name = command.GetArgumentAtIndex(0);
@@ -1840,14 +1841,14 @@
     
     static bool
     PerCategoryCallback(void* param_vp,
-                        const lldb::FormatCategorySP& cate)
+                        const lldb::TypeCategoryImplSP& cate)
     {
         
         CommandObjectTypeSummaryList_LoopCallbackParam* param = 
             (CommandObjectTypeSummaryList_LoopCallbackParam*)param_vp;
         CommandReturnObject* result = param->result;
         
-        const char* cate_name = cate->GetName().c_str();
+        const char* cate_name = cate->GetName();
         
         // if the category is disabled or empty and there is no regex, just skip it
         if ((cate->IsEnabled() == false || cate->GetCount(eFormatCategoryItemSummary | eFormatCategoryItemRegexSummary) == 0) && param->cate_regex == NULL)
@@ -1874,7 +1875,7 @@
     
     bool
     LoopCallback (const char* type,
-                  const lldb::SummaryFormatSP& entry,
+                  const lldb::TypeSummaryImplSP& entry,
                   RegularExpression* regex,
                   CommandReturnObject *result)
     {
@@ -1883,15 +1884,15 @@
         return true;
     }
     
-    friend bool CommandObjectTypeSummaryList_LoopCallback(void* pt2self, ConstString type, const lldb::SummaryFormatSP& entry);
-    friend bool CommandObjectTypeRXSummaryList_LoopCallback(void* pt2self, lldb::RegularExpressionSP regex, const lldb::SummaryFormatSP& entry);
+    friend bool CommandObjectTypeSummaryList_LoopCallback(void* pt2self, ConstString type, const lldb::TypeSummaryImplSP& entry);
+    friend bool CommandObjectTypeRXSummaryList_LoopCallback(void* pt2self, lldb::RegularExpressionSP regex, const lldb::TypeSummaryImplSP& entry);
 };
 
 bool
 CommandObjectTypeSummaryList_LoopCallback (
                                           void* pt2self,
                                           ConstString type,
-                                          const lldb::SummaryFormatSP& entry)
+                                          const lldb::TypeSummaryImplSP& entry)
 {
     CommandObjectTypeSummaryList_LoopCallbackParam* param = (CommandObjectTypeSummaryList_LoopCallbackParam*)pt2self;
     return param->self->LoopCallback(type.AsCString(), entry, param->regex, param->result);
@@ -1901,7 +1902,7 @@
 CommandObjectTypeRXSummaryList_LoopCallback (
                                            void* pt2self,
                                            lldb::RegularExpressionSP regex,
-                                           const lldb::SummaryFormatSP& entry)
+                                           const lldb::TypeSummaryImplSP& entry)
 {
     CommandObjectTypeSummaryList_LoopCallbackParam* param = (CommandObjectTypeSummaryList_LoopCallbackParam*)pt2self;
     return param->self->LoopCallback(regex->GetText(), entry, param->regex, param->result);
@@ -1967,7 +1968,7 @@
                 return false;
             }
             DataVisualization::Categories::Enable(typeCS);
-            lldb::FormatCategorySP cate;
+            lldb::TypeCategoryImplSP cate;
             if (DataVisualization::Categories::GetCategory(typeCS, cate) && cate.get())
             {
                 if (cate->GetCount() == 0)
@@ -2141,14 +2142,14 @@
     
     static bool
     PerCategoryCallback(void* param_vp,
-                        const lldb::FormatCategorySP& cate)
+                        const lldb::TypeCategoryImplSP& cate)
     {
         CommandObjectTypeCategoryList_CallbackParam* param =
             (CommandObjectTypeCategoryList_CallbackParam*)param_vp;
         CommandReturnObject* result = param->result;
         RegularExpression* regex = param->regex;
         
-        const char* cate_name = cate->GetName().c_str();
+        const char* cate_name = cate->GetName();
         
         if (regex == NULL || regex->Execute(cate_name))
             result->GetOutputStream().Printf("Category %s is%s enabled\n",
@@ -2346,10 +2347,10 @@
     
     static bool
     PerCategoryCallback(void* param_vp,
-                        const lldb::FormatCategorySP& cate)
+                        const lldb::TypeCategoryImplSP& cate)
     {
         
-        const char* cate_name = cate->GetName().c_str();
+        const char* cate_name = cate->GetName();
         
         CommandObjectTypeFilterList_LoopCallbackParam* param = 
         (CommandObjectTypeFilterList_LoopCallbackParam*)param_vp;
@@ -2558,14 +2559,14 @@
     
     static bool
     PerCategoryCallback(void* param_vp,
-                        const lldb::FormatCategorySP& cate)
+                        const lldb::TypeCategoryImplSP& cate)
     {
         
         CommandObjectTypeSynthList_LoopCallbackParam* param = 
         (CommandObjectTypeSynthList_LoopCallbackParam*)param_vp;
         CommandReturnObject* result = param->result;
         
-        const char* cate_name = cate->GetName().c_str();
+        const char* cate_name = cate->GetName();
         
         // if the category is disabled or empty and there is no regex, just skip it
         if ((cate->IsEnabled() == false || cate->GetCount(eFormatCategoryItemSynth | eFormatCategoryItemRegexSynth) == 0) && param->cate_regex == NULL)
@@ -2707,7 +2708,7 @@
     
     static bool
     PerCategoryCallback(void* param,
-                        const lldb::FormatCategorySP& cate)
+                        const lldb::TypeCategoryImplSP& cate)
     {
         ConstString *name = (ConstString*)param;
         return cate->Delete(*name, eFormatCategoryItemFilter | eFormatCategoryItemRegexFilter);
@@ -2765,7 +2766,7 @@
             return result.Succeeded();
         }
         
-        lldb::FormatCategorySP category;
+        lldb::TypeCategoryImplSP category;
         DataVisualization::Categories::GetCategory(ConstString(m_options.m_category.c_str()), category);
         
         bool delete_category = category->GetFilterNavigator()->Delete(typeCS);
@@ -2871,7 +2872,7 @@
     
     static bool
     PerCategoryCallback(void* param,
-                        const lldb::FormatCategorySP& cate)
+                        const lldb::TypeCategoryImplSP& cate)
     {
         ConstString* name = (ConstString*)param;
         return cate->Delete(*name, eFormatCategoryItemSynth | eFormatCategoryItemRegexSynth);
@@ -2929,7 +2930,7 @@
             return result.Succeeded();
         }
         
-        lldb::FormatCategorySP category;
+        lldb::TypeCategoryImplSP category;
         DataVisualization::Categories::GetCategory(ConstString(m_options.m_category.c_str()), category);
         
         bool delete_category = category->GetSyntheticNavigator()->Delete(typeCS);
@@ -3031,7 +3032,7 @@
     
     static bool
     PerCategoryCallback(void* param,
-                        const lldb::FormatCategorySP& cate)
+                        const lldb::TypeCategoryImplSP& cate)
     {
         cate->Clear(eFormatCategoryItemFilter | eFormatCategoryItemRegexFilter);
         return true;
@@ -3060,7 +3061,7 @@
         
         else
         {        
-            lldb::FormatCategorySP category;
+            lldb::TypeCategoryImplSP category;
             if (command.GetArgumentCount() > 0)
             {
                 const char* cat_name = command.GetArgumentAtIndex(0);
@@ -3158,7 +3159,7 @@
     
     static bool
     PerCategoryCallback(void* param,
-                        const lldb::FormatCategorySP& cate)
+                        const lldb::TypeCategoryImplSP& cate)
     {
         cate->Clear(eFormatCategoryItemSynth | eFormatCategoryItemRegexSynth);
         return true;
@@ -3187,7 +3188,7 @@
         
         else
         {        
-            lldb::FormatCategorySP category;
+            lldb::TypeCategoryImplSP category;
             if (command.GetArgumentCount() > 0)
             {
                 const char* cat_name = command.GetArgumentAtIndex(0);
@@ -3338,13 +3339,13 @@
         // everything should be fine now, let's add the synth provider class
         
         SyntheticChildrenSP synth_provider;
-        synth_provider.reset(new SyntheticScriptProvider(options->m_cascade,
-                                                         options->m_skip_pointers,
-                                                         options->m_skip_references,
-                                                         std::string(class_name)));
+        synth_provider.reset(new TypeSyntheticImpl(SyntheticChildren::Flags().SetCascades(options->m_cascade).
+                                                         SetSkipPointers(options->m_skip_pointers).
+                                                         SetSkipReferences(options->m_skip_references),
+                                                         class_name));
         
         
-        lldb::FormatCategorySP category;
+        lldb::TypeCategoryImplSP category;
         DataVisualization::Categories::GetCategory(ConstString(options->m_category.c_str()), category);
         
         Error error;
@@ -3457,16 +3458,17 @@
     
     SyntheticChildrenSP entry;
     
-    SyntheticScriptProvider* impl = new SyntheticScriptProvider(m_options.m_cascade,
-                                                                m_options.m_skip_pointers,
-                                                                m_options.m_skip_references,
-                                                                m_options.m_class_name);
+    TypeSyntheticImpl* impl = new TypeSyntheticImpl(SyntheticChildren::Flags().
+                                                    SetCascades(m_options.m_cascade).
+                                                    SetSkipPointers(m_options.m_skip_pointers).
+                                                    SetSkipReferences(m_options.m_skip_references),
+                                                    m_options.m_class_name.c_str());
     
     entry.reset(impl);
     
     // now I have a valid provider, let's add it to every type
     
-    lldb::FormatCategorySP category;
+    lldb::TypeCategoryImplSP category;
     DataVisualization::Categories::GetCategory(ConstString(m_options.m_category.c_str()), category);
     
     Error error;
@@ -3525,7 +3527,7 @@
          std::string category_name,
          Error* error)
 {
-    lldb::FormatCategorySP category;
+    lldb::TypeCategoryImplSP category;
     DataVisualization::Categories::GetCategory(ConstString(category_name.c_str()), category);
     
     if (category->AnyMatches(type_name,
@@ -3704,7 +3706,7 @@
               std::string category_name,
               Error* error)
     {
-        lldb::FormatCategorySP category;
+        lldb::TypeCategoryImplSP category;
         DataVisualization::Categories::GetCategory(ConstString(category_name.c_str()), category);
         
         if (category->AnyMatches(type_name,
@@ -3811,9 +3813,9 @@
         
         SyntheticChildrenSP entry;
         
-        SyntheticFilter* impl = new SyntheticFilter(m_options.m_cascade,
-                                                    m_options.m_skip_pointers,
-                                                    m_options.m_skip_references);
+        TypeFilterImpl* impl = new TypeFilterImpl(SyntheticChildren::Flags().SetCascades(m_options.m_cascade).
+                                                    SetSkipPointers(m_options.m_skip_pointers).
+                                                    SetSkipReferences(m_options.m_skip_references));
         
         entry.reset(impl);
         
@@ -3826,7 +3828,7 @@
         
         // now I have a valid provider, let's add it to every type
         
-        lldb::FormatCategorySP category;
+        lldb::TypeCategoryImplSP category;
         DataVisualization::Categories::GetCategory(ConstString(m_options.m_category.c_str()), category);
         
         Error error;

Modified: lldb/trunk/source/Core/DataVisualization.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/DataVisualization.cpp?rev=150558&r1=150557&r2=150558&view=diff
==============================================================================
--- lldb/trunk/source/Core/DataVisualization.cpp (original)
+++ lldb/trunk/source/Core/DataVisualization.cpp Tue Feb 14 20:34:21 2012
@@ -38,16 +38,24 @@
     return GetFormatManager().GetCurrentRevision();
 }
 
-lldb::ValueFormatSP
+lldb::TypeFormatImplSP
 DataVisualization::ValueFormats::GetFormat (ValueObject& valobj, lldb::DynamicValueType use_dynamic)
 {
-    lldb::ValueFormatSP entry;
+    lldb::TypeFormatImplSP entry;
     GetFormatManager().GetValueNavigator().Get(valobj, entry, use_dynamic);
     return entry;
 }
 
+lldb::TypeFormatImplSP
+DataVisualization::ValueFormats::GetFormat (const ConstString &type)
+{
+    lldb::TypeFormatImplSP entry;
+    GetFormatManager().GetValueNavigator().Get(type, entry);
+    return entry;
+}
+
 void
-DataVisualization::ValueFormats::Add (const ConstString &type, const lldb::ValueFormatSP &entry)
+DataVisualization::ValueFormats::Add (const ConstString &type, const lldb::TypeFormatImplSP &entry)
 {
     GetFormatManager().GetValueNavigator().Add(FormatManager::GetValidTypeName(type),entry);
 }
@@ -65,7 +73,7 @@
 }
 
 void
-DataVisualization::ValueFormats::LoopThrough (ValueFormat::ValueCallback callback, void* callback_baton)
+DataVisualization::ValueFormats::LoopThrough (TypeFormatImpl::ValueCallback callback, void* callback_baton)
 {
     GetFormatManager().GetValueNavigator().LoopThrough(callback, callback_baton);
 }
@@ -76,7 +84,19 @@
     return GetFormatManager().GetValueNavigator().GetCount();
 }
 
-lldb::SummaryFormatSP
+lldb::TypeNameSpecifierImplSP
+DataVisualization::ValueFormats::GetTypeNameSpecifierForFormatAtIndex (uint32_t index)
+{
+    return GetFormatManager().GetValueNavigator().GetTypeNameSpecifierAtIndex(index);
+}
+
+lldb::TypeFormatImplSP
+DataVisualization::ValueFormats::GetFormatAtIndex (uint32_t index)
+{
+    return GetFormatManager().GetValueNavigator().GetAtIndex(index);
+}
+
+lldb::TypeSummaryImplSP
 DataVisualization::GetSummaryFormat (ValueObject& valobj,
                                      lldb::DynamicValueType use_dynamic)
 {
@@ -92,10 +112,10 @@
 
 bool
 DataVisualization::AnyMatches (ConstString type_name,
-                               FormatCategory::FormatCategoryItems items,
+                               TypeCategoryImpl::FormatCategoryItems items,
                                bool only_enabled,
                                const char** matching_category,
-                               FormatCategory::FormatCategoryItems* matching_type)
+                               TypeCategoryImpl::FormatCategoryItems* matching_type)
 {
     return GetFormatManager().AnyMatches(type_name,
                                          items,
@@ -105,10 +125,11 @@
 }
 
 bool
-DataVisualization::Categories::GetCategory (const ConstString &category, lldb::FormatCategorySP &entry)
+DataVisualization::Categories::GetCategory (const ConstString &category, lldb::TypeCategoryImplSP &entry,
+                                            bool allow_create)
 {
-    entry = GetFormatManager().GetCategory(category);
-    return true;
+    entry = GetFormatManager().GetCategory(category, allow_create);
+    return (entry.get() != NULL);
 }
 
 void
@@ -131,31 +152,47 @@
 }
 
 void
-DataVisualization::Categories::Clear (ConstString &category)
+DataVisualization::Categories::Clear (const ConstString &category)
 {
     GetFormatManager().GetCategory(category)->Clear(eFormatCategoryItemSummary | eFormatCategoryItemRegexSummary);
 }
 
 void
-DataVisualization::Categories::Enable (ConstString& category)
+DataVisualization::Categories::Enable (const ConstString& category,
+                                       CategoryMap::Position pos)
 {
-    if (GetFormatManager().GetCategory(category)->IsEnabled() == false)
-        GetFormatManager().EnableCategory(category);
-    else
-    {
+    if (GetFormatManager().GetCategory(category)->IsEnabled())
         GetFormatManager().DisableCategory(category);
-        GetFormatManager().EnableCategory(category);
-    }
+    GetFormatManager().EnableCategory(category, pos);
 }
 
 void
-DataVisualization::Categories::Disable (ConstString& category)
+DataVisualization::Categories::Disable (const ConstString& category)
 {
     if (GetFormatManager().GetCategory(category)->IsEnabled() == true)
         GetFormatManager().DisableCategory(category);
 }
 
 void
+DataVisualization::Categories::Enable (const lldb::TypeCategoryImplSP& category,
+                                       CategoryMap::Position pos)
+{
+    if (category.get())
+    {
+        if (category->IsEnabled())
+            GetFormatManager().DisableCategory(category);
+        GetFormatManager().EnableCategory(category, pos);
+    }
+}
+
+void
+DataVisualization::Categories::Disable (const lldb::TypeCategoryImplSP& category)
+{
+    if (category.get() && category->IsEnabled() == true)
+        GetFormatManager().DisableCategory(category);
+}
+
+void
 DataVisualization::Categories::LoopThrough (FormatManager::CategoryCallback callback, void* callback_baton)
 {
     GetFormatManager().LoopThroughCategories(callback, callback_baton);
@@ -167,14 +204,20 @@
     return GetFormatManager().GetCategoriesCount();
 }
 
+lldb::TypeCategoryImplSP
+DataVisualization::Categories::GetCategoryAtIndex (uint32_t index)
+{
+    return GetFormatManager().GetCategoryAtIndex(index);
+}
+
 bool
-DataVisualization::NamedSummaryFormats::GetSummaryFormat (const ConstString &type, lldb::SummaryFormatSP &entry)
+DataVisualization::NamedSummaryFormats::GetSummaryFormat (const ConstString &type, lldb::TypeSummaryImplSP &entry)
 {
     return GetFormatManager().GetNamedSummaryNavigator().Get(type,entry);
 }
 
 void
-DataVisualization::NamedSummaryFormats::Add (const ConstString &type, const lldb::SummaryFormatSP &entry)
+DataVisualization::NamedSummaryFormats::Add (const ConstString &type, const lldb::TypeSummaryImplSP &entry)
 {
     GetFormatManager().GetNamedSummaryNavigator().Add(FormatManager::GetValidTypeName(type),entry);
 }
@@ -192,7 +235,7 @@
 }
 
 void
-DataVisualization::NamedSummaryFormats::LoopThrough (SummaryFormat::SummaryCallback callback, void* callback_baton)
+DataVisualization::NamedSummaryFormats::LoopThrough (TypeSummaryImpl::SummaryCallback callback, void* callback_baton)
 {
     GetFormatManager().GetNamedSummaryNavigator().LoopThrough(callback, callback_baton);
 }

Modified: lldb/trunk/source/Core/Debugger.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Debugger.cpp?rev=150558&r1=150557&r2=150558&view=diff
==============================================================================
--- lldb/trunk/source/Core/Debugger.cpp (original)
+++ lldb/trunk/source/Core/Debugger.cpp Tue Feb 14 20:34:21 2012
@@ -729,6 +729,27 @@
                                                CommandInterpreter::eBroadcastBitAsynchronousErrorData));
 }    
 
+uint32_t
+Debugger::GetNumDebuggers()
+{
+    Mutex::Locker locker (GetDebuggerListMutex ());
+    return GetDebuggerList().size();
+}
+
+lldb::DebuggerSP
+Debugger::GetDebuggerAtIndex (uint32_t index)
+{
+    DebuggerSP debugger_sp;
+    
+    Mutex::Locker locker (GetDebuggerListMutex ());
+    DebuggerList &debugger_list = GetDebuggerList();
+    
+    if (index < debugger_list.size())
+        debugger_sp = debugger_list[index];
+        
+    return debugger_sp;
+}
+
 DebuggerSP
 Debugger::FindDebuggerWithID (lldb::user_id_t id)
 {

Modified: lldb/trunk/source/Core/FormatClasses.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/FormatClasses.cpp?rev=150558&r1=150557&r2=150558&view=diff
==============================================================================
--- lldb/trunk/source/Core/FormatClasses.cpp (original)
+++ lldb/trunk/source/Core/FormatClasses.cpp Tue Feb 14 20:34:21 2012
@@ -44,30 +44,40 @@
 using namespace lldb;
 using namespace lldb_private;
 
-ValueFormat::ValueFormat (lldb::Format f,
-                          bool casc,
-                          bool skipptr,
-                          bool skipref) : 
-    m_cascades(casc),
-    m_skip_pointers(skipptr),
-    m_skip_references(skipref),
+TypeFormatImpl::TypeFormatImpl (lldb::Format f,
+                          const Flags& flags) : 
+    m_flags(flags),
     m_format (f)
 {
 }
 
-SummaryFormat::SummaryFormat(const SummaryFormat::Flags& flags) :
-    m_flags(flags)
+std::string
+TypeFormatImpl::GetDescription()
 {
+    StreamString sstr;
+    sstr.Printf ("%s%s%s%s\n", 
+                 FormatManager::GetFormatAsCString (GetFormat()),
+                 Cascades() ? "" : " (not cascading)",
+                 SkipsPointers() ? " (skip pointers)" : "",
+                 SkipsReferences() ? " (skip references)" : "");
+    return sstr.GetString();
 }
 
-StringSummaryFormat::StringSummaryFormat(const SummaryFormat::Flags& flags,
-                                         std::string f) :
-    SummaryFormat(flags),
-    m_format(f)
+TypeSummaryImpl::TypeSummaryImpl(const TypeSummaryImpl::Flags& flags) :
+    m_flags(flags)
 {
 }
 
 
+StringSummaryFormat::StringSummaryFormat(const TypeSummaryImpl::Flags& flags,
+                                         const char *format_cstr) :
+    TypeSummaryImpl(flags),
+    m_format()
+{
+  if (format_cstr)
+    m_format.assign(format_cstr);
+}
+
 std::string
 StringSummaryFormat::FormatObject(lldb::ValueObjectSP object)
 {
@@ -141,15 +151,19 @@
 
 #ifndef LLDB_DISABLE_PYTHON
 
-ScriptSummaryFormat::ScriptSummaryFormat(const SummaryFormat::Flags& flags,
-                                         std::string fname,
-                                         std::string pscri) :
-    SummaryFormat(flags),
-    m_function_name(fname),
-    m_python_script(pscri)
-{
-}
 
+ScriptSummaryFormat::ScriptSummaryFormat(const TypeSummaryImpl::Flags& flags,
+                                         const char * function_name,
+                                         const char * python_script) :
+    TypeSummaryImpl(flags),
+    m_function_name(),
+    m_python_script()
+{
+   if (function_name)
+     m_function_name.assign(function_name);
+   if (python_script)
+     m_python_script.assign(python_script);
+}
 
 std::string
 ScriptSummaryFormat::FormatObject(lldb::ValueObjectSP object)
@@ -177,18 +191,18 @@
 #endif // #ifndef LLDB_DISABLE_PYTHON
 
 std::string
-SyntheticFilter::GetDescription()
+TypeFilterImpl::GetDescription()
 {
     StreamString sstr;
     sstr.Printf("%s%s%s {\n",
-                m_cascades ? "" : " (not cascading)",
-                m_skip_pointers ? " (skip pointers)" : "",
-                m_skip_references ? " (skip references)" : "");
+                Cascades() ? "" : " (not cascading)",
+                SkipsPointers() ? " (skip pointers)" : "",
+                SkipsReferences() ? " (skip references)" : "");
     
     for (int i = 0; i < GetCount(); i++)
     {
         sstr.Printf("    %s\n",
-                    GetExpressionPathAtIndex(i).c_str());
+                    GetExpressionPathAtIndex(i));
     }
                     
     sstr.Printf("}");
@@ -200,9 +214,10 @@
 {
     StreamString sstr;
     sstr.Printf("%s%s%s {\n",
-                m_cascades ? "" : " (not cascading)",
-                m_skip_pointers ? " (skip pointers)" : "",
-                m_skip_references ? " (skip references)" : "");
+                Cascades() ? "" : " (not cascading)",
+                SkipsPointers() ? " (skip pointers)" : "",
+                SkipsReferences() ? " (skip references)" : "");
+    
     SyntheticArrayRange* ptr = &m_head;
     while (ptr && ptr != m_tail)
     {
@@ -222,7 +237,7 @@
 
 #ifndef LLDB_DISABLE_PYTHON
 
-SyntheticScriptProvider::FrontEnd::FrontEnd(std::string pclass,
+TypeSyntheticImpl::FrontEnd::FrontEnd(std::string pclass,
                                             lldb::ValueObjectSP be) :
     SyntheticChildrenFrontEnd(be),
     m_python_class(pclass)
@@ -242,13 +257,13 @@
         m_wrapper = m_interpreter->CreateSyntheticScriptedProvider(m_python_class, m_backend);
 }
 
-SyntheticScriptProvider::FrontEnd::~FrontEnd()
+TypeSyntheticImpl::FrontEnd::~FrontEnd()
 {
     Py_XDECREF((PyObject*)m_wrapper);
 }
 
 lldb::ValueObjectSP
-SyntheticScriptProvider::FrontEnd::GetChildAtIndex (uint32_t idx, bool can_create)
+TypeSyntheticImpl::FrontEnd::GetChildAtIndex (uint32_t idx, bool can_create)
 {
     if (m_wrapper == NULL || m_interpreter == NULL)
         return lldb::ValueObjectSP();
@@ -257,13 +272,13 @@
 }
 
 std::string
-SyntheticScriptProvider::GetDescription()
+TypeSyntheticImpl::GetDescription()
 {
     StreamString sstr;
     sstr.Printf("%s%s%s Python class %s",
-                m_cascades ? "" : " (not cascading)",
-                m_skip_pointers ? " (skip pointers)" : "",
-                m_skip_references ? " (skip references)" : "",
+                Cascades() ? "" : " (not cascading)",
+                SkipsPointers() ? " (skip pointers)" : "",
+                SkipsReferences() ? " (skip references)" : "",
                 m_python_class.c_str());
     
     return sstr.GetString();

Modified: lldb/trunk/source/Core/FormatManager.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/FormatManager.cpp?rev=150558&r1=150557&r2=150558&view=diff
==============================================================================
--- lldb/trunk/source/Core/FormatManager.cpp (original)
+++ lldb/trunk/source/Core/FormatManager.cpp Tue Feb 14 20:34:21 2012
@@ -157,8 +157,8 @@
     return NULL;
 }
 
-FormatCategory::FormatCategory(IFormatChangeListener* clist,
-                               std::string name) :
+TypeCategoryImpl::TypeCategoryImpl(IFormatChangeListener* clist,
+                                   ConstString name) :
     m_summary_nav(new SummaryNavigator("summary",clist)),
     m_regex_summary_nav(new RegexSummaryNavigator("regex-summary",clist)),
     m_filter_nav(new FilterNavigator("filter",clist)),
@@ -174,8 +174,8 @@
 {}
 
 bool
-FormatCategory::Get (ValueObject& valobj,
-                     lldb::SummaryFormatSP& entry,
+TypeCategoryImpl::Get (ValueObject& valobj,
+                     lldb::TypeSummaryImplSP& entry,
                      lldb::DynamicValueType use_dynamic,
                      uint32_t* reason)
 {
@@ -190,14 +190,14 @@
 }
 
 bool
-FormatCategory::Get(ValueObject& valobj,
+TypeCategoryImpl::Get(ValueObject& valobj,
                     lldb::SyntheticChildrenSP& entry_sp,
                     lldb::DynamicValueType use_dynamic,
                     uint32_t* reason)
 {
     if (!IsEnabled())
         return false;
-    SyntheticFilter::SharedPointer filter_sp;
+    TypeFilterImpl::SharedPointer filter_sp;
     uint32_t reason_filter = 0;
     bool regex_filter = false;
     // first find both Filter and Synth, and then check which is most recent
@@ -209,7 +209,7 @@
     bool regex_synth = false;
     uint32_t reason_synth = 0;    
     bool pick_synth = false;
-    SyntheticScriptProvider::SharedPointer synth;
+    TypeSyntheticImpl::SharedPointer synth;
     if (!GetSyntheticNavigator()->Get(valobj, synth, use_dynamic, &reason_synth))
         regex_synth = GetRegexSyntheticNavigator()->Get (valobj, synth, use_dynamic, &reason_synth);
     if (!filter_sp.get() && !synth.get())
@@ -222,7 +222,7 @@
     
     else /*if (filter_sp.get() && synth.get())*/
     {
-        if (filter_sp->m_my_revision > synth->m_my_revision)
+        if (filter_sp->GetRevision() > synth->GetRevision())
             pick_synth = false;
         else
             pick_synth = true;
@@ -255,7 +255,7 @@
 }
 
 void
-FormatCategory::Clear (FormatCategoryItems items)
+TypeCategoryImpl::Clear (FormatCategoryItems items)
 {
     if ( (items & eFormatCategoryItemSummary) == eFormatCategoryItemSummary )
         m_summary_nav->Clear();
@@ -274,7 +274,7 @@
 }
 
 bool
-FormatCategory::Delete (ConstString name,
+TypeCategoryImpl::Delete (ConstString name,
                         FormatCategoryItems items)
 {
     bool success = false;
@@ -296,7 +296,7 @@
 }
 
 uint32_t
-FormatCategory::GetCount (FormatCategoryItems items)
+TypeCategoryImpl::GetCount (FormatCategoryItems items)
 {
     uint32_t count = 0;
     if ( (items & eFormatCategoryItemSummary) == eFormatCategoryItemSummary )
@@ -317,7 +317,7 @@
 }
 
 bool
-FormatCategory::AnyMatches(ConstString type_name,
+TypeCategoryImpl::AnyMatches(ConstString type_name,
                            FormatCategoryItems items,
                            bool only_enabled,
                            const char** matching_category,
@@ -326,10 +326,10 @@
     if (!IsEnabled() && only_enabled)
         return false;
     
-    lldb::SummaryFormatSP summary;
-    SyntheticFilter::SharedPointer filter;
+    lldb::TypeSummaryImplSP summary;
+    TypeFilterImpl::SharedPointer filter;
 #ifndef LLDB_DISABLE_PYTHON
-    SyntheticScriptProvider::SharedPointer synth;
+    TypeSyntheticImpl::SharedPointer synth;
 #endif
     
     if ( (items & eFormatCategoryItemSummary) == eFormatCategoryItemSummary )
@@ -337,7 +337,7 @@
         if (m_summary_nav->Get(type_name, summary))
         {
             if (matching_category)
-                *matching_category = m_name.c_str();
+                *matching_category = m_name.GetCString();
             if (matching_type)
                 *matching_type = eFormatCategoryItemSummary;
             return true;
@@ -348,7 +348,7 @@
         if (m_regex_summary_nav->Get(type_name, summary))
         {
             if (matching_category)
-                *matching_category = m_name.c_str();
+                *matching_category = m_name.GetCString();
             if (matching_type)
                 *matching_type = eFormatCategoryItemRegexSummary;
             return true;
@@ -359,7 +359,7 @@
         if (m_filter_nav->Get(type_name, filter))
         {
             if (matching_category)
-                *matching_category = m_name.c_str();
+                *matching_category = m_name.GetCString();
             if (matching_type)
                 *matching_type = eFormatCategoryItemFilter;
             return true;
@@ -370,7 +370,7 @@
         if (m_regex_filter_nav->Get(type_name, filter))
         {
             if (matching_category)
-                *matching_category = m_name.c_str();
+                *matching_category = m_name.GetCString();
             if (matching_type)
                 *matching_type = eFormatCategoryItemRegexFilter;
             return true;
@@ -382,7 +382,7 @@
         if (m_synth_nav->Get(type_name, synth))
         {
             if (matching_category)
-                *matching_category = m_name.c_str();
+                *matching_category = m_name.GetCString();
             if (matching_type)
                 *matching_type = eFormatCategoryItemSynth;
             return true;
@@ -393,7 +393,7 @@
         if (m_regex_synth_nav->Get(type_name, synth))
         {
             if (matching_category)
-                *matching_category = m_name.c_str();
+                *matching_category = m_name.GetCString();
             if (matching_type)
                 *matching_type = eFormatCategoryItemRegexSynth;
             return true;
@@ -405,10 +405,10 @@
 
 bool
 CategoryMap::AnyMatches (ConstString type_name,
-                                    FormatCategory::FormatCategoryItems items,
-                                    bool only_enabled,
-                                    const char** matching_category,
-                                    FormatCategory::FormatCategoryItems* matching_type)
+                         TypeCategoryImpl::FormatCategoryItems items,
+                         bool only_enabled,
+                         const char** matching_category,
+                         TypeCategoryImpl::FormatCategoryItems* matching_type)
 {
     Mutex::Locker(m_map_mutex);
     
@@ -425,7 +425,7 @@
     return false;
 }
 
-lldb::SummaryFormatSP
+lldb::TypeSummaryImplSP
 CategoryMap::GetSummaryFormat (ValueObject& valobj,
                                lldb::DynamicValueType use_dynamic)
 {
@@ -436,13 +436,13 @@
     
     for (begin = m_active_categories.begin(); begin != end; begin++)
     {
-        lldb::FormatCategorySP category = *begin;
-        lldb::SummaryFormatSP current_format;
+        lldb::TypeCategoryImplSP category = *begin;
+        lldb::TypeSummaryImplSP current_format;
         if (!category->Get(valobj, current_format, use_dynamic, &reason_why))
             continue;
         return current_format;
     }
-    return lldb::SummaryFormatSP();
+    return lldb::TypeSummaryImplSP();
 }
 
 lldb::SyntheticChildrenSP
@@ -457,7 +457,7 @@
     
     for (begin = m_active_categories.begin(); begin != end; begin++)
     {
-        lldb::FormatCategorySP category = *begin;
+        lldb::TypeCategoryImplSP category = *begin;
         lldb::SyntheticChildrenSP current_format;
         if (!category->Get(valobj, current_format, use_dynamic, &reason_why))
             continue;
@@ -478,8 +478,8 @@
             ActiveCategoriesIterator begin, end = m_active_categories.end();
             for (begin = m_active_categories.begin(); begin != end; begin++)
             {
-                lldb::FormatCategorySP category = *begin;
-                ConstString type = ConstString(category->GetName().c_str());
+                lldb::TypeCategoryImplSP category = *begin;
+                ConstString type = ConstString(category->GetName());
                 if (!callback(param, category))
                     break;
             }
@@ -500,20 +500,39 @@
     }
 }
 
-lldb::FormatCategorySP
+TypeCategoryImplSP
+CategoryMap::GetAtIndex (uint32_t index)
+{
+    Mutex::Locker(m_map_mutex);
+    
+    if (index < m_map.size())
+    {
+        MapIterator pos, end = m_map.end();
+        for (pos = m_map.begin(); pos != end; pos++)
+        {
+            if (index == 0)
+                return pos->second;
+            index--;
+        }
+    }
+    
+    return TypeCategoryImplSP();
+}
+
+lldb::TypeCategoryImplSP
 FormatManager::GetCategory (const ConstString& category_name,
                          bool can_create)
 {
     if (!category_name)
         return GetCategory(m_default_category_name);
-    lldb::FormatCategorySP category;
+    lldb::TypeCategoryImplSP category;
     if (m_categories_map.Get(category_name, category))
         return category;
     
     if (!can_create)
-        return lldb::FormatCategorySP();
+        return lldb::TypeCategoryImplSP();
     
-    m_categories_map.Add(category_name,lldb::FormatCategorySP(new FormatCategory(this, category_name.AsCString())));
+    m_categories_map.Add(category_name,lldb::TypeCategoryImplSP(new TypeCategoryImpl(this, category_name)));
     return GetCategory(category_name);
 }
 
@@ -566,35 +585,33 @@
     
     // add some default stuff
     // most formats, summaries, ... actually belong to the users' lldbinit file rather than here
-    lldb::SummaryFormatSP string_format(new StringSummaryFormat(SummaryFormat::Flags().SetCascades(false)
-                                                                .SetSkipPointers(true)
-                                                                .SetSkipReferences(false)
-                                                                .SetDontShowChildren(true)
-                                                                .SetDontShowValue(false)
-                                                                .SetShowMembersOneLiner(false)
-                                                                .SetHideItemNames(false),
-                                                                "${var%s}"));
+    lldb::TypeSummaryImplSP string_format(new StringSummaryFormat(TypeSummaryImpl::Flags().SetCascades(false)
+                                                                  .SetSkipPointers(true)
+                                                                  .SetSkipReferences(false)
+                                                                  .SetDontShowChildren(true)
+                                                                  .SetDontShowValue(false)
+                                                                  .SetShowMembersOneLiner(false)
+                                                                  .SetHideItemNames(false),
+                                                                  "${var%s}"));
     
     
-    lldb::SummaryFormatSP string_array_format(new StringSummaryFormat(SummaryFormat::Flags().SetCascades(false)
-                                                                      .SetSkipPointers(true)
-                                                                      .SetSkipReferences(false)
-                                                                      .SetDontShowChildren(false)
-                                                                      .SetDontShowValue(true)
-                                                                      .SetShowMembersOneLiner(false)
-                                                                      .SetHideItemNames(false),
-                                                                      "${var%s}"));
+    lldb::TypeSummaryImplSP string_array_format(new StringSummaryFormat(TypeSummaryImpl::Flags().SetCascades(false)
+                                                                        .SetSkipPointers(true)
+                                                                        .SetSkipReferences(false)
+                                                                        .SetDontShowChildren(false)
+                                                                        .SetDontShowValue(true)
+                                                                        .SetShowMembersOneLiner(false)
+                                                                        .SetHideItemNames(false),
+                                                                        "${var%s}"));
     
     lldb::RegularExpressionSP any_size_char_arr(new RegularExpression("char \\[[0-9]+\\]"));
     
-    FormatCategory::SharedPointer sys_category_sp = GetCategory(m_system_category_name);
+    TypeCategoryImpl::SharedPointer sys_category_sp = GetCategory(m_system_category_name);
     
     sys_category_sp->GetSummaryNavigator()->Add(ConstString("char *"), string_format);
     sys_category_sp->GetSummaryNavigator()->Add(ConstString("const char *"), string_format);
     sys_category_sp->GetRegexSummaryNavigator()->Add(any_size_char_arr, string_array_format);
     
-    GetCategory(m_default_category_name); // this call is there to force LLDB into creating an empty "default" category
-    
     // WARNING: temporary code!!
     // The platform should be responsible for initializing its own formatters
     // (e.g. to handle versioning, different runtime libraries, ...)
@@ -602,16 +619,16 @@
     // the GNU libstdc++ are defined regardless, and enabled by default
     // This is going to be moved to some platform-dependent location
     // (in the meanwhile, these formatters should work for Mac OS X & Linux)
-    lldb::SummaryFormatSP std_string_summary_sp(new StringSummaryFormat(SummaryFormat::Flags().SetCascades(true)
-                                                                        .SetSkipPointers(false)
-                                                                        .SetSkipReferences(false)
-                                                                        .SetDontShowChildren(true)
-                                                                        .SetDontShowValue(true)
-                                                                        .SetShowMembersOneLiner(false)
-                                                                        .SetHideItemNames(false),
-                                                                        "${var._M_dataplus._M_p}"));
+    lldb::TypeSummaryImplSP std_string_summary_sp(new StringSummaryFormat(TypeSummaryImpl::Flags().SetCascades(true)
+                                                                          .SetSkipPointers(false)
+                                                                          .SetSkipReferences(false)
+                                                                          .SetDontShowChildren(true)
+                                                                          .SetDontShowValue(true)
+                                                                          .SetShowMembersOneLiner(false)
+                                                                          .SetHideItemNames(false),
+                                                                          "${var._M_dataplus._M_p}"));
     
-    FormatCategory::SharedPointer gnu_category_sp = GetCategory(m_gnu_cpp_category_name);
+    TypeCategoryImpl::SharedPointer gnu_category_sp = GetCategory(m_gnu_cpp_category_name);
     
     gnu_category_sp->GetSummaryNavigator()->Add(ConstString("std::string"),
                                                 std_string_summary_sp);
@@ -624,40 +641,34 @@
 
     
 #ifndef LLDB_DISABLE_PYTHON
+    
+    SyntheticChildren::Flags stl_synth_flags;
+    stl_synth_flags.SetCascades(true).SetSkipPointers(false).SetSkipReferences(false);
+    
     gnu_category_sp->GetRegexSyntheticNavigator()->Add(RegularExpressionSP(new RegularExpression("^(std::)?vector<.+>$")),
-                                     SyntheticChildrenSP(new SyntheticScriptProvider(true,
-                                                                                     false,
-                                                                                     false,
-                                                                                     "gnu_libstdcpp.StdVectorSynthProvider")));
+                                     SyntheticChildrenSP(new TypeSyntheticImpl(stl_synth_flags,
+                                                                               "gnu_libstdcpp.StdVectorSynthProvider")));
     gnu_category_sp->GetRegexSyntheticNavigator()->Add(RegularExpressionSP(new RegularExpression("^(std::)?map<.+> >$")),
-                                     SyntheticChildrenSP(new SyntheticScriptProvider(true,
-                                                                                     false,
-                                                                                     false,
-                                                                                     "gnu_libstdcpp.StdMapSynthProvider")));
+                                     SyntheticChildrenSP(new TypeSyntheticImpl(stl_synth_flags,
+                                                                               "gnu_libstdcpp.StdMapSynthProvider")));
     gnu_category_sp->GetRegexSyntheticNavigator()->Add(RegularExpressionSP(new RegularExpression("^(std::)?list<.+>$")),
-                                     SyntheticChildrenSP(new SyntheticScriptProvider(true,
-                                                                                     false,
-                                                                                     false,
-                                                                                     "gnu_libstdcpp.StdListSynthProvider")));
-
-    lldb::SummaryFormatSP ObjC_BOOL_summary(new ScriptSummaryFormat(SummaryFormat::Flags().SetCascades(false)
-                                                                    .SetSkipPointers(false)
-                                                                    .SetSkipReferences(false)
-                                                                    .SetDontShowChildren(true)
-                                                                    .SetDontShowValue(true)
-                                                                    .SetShowMembersOneLiner(false)
-                                                                    .SetHideItemNames(false),
-                                                                    "objc.BOOL_SummaryProvider",
-                                                                    ""));
-    FormatCategory::SharedPointer objc_category_sp = GetCategory(m_objc_category_name);
+                                     SyntheticChildrenSP(new TypeSyntheticImpl(stl_synth_flags,
+                                                                               "gnu_libstdcpp.StdListSynthProvider")));
+
+    lldb::TypeSummaryImplSP ObjC_BOOL_summary(new ScriptSummaryFormat(TypeSummaryImpl::Flags().SetCascades(false)
+                                                                      .SetSkipPointers(false)
+                                                                      .SetSkipReferences(false)
+                                                                      .SetDontShowChildren(true)
+                                                                      .SetDontShowValue(true)
+                                                                      .SetShowMembersOneLiner(false)
+                                                                      .SetHideItemNames(false),
+                                                                      "objc.BOOL_SummaryProvider",
+                                                                      ""));
+    TypeCategoryImpl::SharedPointer objc_category_sp = GetCategory(m_objc_category_name);
     objc_category_sp->GetSummaryNavigator()->Add(ConstString("BOOL"),
                                                  ObjC_BOOL_summary);
 #endif
-    
-    // DO NOT change the order of these calls, unless you WANT a change in the priority of these categories
-    EnableCategory(m_system_category_name);
-    EnableCategory(m_objc_category_name);
-    EnableCategory(m_gnu_cpp_category_name);
-    EnableCategory(m_default_category_name);
-    
+    EnableCategory(m_objc_category_name,CategoryMap::Last);
+    EnableCategory(m_gnu_cpp_category_name,CategoryMap::Last);
+    EnableCategory(m_system_category_name,CategoryMap::Last);
 }

Modified: lldb/trunk/source/Core/ValueObject.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObject.cpp?rev=150558&r1=150557&r2=150558&view=diff
==============================================================================
--- lldb/trunk/source/Core/ValueObject.cpp (original)
+++ lldb/trunk/source/Core/ValueObject.cpp Tue Feb 14 20:34:21 2012
@@ -575,7 +575,7 @@
     {        
         if (m_summary_str.empty())
         {
-            SummaryFormat *summary_format = GetSummaryFormat().get();
+            TypeSummaryImpl *summary_format = GetSummaryFormat().get();
 
             if (summary_format)
             {
@@ -1771,7 +1771,7 @@
             
             // We haven't made a synthetic array member for INDEX yet, so
             // lets make one and cache it for any future reference.
-            SyntheticArrayView *view = new SyntheticArrayView();
+            SyntheticArrayView *view = new SyntheticArrayView(SyntheticChildren::Flags());
             view->AddRange(from,to);
             SyntheticChildrenSP view_sp(view);
             synthetic_child = new ValueObjectSynthetic(*this, view_sp);
@@ -3075,7 +3075,7 @@
         std::string value_str;
         const char *val_cstr = NULL;
         const char *sum_cstr = NULL;
-        SummaryFormat* entry = valobj->GetSummaryFormat().get();
+        TypeSummaryImpl* entry = valobj->GetSummaryFormat().get();
         
         if (omit_summary_depth > 0)
             entry = NULL;

Modified: lldb/trunk/source/Interpreter/ScriptInterpreterPython.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/ScriptInterpreterPython.cpp?rev=150558&r1=150557&r2=150558&view=diff
==============================================================================
--- lldb/trunk/source/Interpreter/ScriptInterpreterPython.cpp (original)
+++ lldb/trunk/source/Interpreter/ScriptInterpreterPython.cpp Tue Feb 14 20:34:21 2012
@@ -1140,7 +1140,7 @@
 // this implementation is identical to GenerateBreakpointCommandCallbackData (apart from the name
 // given to generated functions, of course)
 bool
-ScriptInterpreterPython::GenerateTypeScriptFunction (StringList &user_input, StringList &output)
+ScriptInterpreterPython::GenerateTypeScriptFunction (StringList &user_input, StringList &output, void* name_token)
 {
     static int num_created_functions = 0;
     user_input.RemoveBlankLines ();
@@ -1154,7 +1154,10 @@
     // Take what the user wrote, wrap it all up inside one big auto-generated Python function, passing in the
     // ValueObject as parameter to the function.
     
-    sstr.Printf ("lldb_autogen_python_type_print_func_%d", num_created_functions);
+    if (!name_token)
+        sstr.Printf ("lldb_autogen_python_type_print_func_%d", num_created_functions);
+    else
+        sstr.Printf ("lldb_gen_python_type_print_func_%p", name_token);        
     ++num_created_functions;
     std::string auto_generated_function_name = sstr.GetData();
     
@@ -1267,7 +1270,7 @@
 
 
 bool
-ScriptInterpreterPython::GenerateTypeSynthClass (StringList &user_input, StringList &output)
+ScriptInterpreterPython::GenerateTypeSynthClass (StringList &user_input, StringList &output, void* name_token)
 {
     static int num_created_classes = 0;
     user_input.RemoveBlankLines ();
@@ -1280,7 +1283,10 @@
     
     // Wrap all user input into a Python class
     
-    sstr.Printf ("lldb_autogen_python_type_synth_class_%d", num_created_classes);
+    if (!name_token)
+        sstr.Printf ("lldb_autogen_python_type_synth_class_%d", num_created_classes);
+    else
+        sstr.Printf ("lldb_gen_python_type_synth_class_%p", name_token);        
     ++num_created_classes;
     std::string auto_generated_class_name = sstr.GetData();
     
@@ -1349,13 +1355,23 @@
 }
 
 bool
-ScriptInterpreterPython::GenerateTypeScriptFunction (const char* oneliner, StringList &output)
+ScriptInterpreterPython::GenerateTypeScriptFunction (const char* oneliner, StringList &output, void* name_token)
 {
-    StringList input(oneliner);
-    return GenerateTypeScriptFunction(input, output);
+    StringList input;
+    input.SplitIntoLines(oneliner, strlen(oneliner));
+    return GenerateTypeScriptFunction(input, output, name_token);
 }
 
 bool
+ScriptInterpreterPython::GenerateTypeSynthClass (const char* oneliner, StringList &output, void* name_token)
+{
+    StringList input;
+    input.SplitIntoLines(oneliner, strlen(oneliner));
+    return GenerateTypeSynthClass(input, output, name_token);
+}
+
+
+bool
 ScriptInterpreterPython::GenerateBreakpointCommandCallbackData (StringList &user_input, StringList &callback_data)
 {
     static int num_created_functions = 0;
@@ -1775,12 +1791,12 @@
             return false;
         }
         
-        // call __lldb_module_init(debugger,dict)
+        // call __lldb_init_module(debugger,dict)
         if (!g_swig_call_module_init (basename,
                                         m_dictionary_name.c_str(),
                                         debugger_sp))
         {
-            error.SetErrorString("calling __lldb_module_init failed");
+            error.SetErrorString("calling __lldb_init_module failed");
             return false;
         }
         return true;





More information about the lldb-commits mailing list