<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Warning for all interested parties. Apparently something in the way conflicts were solved before checking this in made the build unhappy.<div><div>I am building a clean ToT checkout to see what is going on and fix it.</div><div>Sorry for any disruption.</div><div><br><div>
<div><div style="border-collapse: separate; border-spacing: 0px; "><i>Enrico Granata</i></div><div style="border-collapse: separate; border-spacing: 0px; ">✉ egranata@<font class="Apple-style-span" color="#ff230e"></font>.com</div><div>✆ (408) 972-7683</div></div>
</div>
<br><div><div>On Jan 28, 2013, at 3:47 PM, Enrico Granata <<a href="mailto:egranata@apple.com">egranata@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Author: enrico<br>Date: Mon Jan 28 17:47:25 2013<br>New Revision: 173728<br><br>URL: <a href="http://llvm.org/viewvc/llvm-project?rev=173728&view=rev">http://llvm.org/viewvc/llvm-project?rev=173728&view=rev</a><br>Log:<br><<a href="rdar://problem/12978143">rdar://problem/12978143</a>><br><br>Data formatters now cache themselves.<br>This commit provides a new formatter cache mechanism. Upon resolving a formatter (summary or synthetic), LLDB remembers the resolution for later faster retrieval.<br>Also moved the data formatters subsystem from the core to its own group and folder for easier management, and done some code reorganization.<br>The ObjC runtime v1 now returns a class name if asked for the dynamic type of an object. This is required for formatters caching to work with the v1 runtime.<br>Lastly, this commit disposes of the old hack where ValueObjects had to remember whether they were queried for formatters with their static or dynamic type.<br>Now the ValueObjectDynamicValue class works well enough that we can use its dynamic value setting for the same purpose.<br><br><br><br>Added:<br>    lldb/trunk/include/lldb/DataFormatters/<br>    lldb/trunk/include/lldb/DataFormatters/CXXFormatterFunctions.h<br>      - copied, changed from r173281, lldb/trunk/include/lldb/Core/CXXFormatterFunctions.h<br>    lldb/trunk/include/lldb/DataFormatters/DataVisualization.h<br>      - copied, changed from r173281, lldb/trunk/include/lldb/Core/DataVisualization.h<br>    lldb/trunk/include/lldb/DataFormatters/FormatCache.h<br>    lldb/trunk/include/lldb/DataFormatters/FormatClasses.h<br>      - copied, changed from r173281, lldb/trunk/include/lldb/Core/FormatClasses.h<br>    lldb/trunk/include/lldb/DataFormatters/FormatManager.h<br>      - copied, changed from r173281, lldb/trunk/include/lldb/Core/FormatManager.h<br>    lldb/trunk/include/lldb/DataFormatters/FormatNavigator.h<br>      - copied, changed from r173281, lldb/trunk/include/lldb/Core/FormatNavigator.h<br>    lldb/trunk/include/lldb/DataFormatters/TypeCategory.h<br>    lldb/trunk/include/lldb/DataFormatters/TypeCategoryMap.h<br>    lldb/trunk/include/lldb/DataFormatters/TypeFormat.h<br>    lldb/trunk/include/lldb/DataFormatters/TypeSummary.h<br>    lldb/trunk/include/lldb/DataFormatters/TypeSynthetic.h<br>    lldb/trunk/source/DataFormatters/<br>    lldb/trunk/source/DataFormatters/CXXFormatterFunctions.cpp<br>      - copied, changed from r173281, lldb/trunk/source/Core/CXXFormatterFunctions.cpp<br>    lldb/trunk/source/DataFormatters/DataVisualization.cpp<br>      - copied, changed from r173281, lldb/trunk/source/Core/DataVisualization.cpp<br>    lldb/trunk/source/DataFormatters/FormatCache.cpp<br>    lldb/trunk/source/DataFormatters/FormatClasses.cpp<br>      - copied, changed from r173281, lldb/trunk/source/Core/FormatClasses.cpp<br>    lldb/trunk/source/DataFormatters/FormatManager.cpp<br>      - copied, changed from r173281, lldb/trunk/source/Core/FormatManager.cpp<br>    lldb/trunk/source/DataFormatters/TypeCategory.cpp<br>    lldb/trunk/source/DataFormatters/TypeCategoryMap.cpp<br>    lldb/trunk/source/DataFormatters/TypeFormat.cpp<br>    lldb/trunk/source/DataFormatters/TypeSummary.cpp<br>    lldb/trunk/source/DataFormatters/TypeSynthetic.cpp<br>Removed:<br>    lldb/trunk/include/lldb/Core/CXXFormatterFunctions.h<br>    lldb/trunk/include/lldb/Core/DataVisualization.h<br>    lldb/trunk/include/lldb/Core/FormatClasses.h<br>    lldb/trunk/include/lldb/Core/FormatManager.h<br>    lldb/trunk/include/lldb/Core/FormatNavigator.h<br>    lldb/trunk/source/Core/CXXFormatterFunctions.cpp<br>    lldb/trunk/source/Core/DataVisualization.cpp<br>    lldb/trunk/source/Core/FormatClasses.cpp<br>    lldb/trunk/source/Core/FormatManager.cpp<br>Modified:<br>    lldb/trunk/include/lldb/API/SBTypeSynthetic.h<br>    lldb/trunk/include/lldb/Core/Debugger.h<br>    lldb/trunk/include/lldb/Core/ValueObject.h<br>    lldb/trunk/include/lldb/Core/ValueObjectDynamicValue.h<br>    lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h<br>    lldb/trunk/include/lldb/lldb-forward.h<br>    lldb/trunk/lldb.xcodeproj/project.pbxproj<br>    lldb/trunk/source/API/SBDebugger.cpp<br>    lldb/trunk/source/API/SBTypeCategory.cpp<br>    lldb/trunk/source/API/SBTypeFilter.cpp<br>    lldb/trunk/source/API/SBTypeFormat.cpp<br>    lldb/trunk/source/API/SBTypeNameSpecifier.cpp<br>    lldb/trunk/source/API/SBTypeSummary.cpp<br>    lldb/trunk/source/API/SBTypeSynthetic.cpp<br>    lldb/trunk/source/API/SBValue.cpp<br>    lldb/trunk/source/Commands/CommandObjectFrame.cpp<br>    lldb/trunk/source/Commands/CommandObjectType.cpp<br>    lldb/trunk/source/Core/Debugger.cpp<br>    lldb/trunk/source/Core/Timer.cpp<br>    lldb/trunk/source/Core/ValueObject.cpp<br>    lldb/trunk/source/Core/ValueObjectDynamicValue.cpp<br>    lldb/trunk/source/Core/ValueObjectSyntheticFilter.cpp<br>    lldb/trunk/source/Interpreter/Args.cpp<br>    lldb/trunk/source/Interpreter/CommandObjectScript.cpp<br>    lldb/trunk/source/Interpreter/OptionGroupVariable.cpp<br>    lldb/trunk/source/Interpreter/OptionValueArch.cpp<br>    lldb/trunk/source/Interpreter/OptionValueDictionary.cpp<br>    lldb/trunk/source/Interpreter/OptionValueFileSpec.cpp<br>    lldb/trunk/source/Interpreter/OptionValueFormat.cpp<br>    lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp<br>    lldb/trunk/test/functionalities/data-formatter/rdar-12437442/TestRdar12437442.py<br><br>Modified: lldb/trunk/include/lldb/API/SBTypeSynthetic.h<br>URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBTypeSynthetic.h?rev=173728&r1=173727&r2=173728&view=diff">http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBTypeSynthetic.h?rev=173728&r1=173727&r2=173728&view=diff</a><br>==============================================================================<br>--- lldb/trunk/include/lldb/API/SBTypeSynthetic.h (original)<br>+++ lldb/trunk/include/lldb/API/SBTypeSynthetic.h Mon Jan 28 17:47:25 2013<br>@@ -79,15 +79,15 @@ namespace lldb {<br>         friend class SBTypeCategory;<br>         friend class SBValue;<br><br>-        lldb::TypeSyntheticImplSP<br>+        lldb::ScriptedSyntheticChildrenSP<br>         GetSP ();<br><br>         void<br>-        SetSP (const lldb::TypeSyntheticImplSP &typefilter_impl_sp);    <br>+        SetSP (const lldb::ScriptedSyntheticChildrenSP &typefilter_impl_sp);    <br><br>-        lldb::TypeSyntheticImplSP m_opaque_sp;<br>+        lldb::ScriptedSyntheticChildrenSP m_opaque_sp;<br><br>-        SBTypeSynthetic (const lldb::TypeSyntheticImplSP &);<br>+        SBTypeSynthetic (const lldb::ScriptedSyntheticChildrenSP &);<br><br>         bool<br>         CopyOnWrite_Impl();<br><br>Removed: lldb/trunk/include/lldb/Core/CXXFormatterFunctions.h<br>URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/CXXFormatterFunctions.h?rev=173727&view=auto">http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/CXXFormatterFunctions.h?rev=173727&view=auto</a><br>==============================================================================<br>--- lldb/trunk/include/lldb/Core/CXXFormatterFunctions.h (original)<br>+++ lldb/trunk/include/lldb/Core/CXXFormatterFunctions.h (removed)<br>@@ -1,355 +0,0 @@<br>-//===-- CXXFormatterFunctions.h------------------------------------*- C++ -*-===//<br>-//<br>-//                     The LLVM Compiler Infrastructure<br>-//<br>-// This file is distributed under the University of Illinois Open Source<br>-// License. See LICENSE.TXT for details.<br>-//<br>-//===----------------------------------------------------------------------===//<br>-<br>-#ifndef liblldb_CXXFormatterFunctions_h_<br>-#define liblldb_CXXFormatterFunctions_h_<br>-<br>-#include <stdint.h><br>-#include "lldb/lldb-forward.h"<br>-<br>-#include "lldb/Core/ConstString.h"<br>-#include "lldb/Core/FormatClasses.h"<br>-<br>-#include "clang/AST/ASTContext.h"<br>-<br>-namespace lldb_private {<br>-    namespace formatters<br>-    {<br>-        <br>-        bool<br>-        ExtractValueFromObjCExpression (ValueObject &valobj,<br>-                                        const char* target_type,<br>-                                        const char* selector,<br>-                                        uint64_t &value);<br>-        <br>-        lldb::ValueObjectSP<br>-        CallSelectorOnObject (ValueObject &valobj,<br>-                              const char* return_type,<br>-                              const char* selector,<br>-                              uint64_t index);<br>-        <br>-        lldb::ValueObjectSP<br>-        CallSelectorOnObject (ValueObject &valobj,<br>-                              const char* return_type,<br>-                              const char* selector,<br>-                              const char* key);<br>-        <br>-        bool<br>-        Char16StringSummaryProvider (ValueObject& valobj, Stream& stream); // char16_t* and unichar*<br>-        <br>-        bool<br>-        Char32StringSummaryProvider (ValueObject& valobj, Stream& stream); // char32_t*<br>-        <br>-        bool<br>-        WCharStringSummaryProvider (ValueObject& valobj, Stream& stream); // wchar_t*<br>-        <br>-        bool<br>-        Char16SummaryProvider (ValueObject& valobj, Stream& stream); // char16_t and unichar<br>-        <br>-        bool<br>-        Char32SummaryProvider (ValueObject& valobj, Stream& stream); // char32_t<br>-        <br>-        bool<br>-        WCharSummaryProvider (ValueObject& valobj, Stream& stream); // wchar_t<br>-        <br>-        bool<br>-        LibcxxStringSummaryProvider (ValueObject& valobj, Stream& stream); // libc++ std::string<br>-<br>-        bool<br>-        LibcxxWStringSummaryProvider (ValueObject& valobj, Stream& stream); // libc++ std::wstring<br>-        <br>-        template<bool name_entries><br>-        bool<br>-        NSDictionarySummaryProvider (ValueObject& valobj, Stream& stream);<br>-        <br>-        bool<br>-        NSArraySummaryProvider (ValueObject& valobj, Stream& stream);<br>-        <br>-        template<bool needs_at><br>-        bool<br>-        NSDataSummaryProvider (ValueObject& valobj, Stream& stream);<br>-        <br>-        bool<br>-        NSNumberSummaryProvider (ValueObject& valobj, Stream& stream);<br>-<br>-        bool<br>-        NSStringSummaryProvider (ValueObject& valobj, Stream& stream);<br>-        <br>-        bool<br>-        ObjCBOOLSummaryProvider (ValueObject& valobj, Stream& stream);<br>-        <br>-        template <bool is_sel_ptr><br>-        bool<br>-        ObjCSELSummaryProvider (ValueObject& valobj, Stream& stream);<br>-        <br>-        bool<br>-        RuntimeSpecificDescriptionSummaryProvider (ValueObject& valobj, Stream& stream);<br>-        <br>-        extern template bool<br>-        NSDictionarySummaryProvider<true> (ValueObject&, Stream&) ;<br>-        <br>-        extern template bool<br>-        NSDictionarySummaryProvider<false> (ValueObject&, Stream&) ;<br>-        <br>-        extern template bool<br>-        NSDataSummaryProvider<true> (ValueObject&, Stream&) ;<br>-        <br>-        extern template bool<br>-        NSDataSummaryProvider<false> (ValueObject&, Stream&) ;<br>-        <br>-        extern template bool<br>-        ObjCSELSummaryProvider<true> (ValueObject&, Stream&);<br>-<br>-        extern template bool<br>-        ObjCSELSummaryProvider<false> (ValueObject&, Stream&);<br>-        <br>-        class NSArrayMSyntheticFrontEnd : public SyntheticChildrenFrontEnd<br>-        {<br>-        private:<br>-            struct DataDescriptor_32<br>-            {<br>-                uint32_t _used;<br>-                uint32_t _priv1 : 2 ;<br>-                uint32_t _size : 30;<br>-                uint32_t _priv2 : 2;<br>-                uint32_t offset : 30;<br>-                uint32_t _priv3;<br>-                uint32_t _data;<br>-            };<br>-            struct DataDescriptor_64<br>-            {<br>-                uint64_t _used;<br>-                uint64_t _priv1 : 2 ;<br>-                uint64_t _size : 62;<br>-                uint64_t _priv2 : 2;<br>-                uint64_t offset : 62;<br>-                uint32_t _priv3;<br>-                uint64_t _data;<br>-            };<br>-        public:<br>-            NSArrayMSyntheticFrontEnd (lldb::ValueObjectSP valobj_sp);<br>-            <br>-            virtual size_t<br>-            CalculateNumChildren ();<br>-            <br>-            virtual lldb::ValueObjectSP<br>-            GetChildAtIndex (size_t idx);<br>-            <br>-            virtual bool<br>-            Update();<br>-            <br>-            virtual bool<br>-            MightHaveChildren ();<br>-            <br>-            virtual uint32_t<br>-            GetIndexOfChildWithName (const ConstString &name);<br>-            <br>-            virtual<br>-            ~NSArrayMSyntheticFrontEnd ();<br>-        private:<br>-            ExecutionContextRef m_exe_ctx_ref;<br>-            uint8_t m_ptr_size;<br>-            DataDescriptor_32 *m_data_32;<br>-            DataDescriptor_64 *m_data_64;<br>-            ClangASTType m_id_type;<br>-            std::vector<lldb::ValueObjectSP> m_children;<br>-        };<br>-        <br>-        class NSArrayISyntheticFrontEnd : public SyntheticChildrenFrontEnd<br>-        {<br>-        public:<br>-            NSArrayISyntheticFrontEnd (lldb::ValueObjectSP valobj_sp);<br>-            <br>-            virtual size_t<br>-            CalculateNumChildren ();<br>-            <br>-            virtual lldb::ValueObjectSP<br>-            GetChildAtIndex (size_t idx);<br>-            <br>-            virtual bool<br>-            Update();<br>-            <br>-            virtual bool<br>-            MightHaveChildren ();<br>-            <br>-            virtual uint32_t<br>-            GetIndexOfChildWithName (const ConstString &name);<br>-            <br>-            virtual<br>-            ~NSArrayISyntheticFrontEnd ();<br>-        private:<br>-            ExecutionContextRef m_exe_ctx_ref;<br>-            uint8_t m_ptr_size;<br>-            size_t m_items;<br>-            lldb::addr_t m_data_ptr;<br>-            ClangASTType m_id_type;<br>-            std::vector<lldb::ValueObjectSP> m_children;<br>-        };<br>-        <br>-        class NSArrayCodeRunningSyntheticFrontEnd : public SyntheticChildrenFrontEnd<br>-        {<br>-        public:<br>-            NSArrayCodeRunningSyntheticFrontEnd (lldb::ValueObjectSP valobj_sp);<br>-            <br>-            virtual size_t<br>-            CalculateNumChildren ();<br>-            <br>-            virtual lldb::ValueObjectSP<br>-            GetChildAtIndex (size_t idx);<br>-            <br>-            virtual bool<br>-            Update();<br>-            <br>-            virtual bool<br>-            MightHaveChildren ();<br>-            <br>-            virtual uint32_t<br>-            GetIndexOfChildWithName (const ConstString &name);<br>-            <br>-            virtual<br>-            ~NSArrayCodeRunningSyntheticFrontEnd ();<br>-        };<br>-        <br>-        SyntheticChildrenFrontEnd* NSArraySyntheticFrontEndCreator (CXXSyntheticChildren*, lldb::ValueObjectSP);<br>-        <br>-        class NSDictionaryISyntheticFrontEnd : public SyntheticChildrenFrontEnd<br>-        {<br>-        private:<br>-            struct DataDescriptor_32<br>-            {<br>-                uint32_t _used : 26;<br>-                uint32_t _szidx : 6;<br>-            };<br>-            struct DataDescriptor_64<br>-            {<br>-                uint64_t _used : 58;<br>-                uint32_t _szidx : 6;<br>-            };<br>-            <br>-            struct DictionaryItemDescriptor<br>-            {<br>-                lldb::addr_t key_ptr;<br>-                lldb::addr_t val_ptr;<br>-                lldb::ValueObjectSP valobj_sp;<br>-            };<br>-            <br>-        public:<br>-            NSDictionaryISyntheticFrontEnd (lldb::ValueObjectSP valobj_sp);<br>-            <br>-            virtual size_t<br>-            CalculateNumChildren ();<br>-            <br>-            virtual lldb::ValueObjectSP<br>-            GetChildAtIndex (size_t idx);<br>-            <br>-            virtual bool<br>-            Update();<br>-            <br>-            virtual bool<br>-            MightHaveChildren ();<br>-            <br>-            virtual uint32_t<br>-            GetIndexOfChildWithName (const ConstString &name);<br>-            <br>-            virtual<br>-            ~NSDictionaryISyntheticFrontEnd ();<br>-        private:<br>-            ExecutionContextRef m_exe_ctx_ref;<br>-            uint8_t m_ptr_size;<br>-            DataDescriptor_32 *m_data_32;<br>-            DataDescriptor_64 *m_data_64;<br>-            lldb::addr_t m_data_ptr;<br>-            std::vector<DictionaryItemDescriptor> m_children;<br>-        };<br>-        <br>-        class NSDictionaryMSyntheticFrontEnd : public SyntheticChildrenFrontEnd<br>-        {<br>-        private:<br>-            struct DataDescriptor_32<br>-            {<br>-                uint32_t _used : 26;<br>-                uint32_t _kvo : 1;<br>-                uint32_t _size;<br>-                uint32_t _mutations;<br>-                uint32_t _objs_addr;<br>-                uint32_t _keys_addr;<br>-            };<br>-            struct DataDescriptor_64<br>-            {<br>-                uint64_t _used : 58;<br>-                uint32_t _kvo : 1;<br>-                uint64_t _size;<br>-                uint64_t _mutations;<br>-                uint64_t _objs_addr;<br>-                uint64_t _keys_addr;<br>-            };<br>-            struct DictionaryItemDescriptor<br>-            {<br>-                lldb::addr_t key_ptr;<br>-                lldb::addr_t val_ptr;<br>-                lldb::ValueObjectSP valobj_sp;<br>-            };<br>-        public:<br>-            NSDictionaryMSyntheticFrontEnd (lldb::ValueObjectSP valobj_sp);<br>-            <br>-            virtual size_t<br>-            CalculateNumChildren ();<br>-            <br>-            virtual lldb::ValueObjectSP<br>-            GetChildAtIndex (size_t idx);<br>-            <br>-            virtual bool<br>-            Update();<br>-            <br>-            virtual bool<br>-            MightHaveChildren ();<br>-            <br>-            virtual uint32_t<br>-            GetIndexOfChildWithName (const ConstString &name);<br>-            <br>-            virtual<br>-            ~NSDictionaryMSyntheticFrontEnd ();<br>-        private:<br>-            ExecutionContextRef m_exe_ctx_ref;<br>-            uint8_t m_ptr_size;<br>-            DataDescriptor_32 *m_data_32;<br>-            DataDescriptor_64 *m_data_64;<br>-            std::vector<DictionaryItemDescriptor> m_children;<br>-        };<br>-        <br>-        class NSDictionaryCodeRunningSyntheticFrontEnd : public SyntheticChildrenFrontEnd<br>-        {<br>-        public:<br>-            NSDictionaryCodeRunningSyntheticFrontEnd (lldb::ValueObjectSP valobj_sp);<br>-            <br>-            virtual size_t<br>-            CalculateNumChildren ();<br>-            <br>-            virtual lldb::ValueObjectSP<br>-            GetChildAtIndex (size_t idx);<br>-            <br>-            virtual bool<br>-            Update();<br>-            <br>-            virtual bool<br>-            MightHaveChildren ();<br>-            <br>-            virtual uint32_t<br>-            GetIndexOfChildWithName (const ConstString &name);<br>-            <br>-            virtual<br>-            ~NSDictionaryCodeRunningSyntheticFrontEnd ();<br>-        };<br>-        <br>-        SyntheticChildrenFrontEnd* NSDictionarySyntheticFrontEndCreator (CXXSyntheticChildren*, lldb::ValueObjectSP);<br>-        <br>-    }<br>-}<br>-<br>-#endif<br><br>Removed: lldb/trunk/include/lldb/Core/DataVisualization.h<br>URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/DataVisualization.h?rev=173727&view=auto">http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/DataVisualization.h?rev=173727&view=auto</a><br>==============================================================================<br>--- lldb/trunk/include/lldb/Core/DataVisualization.h (original)<br>+++ lldb/trunk/include/lldb/Core/DataVisualization.h (removed)<br>@@ -1,174 +0,0 @@<br>-//===-- DataVisualization.h ----------------------------------------*- C++ -*-===//<br>-//<br>-//                     The LLVM Compiler Infrastructure<br>-//<br>-// This file is distributed under the University of Illinois Open Source<br>-// License. See LICENSE.TXT for details.<br>-//<br>-//===----------------------------------------------------------------------===//<br>-<br>-#ifndef lldb_DataVisualization_h_<br>-#define lldb_DataVisualization_h_<br>-<br>-// C Includes<br>-// C++ Includes<br>-<br>-// Other libraries and framework includes<br>-// Project includes<br>-#include "lldb/Core/ConstString.h"<br>-#include "lldb/Core/FormatClasses.h"<br>-#include "lldb/Core/FormatManager.h"<br>-<br>-namespace lldb_private {<br>-<br>-// this class is the high-level front-end of LLDB Data Visualization<br>-// code in FormatManager.h/cpp is the low-level implementation of this feature<br>-// clients should refer to this class as the entry-point into the data formatters<br>-// unless they have a good reason to bypass this and go to the backend<br>-class DataVisualization<br>-{<br>-public:<br>-    <br>-    // use this call to force the FM to consider itself updated even when there is no apparent reason for that<br>-    static void<br>-    ForceUpdate();<br>-    <br>-    static uint32_t<br>-    GetCurrentRevision ();<br>-    <br>-    class ValueFormats<br>-    {<br>-    public:<br>-        static lldb::TypeFormatImplSP<br>-        GetFormat (ValueObject& valobj, lldb::DynamicValueType use_dynamic);<br>-        <br>-        static lldb::TypeFormatImplSP<br>-        GetFormat (const ConstString &type);<br>-        <br>-        static void<br>-        Add (const ConstString &type, const lldb::TypeFormatImplSP &entry);<br>-        <br>-        static bool<br>-        Delete (const ConstString &type);<br>-        <br>-        static void<br>-        Clear ();<br>-        <br>-        static void<br>-        LoopThrough (TypeFormatImpl::ValueCallback callback, void* callback_baton);<br>-        <br>-        static uint32_t<br>-        GetCount ();<br>-        <br>-        static lldb::TypeNameSpecifierImplSP<br>-        GetTypeNameSpecifierForFormatAtIndex (uint32_t);<br>-        <br>-        static lldb::TypeFormatImplSP<br>-        GetFormatAtIndex (uint32_t);<br>-    };<br>-    <br>-    static lldb::TypeSummaryImplSP<br>-    GetSummaryFormat(ValueObject& valobj,<br>-                     lldb::DynamicValueType use_dynamic);<br>-<br>-    static lldb::TypeSummaryImplSP<br>-    GetSummaryForType (lldb::TypeNameSpecifierImplSP type_sp);<br>-    <br>-#ifndef LLDB_DISABLE_PYTHON<br>-    static lldb::SyntheticChildrenSP<br>-    GetSyntheticChildrenForType (lldb::TypeNameSpecifierImplSP type_sp);<br>-#endif<br>-    <br>-    static lldb::TypeFilterImplSP<br>-    GetFilterForType (lldb::TypeNameSpecifierImplSP type_sp);<br>-<br>-#ifndef LLDB_DISABLE_PYTHON<br>-    static lldb::TypeSyntheticImplSP<br>-    GetSyntheticForType (lldb::TypeNameSpecifierImplSP type_sp);<br>-#endif<br>-    <br>-#ifndef LLDB_DISABLE_PYTHON<br>-    static lldb::SyntheticChildrenSP<br>-    GetSyntheticChildren(ValueObject& valobj,<br>-                         lldb::DynamicValueType use_dynamic);<br>-#endif<br>-    <br>-    static bool<br>-    AnyMatches(ConstString type_name,<br>-               TypeCategoryImpl::FormatCategoryItems items = TypeCategoryImpl::ALL_ITEM_TYPES,<br>-               bool only_enabled = true,<br>-               const char** matching_category = NULL,<br>-               TypeCategoryImpl::FormatCategoryItems* matching_type = NULL);<br>-    <br>-    class NamedSummaryFormats<br>-    {<br>-    public:<br>-        static bool<br>-        GetSummaryFormat (const ConstString &type, lldb::TypeSummaryImplSP &entry);<br>-        <br>-        static void<br>-        Add (const ConstString &type, const lldb::TypeSummaryImplSP &entry);<br>-        <br>-        static bool<br>-        Delete (const ConstString &type);<br>-        <br>-        static void<br>-        Clear ();<br>-        <br>-        static void<br>-        LoopThrough (TypeSummaryImpl::SummaryCallback callback, void* callback_baton);<br>-        <br>-        static uint32_t<br>-        GetCount ();<br>-    };<br>-    <br>-    class Categories<br>-    {<br>-    public:<br>-        <br>-        static bool<br>-        GetCategory (const ConstString &category,<br>-                     lldb::TypeCategoryImplSP &entry,<br>-                     bool allow_create = true);<br>-<br>-        static void<br>-        Add (const ConstString &category);<br>-        <br>-        static bool<br>-        Delete (const ConstString &category);<br>-        <br>-        static void<br>-        Clear ();<br>-        <br>-        static void<br>-        Clear (const ConstString &category);<br>-        <br>-        static void<br>-        Enable (const ConstString& category,<br>-                CategoryMap::Position = CategoryMap::Default);<br>-        <br>-        static void<br>-        Disable (const ConstString& category);<br>-<br>-        static void<br>-        Enable (const lldb::TypeCategoryImplSP& category,<br>-                CategoryMap::Position = CategoryMap::Default);<br>-        <br>-        static void<br>-        Disable (const lldb::TypeCategoryImplSP& category);<br>-        <br>-        static void<br>-        LoopThrough (FormatManager::CategoryCallback callback, void* callback_baton);<br>-        <br>-        static uint32_t<br>-        GetCount ();<br>-        <br>-        static lldb::TypeCategoryImplSP<br>-        GetCategoryAtIndex (uint32_t);<br>-    };<br>-};<br>-<br>-    <br>-} // namespace lldb_private<br>-<br>-#endif<span class="Apple-tab-span" style="white-space:pre"> </span>// lldb_DataVisualization_h_<br><br>Modified: lldb/trunk/include/lldb/Core/Debugger.h<br>URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Debugger.h?rev=173728&r1=173727&r2=173728&view=diff">http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Debugger.h?rev=173728&r1=173727&r2=173728&view=diff</a><br>==============================================================================<br>--- lldb/trunk/include/lldb/Core/Debugger.h (original)<br>+++ lldb/trunk/include/lldb/Core/Debugger.h Mon Jan 28 17:47:25 2013<br>@@ -23,13 +23,13 @@<br><br> #include "lldb/Core/Broadcaster.h"<br> #include "lldb/Core/Communication.h"<br>-#include "lldb/Core/FormatManager.h"<br> #include "lldb/Core/InputReaderStack.h"<br> #include "lldb/Core/Listener.h"<br> #include "lldb/Core/StreamFile.h"<br> #include "lldb/Core/SourceManager.h"<br> #include "lldb/Core/UserID.h"<br> #include "lldb/Core/UserSettingsController.h"<br>+#include "lldb/DataFormatters/FormatManager.h"<br> #include "lldb/Host/Terminal.h"<br> #include "lldb/Interpreter/OptionValueProperties.h"<br> #include "lldb/Target/ExecutionContext.h"<br><br>Removed: lldb/trunk/include/lldb/Core/FormatClasses.h<br>URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/FormatClasses.h?rev=173727&view=auto">http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/FormatClasses.h?rev=173727&view=auto</a><br>==============================================================================<br>--- lldb/trunk/include/lldb/Core/FormatClasses.h (original)<br>+++ lldb/trunk/include/lldb/Core/FormatClasses.h (removed)<br>@@ -1,1598 +0,0 @@<br>-//===-- FormatClasses.h -----------------------------------------*- C++ -*-===//<br>-//<br>-//                     The LLVM Compiler Infrastructure<br>-//<br>-// This file is distributed under the University of Illinois Open Source<br>-// License. See LICENSE.TXT for details.<br>-//<br>-//===----------------------------------------------------------------------===//<br>-<br>-#ifndef lldb_FormatClasses_h_<br>-#define lldb_FormatClasses_h_<br>-<br>-// C Includes<br>-#include <stdint.h><br>-#include <unistd.h><br>-<br>-// C++ Includes<br>-#include <string><br>-#include <vector><br>-<br>-// Other libraries and framework includes<br>-<br>-// Project includes<br>-#include "lldb/lldb-public.h"<br>-#include "lldb/lldb-enumerations.h"<br>-<br>-#include "lldb/Core/ValueObject.h"<br>-#include "lldb/Interpreter/ScriptInterpreterPython.h"<br>-#include "lldb/Symbol/Type.h"<br>-<br>-namespace lldb_private {<br>-<br>-class TypeFormatImpl<br>-{<br>-public:<br>-    class Flags<br>-    {<br>-    public:<br>-        <br>-        Flags () :<br>-        m_flags (lldb::eTypeOptionCascade)<br>-        {}<br>-        <br>-        Flags (const Flags& other) :<br>-        m_flags (other.m_flags)<br>-        {}<br>-        <br>-        Flags (uint32_t value) :<br>-        m_flags (value)<br>-        {}<br>-        <br>-        Flags&<br>-        operator = (const Flags& rhs)<br>-        {<br>-            if (&rhs != this)<br>-                m_flags = rhs.m_flags;<br>-            <br>-            return *this;<br>-        }<br>-        <br>-        Flags&<br>-        operator = (const uint32_t& rhs)<br>-        {<br>-            m_flags = rhs;<br>-            return *this;<br>-        }<br>-        <br>-        Flags&<br>-        Clear()<br>-        {<br>-            m_flags = 0;<br>-            return *this;<br>-        }<br>-        <br>-        bool<br>-        GetCascades () const<br>-        {<br>-            return (m_flags & lldb::eTypeOptionCascade) == lldb::eTypeOptionCascade;<br>-        }<br>-        <br>-        Flags&<br>-        SetCascades (bool value = true)<br>-        {<br>-            if (value)<br>-                m_flags |= lldb::eTypeOptionCascade;<br>-            else<br>-                m_flags &= ~lldb::eTypeOptionCascade;<br>-            return *this;<br>-        }<br>-        <br>-        bool<br>-        GetSkipPointers () const<br>-        {<br>-            return (m_flags & lldb::eTypeOptionSkipPointers) == lldb::eTypeOptionSkipPointers;<br>-        }<br>-        <br>-        Flags&<br>-        SetSkipPointers (bool value = true)<br>-        {<br>-            if (value)<br>-                m_flags |= lldb::eTypeOptionSkipPointers;<br>-            else<br>-                m_flags &= ~lldb::eTypeOptionSkipPointers;<br>-            return *this;<br>-        }<br>-        <br>-        bool<br>-        GetSkipReferences () const<br>-        {<br>-            return (m_flags & lldb::eTypeOptionSkipReferences) == lldb::eTypeOptionSkipReferences;<br>-        }<br>-        <br>-        Flags&<br>-        SetSkipReferences (bool value = true)<br>-        {<br>-            if (value)<br>-                m_flags |= lldb::eTypeOptionSkipReferences;<br>-            else<br>-                m_flags &= ~lldb::eTypeOptionSkipReferences;<br>-            return *this;<br>-        }<br>-        <br>-        uint32_t<br>-        GetValue ()<br>-        {<br>-            return m_flags;<br>-        }<br>-        <br>-        void<br>-        SetValue (uint32_t value)<br>-        {<br>-            m_flags = value;<br>-        }<br>-<br>-    private:<br>-        uint32_t m_flags;<br>-    };<br>-    <br>-    TypeFormatImpl (lldb::Format f = lldb::eFormatInvalid,<br>-                 const Flags& flags = Flags());<br>-    <br>-    typedef STD_SHARED_PTR(TypeFormatImpl) SharedPointer;<br>-    typedef bool(*ValueCallback)(void*, ConstString, const lldb::TypeFormatImplSP&);<br>-    <br>-    ~TypeFormatImpl ()<br>-    {<br>-    }<br>-    <br>-    bool<br>-    Cascades () const<br>-    {<br>-        return m_flags.GetCascades();<br>-    }<br>-    bool<br>-    SkipsPointers () const<br>-    {<br>-        return m_flags.GetSkipPointers();<br>-    }<br>-    bool<br>-    SkipsReferences () const<br>-    {<br>-        return m_flags.GetSkipReferences();<br>-    }<br>-    <br>-    void<br>-    SetCascades (bool value)<br>-    {<br>-        m_flags.SetCascades(value);<br>-    }<br>-    <br>-    void<br>-    SetSkipsPointers (bool value)<br>-    {<br>-        m_flags.SetSkipPointers(value);<br>-    }<br>-    <br>-    void<br>-    SetSkipsReferences (bool value)<br>-    {<br>-        m_flags.SetSkipReferences(value);<br>-    }<br>-    <br>-    lldb::Format<br>-    GetFormat () const<br>-    {<br>-        return m_format;<br>-    }<br>-    <br>-    void<br>-    SetFormat (lldb::Format fmt)<br>-    {<br>-        m_format = fmt;<br>-    }<br>-    <br>-    uint32_t<br>-    GetOptions ()<br>-    {<br>-        return m_flags.GetValue();<br>-    }<br>-    <br>-    void<br>-    SetOptions (uint32_t value)<br>-    {<br>-        m_flags.SetValue(value);<br>-    }<br>-    <br>-    uint32_t&<br>-    GetRevision ()<br>-    {<br>-        return m_my_revision;<br>-    }<br>-    <br>-    std::string<br>-    GetDescription();<br>-    <br>-protected:<br>-    Flags m_flags;<br>-    lldb::Format m_format;<br>-    uint32_t m_my_revision;<br>-    <br>-private:<br>-    DISALLOW_COPY_AND_ASSIGN(TypeFormatImpl);<br>-};<br>-<br>-class SyntheticChildrenFrontEnd<br>-{<br>-protected:<br>-    ValueObject &m_backend;<br>-public:<br>-    <br>-    SyntheticChildrenFrontEnd (ValueObject &backend) :<br>-        m_backend(backend)<br>-    {}<br>-    <br>-    virtual<br>-    ~SyntheticChildrenFrontEnd ()<br>-    {<br>-    }<br>-    <br>-    virtual size_t<br>-    CalculateNumChildren () = 0;<br>-    <br>-    virtual lldb::ValueObjectSP<br>-    GetChildAtIndex (size_t idx) = 0;<br>-    <br>-    virtual uint32_t<br>-    GetIndexOfChildWithName (const ConstString &name) = 0;<br>-    <br>-    // this function is assumed to always succeed and it if fails, the front-end should know to deal<br>-    // with it in the correct way (most probably, by refusing to return any children)<br>-    // the return value of Update() should actually be interpreted as "ValueObjectSyntheticFilter cache is good/bad"<br>-    // if =true, ValueObjectSyntheticFilter is allowed to use the children it fetched previously and cached<br>-    // if =false, ValueObjectSyntheticFilter must throw away its cache, and query again for children<br>-    virtual bool<br>-    Update () = 0;<br>-    <br>-    // if this function returns false, then CalculateNumChildren() MUST return 0 since UI frontends<br>-    // might validly decide not to inquire for children given a false return value from this call<br>-    // if it returns true, then CalculateNumChildren() can return any number >= 0 (0 being valid)<br>-    // it should if at all possible be more efficient than CalculateNumChildren()<br>-    virtual bool<br>-    MightHaveChildren () = 0;<br>-    <br>-    typedef STD_SHARED_PTR(SyntheticChildrenFrontEnd) SharedPointer;<br>-    typedef std::auto_ptr<SyntheticChildrenFrontEnd> AutoPointer;<br>-    <br>-private:<br>-    DISALLOW_COPY_AND_ASSIGN(SyntheticChildrenFrontEnd);<br>-};<br>-<br>-class SyntheticChildren<br>-{<br>-public:<br>-    <br>-    class Flags<br>-    {<br>-    public:<br>-        <br>-        Flags () :<br>-        m_flags (lldb::eTypeOptionCascade)<br>-        {}<br>-        <br>-        Flags (const Flags& other) :<br>-        m_flags (other.m_flags)<br>-        {}<br>-        <br>-        Flags (uint32_t value) :<br>-        m_flags (value)<br>-        {}<br>-        <br>-        Flags&<br>-        operator = (const Flags& rhs)<br>-        {<br>-            if (&rhs != this)<br>-                m_flags = rhs.m_flags;<br>-            <br>-            return *this;<br>-        }<br>-        <br>-        Flags&<br>-        operator = (const uint32_t& rhs)<br>-        {<br>-            m_flags = rhs;<br>-            return *this;<br>-        }<br>-        <br>-        Flags&<br>-        Clear()<br>-        {<br>-            m_flags = 0;<br>-            return *this;<br>-        }<br>-        <br>-        bool<br>-        GetCascades () const<br>-        {<br>-            return (m_flags & lldb::eTypeOptionCascade) == lldb::eTypeOptionCascade;<br>-        }<br>-        <br>-        Flags&<br>-        SetCascades (bool value = true)<br>-        {<br>-            if (value)<br>-                m_flags |= lldb::eTypeOptionCascade;<br>-            else<br>-                m_flags &= ~lldb::eTypeOptionCascade;<br>-            return *this;<br>-        }<br>-        <br>-        bool<br>-        GetSkipPointers () const<br>-        {<br>-            return (m_flags & lldb::eTypeOptionSkipPointers) == lldb::eTypeOptionSkipPointers;<br>-        }<br>-        <br>-        Flags&<br>-        SetSkipPointers (bool value = true)<br>-        {<br>-            if (value)<br>-                m_flags |= lldb::eTypeOptionSkipPointers;<br>-            else<br>-                m_flags &= ~lldb::eTypeOptionSkipPointers;<br>-            return *this;<br>-        }<br>-        <br>-        bool<br>-        GetSkipReferences () const<br>-        {<br>-            return (m_flags & lldb::eTypeOptionSkipReferences) == lldb::eTypeOptionSkipReferences;<br>-        }<br>-        <br>-        Flags&<br>-        SetSkipReferences (bool value = true)<br>-        {<br>-            if (value)<br>-                m_flags |= lldb::eTypeOptionSkipReferences;<br>-            else<br>-                m_flags &= ~lldb::eTypeOptionSkipReferences;<br>-            return *this;<br>-        }<br>-        <br>-        uint32_t<br>-        GetValue ()<br>-        {<br>-            return m_flags;<br>-        }<br>-        <br>-        void<br>-        SetValue (uint32_t value)<br>-        {<br>-            m_flags = value;<br>-        }<br>-        <br>-    private:<br>-        uint32_t m_flags;<br>-    };<br>-    <br>-    SyntheticChildren (const Flags& flags) :<br>-        m_flags(flags)<br>-    {<br>-    }<br>-    <br>-    virtual<br>-    ~SyntheticChildren ()<br>-    {<br>-    }<br>-    <br>-    bool<br>-    Cascades () const<br>-    {<br>-        return m_flags.GetCascades();<br>-    }<br>-    bool<br>-    SkipsPointers () const<br>-    {<br>-        return m_flags.GetSkipPointers();<br>-    }<br>-    bool<br>-    SkipsReferences () const<br>-    {<br>-        return m_flags.GetSkipReferences();<br>-    }<br>-    <br>-    void<br>-    SetCascades (bool value)<br>-    {<br>-        m_flags.SetCascades(value);<br>-    }<br>-    <br>-    void<br>-    SetSkipsPointers (bool value)<br>-    {<br>-        m_flags.SetSkipPointers(value);<br>-    }<br>-    <br>-    void<br>-    SetSkipsReferences (bool value)<br>-    {<br>-        m_flags.SetSkipReferences(value);<br>-    }<br>-    <br>-    uint32_t<br>-    GetOptions ()<br>-    {<br>-        return m_flags.GetValue();<br>-    }<br>-    <br>-    void<br>-    SetOptions (uint32_t value)<br>-    {<br>-        m_flags.SetValue(value);<br>-    }<br>-    <br>-    virtual bool<br>-    IsScripted () = 0;<br>-    <br>-    virtual std::string<br>-    GetDescription () = 0;<br>-    <br>-    virtual SyntheticChildrenFrontEnd::AutoPointer<br>-    GetFrontEnd (ValueObject &backend) = 0;<br>-    <br>-    typedef STD_SHARED_PTR(SyntheticChildren) SharedPointer;<br>-    typedef bool(*SyntheticChildrenCallback)(void*, ConstString, const SyntheticChildren::SharedPointer&);<br>-    <br>-    uint32_t&<br>-    GetRevision ()<br>-    {<br>-        return m_my_revision;<br>-    }<br>-    <br>-protected:<br>-    uint32_t m_my_revision;<br>-    Flags m_flags;<br>-    <br>-private:<br>-    DISALLOW_COPY_AND_ASSIGN(SyntheticChildren);<br>-};<br>-<br>-class TypeFilterImpl : public SyntheticChildren<br>-{<br>-    std::vector<std::string> m_expression_paths;<br>-public:<br>-    TypeFilterImpl(const SyntheticChildren::Flags& flags) :<br>-        SyntheticChildren(flags),<br>-        m_expression_paths()<br>-    {<br>-    }<br>-    <br>-    void<br>-    AddExpressionPath (const char* path)<br>-    {<br>-        AddExpressionPath(std::string(path));<br>-    }<br>-        <br>-    void<br>-    Clear()<br>-    {<br>-        m_expression_paths.clear();<br>-    }<br>-    <br>-    size_t<br>-    GetCount() const<br>-    {<br>-        return m_expression_paths.size();<br>-    }<br>-    <br>-    const char*<br>-    GetExpressionPathAtIndex(size_t i) const<br>-    {<br>-        return m_expression_paths[i].c_str();<br>-    }<br>-    <br>-    bool<br>-    SetExpressionPathAtIndex (int i, const char* path)<br>-    {<br>-        return SetExpressionPathAtIndex(i, std::string(path));<br>-    }<br>-    <br>-    void<br>-    AddExpressionPath (std::string path)<br>-    {<br>-        bool need_add_dot = true;<br>-        if (path[0] == '.' ||<br>-            (path[0] == '-' && path[1] == '>') ||<br>-            path[0] == '[')<br>-            need_add_dot = false;<br>-        // add a '.' symbol to help forgetful users<br>-        if(!need_add_dot)<br>-            m_expression_paths.push_back(path);<br>-        else<br>-            m_expression_paths.push_back(std::string(".") + path);<br>-    }<br>-    <br>-    bool<br>-    SetExpressionPathAtIndex (int i, std::string path)<br>-    {<br>-        if (i >= GetCount())<br>-            return false;<br>-        bool need_add_dot = true;<br>-        if (path[0] == '.' ||<br>-            (path[0] == '-' && path[1] == '>') ||<br>-            path[0] == '[')<br>-            need_add_dot = false;<br>-        // add a '.' symbol to help forgetful users<br>-        if(!need_add_dot)<br>-            m_expression_paths[i] = path;<br>-        else<br>-            m_expression_paths[i] = std::string(".") + path;<br>-        return true;<br>-    }<br>-    <br>-    bool<br>-    IsScripted()<br>-    {<br>-        return false;<br>-    }<br>-    <br>-    std::string<br>-    GetDescription();<br>-    <br>-    class FrontEnd : public SyntheticChildrenFrontEnd<br>-    {<br>-    private:<br>-        TypeFilterImpl* filter;<br>-    public:<br>-        <br>-        FrontEnd(TypeFilterImpl* flt,<br>-                 ValueObject &backend) :<br>-        SyntheticChildrenFrontEnd(backend),<br>-        filter(flt)<br>-        {}<br>-        <br>-        virtual<br>-        ~FrontEnd()<br>-        {<br>-        }<br>-        <br>-        virtual size_t<br>-        CalculateNumChildren()<br>-        {<br>-            return filter->GetCount();<br>-        }<br>-        <br>-        virtual lldb::ValueObjectSP<br>-        GetChildAtIndex (size_t idx)<br>-        {<br>-            if (idx >= filter->GetCount())<br>-                return lldb::ValueObjectSP();<br>-            return m_backend.GetSyntheticExpressionPathChild(filter->GetExpressionPathAtIndex(idx), true);<br>-        }<br>-        <br>-        virtual bool<br>-        Update() { return false; }<br>-        <br>-        virtual bool<br>-        MightHaveChildren ()<br>-        {<br>-            return filter->GetCount() > 0;<br>-        }<br>-        <br>-        virtual uint32_t<br>-        GetIndexOfChildWithName (const ConstString &name)<br>-        {<br>-            const char* name_cstr = name.GetCString();<br>-            for (int i = 0; i < filter->GetCount(); i++)<br>-            {<br>-                const char* expr_cstr = filter->GetExpressionPathAtIndex(i);<br>-                if (expr_cstr)<br>-                {<br>-                    if (*expr_cstr == '.')<br>-                        expr_cstr++;<br>-                    else if (*expr_cstr == '-' && *(expr_cstr+1) == '>')<br>-                        expr_cstr += 2;<br>-                }<br>-                if (!::strcmp(name_cstr, expr_cstr))<br>-                    return i;<br>-            }<br>-            return UINT32_MAX;<br>-        }<br>-        <br>-        typedef STD_SHARED_PTR(SyntheticChildrenFrontEnd) SharedPointer;<br>-        <br>-    private:<br>-        DISALLOW_COPY_AND_ASSIGN(FrontEnd);<br>-    };<br>-    <br>-    virtual SyntheticChildrenFrontEnd::AutoPointer<br>-    GetFrontEnd(ValueObject &backend)<br>-    {<br>-        return SyntheticChildrenFrontEnd::AutoPointer(new FrontEnd(this, backend));<br>-    }<br>-    <br>-private:<br>-    DISALLOW_COPY_AND_ASSIGN(TypeFilterImpl);<br>-};<br>-<br>-    class CXXSyntheticChildren : public SyntheticChildren<br>-    {<br>-    public:<br>-        typedef SyntheticChildrenFrontEnd* (*CreateFrontEndCallback) (CXXSyntheticChildren*, lldb::ValueObjectSP);<br>-    protected:<br>-        CreateFrontEndCallback m_create_callback;<br>-        std::string m_description;<br>-    public:<br>-        CXXSyntheticChildren(const SyntheticChildren::Flags& flags,<br>-                             const char* description,<br>-                             CreateFrontEndCallback callback) :<br>-        SyntheticChildren(flags),<br>-        m_create_callback(callback),<br>-        m_description(description ? description : "")<br>-        {<br>-        }<br>-        <br>-        bool<br>-        IsScripted()<br>-        {<br>-            return false;<br>-        }<br>-        <br>-        std::string<br>-        GetDescription();<br>-                <br>-        virtual SyntheticChildrenFrontEnd::AutoPointer<br>-        GetFrontEnd(ValueObject &backend)<br>-        {<br>-            return SyntheticChildrenFrontEnd::AutoPointer(m_create_callback(this, backend.GetSP()));<br>-        }<br>-        <br>-    private:<br>-        DISALLOW_COPY_AND_ASSIGN(CXXSyntheticChildren);<br>-    };<br>-<br>-#ifndef LLDB_DISABLE_PYTHON<br>-<br>-class TypeSyntheticImpl : public SyntheticChildren<br>-{<br>-    std::string m_python_class;<br>-    std::string m_python_code;<br>-public:<br>-    <br>-    TypeSyntheticImpl(const SyntheticChildren::Flags& flags,<br>-                      const char* pclass,<br>-                      const char* pcode = NULL) :<br>-        SyntheticChildren(flags),<br>-        m_python_class(),<br>-        m_python_code()<br>-    {<br>-        if (pclass)<br>-                m_python_class = pclass;<br>-        if (pcode)<br>-                m_python_code = pcode;<br>-    }<br>-<br>-    const char*<br>-    GetPythonClassName()<br>-    {<br>-        return m_python_class.c_str();<br>-    }<br>-<br>-    const char*<br>-    GetPythonCode()<br>-    {<br>-        return m_python_code.c_str();<br>-    }<br>-    <br>-    void<br>-    SetPythonClassName (const char* fname)<br>-    {<br>-        m_python_class.assign(fname);<br>-        m_python_code.clear();<br>-    }<br>-    <br>-    void<br>-    SetPythonCode (const char* script)<br>-    {<br>-        m_python_code.assign(script);<br>-    }<br>-    <br>-    std::string<br>-    GetDescription();<br>-    <br>-    bool<br>-    IsScripted()<br>-    {<br>-        return true;<br>-    }<br>-<br>-    class FrontEnd : public SyntheticChildrenFrontEnd<br>-    {<br>-    private:<br>-        std::string m_python_class;<br>-        lldb::ScriptInterpreterObjectSP m_wrapper_sp;<br>-        ScriptInterpreter *m_interpreter;<br>-    public:<br>-        <br>-        FrontEnd(std::string pclass,<br>-                 ValueObject &backend);<br>-        <br>-        virtual<br>-        ~FrontEnd();<br>-        <br>-        virtual size_t<br>-        CalculateNumChildren()<br>-        {<br>-            if (!m_wrapper_sp || m_interpreter == NULL)<br>-                return 0;<br>-            return m_interpreter->CalculateNumChildren(m_wrapper_sp);<br>-        }<br>-        <br>-        virtual lldb::ValueObjectSP<br>-        GetChildAtIndex (size_t idx);<br>-        <br>-        virtual bool<br>-        Update()<br>-        {<br>-            if (!m_wrapper_sp || m_interpreter == NULL)<br>-                return false;<br>-            <br>-            return m_interpreter->UpdateSynthProviderInstance(m_wrapper_sp);<br>-        }<br>-        <br>-        virtual bool<br>-        MightHaveChildren()<br>-        {<br>-            if (!m_wrapper_sp || m_interpreter == NULL)<br>-                return false;<br>-            <br>-            return m_interpreter->MightHaveChildrenSynthProviderInstance(m_wrapper_sp);<br>-        }<br>-        <br>-        virtual uint32_t<br>-        GetIndexOfChildWithName (const ConstString &name)<br>-        {<br>-            if (!m_wrapper_sp || m_interpreter == NULL)<br>-                return UINT32_MAX;<br>-            return m_interpreter->GetIndexOfChildWithName(m_wrapper_sp, name.GetCString());<br>-        }<br>-        <br>-        typedef STD_SHARED_PTR(SyntheticChildrenFrontEnd) SharedPointer;<br>-<br>-    private:<br>-        DISALLOW_COPY_AND_ASSIGN(FrontEnd);<br>-    };<br>-    <br>-    virtual SyntheticChildrenFrontEnd::AutoPointer<br>-    GetFrontEnd(ValueObject &backend)<br>-    {<br>-        return SyntheticChildrenFrontEnd::AutoPointer(new FrontEnd(m_python_class, backend));<br>-    }    <br>-    <br>-private:<br>-    DISALLOW_COPY_AND_ASSIGN(TypeSyntheticImpl);<br>-};<br>-<br>-#endif // #ifndef LLDB_DISABLE_PYTHON<br>-class SyntheticArrayView : public SyntheticChildren<br>-{<br>-public:<br>-    <br>-    struct SyntheticArrayRange<br>-    {<br>-    private:<br>-        int m_low;<br>-        int m_high;<br>-        SyntheticArrayRange* m_next;<br>-        <br>-    public:<br>-        <br>-        SyntheticArrayRange () : <br>-        m_low(-1),<br>-        m_high(-2),<br>-        m_next(NULL)<br>-        {}<br>-        <br>-        SyntheticArrayRange (int L) : <br>-        m_low(L),<br>-        m_high(L),<br>-        m_next(NULL)<br>-        {}<br>-        <br>-        SyntheticArrayRange (int L, int H) : <br>-        m_low(L),<br>-        m_high(H),<br>-        m_next(NULL)<br>-        {}<br>-        <br>-        SyntheticArrayRange (int L, int H, SyntheticArrayRange* N) : <br>-        m_low(L),<br>-        m_high(H),<br>-        m_next(N)<br>-        {}<br>-        <br>-        inline int<br>-        GetLow ()<br>-        {<br>-            return m_low;<br>-        }<br>-        <br>-        inline int<br>-        GetHigh ()<br>-        {<br>-            return m_high;<br>-        }<br>-        <br>-        inline void<br>-        SetLow (int L)<br>-        {<br>-            m_low = L;<br>-        }<br>-        <br>-        inline void<br>-        SetHigh (int H)<br>-        {<br>-            m_high = H;<br>-        }<br>-        <br>-        inline  int<br>-        GetSelfCount()<br>-        {<br>-            return GetHigh() - GetLow() + 1;<br>-        }<br>-        <br>-        int<br>-        GetCount()<br>-        {<br>-            int count = GetSelfCount();<br>-            if (m_next)<br>-                count += m_next->GetCount();<br>-            return count;<br>-        }<br>-        <br>-        inline SyntheticArrayRange*<br>-        GetNext()<br>-        {<br>-            return m_next;<br>-        }<br>-        <br>-        void<br>-        SetNext(SyntheticArrayRange* N)<br>-        {<br>-            if (m_next)<br>-                delete m_next;<br>-            m_next = N;<br>-        }<br>-        <br>-        void<br>-        SetNext(int L, int H)<br>-        {<br>-            if (m_next)<br>-                delete m_next;<br>-            m_next = new SyntheticArrayRange(L, H);<br>-        }<br>-        <br>-        void<br>-        SetNext(int L)<br>-        {<br>-            if (m_next)<br>-                delete m_next;<br>-            m_next = new SyntheticArrayRange(L);<br>-        }<br>-        <br>-        ~SyntheticArrayRange()<br>-        {<br>-            delete m_next;<br>-            m_next = NULL;<br>-        }<br>-        <br>-    };<br>-    <br>-    SyntheticArrayView(const SyntheticChildren::Flags& flags) :<br>-        SyntheticChildren(flags),<br>-        m_head(),<br>-        m_tail(&m_head)<br>-    {<br>-    }<br>-    <br>-    void<br>-    AddRange(int L, int H)<br>-    {<br>-        m_tail->SetLow(L);<br>-        m_tail->SetHigh(H);<br>-        m_tail->SetNext(new SyntheticArrayRange());<br>-        m_tail = m_tail->GetNext();<br>-    }<br>-    <br>-    int<br>-    GetCount()<br>-    {<br>-        return m_head.GetCount();<br>-    }<br>-    <br>-    int<br>-    GetRealIndexForIndex(size_t i);<br>-    <br>-    bool<br>-    IsScripted()<br>-    {<br>-        return false;<br>-    }<br>-    <br>-    std::string<br>-    GetDescription();<br>-    <br>-    class FrontEnd : public SyntheticChildrenFrontEnd<br>-    {<br>-    private:<br>-        SyntheticArrayView* filter;<br>-    public:<br>-        <br>-        FrontEnd(SyntheticArrayView* flt,<br>-                 ValueObject &backend) :<br>-        SyntheticChildrenFrontEnd(backend),<br>-        filter(flt)<br>-        {}<br>-        <br>-        virtual<br>-        ~FrontEnd()<br>-        {<br>-        }<br>-        <br>-        virtual size_t<br>-        CalculateNumChildren()<br>-        {<br>-            return filter->GetCount();<br>-        }<br>-        <br>-        virtual bool<br>-        MightHaveChildren ()<br>-        {<br>-            return filter->GetCount() > 0;<br>-        }<br>-        <br>-        virtual lldb::ValueObjectSP<br>-        GetChildAtIndex (size_t idx)<br>-        {<br>-            if (idx >= filter->GetCount())<br>-                return lldb::ValueObjectSP();<br>-            return m_backend.GetSyntheticArrayMember(filter->GetRealIndexForIndex(idx), true);<br>-        }<br>-        <br>-        virtual bool<br>-        Update() { return false; }<br>-        <br>-        virtual uint32_t<br>-        GetIndexOfChildWithName (const ConstString &name_cs);<br>-        <br>-        typedef STD_SHARED_PTR(SyntheticChildrenFrontEnd) SharedPointer;<br>-    <br>-    private:<br>-        DISALLOW_COPY_AND_ASSIGN(FrontEnd);<br>-    };<br>-    <br>-    virtual SyntheticChildrenFrontEnd::AutoPointer<br>-    GetFrontEnd(ValueObject &backend)<br>-    {<br>-        return SyntheticChildrenFrontEnd::AutoPointer(new FrontEnd(this, backend));<br>-    }<br>-private:<br>-    SyntheticArrayRange m_head;<br>-    SyntheticArrayRange *m_tail;<br>-<br>-private:<br>-    DISALLOW_COPY_AND_ASSIGN(SyntheticArrayView);<br>-};<br>-<br>-<br>-class TypeSummaryImpl<br>-{<br>-public:<br>-    class Flags<br>-    {<br>-    public:<br>-        <br>-        Flags () :<br>-            m_flags (lldb::eTypeOptionCascade)<br>-        {}<br>-        <br>-        Flags (const Flags& other) :<br>-            m_flags (other.m_flags)<br>-        {}<br>-        <br>-        Flags (uint32_t value) :<br>-            m_flags (value)<br>-        {}<br>-        <br>-        Flags&<br>-        operator = (const Flags& rhs)<br>-        {<br>-            if (&rhs != this)<br>-                m_flags = rhs.m_flags;<br>-            <br>-            return *this;<br>-        }<br>-        <br>-        Flags&<br>-        operator = (const uint32_t& rhs)<br>-        {<br>-            m_flags = rhs;<br>-            return *this;<br>-        }<br>-        <br>-        Flags&<br>-        Clear()<br>-        {<br>-            m_flags = 0;<br>-            return *this;<br>-        }<br>-        <br>-        bool<br>-        GetCascades () const<br>-        {<br>-            return (m_flags & lldb::eTypeOptionCascade) == lldb::eTypeOptionCascade;<br>-        }<br>-        <br>-        Flags&<br>-        SetCascades (bool value = true)<br>-        {<br>-            if (value)<br>-                m_flags |= lldb::eTypeOptionCascade;<br>-            else<br>-                m_flags &= ~lldb::eTypeOptionCascade;<br>-            return *this;<br>-        }<br>-<br>-        bool<br>-        GetSkipPointers () const<br>-        {<br>-            return (m_flags & lldb::eTypeOptionSkipPointers) == lldb::eTypeOptionSkipPointers;<br>-        }<br>-<br>-        Flags&<br>-        SetSkipPointers (bool value = true)<br>-        {<br>-            if (value)<br>-                m_flags |= lldb::eTypeOptionSkipPointers;<br>-            else<br>-                m_flags &= ~lldb::eTypeOptionSkipPointers;<br>-            return *this;<br>-        }<br>-        <br>-        bool<br>-        GetSkipReferences () const<br>-        {<br>-            return (m_flags & lldb::eTypeOptionSkipReferences) == lldb::eTypeOptionSkipReferences;<br>-        }<br>-        <br>-        Flags&<br>-        SetSkipReferences (bool value = true)<br>-        {<br>-            if (value)<br>-                m_flags |= lldb::eTypeOptionSkipReferences;<br>-            else<br>-                m_flags &= ~lldb::eTypeOptionSkipReferences;<br>-            return *this;<br>-        }<br>-        <br>-        bool<br>-        GetDontShowChildren () const<br>-        {<br>-            return (m_flags & lldb::eTypeOptionHideChildren) == lldb::eTypeOptionHideChildren;<br>-        }<br>-        <br>-        Flags&<br>-        SetDontShowChildren (bool value = true)<br>-        {<br>-            if (value)<br>-                m_flags |= lldb::eTypeOptionHideChildren;<br>-            else<br>-                m_flags &= ~lldb::eTypeOptionHideChildren;<br>-            return *this;<br>-        }<br>-        <br>-        bool<br>-        GetDontShowValue () const<br>-        {<br>-            return (m_flags & lldb::eTypeOptionHideValue) == lldb::eTypeOptionHideValue;<br>-        }<br>-        <br>-        Flags&<br>-        SetDontShowValue (bool value = true)<br>-        {<br>-            if (value)<br>-                m_flags |= lldb::eTypeOptionHideValue;<br>-            else<br>-                m_flags &= ~lldb::eTypeOptionHideValue;<br>-            return *this;<br>-        }<br>-        <br>-        bool<br>-        GetShowMembersOneLiner () const<br>-        {<br>-            return (m_flags & lldb::eTypeOptionShowOneLiner) == lldb::eTypeOptionShowOneLiner;<br>-        }<br>-        <br>-        Flags&<br>-        SetShowMembersOneLiner (bool value = true)<br>-        {<br>-            if (value)<br>-                m_flags |= lldb::eTypeOptionShowOneLiner;<br>-            else<br>-                m_flags &= ~lldb::eTypeOptionShowOneLiner;<br>-            return *this;<br>-        }<br>-        <br>-        bool<br>-        GetHideItemNames () const<br>-        {<br>-            return (m_flags & lldb::eTypeOptionHideNames) == lldb::eTypeOptionHideNames;<br>-        }<br>-        <br>-        Flags&<br>-        SetHideItemNames (bool value = true)<br>-        {<br>-            if (value)<br>-                m_flags |= lldb::eTypeOptionHideNames;<br>-            else<br>-                m_flags &= ~lldb::eTypeOptionHideNames;<br>-            return *this;<br>-        }<br>-        <br>-        uint32_t<br>-        GetValue ()<br>-        {<br>-            return m_flags;<br>-        }<br>-        <br>-        void<br>-        SetValue (uint32_t value)<br>-        {<br>-            m_flags = value;<br>-        }<br>-                <br>-    private:<br>-        uint32_t m_flags;<br>-    };<br>-    <br>-    typedef enum Type<br>-    {<br>-        eTypeUnknown,<br>-        eTypeString,<br>-        eTypeScript,<br>-        eTypeCallback<br>-    } Type;<br>-    <br>-    TypeSummaryImpl (const TypeSummaryImpl::Flags& flags);<br>-    <br>-    bool<br>-    Cascades () const<br>-    {<br>-        return m_flags.GetCascades();<br>-    }<br>-    bool<br>-    SkipsPointers () const<br>-    {<br>-        return m_flags.GetSkipPointers();<br>-    }<br>-    bool<br>-    SkipsReferences () const<br>-    {<br>-        return m_flags.GetSkipReferences();<br>-    }<br>-    <br>-    bool<br>-    DoesPrintChildren () const<br>-    {<br>-        return !m_flags.GetDontShowChildren();<br>-    }<br>-    <br>-    bool<br>-    DoesPrintValue () const<br>-    {<br>-        return !m_flags.GetDontShowValue();<br>-    }<br>-    <br>-    bool<br>-    IsOneliner () const<br>-    {<br>-        return m_flags.GetShowMembersOneLiner();<br>-    }<br>-    <br>-    bool<br>-    HideNames () const<br>-    {<br>-        return m_flags.GetHideItemNames();<br>-    }<br>-    <br>-    void<br>-    SetCascades (bool value)<br>-    {<br>-        m_flags.SetCascades(value);<br>-    }<br>-    <br>-    void<br>-    SetSkipsPointers (bool value)<br>-    {<br>-        m_flags.SetSkipPointers(value);<br>-    }<br>-    <br>-    void<br>-    SetSkipsReferences (bool value)<br>-    {<br>-        m_flags.SetSkipReferences(value);<br>-    }<br>-    <br>-    void<br>-    SetDoesPrintChildren (bool value)<br>-    {<br>-        m_flags.SetDontShowChildren(!value);<br>-    }<br>-    <br>-    void<br>-    SetDoesPrintValue (bool value)<br>-    {<br>-        m_flags.SetDontShowValue(!value);<br>-    }<br>-    <br>-    void<br>-    SetIsOneliner (bool value)<br>-    {<br>-        m_flags.SetShowMembersOneLiner(value);<br>-    }<br>-    <br>-    void<br>-    SetHideNames (bool value)<br>-    {<br>-        m_flags.SetHideItemNames(value);<br>-    }<br>-    <br>-    uint32_t<br>-    GetOptions ()<br>-    {<br>-        return m_flags.GetValue();<br>-    }<br>-    <br>-    void<br>-    SetOptions (uint32_t value)<br>-    {<br>-        m_flags.SetValue(value);<br>-    }<br>-    <br>-    virtual<br>-    ~TypeSummaryImpl ()<br>-    {<br>-    }<br>-    <br>-    // we are using a ValueObject* instead of a ValueObjectSP because we do not need to hold on to this for<br>-    // extended periods of time and we trust the ValueObject to stay around for as long as it is required<br>-    // for us to generate its summary<br>-    virtual bool<br>-    FormatObject (ValueObject *valobj,<br>-                  std::string& dest) = 0;<br>-    <br>-    virtual std::string<br>-    GetDescription () = 0;<br>-    <br>-    virtual bool<br>-    IsScripted() = 0;<br>-    <br>-    virtual Type<br>-    GetType () = 0;<br>-    <br>-    uint32_t&<br>-    GetRevision ()<br>-    {<br>-        return m_my_revision;<br>-    }<br>-    <br>-    typedef STD_SHARED_PTR(TypeSummaryImpl) SharedPointer;<br>-    typedef bool(*SummaryCallback)(void*, ConstString, const lldb::TypeSummaryImplSP&);<br>-    typedef bool(*RegexSummaryCallback)(void*, lldb::RegularExpressionSP, const lldb::TypeSummaryImplSP&);<br>-<br>-protected:<br>-    uint32_t m_my_revision;<br>-    Flags m_flags;<br>-    <br>-private:<br>-    DISALLOW_COPY_AND_ASSIGN(TypeSummaryImpl);<br>-};<br>-<br>-// simple string-based summaries, using ${var to show data<br>-struct StringSummaryFormat : public TypeSummaryImpl<br>-{<br>-    std::string m_format;<br>-    <br>-    StringSummaryFormat(const TypeSummaryImpl::Flags& flags,<br>-                        const char* f);<br>-    <br>-    const char*<br>-    GetSummaryString () const<br>-    {<br>-        return m_format.c_str();<br>-    }<br>-    <br>-    void<br>-    SetSummaryString (const char* data)<br>-    {<br>-        if (data)<br>-                m_format.assign(data);<br>-        else<br>-                m_format.clear();<br>-    }<br>-    <br>-    virtual<br>-    ~StringSummaryFormat()<br>-    {<br>-    }<br>-    <br>-    virtual bool<br>-    FormatObject(ValueObject *valobj,<br>-                 std::string& dest);<br>-    <br>-    virtual std::string<br>-    GetDescription();<br>-    <br>-    virtual bool<br>-    IsScripted()<br>-    {<br>-        return false;<br>-    }<br>-<br>-    <br>-    virtual Type<br>-    GetType ()<br>-    {<br>-        return TypeSummaryImpl::eTypeString;<br>-    }<br>-    <br>-private:<br>-    DISALLOW_COPY_AND_ASSIGN(StringSummaryFormat);<br>-};<br>-<br>-// summaries implemented via a C++ function<br>-struct CXXFunctionSummaryFormat : public TypeSummaryImpl<br>-{<br>-    <br>-    // we should convert these to SBValue and SBStream if we ever cross<br>-    // the boundary towards the external world<br>-    typedef bool (*Callback)(ValueObject& valobj,<br>-                             Stream& dest);<br>-    <br>-    <br>-    Callback m_impl;<br>-    std::string m_description;<br>-    <br>-    CXXFunctionSummaryFormat(const TypeSummaryImpl::Flags& flags,<br>-                             Callback impl,<br>-                             const char* description);<br>-    <br>-    Callback<br>-    GetBackendFunction () const<br>-    {<br>-        return m_impl;<br>-    }<br>-    <br>-    const char*<br>-    GetTextualInfo () const<br>-    {<br>-        return m_description.c_str();<br>-    }<br>-    <br>-    void<br>-    SetBackendFunction (Callback cb_func)<br>-    {<br>-        m_impl = cb_func;<br>-    }<br>-    <br>-    void<br>-    SetTextualInfo (const char* descr)<br>-    {<br>-        if (descr)<br>-            m_description.assign(descr);<br>-        else<br>-            m_description.clear();<br>-    }<br>-    <br>-    virtual<br>-    ~CXXFunctionSummaryFormat()<br>-    {<br>-    }<br>-    <br>-    virtual bool<br>-    FormatObject(ValueObject *valobj,<br>-                 std::string& dest);<br>-    <br>-    virtual std::string<br>-    GetDescription();<br>-    <br>-    virtual bool<br>-    IsScripted()<br>-    {<br>-        return false;<br>-    }<br>-    <br>-    virtual Type<br>-    GetType ()<br>-    {<br>-        return TypeSummaryImpl::eTypeCallback;<br>-    }<br>-    <br>-    typedef STD_SHARED_PTR(CXXFunctionSummaryFormat) SharedPointer;<br>-<br>-private:<br>-    DISALLOW_COPY_AND_ASSIGN(CXXFunctionSummaryFormat);<br>-};<br>-    <br>-#ifndef LLDB_DISABLE_PYTHON<br>-<br>-// Python-based summaries, running script code to show data<br>-struct ScriptSummaryFormat : public TypeSummaryImpl<br>-{<br>-    std::string m_function_name;<br>-    std::string m_python_script;<br>-    lldb::ScriptInterpreterObjectSP m_script_function_sp;<br>-    <br>-    ScriptSummaryFormat(const TypeSummaryImpl::Flags& flags,<br>-                        const char *function_name,<br>-                        const char* python_script = NULL);<br>-    <br>-    const char*<br>-    GetFunctionName () const<br>-    {<br>-        return m_function_name.c_str();<br>-    }<br>-    <br>-    const char*<br>-    GetPythonScript () const<br>-    {<br>-        return m_python_script.c_str();<br>-    }<br>-    <br>-    void<br>-    SetFunctionName (const char* function_name)<br>-    {<br>-        if (function_name)<br>-                m_function_name.assign(function_name);<br>-        else<br>-                m_function_name.clear();<br>-        m_python_script.clear();<br>-    }<br>-    <br>-    void<br>-    SetPythonScript (const char* script)<br>-    {<br>-        if (script)<br>-                m_python_script.assign(script);<br>-        else<br>-                m_python_script.clear();<br>-    }<br>-    <br>-    virtual<br>-    ~ScriptSummaryFormat()<br>-    {<br>-    }<br>-    <br>-    virtual bool<br>-    FormatObject(ValueObject *valobj,<br>-                 std::string& dest);<br>-    <br>-    virtual std::string<br>-    GetDescription();<br>-    <br>-    virtual bool<br>-    IsScripted()<br>-    {<br>-        return true;<br>-    }<br>-    <br>-    virtual Type<br>-    GetType ()<br>-    {<br>-        return TypeSummaryImpl::eTypeScript;<br>-    }<br>-    <br>-    typedef STD_SHARED_PTR(ScriptSummaryFormat) SharedPointer;<br>-<br>-    <br>-private:<br>-    DISALLOW_COPY_AND_ASSIGN(ScriptSummaryFormat);<br>-};<br>-<br>-#endif // #ifndef LLDB_DISABLE_PYTHON<br>-<br>-// TODO: at the moment, this class is only used as a backing store for SBTypeNameSpecifier in the public API<br>-// In the future, this might be used as the basic unit for typename-to-formatter matching, replacing<br>-// the current plain/regexp distinction in FormatNavigator<><br>-class TypeNameSpecifierImpl<br>-{<br>-public:<br>-    <br>-    TypeNameSpecifierImpl() :<br>-    m_is_regex(false),<br>-    m_type()<br>-    {<br>-    }<br>-    <br>-    TypeNameSpecifierImpl (const char* name, bool is_regex) :<br>-    m_is_regex(is_regex),<br>-    m_type()<br>-    {<br>-        if (name)<br>-            m_type.m_type_name.assign(name);<br>-    }<br>-    <br>-    // if constructing with a given type, is_regex cannot be true since we are<br>-    // giving an exact type to match<br>-    TypeNameSpecifierImpl (lldb::TypeSP type) :<br>-    m_is_regex(false),<br>-    m_type()<br>-    {<br>-        if (type)<br>-        {<br>-            m_type.m_type_name.assign(type->GetName().GetCString());<br>-            m_type.m_typeimpl_sp = lldb::TypeImplSP(new TypeImpl(type));<br>-        }<br>-    }<br>-<br>-    TypeNameSpecifierImpl (ClangASTType type) :<br>-    m_is_regex(false),<br>-    m_type()<br>-    {<br>-        if (type.IsValid())<br>-        {<br>-            m_type.m_type_name.assign(type.GetConstTypeName().GetCString());<br>-            m_type.m_typeimpl_sp = lldb::TypeImplSP(new TypeImpl(type));<br>-        }<br>-    }<br>-    <br>-    const char*<br>-    GetName()<br>-    {<br>-        if (m_type.m_type_name.size())<br>-            return m_type.m_type_name.c_str();<br>-        return NULL;<br>-    }<br>-    <br>-    lldb::TypeSP<br>-    GetTypeSP ()<br>-    {<br>-        if (m_type.m_typeimpl_sp && m_type.m_typeimpl_sp->IsValid())<br>-            return m_type.m_typeimpl_sp->GetTypeSP();<br>-        return lldb::TypeSP();<br>-    }<br>-    <br>-    ClangASTType<br>-    GetClangASTType ()<br>-    {<br>-        if (m_type.m_typeimpl_sp && m_type.m_typeimpl_sp->IsValid())<br>-            return m_type.m_typeimpl_sp->GetClangASTType();<br>-        return ClangASTType();<br>-    }<br>-    <br>-    bool<br>-    IsRegex()<br>-    {<br>-        return m_is_regex;<br>-    }<br>-    <br>-private:<br>-    bool m_is_regex;<br>-    // this works better than TypeAndOrName because the latter only wraps a TypeSP<br>-    // whereas TypeImplSP can also be backed by a ClangASTType which is more commonly<br>-    // used in LLDB. moreover, TypeImplSP is also what is currently backing SBType<br>-    struct TypeOrName<br>-    {<br>-        std::string m_type_name;<br>-        lldb::TypeImplSP m_typeimpl_sp;<br>-    };<br>-    TypeOrName m_type;<br>-    <br>-    <br>-private:<br>-    DISALLOW_COPY_AND_ASSIGN(TypeNameSpecifierImpl);<br>-};<br>-    <br>-} // namespace lldb_private<br>-<br>-#endif<span class="Apple-tab-span" style="white-space:pre"> </span>// lldb_FormatClasses_h_<br><br>Removed: lldb/trunk/include/lldb/Core/FormatManager.h<br>URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/FormatManager.h?rev=173727&view=auto">http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/FormatManager.h?rev=173727&view=auto</a><br>==============================================================================<br>--- lldb/trunk/include/lldb/Core/FormatManager.h (original)<br>+++ lldb/trunk/include/lldb/Core/FormatManager.h (removed)<br>@@ -1,776 +0,0 @@<br>-//===-- FormatManager.h -------------------------------------------*- C++ -*-===//<br>-//<br>-//                     The LLVM Compiler Infrastructure<br>-//<br>-// This file is distributed under the University of Illinois Open Source<br>-// License. See LICENSE.TXT for details.<br>-//<br>-//===----------------------------------------------------------------------===//<br>-<br>-#ifndef lldb_FormatManager_h_<br>-#define lldb_FormatManager_h_<br>-<br>-// C Includes<br>-// C++ Includes<br>-<br>-// Other libraries and framework includes<br>-// Project includes<br>-#include "lldb/lldb-public.h"<br>-#include "lldb/lldb-enumerations.h"<br>-<br>-#include "lldb/Core/FormatNavigator.h"<br>-#include "lldb/Interpreter/ScriptInterpreterPython.h"<br>-#include "lldb/Target/ExecutionContext.h"<br>-#include "lldb/Target/Platform.h"<br>-<br>-using lldb::LogSP;<br>-<br>-namespace lldb_private {<br>-    <br>-// this file (and its. cpp) contain the low-level implementation of LLDB Data Visualization<br>-// class DataVisualization is the high-level front-end of this feature<br>-// clients should refer to that class as the entry-point into the data formatters<br>-// unless they have a good reason to bypass it and prefer to use this file's objects directly<br>-    <br>-class CategoryMap;<br>-    <br>-class TypeCategoryImpl<br>-{<br>-private:<br>-    <br>-    typedef FormatNavigator<ConstString, TypeSummaryImpl> SummaryNavigator;<br>-    typedef FormatNavigator<lldb::RegularExpressionSP, TypeSummaryImpl> RegexSummaryNavigator;<br>-    <br>-    typedef FormatNavigator<ConstString, TypeFilterImpl> FilterNavigator;<br>-    typedef FormatNavigator<lldb::RegularExpressionSP, TypeFilterImpl> RegexFilterNavigator;<br>-    <br>-#ifndef LLDB_DISABLE_PYTHON<br>-    typedef FormatNavigator<ConstString, TypeSyntheticImpl> SynthNavigator;<br>-    typedef FormatNavigator<lldb::RegularExpressionSP, TypeSyntheticImpl> RegexSynthNavigator;<br>-#endif // #ifndef LLDB_DISABLE_PYTHON<br>-<br>-    typedef SummaryNavigator::MapType SummaryMap;<br>-    typedef RegexSummaryNavigator::MapType RegexSummaryMap;<br>-    typedef FilterNavigator::MapType FilterMap;<br>-    typedef RegexFilterNavigator::MapType RegexFilterMap;<br>-#ifndef LLDB_DISABLE_PYTHON<br>-    typedef SynthNavigator::MapType SynthMap;<br>-    typedef RegexSynthNavigator::MapType RegexSynthMap;<br>-#endif // #ifndef LLDB_DISABLE_PYTHON<br>-<br>-public:<br>-        <br>-    typedef uint16_t FormatCategoryItems;<br>-    static const uint16_t ALL_ITEM_TYPES = UINT16_MAX;<br>-    <br>-    typedef SummaryNavigator::SharedPointer SummaryNavigatorSP;<br>-    typedef RegexSummaryNavigator::SharedPointer RegexSummaryNavigatorSP;<br>-    typedef FilterNavigator::SharedPointer FilterNavigatorSP;<br>-    typedef RegexFilterNavigator::SharedPointer RegexFilterNavigatorSP;<br>-#ifndef LLDB_DISABLE_PYTHON<br>-    typedef SynthNavigator::SharedPointer SynthNavigatorSP;<br>-    typedef RegexSynthNavigator::SharedPointer RegexSynthNavigatorSP;<br>-#endif // #ifndef LLDB_DISABLE_PYTHON<br>-<br>-    TypeCategoryImpl (IFormatChangeListener* clist,<br>-                      ConstString name);<br>-    <br>-    SummaryNavigatorSP<br>-    GetSummaryNavigator ()<br>-    {<br>-        return SummaryNavigatorSP(m_summary_nav);<br>-    }<br>-    <br>-    RegexSummaryNavigatorSP<br>-    GetRegexSummaryNavigator ()<br>-    {<br>-        return RegexSummaryNavigatorSP(m_regex_summary_nav);<br>-    }<br>-    <br>-    FilterNavigatorSP<br>-    GetFilterNavigator ()<br>-    {<br>-        return FilterNavigatorSP(m_filter_nav);<br>-    }<br>-    <br>-    RegexFilterNavigatorSP<br>-    GetRegexFilterNavigator ()<br>-    {<br>-        return RegexFilterNavigatorSP(m_regex_filter_nav);<br>-    }<br>-    <br>-    SummaryNavigator::MapValueType<br>-    GetSummaryForType (lldb::TypeNameSpecifierImplSP type_sp)<br>-    {<br>-        SummaryNavigator::MapValueType retval;<br>-        <br>-        if (type_sp)<br>-        {<br>-            if (type_sp->IsRegex())<br>-                m_regex_summary_nav->GetExact(ConstString(type_sp->GetName()),retval);<br>-            else<br>-                m_summary_nav->GetExact(ConstString(type_sp->GetName()),retval);<br>-        }<br>-<br>-        return retval;<br>-    }<br>-    <br>-    FilterNavigator::MapValueType<br>-    GetFilterForType (lldb::TypeNameSpecifierImplSP type_sp)<br>-    {<br>-        FilterNavigator::MapValueType retval;<br>-        <br>-        if (type_sp)<br>-        {<br>-            if (type_sp->IsRegex())<br>-                m_regex_filter_nav->GetExact(ConstString(type_sp->GetName()),retval);<br>-            else<br>-                m_filter_nav->GetExact(ConstString(type_sp->GetName()),retval);<br>-        }<br>-        <br>-        return retval;<br>-    }<br>-    <br>-#ifndef LLDB_DISABLE_PYTHON<br>-    SynthNavigator::MapValueType<br>-    GetSyntheticForType (lldb::TypeNameSpecifierImplSP type_sp)<br>-    {<br>-        SynthNavigator::MapValueType retval;<br>-        <br>-        if (type_sp)<br>-        {<br>-            if (type_sp->IsRegex())<br>-                m_regex_synth_nav->GetExact(ConstString(type_sp->GetName()),retval);<br>-            else<br>-                m_synth_nav->GetExact(ConstString(type_sp->GetName()),retval);<br>-        }<br>-        <br>-        return retval;<br>-    }<br>-#endif<br>-    <br>-    lldb::TypeNameSpecifierImplSP<br>-    GetTypeNameSpecifierForSummaryAtIndex (size_t index)<br>-    {<br>-        if (index < m_summary_nav->GetCount())<br>-            return m_summary_nav->GetTypeNameSpecifierAtIndex(index);<br>-        else<br>-            return m_regex_summary_nav->GetTypeNameSpecifierAtIndex(index-m_summary_nav->GetCount());<br>-    }<br>-    <br>-    SummaryNavigator::MapValueType<br>-    GetSummaryAtIndex (size_t index)<br>-    {<br>-        if (index < m_summary_nav->GetCount())<br>-            return m_summary_nav->GetAtIndex(index);<br>-        else<br>-            return m_regex_summary_nav->GetAtIndex(index-m_summary_nav->GetCount());<br>-    }<br>-<br>-    FilterNavigator::MapValueType<br>-    GetFilterAtIndex (size_t index)<br>-    {<br>-        if (index < m_filter_nav->GetCount())<br>-            return m_filter_nav->GetAtIndex(index);<br>-        else<br>-            return m_regex_filter_nav->GetAtIndex(index-m_filter_nav->GetCount());<br>-    }<br>-    <br>-    lldb::TypeNameSpecifierImplSP<br>-    GetTypeNameSpecifierForFilterAtIndex (size_t index)<br>-    {<br>-        if (index < m_filter_nav->GetCount())<br>-            return m_filter_nav->GetTypeNameSpecifierAtIndex(index);<br>-        else<br>-            return m_regex_filter_nav->GetTypeNameSpecifierAtIndex(index-m_filter_nav->GetCount());<br>-    }<br>-<br>-#ifndef LLDB_DISABLE_PYTHON<br>-    SynthNavigatorSP<br>-    GetSyntheticNavigator ()<br>-    {<br>-        return SynthNavigatorSP(m_synth_nav);<br>-    }<br>-    <br>-    RegexSynthNavigatorSP<br>-    GetRegexSyntheticNavigator ()<br>-    {<br>-        return RegexSynthNavigatorSP(m_regex_synth_nav);<br>-    }<br>-    <br>-    SynthNavigator::MapValueType<br>-    GetSyntheticAtIndex (size_t index)<br>-    {<br>-        if (index < m_synth_nav->GetCount())<br>-            return m_synth_nav->GetAtIndex(index);<br>-        else<br>-            return m_regex_synth_nav->GetAtIndex(index-m_synth_nav->GetCount());<br>-    }<br>-    <br>-    lldb::TypeNameSpecifierImplSP<br>-    GetTypeNameSpecifierForSyntheticAtIndex (size_t index)<br>-    {<br>-        if (index < m_synth_nav->GetCount())<br>-            return m_synth_nav->GetTypeNameSpecifierAtIndex(index);<br>-        else<br>-            return m_regex_synth_nav->GetTypeNameSpecifierAtIndex(index - m_synth_nav->GetCount());<br>-    }<br>-    <br>-#endif // #ifndef LLDB_DISABLE_PYTHON<br>-<br>-    bool<br>-    IsEnabled () const<br>-    {<br>-        return m_enabled;<br>-    }<br>-    <br>-    uint32_t<br>-    GetEnabledPosition()<br>-    {<br>-        if (m_enabled == false)<br>-            return UINT32_MAX;<br>-        else<br>-            return m_enabled_position;<br>-    }<br>-    <br>-    bool<br>-    Get (ValueObject& valobj,<br>-         lldb::TypeSummaryImplSP& entry,<br>-         lldb::DynamicValueType use_dynamic,<br>-         uint32_t* reason = NULL);<br>-    <br>-    bool<br>-    Get (ValueObject& valobj,<br>-         lldb::SyntheticChildrenSP& entry,<br>-         lldb::DynamicValueType use_dynamic,<br>-         uint32_t* reason = NULL);<br>-        <br>-    void<br>-    Clear (FormatCategoryItems items = ALL_ITEM_TYPES);<br>-    <br>-    bool<br>-    Delete (ConstString name,<br>-            FormatCategoryItems items = ALL_ITEM_TYPES);<br>-    <br>-    uint32_t<br>-    GetCount (FormatCategoryItems items = ALL_ITEM_TYPES);<br>-    <br>-    const char*<br>-    GetName ()<br>-    {<br>-        return m_name.GetCString();<br>-    }<br>-    <br>-    bool<br>-    AnyMatches (ConstString type_name,<br>-                FormatCategoryItems items = ALL_ITEM_TYPES,<br>-                bool only_enabled = true,<br>-                const char** matching_category = NULL,<br>-                FormatCategoryItems* matching_type = NULL);<br>-    <br>-    typedef STD_SHARED_PTR(TypeCategoryImpl) SharedPointer;<br>-    <br>-private:<br>-    SummaryNavigator::SharedPointer m_summary_nav;<br>-    RegexSummaryNavigator::SharedPointer m_regex_summary_nav;<br>-    FilterNavigator::SharedPointer m_filter_nav;<br>-    RegexFilterNavigator::SharedPointer m_regex_filter_nav;<br>-#ifndef LLDB_DISABLE_PYTHON<br>-    SynthNavigator::SharedPointer m_synth_nav;<br>-    RegexSynthNavigator::SharedPointer m_regex_synth_nav;<br>-#endif // #ifndef LLDB_DISABLE_PYTHON<br>-    <br>-    bool m_enabled;<br>-    <br>-    IFormatChangeListener* m_change_listener;<br>-    <br>-    Mutex m_mutex;<br>-    <br>-    ConstString m_name;<br>-    <br>-    uint32_t m_enabled_position;<br>-    <br>-    void<br>-    Enable (bool value,<br>-            uint32_t position)<br>-    {<br>-        Mutex::Locker locker(m_mutex);<br>-        m_enabled = value;<br>-        m_enabled_position = position;<br>-        if (m_change_listener)<br>-            m_change_listener->Changed();<br>-    }<br>-    <br>-    void<br>-    Disable ()<br>-    {<br>-        Enable(false, UINT32_MAX);<br>-    }<br>-    <br>-    friend class CategoryMap;<br>-    <br>-    friend class FormatNavigator<ConstString, TypeSummaryImpl>;<br>-    friend class FormatNavigator<lldb::RegularExpressionSP, TypeSummaryImpl>;<br>-    <br>-    friend class FormatNavigator<ConstString, TypeFilterImpl>;<br>-    friend class FormatNavigator<lldb::RegularExpressionSP, TypeFilterImpl>;<br>-    <br>-#ifndef LLDB_DISABLE_PYTHON<br>-    friend class FormatNavigator<ConstString, TypeSyntheticImpl>;<br>-    friend class FormatNavigator<lldb::RegularExpressionSP, TypeSyntheticImpl>;<br>-#endif // #ifndef LLDB_DISABLE_PYTHON<br>-    <br>-<br>-};<br>-<br>-class CategoryMap<br>-{<br>-private:<br>-    typedef ConstString KeyType;<br>-    typedef TypeCategoryImpl ValueType;<br>-    typedef ValueType::SharedPointer ValueSP;<br>-    typedef std::list<lldb::TypeCategoryImplSP> ActiveCategoriesList;<br>-    typedef ActiveCategoriesList::iterator ActiveCategoriesIterator;<br>-        <br>-public:<br>-    typedef std::map<KeyType, ValueSP> MapType;<br>-    typedef MapType::iterator MapIterator;<br>-    typedef bool(*CallbackType)(void*, const ValueSP&);<br>-    typedef uint32_t Position;<br>-    <br>-    static const Position First = 0;<br>-    static const Position Default = 1;<br>-    static const Position Last = UINT32_MAX;<br>-    <br>-    CategoryMap (IFormatChangeListener* lst) :<br>-        m_map_mutex(Mutex::eMutexTypeRecursive),<br>-        listener(lst),<br>-        m_map(),<br>-        m_active_categories()<br>-    {<br>-        ConstString default_cs("default");<br>-        lldb::TypeCategoryImplSP default_sp = lldb::TypeCategoryImplSP(new TypeCategoryImpl(listener, default_cs));<br>-        Add(default_cs,default_sp);<br>-        Enable(default_cs,First);<br>-    }<br>-    <br>-    void<br>-    Add (KeyType name,<br>-         const ValueSP& entry)<br>-    {<br>-        Mutex::Locker locker(m_map_mutex);<br>-        m_map[name] = entry;<br>-        if (listener)<br>-            listener->Changed();<br>-    }<br>-    <br>-    bool<br>-    Delete (KeyType name)<br>-    {<br>-        Mutex::Locker locker(m_map_mutex);<br>-        MapIterator iter = m_map.find(name);<br>-        if (iter == m_map.end())<br>-            return false;<br>-        m_map.erase(name);<br>-        Disable(name);<br>-        if (listener)<br>-            listener->Changed();<br>-        return true;<br>-    }<br>-    <br>-    bool<br>-    Enable (KeyType category_name,<br>-            Position pos = Default)<br>-    {<br>-        Mutex::Locker locker(m_map_mutex);<br>-        ValueSP category;<br>-        if (!Get(category_name,category))<br>-            return false;<br>-        return Enable(category, pos);<br>-    }<br>-    <br>-    bool<br>-    Disable (KeyType category_name)<br>-    {<br>-        Mutex::Locker locker(m_map_mutex);<br>-        ValueSP category;<br>-        if (!Get(category_name,category))<br>-            return false;<br>-        return Disable(category);<br>-    }<br>-    <br>-    bool<br>-    Enable (ValueSP category,<br>-            Position pos = Default)<br>-    {<br>-        Mutex::Locker locker(m_map_mutex);<br>-        if (category.get())<br>-        {<br>-            Position pos_w = pos;<br>-            if (pos == First || m_active_categories.size() == 0)<br>-                m_active_categories.push_front(category);<br>-            else if (pos == Last || pos == m_active_categories.size())<br>-                m_active_categories.push_back(category);<br>-            else if (pos < m_active_categories.size())<br>-            {<br>-                ActiveCategoriesList::iterator iter = m_active_categories.begin();<br>-                while (pos_w)<br>-                {<br>-                    pos_w--,iter++;<br>-                }<br>-                m_active_categories.insert(iter,category);<br>-            }<br>-            else<br>-                return false;<br>-            category->Enable(true,<br>-                             pos);<br>-            return true;<br>-        }<br>-        return false;<br>-    }<br>-    <br>-    bool<br>-    Disable (ValueSP category)<br>-    {<br>-        Mutex::Locker locker(m_map_mutex);<br>-        if (category.get())<br>-        {<br>-            m_active_categories.remove_if(delete_matching_categories(category));<br>-            category->Disable();<br>-            return true;<br>-        }<br>-        return false;<br>-    }<br>-    <br>-    void<br>-    Clear ()<br>-    {<br>-        Mutex::Locker locker(m_map_mutex);<br>-        m_map.clear();<br>-        m_active_categories.clear();<br>-        if (listener)<br>-            listener->Changed();<br>-    }<br>-    <br>-    bool<br>-    Get (KeyType name,<br>-         ValueSP& entry)<br>-    {<br>-        Mutex::Locker locker(m_map_mutex);<br>-        MapIterator iter = m_map.find(name);<br>-        if (iter == m_map.end())<br>-            return false;<br>-        entry = iter->second;<br>-        return true;<br>-    }<br>-    <br>-    bool<br>-    Get (uint32_t pos,<br>-         ValueSP& entry)<br>-    {<br>-        Mutex::Locker locker(m_map_mutex);<br>-        MapIterator iter = m_map.begin();<br>-        MapIterator end = m_map.end();<br>-        while (pos > 0)<br>-        {<br>-            iter++;<br>-            pos--;<br>-            if (iter == end)<br>-                return false;<br>-        }<br>-        entry = iter->second;<br>-        return false;<br>-    }<br>-    <br>-    void<br>-    LoopThrough (CallbackType callback, void* param);<br>-    <br>-    lldb::TypeCategoryImplSP<br>-    GetAtIndex (size_t index);<br>-    <br>-    bool<br>-    AnyMatches (ConstString type_name,<br>-                TypeCategoryImpl::FormatCategoryItems items = TypeCategoryImpl::ALL_ITEM_TYPES,<br>-                bool only_enabled = true,<br>-                const char** matching_category = NULL,<br>-                TypeCategoryImpl::FormatCategoryItems* matching_type = NULL);<br>-    <br>-    size_t<br>-    GetCount ()<br>-    {<br>-        return m_map.size();<br>-    }<br>-    <br>-    lldb::TypeSummaryImplSP<br>-    GetSummaryFormat (ValueObject& valobj,<br>-         lldb::DynamicValueType use_dynamic);<br>-    <br>-#ifndef LLDB_DISABLE_PYTHON<br>-    lldb::SyntheticChildrenSP<br>-    GetSyntheticChildren (ValueObject& valobj,<br>-                          lldb::DynamicValueType use_dynamic);<br>-#endif<br>-    <br>-private:<br>-    <br>-    class delete_matching_categories<br>-    {<br>-        lldb::TypeCategoryImplSP ptr;<br>-    public:<br>-        delete_matching_categories(lldb::TypeCategoryImplSP p) : ptr(p)<br>-        {}<br>-        <br>-        bool operator()(const lldb::TypeCategoryImplSP& other)<br>-        {<br>-            return ptr.get() == other.get();<br>-        }<br>-    };<br>-    <br>-    Mutex m_map_mutex;<br>-    IFormatChangeListener* listener;<br>-    <br>-    MapType m_map;<br>-    ActiveCategoriesList m_active_categories;<br>-    <br>-    MapType& map ()<br>-    {<br>-        return m_map;<br>-    }<br>-    <br>-    ActiveCategoriesList& active_list ()<br>-    {<br>-        return m_active_categories;<br>-    }<br>-    <br>-    Mutex& mutex ()<br>-    {<br>-        return m_map_mutex;<br>-    }<br>-    <br>-    friend class FormatNavigator<KeyType, ValueType>;<br>-    friend class FormatManager;<br>-};<br>-<br>-class FormatManager : public IFormatChangeListener<br>-{<br>-    typedef FormatNavigator<ConstString, TypeFormatImpl> ValueNavigator;<br>-    typedef ValueNavigator::MapType ValueMap;<br>-    typedef FormatMap<ConstString, TypeSummaryImpl> NamedSummariesMap;<br>-    typedef CategoryMap::MapType::iterator CategoryMapIterator;<br>-public:<br>-    <br>-    typedef CategoryMap::CallbackType CategoryCallback;<br>-    <br>-    FormatManager ();<br>-    <br>-    ValueNavigator&<br>-    GetValueNavigator ()<br>-    {<br>-        return m_value_nav;<br>-    }<br>-    <br>-    NamedSummariesMap&<br>-    GetNamedSummaryNavigator ()<br>-    {<br>-        return m_named_summaries_map;<br>-    }<br>-    <br>-    void<br>-    EnableCategory (const ConstString& category_name,<br>-                    CategoryMap::Position pos = CategoryMap::Default)<br>-    {<br>-        m_categories_map.Enable(category_name,<br>-                                pos);<br>-    }<br>-    <br>-    void<br>-    DisableCategory (const ConstString& category_name)<br>-    {<br>-        m_categories_map.Disable(category_name);<br>-    }<br>-    <br>-    void<br>-    EnableCategory (const lldb::TypeCategoryImplSP& category,<br>-                    CategoryMap::Position pos = CategoryMap::Default)<br>-    {<br>-        m_categories_map.Enable(category,<br>-                                pos);<br>-    }<br>-    <br>-    void<br>-    DisableCategory (const lldb::TypeCategoryImplSP& category)<br>-    {<br>-        m_categories_map.Disable(category);<br>-    }<br>-    <br>-    bool<br>-    DeleteCategory (const ConstString& category_name)<br>-    {<br>-        return m_categories_map.Delete(category_name);<br>-    }<br>-    <br>-    void<br>-    ClearCategories ()<br>-    {<br>-        return m_categories_map.Clear();<br>-    }<br>-    <br>-    size_t<br>-    GetCategoriesCount ()<br>-    {<br>-        return m_categories_map.GetCount();<br>-    }<br>-    <br>-    lldb::TypeCategoryImplSP<br>-    GetCategoryAtIndex (size_t index)<br>-    {<br>-        return m_categories_map.GetAtIndex(index);<br>-    }<br>-    <br>-    void<br>-    LoopThroughCategories (CategoryCallback callback, void* param)<br>-    {<br>-        m_categories_map.LoopThrough(callback, param);<br>-    }<br>-    <br>-    lldb::TypeCategoryImplSP<br>-    GetCategory (const char* category_name = NULL,<br>-                 bool can_create = true)<br>-    {<br>-        if (!category_name)<br>-            return GetCategory(m_default_category_name);<br>-        return GetCategory(ConstString(category_name));<br>-    }<br>-    <br>-    lldb::TypeCategoryImplSP<br>-    GetCategory (const ConstString& category_name,<br>-                 bool can_create = true);<br>-    <br>-    lldb::TypeSummaryImplSP<br>-    GetSummaryFormat (ValueObject& valobj,<br>-                      lldb::DynamicValueType use_dynamic)<br>-    {<br>-        return m_categories_map.GetSummaryFormat(valobj, use_dynamic);<br>-    }<br>-    <br>-    lldb::TypeSummaryImplSP<br>-    GetSummaryForType (lldb::TypeNameSpecifierImplSP type_sp);<br>-<br>-    lldb::TypeFilterImplSP<br>-    GetFilterForType (lldb::TypeNameSpecifierImplSP type_sp);<br>-<br>-#ifndef LLDB_DISABLE_PYTHON<br>-    lldb::TypeSyntheticImplSP<br>-    GetSyntheticForType (lldb::TypeNameSpecifierImplSP type_sp);<br>-#endif<br>-    <br>-#ifndef LLDB_DISABLE_PYTHON<br>-    lldb::SyntheticChildrenSP<br>-    GetSyntheticChildrenForType (lldb::TypeNameSpecifierImplSP type_sp);<br>-#endif<br>-    <br>-#ifndef LLDB_DISABLE_PYTHON<br>-    lldb::SyntheticChildrenSP<br>-    GetSyntheticChildren (ValueObject& valobj,<br>-                          lldb::DynamicValueType use_dynamic)<br>-    {<br>-        return m_categories_map.GetSyntheticChildren(valobj, use_dynamic);<br>-    }<br>-#endif<br>-    <br>-    bool<br>-    AnyMatches (ConstString type_name,<br>-                TypeCategoryImpl::FormatCategoryItems items = TypeCategoryImpl::ALL_ITEM_TYPES,<br>-                bool only_enabled = true,<br>-                const char** matching_category = NULL,<br>-                TypeCategoryImpl::FormatCategoryItems* matching_type = NULL)<br>-    {<br>-        return m_categories_map.AnyMatches(type_name,<br>-                                           items,<br>-                                           only_enabled,<br>-                                           matching_category,<br>-                                           matching_type);<br>-    }<br>-<br>-    static bool<br>-    GetFormatFromCString (const char *format_cstr,<br>-                          bool partial_match_ok,<br>-                          lldb::Format &format);<br>-<br>-    static char<br>-    GetFormatAsFormatChar (lldb::Format format);<br>-<br>-    static const char *<br>-    GetFormatAsCString (lldb::Format format);<br>-    <br>-    // if the user tries to add formatters for, say, "struct Foo"<br>-    // those will not match any type because of the way we strip qualifiers from typenames<br>-    // this method looks for the case where the user is adding a "class","struct","enum" or "union" Foo<br>-    // and strips the unnecessary qualifier<br>-    static ConstString<br>-    GetValidTypeName (const ConstString& type);<br>-    <br>-    // when DataExtractor dumps a vectorOfT, it uses a predefined format for each item<br>-    // this method returns it, or eFormatInvalid if vector_format is not a vectorOf<br>-    static lldb::Format<br>-    GetSingleItemFormat (lldb::Format vector_format);<br>-    <br>-    void<br>-    Changed ()<br>-    {<br>-        __sync_add_and_fetch(&m_last_revision, +1);<br>-    }<br>-    <br>-    uint32_t<br>-    GetCurrentRevision ()<br>-    {<br>-        return m_last_revision;<br>-    }<br>-    <br>-    ~FormatManager ()<br>-    {<br>-    }<br>-    <br>-private:    <br>-    ValueNavigator m_value_nav;<br>-    NamedSummariesMap m_named_summaries_map;<br>-    uint32_t m_last_revision;<br>-    CategoryMap m_categories_map;<br>-    <br>-    ConstString m_default_category_name;<br>-    ConstString m_system_category_name;<br>-    ConstString m_gnu_cpp_category_name;<br>-    ConstString m_libcxx_category_name;<br>-    ConstString m_objc_category_name;<br>-    ConstString m_corefoundation_category_name;<br>-    ConstString m_coregraphics_category_name;<br>-    ConstString m_coreservices_category_name;<br>-    ConstString m_vectortypes_category_name;<br>-    ConstString m_appkit_category_name;<br>-    <br>-    CategoryMap&<br>-    GetCategories ()<br>-    {<br>-        return m_categories_map;<br>-    }<br>-    <br>-    // WARNING: these are temporary functions that setup formatters<br>-    // while a few of these actually should be globally available and setup by LLDB itself<br>-    // most would actually belong to the users' lldbinit file or to some other form of configurable<br>-    // storage<br>-    void<br>-    LoadLibStdcppFormatters ();<br>-    <br>-    void<br>-    LoadLibcxxFormatters ();<br>-    <br>-    void<br>-    LoadSystemFormatters ();<br>-    <br>-    void<br>-    LoadObjCFormatters ();<br>-};<br>-    <br>-} // namespace lldb_private<br>-<br>-#endif<span class="Apple-tab-span" style="white-space:pre"> </span>// lldb_FormatManager_h_<br><br>Removed: lldb/trunk/include/lldb/Core/FormatNavigator.h<br>URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/FormatNavigator.h?rev=173727&view=auto">http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/FormatNavigator.h?rev=173727&view=auto</a><br>==============================================================================<br>--- lldb/trunk/include/lldb/Core/FormatNavigator.h (original)<br>+++ lldb/trunk/include/lldb/Core/FormatNavigator.h (removed)<br>@@ -1,663 +0,0 @@<br>-//===-- FormatNavigator.h ----------------------------------------*- C++ -*-===//<br>-//<br>-//                     The LLVM Compiler Infrastructure<br>-//<br>-// This file is distributed under the University of Illinois Open Source<br>-// License. See LICENSE.TXT for details.<br>-//<br>-//===----------------------------------------------------------------------===//<br>-<br>-#ifndef lldb_FormatNavigator_h_<br>-#define lldb_FormatNavigator_h_<br>-<br>-// C Includes<br>-// C++ Includes<br>-<br>-// Other libraries and framework includes<br>-#include "clang/AST/DeclCXX.h"<br>-#include "clang/AST/Type.h"<br>-#include "clang/AST/DeclObjC.h"<br>-<br>-// Project includes<br>-#include "lldb/lldb-public.h"<br>-<br>-#include "lldb/Core/FormatClasses.h"<br>-#include "lldb/Core/Log.h"<br>-#include "lldb/Core/RegularExpression.h"<br>-#include "lldb/Core/ValueObject.h"<br>-<br>-#include "lldb/Symbol/ClangASTContext.h"<br>-<br>-#include "lldb/Target/ObjCLanguageRuntime.h"<br>-#include "lldb/Target/Process.h"<br>-#include "lldb/Target/StackFrame.h"<br>-#include "lldb/Target/TargetList.h"<br>-<br>-using lldb::LogSP;<br>-<br>-namespace lldb_private {<br>-    <br>-// this file (and its. cpp) contain the low-level implementation of LLDB Data Visualization<br>-// class DataVisualization is the high-level front-end of this feature<br>-// clients should refer to that class as the entry-point into the data formatters<br>-// unless they have a good reason to bypass it and prefer to use this file's objects directly<br>-class IFormatChangeListener<br>-{<br>-public:<br>-    virtual void<br>-    Changed () = 0;<br>-    <br>-    virtual<br>-    ~IFormatChangeListener () {}<br>-    <br>-    virtual uint32_t<br>-    GetCurrentRevision () = 0;<br>-    <br>-};<br>-    <br>-static inline bool<br>-IsWhitespace (char c)<br>-{<br>-    return ( (c == ' ') || (c == '\t') || (c == '\v') || (c == '\f') );<br>-}<br>-<br>-static inline bool<br>-HasPrefix (const char* str1, const char* str2)<br>-{<br>-    return ( ::strstr(str1, str2) == str1 );<br>-}<br>-    <br>-// if the user tries to add formatters for, say, "struct Foo"<br>-// those will not match any type because of the way we strip qualifiers from typenames<br>-// this method looks for the case where the user is adding a "class","struct","enum" or "union" Foo<br>-// and strips the unnecessary qualifier<br>-static ConstString<br>-GetValidTypeName_Impl (const ConstString& type)<br>-{<br>-    int strip_len = 0;<br>-    <br>-    if (type == false)<br>-        return type;<br>-    <br>-    const char* type_cstr = type.AsCString();<br>-    <br>-    if ( HasPrefix(type_cstr, "class ") )<br>-        strip_len = 6;<br>-    else if ( HasPrefix(type_cstr, "enum ") )<br>-        strip_len = 5;<br>-    else if ( HasPrefix(type_cstr, "struct ") )<br>-        strip_len = 7;<br>-    else if ( HasPrefix(type_cstr, "union ") )<br>-        strip_len = 6;<br>-    <br>-    if (strip_len == 0)<br>-        return type;<br>-    <br>-    type_cstr += strip_len;<br>-    while (IsWhitespace(*type_cstr) && ++type_cstr)<br>-        ;<br>-    <br>-    return ConstString(type_cstr);<br>-}<br>-    <br>-template<typename KeyType, typename ValueType><br>-class FormatNavigator;<br>-<br>-template<typename KeyType, typename ValueType><br>-class FormatMap<br>-{<br>-public:<br>-<br>-    typedef typename ValueType::SharedPointer ValueSP;<br>-    typedef std::map<KeyType, ValueSP> MapType;<br>-    typedef typename MapType::iterator MapIterator;<br>-    typedef bool(*CallbackType)(void*, KeyType, const ValueSP&);<br>-    <br>-    FormatMap(IFormatChangeListener* lst) :<br>-    m_map(),<br>-    m_map_mutex(Mutex::eMutexTypeRecursive),<br>-    listener(lst)<br>-    {<br>-    }<br>-    <br>-    void<br>-    Add(KeyType name,<br>-        const ValueSP& entry)<br>-    {<br>-        if (listener)<br>-            entry->GetRevision() = listener->GetCurrentRevision();<br>-        else<br>-            entry->GetRevision() = 0;<br>-<br>-        Mutex::Locker locker(m_map_mutex);<br>-        m_map[name] = entry;<br>-        if (listener)<br>-            listener->Changed();<br>-    }<br>-    <br>-    bool<br>-    Delete (KeyType name)<br>-    {<br>-        Mutex::Locker locker(m_map_mutex);<br>-        MapIterator iter = m_map.find(name);<br>-        if (iter == m_map.end())<br>-            return false;<br>-        m_map.erase(name);<br>-        if (listener)<br>-            listener->Changed();<br>-        return true;<br>-    }<br>-    <br>-    void<br>-    Clear ()<br>-    {<br>-        Mutex::Locker locker(m_map_mutex);<br>-        m_map.clear();<br>-        if (listener)<br>-            listener->Changed();<br>-    }<br>-    <br>-    bool<br>-    Get(KeyType name,<br>-        ValueSP& entry)<br>-    {<br>-        Mutex::Locker locker(m_map_mutex);<br>-        MapIterator iter = m_map.find(name);<br>-        if (iter == m_map.end())<br>-            return false;<br>-        entry = iter->second;<br>-        return true;<br>-    }<br>-    <br>-    void<br>-    LoopThrough (CallbackType callback, void* param)<br>-    {<br>-        if (callback)<br>-        {<br>-            Mutex::Locker locker(m_map_mutex);<br>-            MapIterator pos, end = m_map.end();<br>-            for (pos = m_map.begin(); pos != end; pos++)<br>-            {<br>-                KeyType type = pos->first;<br>-                if (!callback(param, type, pos->second))<br>-                    break;<br>-            }<br>-        }<br>-    }<br>-    <br>-    size_t<br>-    GetCount ()<br>-    {<br>-        return m_map.size();<br>-    }<br>-    <br>-    ValueSP<br>-    GetValueAtIndex (size_t index)<br>-    {<br>-        Mutex::Locker locker(m_map_mutex);<br>-        MapIterator iter = m_map.begin();<br>-        MapIterator end = m_map.end();<br>-        while (index > 0)<br>-        {<br>-            iter++;<br>-            index--;<br>-            if (end == iter)<br>-                return ValueSP();<br>-        }<br>-        return iter->second;<br>-    }<br>-    <br>-    KeyType<br>-    GetKeyAtIndex (size_t index)<br>-    {<br>-        Mutex::Locker locker(m_map_mutex);<br>-        MapIterator iter = m_map.begin();<br>-        MapIterator end = m_map.end();<br>-        while (index > 0)<br>-        {<br>-            iter++;<br>-            index--;<br>-            if (end == iter)<br>-                return KeyType();<br>-        }<br>-        return iter->first;<br>-    }<br>-    <br>-protected:<br>-    MapType m_map;    <br>-    Mutex m_map_mutex;<br>-    IFormatChangeListener* listener;<br>-    <br>-    MapType&<br>-    map ()<br>-    {<br>-        return m_map;<br>-    }<br>-    <br>-    Mutex&<br>-    mutex ()<br>-    {<br>-        return m_map_mutex;<br>-    }<br>-    <br>-    friend class FormatNavigator<KeyType, ValueType>;<br>-    friend class FormatManager;<br>-    <br>-};<br>-    <br>-template<typename KeyType, typename ValueType><br>-class FormatNavigator<br>-{<br>-protected:<br>-    typedef FormatMap<KeyType,ValueType> BackEndType;<br>-    <br>-public:<br>-    typedef typename BackEndType::MapType MapType;<br>-    typedef typename MapType::iterator MapIterator;<br>-    typedef typename MapType::key_type MapKeyType;<br>-    typedef typename MapType::mapped_type MapValueType;<br>-    typedef typename BackEndType::CallbackType CallbackType;<br>-#ifdef _LIBCPP_VERSION<br>-    typedef typename std::shared_ptr<FormatNavigator<KeyType, ValueType> > SharedPointer;<br>-#else<br>-    typedef typename std::tr1::shared_ptr<FormatNavigator<KeyType, ValueType> > SharedPointer;<br>-#endif<br>-    <br>-    friend class TypeCategoryImpl;<br>-<br>-    FormatNavigator(std::string name,<br>-                    IFormatChangeListener* lst) :<br>-    m_format_map(lst),<br>-    m_name(name),<br>-    m_id_cs(ConstString("id"))<br>-    {<br>-    }<br>-    <br>-    void<br>-    Add (const MapKeyType &type, const MapValueType& entry)<br>-    {<br>-        Add_Impl(type, entry, (KeyType*)NULL);<br>-    }<br>-    <br>-    bool<br>-    Delete (ConstString type)<br>-    {<br>-        return Delete_Impl(type, (KeyType*)NULL);<br>-    }<br>-        <br>-    bool<br>-    Get(ValueObject& valobj,<br>-        MapValueType& entry,<br>-        lldb::DynamicValueType use_dynamic,<br>-        uint32_t* why = NULL)<br>-    {<br>-        uint32_t value = lldb_private::eFormatterChoiceCriterionDirectChoice;<br>-        clang::QualType type = clang::QualType::getFromOpaquePtr(valobj.GetClangType());<br>-        bool ret = Get(valobj, type, entry, use_dynamic, value);<br>-        if (ret)<br>-            entry = MapValueType(entry);<br>-        else<br>-            entry = MapValueType();        <br>-        if (why)<br>-            *why = value;<br>-        return ret;<br>-    }<br>-    <br>-    bool<br>-    Get (ConstString type, MapValueType& entry)<br>-    {<br>-        return Get_Impl(type, entry, (KeyType*)NULL);<br>-    }<br>-    <br>-    bool<br>-    GetExact (ConstString type, MapValueType& entry)<br>-    {<br>-        return GetExact_Impl(type, entry, (KeyType*)NULL);<br>-    }<br>-    <br>-    MapValueType<br>-    GetAtIndex (size_t index)<br>-    {<br>-        return m_format_map.GetValueAtIndex(index);<br>-    }<br>-    <br>-    lldb::TypeNameSpecifierImplSP<br>-    GetTypeNameSpecifierAtIndex (size_t index)<br>-    {<br>-        return GetTypeNameSpecifierAtIndex_Impl(index, (KeyType*)NULL);<br>-    }<br>-    <br>-    void<br>-    Clear ()<br>-    {<br>-        m_format_map.Clear();<br>-    }<br>-    <br>-    void<br>-    LoopThrough (CallbackType callback, void* param)<br>-    {<br>-        m_format_map.LoopThrough(callback,param);<br>-    }<br>-    <br>-    size_t<br>-    GetCount ()<br>-    {<br>-        return m_format_map.GetCount();<br>-    }<br>-    <br>-protected:<br>-        <br>-    BackEndType m_format_map;<br>-    <br>-    std::string m_name;<br>-    <br>-    DISALLOW_COPY_AND_ASSIGN(FormatNavigator);<br>-    <br>-    ConstString m_id_cs;<br>-                           <br>-    void<br>-    Add_Impl (const MapKeyType &type, const MapValueType& entry, lldb::RegularExpressionSP *dummy)<br>-    {<br>-       m_format_map.Add(type,entry);<br>-    }<br>-<br>-    void Add_Impl (const ConstString &type, const MapValueType& entry, ConstString *dummy)<br>-    {<br>-       m_format_map.Add(GetValidTypeName_Impl(type), entry);<br>-    }<br>-<br>-    bool<br>-    Delete_Impl (ConstString type, ConstString *dummy)<br>-    {<br>-       return m_format_map.Delete(type);<br>-    }<br>-<br>-    bool<br>-    Delete_Impl (ConstString type, lldb::RegularExpressionSP *dummy)<br>-    {<br>-       Mutex& x_mutex = m_format_map.mutex();<br>-        lldb_private::Mutex::Locker locker(x_mutex);<br>-       MapIterator pos, end = m_format_map.map().end();<br>-       for (pos = m_format_map.map().begin(); pos != end; pos++)<br>-       {<br>-           lldb::RegularExpressionSP regex = pos->first;<br>-           if ( ::strcmp(type.AsCString(),regex->GetText()) == 0)<br>-           {<br>-               m_format_map.map().erase(pos);<br>-               if (m_format_map.listener)<br>-                   m_format_map.listener->Changed();<br>-               return true;<br>-           }<br>-       }<br>-       return false;<br>-    }    <br>-<br>-    bool<br>-    Get_Impl (ConstString type, MapValueType& entry, ConstString *dummy)<br>-    {<br>-       return m_format_map.Get(type, entry);<br>-    }<br>-<br>-    bool<br>-    GetExact_Impl (ConstString type, MapValueType& entry, ConstString *dummy)<br>-    {<br>-        return Get_Impl(type,entry, (KeyType*)0);<br>-    }<br>-    <br>-    lldb::TypeNameSpecifierImplSP<br>-    GetTypeNameSpecifierAtIndex_Impl (size_t index, ConstString *dummy)<br>-    {<br>-        ConstString key = m_format_map.GetKeyAtIndex(index);<br>-        if (key)<br>-            return lldb::TypeNameSpecifierImplSP(new TypeNameSpecifierImpl(key.AsCString(),<br>-                                                                           false));<br>-        else<br>-            return lldb::TypeNameSpecifierImplSP();<br>-    }<br>-    <br>-    lldb::TypeNameSpecifierImplSP<br>-    GetTypeNameSpecifierAtIndex_Impl (size_t index, lldb::RegularExpressionSP *dummy)<br>-    {<br>-        lldb::RegularExpressionSP regex = m_format_map.GetKeyAtIndex(index);<br>-        if (regex.get() == NULL)<br>-            return lldb::TypeNameSpecifierImplSP();<br>-        return lldb::TypeNameSpecifierImplSP(new TypeNameSpecifierImpl(regex->GetText(),<br>-                                                                       true));<br>-    }<br>-<br>-    bool<br>-    Get_Impl (ConstString key, MapValueType& value, lldb::RegularExpressionSP *dummy)<br>-    {<br>-       const char* key_cstr = key.AsCString();<br>-       if (!key_cstr)<br>-           return false;<br>-       Mutex& x_mutex = m_format_map.mutex();<br>-       lldb_private::Mutex::Locker locker(x_mutex);<br>-       MapIterator pos, end = m_format_map.map().end();<br>-       for (pos = m_format_map.map().begin(); pos != end; pos++)<br>-       {<br>-           lldb::RegularExpressionSP regex = pos->first;<br>-           if (regex->Execute(key_cstr))<br>-           {<br>-               value = pos->second;<br>-               return true;<br>-           }<br>-       }<br>-       return false;<br>-    }<br>-    <br>-    bool<br>-    GetExact_Impl (ConstString key, MapValueType& value, lldb::RegularExpressionSP *dummy)<br>-    {<br>-        Mutex& x_mutex = m_format_map.mutex();<br>-        lldb_private::Mutex::Locker locker(x_mutex);<br>-        MapIterator pos, end = m_format_map.map().end();<br>-        for (pos = m_format_map.map().begin(); pos != end; pos++)<br>-        {<br>-            lldb::RegularExpressionSP regex = pos->first;<br>-            if (strcmp(regex->GetText(),key.AsCString()) == 0)<br>-            {<br>-                value = pos->second;<br>-                return true;<br>-            }<br>-        }<br>-        return false;<br>-    }<br>-    <br>-    bool<br>-    Get_BitfieldMatch (ValueObject& valobj,<br>-                       ConstString typeName,<br>-                       MapValueType& entry,<br>-                       uint32_t& reason)<br>-    {<br>-        LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_TYPES));<br>-        // for bitfields, append size to the typename so one can custom format them<br>-        StreamString sstring;<br>-        sstring.Printf("%s:%d",typeName.AsCString(),valobj.GetBitfieldBitSize());<br>-        ConstString bitfieldname = ConstString(sstring.GetData());<br>-        if (log)<br>-            log->Printf("[Get_BitfieldMatch] appended bitfield info, final result is %s", bitfieldname.GetCString());<br>-        if (Get(bitfieldname, entry))<br>-        {<br>-            if (log)<br>-                log->Printf("[Get_BitfieldMatch] bitfield direct match found, returning");<br>-            return true;<br>-        }<br>-        else<br>-        {<br>-            reason |= lldb_private::eFormatterChoiceCriterionStrippedBitField;<br>-            if (log)<br>-                log->Printf("[Get_BitfieldMatch] no bitfield direct match");<br>-            return false;<br>-        }<br>-    }<br>-    <br>-    bool Get_ObjC (ValueObject& valobj,<br>-                   MapValueType& entry)<br>-    {<br>-        LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_TYPES));<br>-        lldb::ProcessSP process_sp = valobj.GetProcessSP();<br>-        ObjCLanguageRuntime* runtime = process_sp->GetObjCLanguageRuntime();<br>-        if (runtime == NULL)<br>-        {<br>-            if (log)<br>-                log->Printf("[Get_ObjC] no valid ObjC runtime, skipping dynamic");<br>-            return false;<br>-        }<br>-        ObjCLanguageRuntime::ClassDescriptorSP objc_class_sp (runtime->GetClassDescriptor(valobj));<br>-        if (!objc_class_sp)<br>-        {<br>-            if (log)<br>-                log->Printf("[Get_ObjC] invalid ISA, skipping dynamic");<br>-            return false;<br>-        }<br>-        ConstString name (objc_class_sp->GetClassName());<br>-        if (log)<br>-            log->Printf("[Get_ObjC] dynamic type inferred is %s - looking for direct dynamic match", name.GetCString());<br>-        if (Get(name, entry))<br>-        {<br>-            if (log)<br>-                log->Printf("[Get_ObjC] direct dynamic match found, returning");<br>-            return true;<br>-        }<br>-        if (log)<br>-            log->Printf("[Get_ObjC] no dynamic match");<br>-        return false;<br>-    }<br>-    <br>-    // we are separately passing in valobj and type because the valobj is fixed (and is used for ObjC discovery and bitfield size)<br>-    // but the type can change (e.g. stripping pointers, ...)<br>-    bool Get (ValueObject& valobj,<br>-              clang::QualType type,<br>-              MapValueType& entry,<br>-              lldb::DynamicValueType use_dynamic,<br>-              uint32_t& reason)<br>-    {<br>-        LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_TYPES));<br>-        if (type.isNull())<br>-        {<br>-            if (log)<br>-                log->Printf("[Get] type is NULL, returning");<br>-            return false;<br>-        }<br>-<br>-        type.removeLocalConst(); type.removeLocalVolatile(); type.removeLocalRestrict();<br>-        const clang::Type* typePtr = type.getTypePtrOrNull();<br>-        if (!typePtr)<br>-        {<br>-            if (log)<br>-                log->Printf("[Get] type is NULL, returning");<br>-            return false;<br>-        }<br>-        ConstString typeName(ClangASTType::GetTypeNameForQualType(valobj.GetClangAST(), type).c_str());<br>-        <br>-        if (valobj.GetBitfieldBitSize() > 0)<br>-        {<br>-            if (Get_BitfieldMatch(valobj, typeName, entry, reason))<br>-                return true;<br>-        }<br>-        <br>-        if (log)<br>-            log->Printf("[Get] trying to get %s for VO name %s of type %s",<br>-                        m_name.c_str(),<br>-                        valobj.GetName().AsCString(),<br>-                        typeName.AsCString());<br>-        <br>-        if (Get(typeName, entry))<br>-        {<br>-            if (log)<br>-                log->Printf("[Get] direct match found, returning");<br>-            return true;<br>-        }<br>-        if (log)<br>-            log->Printf("[Get] no direct match");<br>-<br>-        // strip pointers and references and see if that helps<br>-        if (typePtr->isReferenceType())<br>-        {<br>-            if (log)<br>-                log->Printf("[Get] stripping reference");<br>-            if (Get(valobj,type.getNonReferenceType(),entry, use_dynamic, reason) && !entry->SkipsReferences())<br>-            {<br>-                reason |= lldb_private::eFormatterChoiceCriterionStrippedPointerReference;<br>-                return true;<br>-            }<br>-        }<br>-        else if (typePtr->isPointerType())<br>-        {<br>-            if (log)<br>-                log->Printf("[Get] stripping pointer");<br>-            clang::QualType pointee = typePtr->getPointeeType();<br>-            if (Get(valobj, pointee, entry, use_dynamic, reason) && !entry->SkipsPointers())<br>-            {<br>-                reason |= lldb_private::eFormatterChoiceCriterionStrippedPointerReference;<br>-                return true;<br>-            }<br>-        }<br>-<br>-        bool canBeObjCDynamic = ClangASTContext::IsPossibleDynamicType (valobj.GetClangAST(),<br>-                                                                        type.getAsOpaquePtr(),<br>-                                                                        NULL,<br>-                                                                        false, // no C++<br>-                                                                        true); // yes ObjC<br>-        <br>-        if (canBeObjCDynamic)<br>-        {<br>-            if (use_dynamic != lldb::eNoDynamicValues)<br>-            {<br>-                if (log)<br>-                    log->Printf("[Get] allowed to figure out dynamic ObjC type");<br>-                if (Get_ObjC(valobj,entry))<br>-                {<br>-                    reason |= lldb_private::eFormatterChoiceCriterionDynamicObjCDiscovery;<br>-                    return true;<br>-                }<br>-            }<br>-            if (log)<br>-                log->Printf("[Get] dynamic disabled or failed - stripping ObjC pointer");<br>-            clang::QualType pointee = typePtr->getPointeeType();<br>-            if (Get(valobj, pointee, entry, use_dynamic, reason) && !entry->SkipsPointers())<br>-            {<br>-                reason |= lldb_private::eFormatterChoiceCriterionStrippedPointerReference;<br>-                return true;<br>-            }<br>-        }<br>-    <br>-        // try to strip typedef chains<br>-        const clang::TypedefType* type_tdef = type->getAs<clang::TypedefType>();<br>-        if (type_tdef)<br>-        {<br>-            if (log)<br>-                log->Printf("[Get] stripping typedef");<br>-            if ((Get(valobj, type_tdef->getDecl()->getUnderlyingType(), entry, use_dynamic, reason)) && entry->Cascades())<br>-            {<br>-                reason |= lldb_private::eFormatterChoiceCriterionNavigatedTypedefs;<br>-                return true;<br>-            }<br>-        }<br>-        <br>-        // if all else fails, go to static type<br>-        if (valobj.IsDynamic())<br>-        {<br>-            if (log)<br>-                log->Printf("[Get] going to static value");<br>-            lldb::ValueObjectSP static_value_sp(valobj.GetStaticValue());<br>-            if (static_value_sp)<br>-            {<br>-                if (log)<br>-                    log->Printf("[Get] has a static value - actually use it");<br>-                if (Get(*static_value_sp.get(), clang::QualType::getFromOpaquePtr(static_value_sp->GetClangType()) , entry, use_dynamic, reason))<br>-                {<br>-                    reason |= lldb_private::eFormatterChoiceCriterionWentToStaticValue;<br>-                    return true;<br>-                }<br>-            }<br>-        }<br>-        <br>-        return false;<br>-    }<br>-};<br>-<br>-} // namespace lldb_private<br>-<br>-#endif<span class="Apple-tab-span" style="white-space:pre">     </span>// lldb_FormatNavigator_h_<br><br>Modified: lldb/trunk/include/lldb/Core/ValueObject.h<br>URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObject.h?rev=173728&r1=173727&r2=173728&view=diff">http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObject.h?rev=173728&r1=173727&r2=173728&view=diff</a><br>==============================================================================<br>--- lldb/trunk/include/lldb/Core/ValueObject.h (original)<br>+++ lldb/trunk/include/lldb/Core/ValueObject.h Mon Jan 28 17:47:25 2013<br>@@ -808,10 +808,7 @@ public:<br>     UpdateValueIfNeeded (bool update_format = true);<br><br>     bool<br>-    UpdateValueIfNeeded (lldb::DynamicValueType use_dynamic, bool update_format = true);<br>-    <br>-    bool<br>-    UpdateFormatsIfNeeded(lldb::DynamicValueType use_dynamic = lldb::eNoDynamicValues);<br>+    UpdateFormatsIfNeeded();<br><br>     lldb::ValueObjectSP<br>     GetSP ()<br>@@ -843,10 +840,7 @@ public:<br><br>     lldb::ValueObjectSP<br>     GetSyntheticBitFieldChild (uint32_t from, uint32_t to, bool can_create);<br>-    <br>-    lldb::ValueObjectSP<br>-    GetSyntheticArrayRangeChild (uint32_t from, uint32_t to, bool can_create);<br>-    <br>+<br>     lldb::ValueObjectSP<br>     GetSyntheticExpressionPathChild(const char* expression, bool can_create);<br><br>@@ -856,6 +850,15 @@ public:<br>     virtual lldb::ValueObjectSP<br>     GetDynamicValue (lldb::DynamicValueType valueType);<br><br>+    virtual lldb::DynamicValueType<br>+    GetDynamicValueType ()<br>+    {<br>+        if (m_parent)<br>+            return m_parent->GetDynamicValueType ();<br>+        else<br>+            return lldb::eNoDynamicValues;<br>+    }<br>+    <br>     virtual lldb::ValueObjectSP<br>     GetStaticValue ();<br><br>@@ -1009,7 +1012,7 @@ public:<br>     lldb::TypeSummaryImplSP<br>     GetSummaryFormat()<br>     {<br>-        UpdateFormatsIfNeeded(m_last_format_mgr_dynamic);<br>+        UpdateFormatsIfNeeded();<br>         return m_type_summary_sp;<br>     }<br><br>@@ -1030,7 +1033,7 @@ public:<br>     lldb::TypeFormatImplSP<br>     GetValueFormat()<br>     {<br>-        UpdateFormatsIfNeeded(m_last_format_mgr_dynamic);<br>+        UpdateFormatsIfNeeded();<br>         return m_type_format_sp;<br>     }<br><br>@@ -1046,7 +1049,7 @@ public:<br>     lldb::SyntheticChildrenSP<br>     GetSyntheticChildren()<br>     {<br>-        UpdateFormatsIfNeeded(m_last_format_mgr_dynamic);<br>+        UpdateFormatsIfNeeded();<br>         return m_synthetic_children_sp;<br>     }<br><br>@@ -1218,7 +1221,6 @@ protected:<br><br>     lldb::Format                m_format;<br>     uint32_t                    m_last_format_mgr_revision;<br>-    lldb::DynamicValueType      m_last_format_mgr_dynamic;<br>     lldb::TypeSummaryImplSP     m_type_summary_sp;<br>     lldb::TypeFormatImplSP      m_type_format_sp;<br>     lldb::SyntheticChildrenSP   m_synthetic_children_sp;<br><br>Modified: lldb/trunk/include/lldb/Core/ValueObjectDynamicValue.h<br>URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObjectDynamicValue.h?rev=173728&r1=173727&r2=173728&view=diff">http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObjectDynamicValue.h?rev=173728&r1=173727&r2=173728&view=diff</a><br>==============================================================================<br>--- lldb/trunk/include/lldb/Core/ValueObjectDynamicValue.h (original)<br>+++ lldb/trunk/include/lldb/Core/ValueObjectDynamicValue.h Mon Jan 28 17:47:25 2013<br>@@ -90,6 +90,12 @@ public:<br>     virtual bool<br>     SetValueFromCString (const char *value_str, Error& error);<br><br>+    virtual lldb::DynamicValueType<br>+    GetDynamicValueType ()<br>+    {<br>+        return m_use_dynamic;<br>+    }<br>+    <br> protected:<br>     virtual bool<br>     UpdateValue ();<br><br>Modified: lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h<br>URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h?rev=173728&r1=173727&r2=173728&view=diff">http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h?rev=173728&r1=173727&r2=173728&view=diff</a><br>==============================================================================<br>--- lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h (original)<br>+++ lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h Mon Jan 28 17:47:25 2013<br>@@ -38,6 +38,9 @@ public:<br><br>     virtual ConstString<br>     GetTypeName();<br>+    <br>+    virtual ConstString<br>+    GetQualifiedTypeName();<br><br>     virtual bool<br>     MightHaveChildren();<br>@@ -57,6 +60,9 @@ public:<br>     virtual size_t<br>     GetIndexOfChildWithName (const ConstString &name);<br><br>+    virtual lldb::ValueObjectSP<br>+    GetDynamicValue (lldb::DynamicValueType valueType);<br>+    <br>     virtual bool<br>     IsInScope ();<br><br><br>Copied: lldb/trunk/include/lldb/DataFormatters/CXXFormatterFunctions.h (from r173281, lldb/trunk/include/lldb/Core/CXXFormatterFunctions.h)<br>URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/CXXFormatterFunctions.h?p2=lldb/trunk/include/lldb/DataFormatters/CXXFormatterFunctions.h&p1=lldb/trunk/include/lldb/Core/CXXFormatterFunctions.h&r1=173281&r2=173728&rev=173728&view=diff">http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/CXXFormatterFunctions.h?p2=lldb/trunk/include/lldb/DataFormatters/CXXFormatterFunctions.h&p1=lldb/trunk/include/lldb/Core/CXXFormatterFunctions.h&r1=173281&r2=173728&rev=173728&view=diff</a><br>==============================================================================<br>--- lldb/trunk/include/lldb/Core/CXXFormatterFunctions.h (original)<br>+++ lldb/trunk/include/lldb/DataFormatters/CXXFormatterFunctions.h Mon Jan 28 17:47:25 2013<br>@@ -14,14 +14,13 @@<br> #include "lldb/lldb-forward.h"<br><br> #include "lldb/Core/ConstString.h"<br>-#include "lldb/Core/FormatClasses.h"<br>+#include "lldb/DataFormatters/FormatClasses.h"<br><br> #include "clang/AST/ASTContext.h"<br><br> namespace lldb_private {<br>     namespace formatters<br>     {<br>-        <br>         bool<br>         ExtractValueFromObjCExpression (ValueObject &valobj,<br>                                         const char* target_type,<br>@@ -135,11 +134,11 @@ namespace lldb_private {<br>         public:<br>             NSArrayMSyntheticFrontEnd (lldb::ValueObjectSP valobj_sp);<br><br>-            virtual uint32_t<br>+            virtual size_t<br>             CalculateNumChildren ();<br><br>             virtual lldb::ValueObjectSP<br>-            GetChildAtIndex (uint32_t idx);<br>+            GetChildAtIndex (size_t idx);<br><br>             virtual bool<br>             Update();<br>@@ -147,7 +146,7 @@ namespace lldb_private {<br>             virtual bool<br>             MightHaveChildren ();<br><br>-            virtual uint32_t<br>+            virtual size_t<br>             GetIndexOfChildWithName (const ConstString &name);<br><br>             virtual<br>@@ -166,11 +165,11 @@ namespace lldb_private {<br>         public:<br>             NSArrayISyntheticFrontEnd (lldb::ValueObjectSP valobj_sp);<br><br>-            virtual uint32_t<br>+            virtual size_t<br>             CalculateNumChildren ();<br><br>             virtual lldb::ValueObjectSP<br>-            GetChildAtIndex (uint32_t idx);<br>+            GetChildAtIndex (size_t idx);<br><br>             virtual bool<br>             Update();<br>@@ -178,7 +177,7 @@ namespace lldb_private {<br>             virtual bool<br>             MightHaveChildren ();<br><br>-            virtual uint32_t<br>+            virtual size_t<br>             GetIndexOfChildWithName (const ConstString &name);<br><br>             virtual<br>@@ -197,11 +196,11 @@ namespace lldb_private {<br>         public:<br>             NSArrayCodeRunningSyntheticFrontEnd (lldb::ValueObjectSP valobj_sp);<br><br>-            virtual uint32_t<br>+            virtual size_t<br>             CalculateNumChildren ();<br><br>             virtual lldb::ValueObjectSP<br>-            GetChildAtIndex (uint32_t idx);<br>+            GetChildAtIndex (size_t idx);<br><br>             virtual bool<br>             Update();<br>@@ -209,7 +208,7 @@ namespace lldb_private {<br>             virtual bool<br>             MightHaveChildren ();<br><br>-            virtual uint32_t<br>+            virtual size_t<br>             GetIndexOfChildWithName (const ConstString &name);<br><br>             virtual<br>@@ -242,11 +241,11 @@ namespace lldb_private {<br>         public:<br>             NSDictionaryISyntheticFrontEnd (lldb::ValueObjectSP valobj_sp);<br><br>-            virtual uint32_t<br>+            virtual size_t<br>             CalculateNumChildren ();<br><br>             virtual lldb::ValueObjectSP<br>-            GetChildAtIndex (uint32_t idx);<br>+            GetChildAtIndex (size_t idx);<br><br>             virtual bool<br>             Update();<br>@@ -254,7 +253,7 @@ namespace lldb_private {<br>             virtual bool<br>             MightHaveChildren ();<br><br>-            virtual uint32_t<br>+            virtual size_t<br>             GetIndexOfChildWithName (const ConstString &name);<br><br>             virtual<br>@@ -298,11 +297,11 @@ namespace lldb_private {<br>         public:<br>             NSDictionaryMSyntheticFrontEnd (lldb::ValueObjectSP valobj_sp);<br><br>-            virtual uint32_t<br>+            virtual size_t<br>             CalculateNumChildren ();<br><br>             virtual lldb::ValueObjectSP<br>-            GetChildAtIndex (uint32_t idx);<br>+            GetChildAtIndex (size_t idx);<br><br>             virtual bool<br>             Update();<br>@@ -310,7 +309,7 @@ namespace lldb_private {<br>             virtual bool<br>             MightHaveChildren ();<br><br>-            virtual uint32_t<br>+            virtual size_t<br>             GetIndexOfChildWithName (const ConstString &name);<br><br>             virtual<br>@@ -328,11 +327,11 @@ namespace lldb_private {<br>         public:<br>             NSDictionaryCodeRunningSyntheticFrontEnd (lldb::ValueObjectSP valobj_sp);<br><br>-            virtual uint32_t<br>+            virtual size_t<br>             CalculateNumChildren ();<br><br>             virtual lldb::ValueObjectSP<br>-            GetChildAtIndex (uint32_t idx);<br>+            GetChildAtIndex (size_t idx);<br><br>             virtual bool<br>             Update();<br>@@ -340,7 +339,7 @@ namespace lldb_private {<br>             virtual bool<br>             MightHaveChildren ();<br><br>-            virtual uint32_t<br>+            virtual size_t<br>             GetIndexOfChildWithName (const ConstString &name);<br><br>             virtual<br><br>Copied: lldb/trunk/include/lldb/DataFormatters/DataVisualization.h (from r173281, lldb/trunk/include/lldb/Core/DataVisualization.h)<br>URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/DataVisualization.h?p2=lldb/trunk/include/lldb/DataFormatters/DataVisualization.h&p1=lldb/trunk/include/lldb/Core/DataVisualization.h&r1=173281&r2=173728&rev=173728&view=diff">http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/DataVisualization.h?p2=lldb/trunk/include/lldb/DataFormatters/DataVisualization.h&p1=lldb/trunk/include/lldb/Core/DataVisualization.h&r1=173281&r2=173728&rev=173728&view=diff</a><br>==============================================================================<br>--- lldb/trunk/include/lldb/Core/DataVisualization.h (original)<br>+++ lldb/trunk/include/lldb/DataFormatters/DataVisualization.h Mon Jan 28 17:47:25 2013<br>@@ -16,8 +16,8 @@<br> // Other libraries and framework includes<br> // Project includes<br> #include "lldb/Core/ConstString.h"<br>-#include "lldb/Core/FormatClasses.h"<br>-#include "lldb/Core/FormatManager.h"<br>+#include "lldb/DataFormatters/FormatClasses.h"<br>+#include "lldb/DataFormatters/FormatManager.h"<br><br> namespace lldb_private {<br><br>@@ -57,14 +57,14 @@ public:<br>         static void<br>         LoopThrough (TypeFormatImpl::ValueCallback callback, void* callback_baton);<br><br>-        static uint32_t<br>+        static size_t<br>         GetCount ();<br><br>         static lldb::TypeNameSpecifierImplSP<br>-        GetTypeNameSpecifierForFormatAtIndex (uint32_t);<br>+        GetTypeNameSpecifierForFormatAtIndex (size_t);<br><br>         static lldb::TypeFormatImplSP<br>-        GetFormatAtIndex (uint32_t);<br>+        GetFormatAtIndex (size_t);<br>     };<br><br>     static lldb::TypeSummaryImplSP<br>@@ -83,7 +83,7 @@ public:<br>     GetFilterForType (lldb::TypeNameSpecifierImplSP type_sp);<br><br> #ifndef LLDB_DISABLE_PYTHON<br>-    static lldb::TypeSyntheticImplSP<br>+    static lldb::ScriptedSyntheticChildrenSP<br>     GetSyntheticForType (lldb::TypeNameSpecifierImplSP type_sp);<br> #endif<br><br>@@ -145,14 +145,14 @@ public:<br><br>         static void<br>         Enable (const ConstString& category,<br>-                CategoryMap::Position = CategoryMap::Default);<br>+                TypeCategoryMap::Position = TypeCategoryMap::Default);<br><br>         static void<br>         Disable (const ConstString& category);<br><br>         static void<br>         Enable (const lldb::TypeCategoryImplSP& category,<br>-                CategoryMap::Position = CategoryMap::Default);<br>+                TypeCategoryMap::Position = TypeCategoryMap::Default);<br><br>         static void<br>         Disable (const lldb::TypeCategoryImplSP& category);<br>@@ -164,7 +164,7 @@ public:<br>         GetCount ();<br><br>         static lldb::TypeCategoryImplSP<br>-        GetCategoryAtIndex (uint32_t);<br>+        GetCategoryAtIndex (size_t);<br>     };<br> };<br><br><br>Added: lldb/trunk/include/lldb/DataFormatters/FormatCache.h<br>URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/FormatCache.h?rev=173728&view=auto">http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/FormatCache.h?rev=173728&view=auto</a><br>==============================================================================<br>--- lldb/trunk/include/lldb/DataFormatters/FormatCache.h (added)<br>+++ lldb/trunk/include/lldb/DataFormatters/FormatCache.h Mon Jan 28 17:47:25 2013<br>@@ -0,0 +1,105 @@<br>+//===-- FormatCache.h ---------------------------------------------*- C++ -*-===//<br>+//<br>+//                     The LLVM Compiler Infrastructure<br>+//<br>+// This file is distributed under the University of Illinois Open Source<br>+// License. See LICENSE.TXT for details.<br>+//<br>+//===----------------------------------------------------------------------===//<br>+<br>+#ifndef lldb_FormatCache_h_<br>+#define lldb_FormatCache_h_<br>+<br>+// C Includes<br>+// C++ Includes<br>+#include <map><br>+<br>+// Other libraries and framework includes<br>+// Project includes<br>+#include "lldb/lldb-public.h"<br>+#include "lldb/Core/ConstString.h"<br>+#include "lldb/DataFormatters/FormatClasses.h"<br>+<br>+namespace lldb_private {<br>+class FormatCache<br>+{<br>+private:<br>+    struct Entry<br>+    {<br>+    private:<br>+        bool m_summary_cached : 1;<br>+        bool m_synthetic_cached : 1;<br>+        <br>+        lldb::TypeSummaryImplSP m_summary_sp;<br>+        lldb::SyntheticChildrenSP m_synthetic_sp;<br>+    public:<br>+        Entry ();<br>+        Entry (lldb::TypeSummaryImplSP);<br>+        Entry (lldb::SyntheticChildrenSP);<br>+        Entry (lldb::TypeSummaryImplSP,lldb::SyntheticChildrenSP);<br>+<br>+        bool<br>+        IsSummaryCached ();<br>+        <br>+        bool<br>+        IsSyntheticCached ();<br>+        <br>+        lldb::TypeSummaryImplSP<br>+        GetSummary ();<br>+        <br>+        lldb::SyntheticChildrenSP<br>+        GetSynthetic ();<br>+        <br>+        void<br>+        SetSummary (lldb::TypeSummaryImplSP);<br>+        <br>+        void<br>+        SetSynthetic (lldb::SyntheticChildrenSP);<br>+    };<br>+    typedef std::map<ConstString,Entry> CacheMap;<br>+    CacheMap m_map;<br>+    Mutex m_mutex;<br>+    <br>+#ifdef LLDB_CONFIGURATION_DEBUG<br>+    uint64_t m_cache_hits;<br>+    uint64_t m_cache_misses;<br>+#endif<br>+    <br>+    Entry&<br>+    GetEntry (const ConstString& type);<br>+    <br>+public:<br>+    FormatCache ();<br>+    <br>+    bool<br>+    GetSummary (const ConstString& type,lldb::TypeSummaryImplSP& summary_sp);<br>+<br>+    bool<br>+    GetSynthetic (const ConstString& type,lldb::SyntheticChildrenSP& synthetic_sp);<br>+    <br>+    void<br>+    SetSummary (const ConstString& type,lldb::TypeSummaryImplSP& summary_sp);<br>+    <br>+    void<br>+    SetSynthetic (const ConstString& type,lldb::SyntheticChildrenSP& synthetic_sp);<br>+    <br>+    void<br>+    Clear ();<br>+    <br>+#ifdef LLDB_CONFIGURATION_DEBUG<br>+    uint64_t<br>+    GetCacheHits ()<br>+    {<br>+        return m_cache_hits;<br>+    }<br>+    <br>+    uint64_t<br>+    GetCacheMisses ()<br>+    {<br>+        return m_cache_misses;<br>+    }<br>+#endif<br>+};<br>+} // namespace lldb_private<br>+<br>+#endif<span class="Apple-tab-span" style="white-space:pre">    </span>// lldb_FormatCache_h_<br><br>Copied: lldb/trunk/include/lldb/DataFormatters/FormatClasses.h (from r173281, lldb/trunk/include/lldb/Core/FormatClasses.h)<br>URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/FormatClasses.h?p2=lldb/trunk/include/lldb/DataFormatters/FormatClasses.h&p1=lldb/trunk/include/lldb/Core/FormatClasses.h&r1=173281&r2=173728&rev=173728&view=diff">http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/FormatClasses.h?p2=lldb/trunk/include/lldb/DataFormatters/FormatClasses.h&p1=lldb/trunk/include/lldb/Core/FormatClasses.h&r1=173281&r2=173728&rev=173728&view=diff</a><br>==============================================================================<br>--- lldb/trunk/include/lldb/Core/FormatClasses.h (original)<br>+++ lldb/trunk/include/lldb/DataFormatters/FormatClasses.h Mon Jan 28 17:47:25 2013<br>@@ -26,1488 +26,18 @@<br><br> #include "lldb/Core/ValueObject.h"<br> #include "lldb/Interpreter/ScriptInterpreterPython.h"<br>+#include "lldb/Symbol/ClangASTType.h"<br> #include "lldb/Symbol/Type.h"<br><br>-namespace lldb_private {<br>-<br>-class TypeFormatImpl<br>-{<br>-public:<br>-    class Flags<br>-    {<br>-    public:<br>-        <br>-        Flags () :<br>-        m_flags (lldb::eTypeOptionCascade)<br>-        {}<br>-        <br>-        Flags (const Flags& other) :<br>-        m_flags (other.m_flags)<br>-        {}<br>-        <br>-        Flags (uint32_t value) :<br>-        m_flags (value)<br>-        {}<br>-        <br>-        Flags&<br>-        operator = (const Flags& rhs)<br>-        {<br>-            if (&rhs != this)<br>-                m_flags = rhs.m_flags;<br>-            <br>-            return *this;<br>-        }<br>-        <br>-        Flags&<br>-        operator = (const uint32_t& rhs)<br>-        {<br>-            m_flags = rhs;<br>-            return *this;<br>-        }<br>-        <br>-        Flags&<br>-        Clear()<br>-        {<br>-            m_flags = 0;<br>-            return *this;<br>-        }<br>-        <br>-        bool<br>-        GetCascades () const<br>-        {<br>-            return (m_flags & lldb::eTypeOptionCascade) == lldb::eTypeOptionCascade;<br>-        }<br>-        <br>-        Flags&<br>-        SetCascades (bool value = true)<br>-        {<br>-            if (value)<br>-                m_flags |= lldb::eTypeOptionCascade;<br>-            else<br>-                m_flags &= ~lldb::eTypeOptionCascade;<br>-            return *this;<br>-        }<br>-        <br>-        bool<br>-        GetSkipPointers () const<br>-        {<br>-            return (m_flags & lldb::eTypeOptionSkipPointers) == lldb::eTypeOptionSkipPointers;<br>-        }<br>-        <br>-        Flags&<br>-        SetSkipPointers (bool value = true)<br>-        {<br>-            if (value)<br>-                m_flags |= lldb::eTypeOptionSkipPointers;<br>-            else<br>-                m_flags &= ~lldb::eTypeOptionSkipPointers;<br>-            return *this;<br>-        }<br>-        <br>-        bool<br>-        GetSkipReferences () const<br>-        {<br>-            return (m_flags & lldb::eTypeOptionSkipReferences) == lldb::eTypeOptionSkipReferences;<br>-        }<br>-        <br>-        Flags&<br>-        SetSkipReferences (bool value = true)<br>-        {<br>-            if (value)<br>-                m_flags |= lldb::eTypeOptionSkipReferences;<br>-            else<br>-                m_flags &= ~lldb::eTypeOptionSkipReferences;<br>-            return *this;<br>-        }<br>-        <br>-        uint32_t<br>-        GetValue ()<br>-        {<br>-            return m_flags;<br>-        }<br>-        <br>-        void<br>-        SetValue (uint32_t value)<br>-        {<br>-            m_flags = value;<br>-        }<br>-<br>-    private:<br>-        uint32_t m_flags;<br>-    };<br>-    <br>-    TypeFormatImpl (lldb::Format f = lldb::eFormatInvalid,<br>-                 const Flags& flags = Flags());<br>-    <br>-    typedef STD_SHARED_PTR(TypeFormatImpl) SharedPointer;<br>-    typedef bool(*ValueCallback)(void*, ConstString, const lldb::TypeFormatImplSP&);<br>-    <br>-    ~TypeFormatImpl ()<br>-    {<br>-    }<br>-    <br>-    bool<br>-    Cascades () const<br>-    {<br>-        return m_flags.GetCascades();<br>-    }<br>-    bool<br>-    SkipsPointers () const<br>-    {<br>-        return m_flags.GetSkipPointers();<br>-    }<br>-    bool<br>-    SkipsReferences () const<br>-    {<br>-        return m_flags.GetSkipReferences();<br>-    }<br>-    <br>-    void<br>-    SetCascades (bool value)<br>-    {<br>-        m_flags.SetCascades(value);<br>-    }<br>-    <br>-    void<br>-    SetSkipsPointers (bool value)<br>-    {<br>-        m_flags.SetSkipPointers(value);<br>-    }<br>-    <br>-    void<br>-    SetSkipsReferences (bool value)<br>-    {<br>-        m_flags.SetSkipReferences(value);<br>-    }<br>-    <br>-    lldb::Format<br>-    GetFormat () const<br>-    {<br>-        return m_format;<br>-    }<br>-    <br>-    void<br>-    SetFormat (lldb::Format fmt)<br>-    {<br>-        m_format = fmt;<br>-    }<br>-    <br>-    uint32_t<br>-    GetOptions ()<br>-    {<br>-        return m_flags.GetValue();<br>-    }<br>-    <br>-    void<br>-    SetOptions (uint32_t value)<br>-    {<br>-        m_flags.SetValue(value);<br>-    }<br>-    <br>-    uint32_t&<br>-    GetRevision ()<br>-    {<br>-        return m_my_revision;<br>-    }<br>-    <br>-    std::string<br>-    GetDescription();<br>-    <br>-protected:<br>-    Flags m_flags;<br>-    lldb::Format m_format;<br>-    uint32_t m_my_revision;<br>-    <br>-private:<br>-    DISALLOW_COPY_AND_ASSIGN(TypeFormatImpl);<br>-};<br>-<br>-class SyntheticChildrenFrontEnd<br>-{<br>-protected:<br>-    ValueObject &m_backend;<br>-public:<br>-    <br>-    SyntheticChildrenFrontEnd (ValueObject &backend) :<br>-        m_backend(backend)<br>-    {}<br>-    <br>-    virtual<br>-    ~SyntheticChildrenFrontEnd ()<br>-    {<br>-    }<br>-    <br>-    virtual uint32_t<br>-    CalculateNumChildren () = 0;<br>-    <br>-    virtual lldb::ValueObjectSP<br>-    GetChildAtIndex (uint32_t idx) = 0;<br>-    <br>-    virtual uint32_t<br>-    GetIndexOfChildWithName (const ConstString &name) = 0;<br>-    <br>-    // this function is assumed to always succeed and it if fails, the front-end should know to deal<br>-    // with it in the correct way (most probably, by refusing to return any children)<br>-    // the return value of Update() should actually be interpreted as "ValueObjectSyntheticFilter cache is good/bad"<br>-    // if =true, ValueObjectSyntheticFilter is allowed to use the children it fetched previously and cached<br>-    // if =false, ValueObjectSyntheticFilter must throw away its cache, and query again for children<br>-    virtual bool<br>-    Update () = 0;<br>-    <br>-    // if this function returns false, then CalculateNumChildren() MUST return 0 since UI frontends<br>-    // might validly decide not to inquire for children given a false return value from this call<br>-    // if it returns true, then CalculateNumChildren() can return any number >= 0 (0 being valid)<br>-    // it should if at all possible be more efficient than CalculateNumChildren()<br>-    virtual bool<br>-    MightHaveChildren () = 0;<br>-    <br>-    typedef STD_SHARED_PTR(SyntheticChildrenFrontEnd) SharedPointer;<br>-    typedef std::auto_ptr<SyntheticChildrenFrontEnd> AutoPointer;<br>-    <br>-private:<br>-    DISALLOW_COPY_AND_ASSIGN(SyntheticChildrenFrontEnd);<br>-};<br>-<br>-class SyntheticChildren<br>-{<br>-public:<br>-    <br>-    class Flags<br>-    {<br>-    public:<br>-        <br>-        Flags () :<br>-        m_flags (lldb::eTypeOptionCascade)<br>-        {}<br>-        <br>-        Flags (const Flags& other) :<br>-        m_flags (other.m_flags)<br>-        {}<br>-        <br>-        Flags (uint32_t value) :<br>-        m_flags (value)<br>-        {}<br>-        <br>-        Flags&<br>-        operator = (const Flags& rhs)<br>-        {<br>-            if (&rhs != this)<br>-                m_flags = rhs.m_flags;<br>-            <br>-            return *this;<br>-        }<br>-        <br>-        Flags&<br>-        operator = (const uint32_t& rhs)<br>-        {<br>-            m_flags = rhs;<br>-            return *this;<br>-        }<br>-        <br>-        Flags&<br>-        Clear()<br>-        {<br>-            m_flags = 0;<br>-            return *this;<br>-        }<br>-        <br>-        bool<br>-        GetCascades () const<br>-        {<br>-            return (m_flags & lldb::eTypeOptionCascade) == lldb::eTypeOptionCascade;<br>-        }<br>-        <br>-        Flags&<br>-        SetCascades (bool value = true)<br>-        {<br>-            if (value)<br>-                m_flags |= lldb::eTypeOptionCascade;<br>-            else<br>-                m_flags &= ~lldb::eTypeOptionCascade;<br>-            return *this;<br>-        }<br>-        <br>-        bool<br>-        GetSkipPointers () const<br>-        {<br>-            return (m_flags & lldb::eTypeOptionSkipPointers) == lldb::eTypeOptionSkipPointers;<br>-        }<br>-        <br>-        Flags&<br>-        SetSkipPointers (bool value = true)<br>-        {<br>-            if (value)<br>-                m_flags |= lldb::eTypeOptionSkipPointers;<br>-            else<br>-                m_flags &= ~lldb::eTypeOptionSkipPointers;<br>-            return *this;<br>-        }<br>-        <br>-        bool<br>-        GetSkipReferences () const<br>-        {<br>-            return (m_flags & lldb::eTypeOptionSkipReferences) == lldb::eTypeOptionSkipReferences;<br>-        }<br>-        <br>-        Flags&<br>-        SetSkipReferences (bool value = true)<br>-        {<br>-            if (value)<br>-                m_flags |= lldb::eTypeOptionSkipReferences;<br>-            else<br>-                m_flags &= ~lldb::eTypeOptionSkipReferences;<br>-            return *this;<br>-        }<br>-        <br>-        uint32_t<br>-        GetValue ()<br>-        {<br>-            return m_flags;<br>-        }<br>-        <br>-        void<br>-        SetValue (uint32_t value)<br>-        {<br>-            m_flags = value;<br>-        }<br>-        <br>-    private:<br>-        uint32_t m_flags;<br>-    };<br>-    <br>-    SyntheticChildren (const Flags& flags) :<br>-        m_flags(flags)<br>-    {<br>-    }<br>-    <br>-    virtual<br>-    ~SyntheticChildren ()<br>-    {<br>-    }<br>-    <br>-    bool<br>-    Cascades () const<br>-    {<br>-        return m_flags.GetCascades();<br>-    }<br>-    bool<br>-    SkipsPointers () const<br>-    {<br>-        return m_flags.GetSkipPointers();<br>-    }<br>-    bool<br>-    SkipsReferences () const<br>-    {<br>-        return m_flags.GetSkipReferences();<br>-    }<br>-    <br>-    void<br>-    SetCascades (bool value)<br>-    {<br>-        m_flags.SetCascades(value);<br>-    }<br>-    <br>-    void<br>-    SetSkipsPointers (bool value)<br>-    {<br>-        m_flags.SetSkipPointers(value);<br>-    }<br>-    <br>-    void<br>-    SetSkipsReferences (bool value)<br>-    {<br>-        m_flags.SetSkipReferences(value);<br>-    }<br>-    <br>-    uint32_t<br>-    GetOptions ()<br>-    {<br>-        return m_flags.GetValue();<br>-    }<br>-    <br>-    void<br>-    SetOptions (uint32_t value)<br>-    {<br>-        m_flags.SetValue(value);<br>-    }<br>-    <br>-    virtual bool<br>-    IsScripted () = 0;<br>-    <br>-    virtual std::string<br>-    GetDescription () = 0;<br>-    <br>-    virtual SyntheticChildrenFrontEnd::AutoPointer<br>-    GetFrontEnd (ValueObject &backend) = 0;<br>-    <br>-    typedef STD_SHARED_PTR(SyntheticChildren) SharedPointer;<br>-    typedef bool(*SyntheticChildrenCallback)(void*, ConstString, const SyntheticChildren::SharedPointer&);<br>-    <br>-    uint32_t&<br>-    GetRevision ()<br>-    {<br>-        return m_my_revision;<br>-    }<br>-    <br>-protected:<br>-    uint32_t m_my_revision;<br>-    Flags m_flags;<br>-    <br>-private:<br>-    DISALLOW_COPY_AND_ASSIGN(SyntheticChildren);<br>-};<br>-<br>-class TypeFilterImpl : public SyntheticChildren<br>-{<br>-    std::vector<std::string> m_expression_paths;<br>-public:<br>-    TypeFilterImpl(const SyntheticChildren::Flags& flags) :<br>-        SyntheticChildren(flags),<br>-        m_expression_paths()<br>-    {<br>-    }<br>-    <br>-    void<br>-    AddExpressionPath (const char* path)<br>-    {<br>-        AddExpressionPath(std::string(path));<br>-    }<br>-        <br>-    void<br>-    Clear()<br>-    {<br>-        m_expression_paths.clear();<br>-    }<br>-    <br>-    int<br>-    GetCount() const<br>-    {<br>-        return m_expression_paths.size();<br>-    }<br>-    <br>-    const char*<br>-    GetExpressionPathAtIndex(int i) const<br>-    {<br>-        return m_expression_paths[i].c_str();<br>-    }<br>-    <br>-    bool<br>-    SetExpressionPathAtIndex (int i, const char* path)<br>-    {<br>-        return SetExpressionPathAtIndex(i, std::string(path));<br>-    }<br>-    <br>-    void<br>-    AddExpressionPath (std::string path)<br>-    {<br>-        bool need_add_dot = true;<br>-        if (path[0] == '.' ||<br>-            (path[0] == '-' && path[1] == '>') ||<br>-            path[0] == '[')<br>-            need_add_dot = false;<br>-        // add a '.' symbol to help forgetful users<br>-        if(!need_add_dot)<br>-            m_expression_paths.push_back(path);<br>-        else<br>-            m_expression_paths.push_back(std::string(".") + path);<br>-    }<br>-    <br>-    bool<br>-    SetExpressionPathAtIndex (int i, std::string path)<br>-    {<br>-        if (i >= GetCount())<br>-            return false;<br>-        bool need_add_dot = true;<br>-        if (path[0] == '.' ||<br>-            (path[0] == '-' && path[1] == '>') ||<br>-            path[0] == '[')<br>-            need_add_dot = false;<br>-        // add a '.' symbol to help forgetful users<br>-        if(!need_add_dot)<br>-            m_expression_paths[i] = path;<br>-        else<br>-            m_expression_paths[i] = std::string(".") + path;<br>-        return true;<br>-    }<br>-    <br>-    bool<br>-    IsScripted()<br>-    {<br>-        return false;<br>-    }<br>-    <br>-    std::string<br>-    GetDescription();<br>-    <br>-    class FrontEnd : public SyntheticChildrenFrontEnd<br>-    {<br>-    private:<br>-        TypeFilterImpl* filter;<br>-    public:<br>-        <br>-        FrontEnd(TypeFilterImpl* flt,<br>-                 ValueObject &backend) :<br>-        SyntheticChildrenFrontEnd(backend),<br>-        filter(flt)<br>-        {}<br>-        <br>-        virtual<br>-        ~FrontEnd()<br>-        {<br>-        }<br>-        <br>-        virtual uint32_t<br>-        CalculateNumChildren()<br>-        {<br>-            return filter->GetCount();<br>-        }<br>-        <br>-        virtual lldb::ValueObjectSP<br>-        GetChildAtIndex (uint32_t idx)<br>-        {<br>-            if (idx >= filter->GetCount())<br>-                return lldb::ValueObjectSP();<br>-            return m_backend.GetSyntheticExpressionPathChild(filter->GetExpressionPathAtIndex(idx), true);<br>-        }<br>-        <br>-        virtual bool<br>-        Update() { return false; }<br>-        <br>-        virtual bool<br>-        MightHaveChildren ()<br>-        {<br>-            return filter->GetCount() > 0;<br>-        }<br>-        <br>-        virtual uint32_t<br>-        GetIndexOfChildWithName (const ConstString &name)<br>-        {<br>-            const char* name_cstr = name.GetCString();<br>-            for (int i = 0; i < filter->GetCount(); i++)<br>-            {<br>-                const char* expr_cstr = filter->GetExpressionPathAtIndex(i);<br>-                if (expr_cstr)<br>-                {<br>-                    if (*expr_cstr == '.')<br>-                        expr_cstr++;<br>-                    else if (*expr_cstr == '-' && *(expr_cstr+1) == '>')<br>-                        expr_cstr += 2;<br>-                }<br>-                if (!::strcmp(name_cstr, expr_cstr))<br>-                    return i;<br>-            }<br>-            return UINT32_MAX;<br>-        }<br>-        <br>-        typedef STD_SHARED_PTR(SyntheticChildrenFrontEnd) SharedPointer;<br>-        <br>-    private:<br>-        DISALLOW_COPY_AND_ASSIGN(FrontEnd);<br>-    };<br>-    <br>-    virtual SyntheticChildrenFrontEnd::AutoPointer<br>-    GetFrontEnd(ValueObject &backend)<br>-    {<br>-        return SyntheticChildrenFrontEnd::AutoPointer(new FrontEnd(this, backend));<br>-    }<br>-    <br>-private:<br>-    DISALLOW_COPY_AND_ASSIGN(TypeFilterImpl);<br>-};<br>-<br>-    class CXXSyntheticChildren : public SyntheticChildren<br>-    {<br>-    public:<br>-        typedef SyntheticChildrenFrontEnd* (*CreateFrontEndCallback) (CXXSyntheticChildren*, lldb::ValueObjectSP);<br>-    protected:<br>-        CreateFrontEndCallback m_create_callback;<br>-        std::string m_description;<br>-    public:<br>-        CXXSyntheticChildren(const SyntheticChildren::Flags& flags,<br>-                             const char* description,<br>-                             CreateFrontEndCallback callback) :<br>-        SyntheticChildren(flags),<br>-        m_create_callback(callback),<br>-        m_description(description ? description : "")<br>-        {<br>-        }<br>-        <br>-        bool<br>-        IsScripted()<br>-        {<br>-            return false;<br>-        }<br>-        <br>-        std::string<br>-        GetDescription();<br>-                <br>-        virtual SyntheticChildrenFrontEnd::AutoPointer<br>-        GetFrontEnd(ValueObject &backend)<br>-        {<br>-            return SyntheticChildrenFrontEnd::AutoPointer(m_create_callback(this, backend.GetSP()));<br>-        }<br>-        <br>-    private:<br>-        DISALLOW_COPY_AND_ASSIGN(CXXSyntheticChildren);<br>-    };<br>-<br>-#ifndef LLDB_DISABLE_PYTHON<br>-<br>-class TypeSyntheticImpl : public SyntheticChildren<br>-{<br>-    std::string m_python_class;<br>-    std::string m_python_code;<br>-public:<br>-    <br>-    TypeSyntheticImpl(const SyntheticChildren::Flags& flags,<br>-                      const char* pclass,<br>-                      const char* pcode = NULL) :<br>-        SyntheticChildren(flags),<br>-        m_python_class(),<br>-        m_python_code()<br>-    {<br>-        if (pclass)<br>-                m_python_class = pclass;<br>-        if (pcode)<br>-                m_python_code = pcode;<br>-    }<br>-<br>-    const char*<br>-    GetPythonClassName()<br>-    {<br>-        return m_python_class.c_str();<br>-    }<br>-<br>-    const char*<br>-    GetPythonCode()<br>-    {<br>-        return m_python_code.c_str();<br>-    }<br>-    <br>-    void<br>-    SetPythonClassName (const char* fname)<br>-    {<br>-        m_python_class.assign(fname);<br>-        m_python_code.clear();<br>-    }<br>-    <br>-    void<br>-    SetPythonCode (const char* script)<br>-    {<br>-        m_python_code.assign(script);<br>-    }<br>-    <br>-    std::string<br>-    GetDescription();<br>-    <br>-    bool<br>-    IsScripted()<br>-    {<br>-        return true;<br>-    }<br>-<br>-    class FrontEnd : public SyntheticChildrenFrontEnd<br>-    {<br>-    private:<br>-        std::string m_python_class;<br>-        lldb::ScriptInterpreterObjectSP m_wrapper_sp;<br>-        ScriptInterpreter *m_interpreter;<br>-    public:<br>-        <br>-        FrontEnd(std::string pclass,<br>-                 ValueObject &backend);<br>-        <br>-        virtual<br>-        ~FrontEnd();<br>-        <br>-        virtual uint32_t<br>-        CalculateNumChildren()<br>-        {<br>-            if (!m_wrapper_sp || m_interpreter == NULL)<br>-                return 0;<br>-            return m_interpreter->CalculateNumChildren(m_wrapper_sp);<br>-        }<br>-        <br>-        virtual lldb::ValueObjectSP<br>-        GetChildAtIndex (uint32_t idx);<br>-        <br>-        virtual bool<br>-        Update()<br>-        {<br>-            if (!m_wrapper_sp || m_interpreter == NULL)<br>-                return false;<br>-            <br>-            return m_interpreter->UpdateSynthProviderInstance(m_wrapper_sp);<br>-        }<br>-        <br>-        virtual bool<br>-        MightHaveChildren()<br>-        {<br>-            if (!m_wrapper_sp || m_interpreter == NULL)<br>-                return false;<br>-            <br>-            return m_interpreter->MightHaveChildrenSynthProviderInstance(m_wrapper_sp);<br>-        }<br>-        <br>-        virtual uint32_t<br>-        GetIndexOfChildWithName (const ConstString &name)<br>-        {<br>-            if (!m_wrapper_sp || m_interpreter == NULL)<br>-                return UINT32_MAX;<br>-            return m_interpreter->GetIndexOfChildWithName(m_wrapper_sp, name.GetCString());<br>-        }<br>-        <br>-        typedef STD_SHARED_PTR(SyntheticChildrenFrontEnd) SharedPointer;<br>-<br>-    private:<br>-        DISALLOW_COPY_AND_ASSIGN(FrontEnd);<br>-    };<br>-    <br>-    virtual SyntheticChildrenFrontEnd::AutoPointer<br>-    GetFrontEnd(ValueObject &backend)<br>-    {<br>-        return SyntheticChildrenFrontEnd::AutoPointer(new FrontEnd(m_python_class, backend));<br>-    }    <br>-    <br>-private:<br>-    DISALLOW_COPY_AND_ASSIGN(TypeSyntheticImpl);<br>-};<br>-<br>-#endif // #ifndef LLDB_DISABLE_PYTHON<br>-class SyntheticArrayView : public SyntheticChildren<br>-{<br>-public:<br>-    <br>-    struct SyntheticArrayRange<br>-    {<br>-    private:<br>-        int m_low;<br>-        int m_high;<br>-        SyntheticArrayRange* m_next;<br>-        <br>-    public:<br>-        <br>-        SyntheticArrayRange () : <br>-        m_low(-1),<br>-        m_high(-2),<br>-        m_next(NULL)<br>-        {}<br>-        <br>-        SyntheticArrayRange (int L) : <br>-        m_low(L),<br>-        m_high(L),<br>-        m_next(NULL)<br>-        {}<br>-        <br>-        SyntheticArrayRange (int L, int H) : <br>-        m_low(L),<br>-        m_high(H),<br>-        m_next(NULL)<br>-        {}<br>-        <br>-        SyntheticArrayRange (int L, int H, SyntheticArrayRange* N) : <br>-        m_low(L),<br>-        m_high(H),<br>-        m_next(N)<br>-        {}<br>-        <br>-        inline int<br>-        GetLow ()<br>-        {<br>-            return m_low;<br>-        }<br>-        <br>-        inline int<br>-        GetHigh ()<br>-        {<br>-            return m_high;<br>-        }<br>-        <br>-        inline void<br>-        SetLow (int L)<br>-        {<br>-            m_low = L;<br>-        }<br>-        <br>-        inline void<br>-        SetHigh (int H)<br>-        {<br>-            m_high = H;<br>-        }<br>-        <br>-        inline  int<br>-        GetSelfCount()<br>-        {<br>-            return GetHigh() - GetLow() + 1;<br>-        }<br>-        <br>-        int<br>-        GetCount()<br>-        {<br>-            int count = GetSelfCount();<br>-            if (m_next)<br>-                count += m_next->GetCount();<br>-            return count;<br>-        }<br>-        <br>-        inline SyntheticArrayRange*<br>-        GetNext()<br>-        {<br>-            return m_next;<br>-        }<br>-        <br>-        void<br>-        SetNext(SyntheticArrayRange* N)<br>-        {<br>-            if (m_next)<br>-                delete m_next;<br>-            m_next = N;<br>-        }<br>-        <br>-        void<br>-        SetNext(int L, int H)<br>-        {<br>-            if (m_next)<br>-                delete m_next;<br>-            m_next = new SyntheticArrayRange(L, H);<br>-        }<br>-        <br>-        void<br>-        SetNext(int L)<br>-        {<br>-            if (m_next)<br>-                delete m_next;<br>-            m_next = new SyntheticArrayRange(L);<br>-        }<br>-        <br>-        ~SyntheticArrayRange()<br>-        {<br>-            delete m_next;<br>-            m_next = NULL;<br>-        }<br>-        <br>-    };<br>-    <br>-    SyntheticArrayView(const SyntheticChildren::Flags& flags) :<br>-        SyntheticChildren(flags),<br>-        m_head(),<br>-        m_tail(&m_head)<br>-    {<br>-    }<br>-    <br>-    void<br>-    AddRange(int L, int H)<br>-    {<br>-        m_tail->SetLow(L);<br>-        m_tail->SetHigh(H);<br>-        m_tail->SetNext(new SyntheticArrayRange());<br>-        m_tail = m_tail->GetNext();<br>-    }<br>-    <br>-    int<br>-    GetCount()<br>-    {<br>-        return m_head.GetCount();<br>-    }<br>-    <br>-    int<br>-    GetRealIndexForIndex(int i);<br>-    <br>-    bool<br>-    IsScripted()<br>-    {<br>-        return false;<br>-    }<br>-    <br>-    std::string<br>-    GetDescription();<br>-    <br>-    class FrontEnd : public SyntheticChildrenFrontEnd<br>-    {<br>-    private:<br>-        SyntheticArrayView* filter;<br>-    public:<br>-        <br>-        FrontEnd(SyntheticArrayView* flt,<br>-                 ValueObject &backend) :<br>-        SyntheticChildrenFrontEnd(backend),<br>-        filter(flt)<br>-        {}<br>-        <br>-        virtual<br>-        ~FrontEnd()<br>-        {<br>-        }<br>-        <br>-        virtual uint32_t<br>-        CalculateNumChildren()<br>-        {<br>-            return filter->GetCount();<br>-        }<br>-        <br>-        virtual bool<br>-        MightHaveChildren ()<br>-        {<br>-            return filter->GetCount() > 0;<br>-        }<br>-        <br>-        virtual lldb::ValueObjectSP<br>-        GetChildAtIndex (uint32_t idx)<br>-        {<br>-            if (idx >= filter->GetCount())<br>-                return lldb::ValueObjectSP();<br>-            return m_backend.GetSyntheticArrayMember(filter->GetRealIndexForIndex(idx), true);<br>-        }<br>-        <br>-        virtual bool<br>-        Update() { return false; }<br>-        <br>-        virtual uint32_t<br>-        GetIndexOfChildWithName (const ConstString &name_cs);<br>-        <br>-        typedef STD_SHARED_PTR(SyntheticChildrenFrontEnd) SharedPointer;<br>-    <br>-    private:<br>-        DISALLOW_COPY_AND_ASSIGN(FrontEnd);<br>-    };<br>-    <br>-    virtual SyntheticChildrenFrontEnd::AutoPointer<br>-    GetFrontEnd(ValueObject &backend)<br>-    {<br>-        return SyntheticChildrenFrontEnd::AutoPointer(new FrontEnd(this, backend));<br>-    }<br>-private:<br>-    SyntheticArrayRange m_head;<br>-    SyntheticArrayRange *m_tail;<br>-<br>-private:<br>-    DISALLOW_COPY_AND_ASSIGN(SyntheticArrayView);<br>-};<br>-<br>-<br>-class TypeSummaryImpl<br>-{<br>-public:<br>-    class Flags<br>-    {<br>-    public:<br>-        <br>-        Flags () :<br>-            m_flags (lldb::eTypeOptionCascade)<br>-        {}<br>-        <br>-        Flags (const Flags& other) :<br>-            m_flags (other.m_flags)<br>-        {}<br>-        <br>-        Flags (uint32_t value) :<br>-            m_flags (value)<br>-        {}<br>-        <br>-        Flags&<br>-        operator = (const Flags& rhs)<br>-        {<br>-            if (&rhs != this)<br>-                m_flags = rhs.m_flags;<br>-            <br>-            return *this;<br>-        }<br>-        <br>-        Flags&<br>-        operator = (const uint32_t& rhs)<br>-        {<br>-            m_flags = rhs;<br>-            return *this;<br>-        }<br>-        <br>-        Flags&<br>-        Clear()<br>-        {<br>-            m_flags = 0;<br>-            return *this;<br>-        }<br>-        <br>-        bool<br>-        GetCascades () const<br>-        {<br>-            return (m_flags & lldb::eTypeOptionCascade) == lldb::eTypeOptionCascade;<br>-        }<br>-        <br>-        Flags&<br>-        SetCascades (bool value = true)<br>-        {<br>-            if (value)<br>-                m_flags |= lldb::eTypeOptionCascade;<br>-            else<br>-                m_flags &= ~lldb::eTypeOptionCascade;<br>-            return *this;<br>-        }<br>-<br>-        bool<br>-        GetSkipPointers () const<br>-        {<br>-            return (m_flags & lldb::eTypeOptionSkipPointers) == lldb::eTypeOptionSkipPointers;<br>-        }<br>-<br>-        Flags&<br>-        SetSkipPointers (bool value = true)<br>-        {<br>-            if (value)<br>-                m_flags |= lldb::eTypeOptionSkipPointers;<br>-            else<br>-                m_flags &= ~lldb::eTypeOptionSkipPointers;<br>-            return *this;<br>-        }<br>-        <br>-        bool<br>-        GetSkipReferences () const<br>-        {<br>-            return (m_flags & lldb::eTypeOptionSkipReferences) == lldb::eTypeOptionSkipReferences;<br>-        }<br>-        <br>-        Flags&<br>-        SetSkipReferences (bool value = true)<br>-        {<br>-            if (value)<br>-                m_flags |= lldb::eTypeOptionSkipReferences;<br>-            else<br>-                m_flags &= ~lldb::eTypeOptionSkipReferences;<br>-            return *this;<br>-        }<br>-        <br>-        bool<br>-        GetDontShowChildren () const<br>-        {<br>-            return (m_flags & lldb::eTypeOptionHideChildren) == lldb::eTypeOptionHideChildren;<br>-        }<br>-        <br>-        Flags&<br>-        SetDontShowChildren (bool value = true)<br>-        {<br>-            if (value)<br>-                m_flags |= lldb::eTypeOptionHideChildren;<br>-            else<br>-                m_flags &= ~lldb::eTypeOptionHideChildren;<br>-            return *this;<br>-        }<br>-        <br>-        bool<br>-        GetDontShowValue () const<br>-        {<br>-            return (m_flags & lldb::eTypeOptionHideValue) == lldb::eTypeOptionHideValue;<br>-        }<br>-        <br>-        Flags&<br>-        SetDontShowValue (bool value = true)<br>-        {<br>-            if (value)<br>-                m_flags |= lldb::eTypeOptionHideValue;<br>-            else<br>-                m_flags &= ~lldb::eTypeOptionHideValue;<br>-            return *this;<br>-        }<br>-        <br>-        bool<br>-        GetShowMembersOneLiner () const<br>-        {<br>-            return (m_flags & lldb::eTypeOptionShowOneLiner) == lldb::eTypeOptionShowOneLiner;<br>-        }<br>-        <br>-        Flags&<br>-        SetShowMembersOneLiner (bool value = true)<br>-        {<br>-            if (value)<br>-                m_flags |= lldb::eTypeOptionShowOneLiner;<br>-            else<br>-                m_flags &= ~lldb::eTypeOptionShowOneLiner;<br>-            return *this;<br>-        }<br>-        <br>-        bool<br>-        GetHideItemNames () const<br>-        {<br>-            return (m_flags & lldb::eTypeOptionHideNames) == lldb::eTypeOptionHideNames;<br>-        }<br>-        <br>-        Flags&<br>-        SetHideItemNames (bool value = true)<br>-        {<br>-            if (value)<br>-                m_flags |= lldb::eTypeOptionHideNames;<br>-            else<br>-                m_flags &= ~lldb::eTypeOptionHideNames;<br>-            return *this;<br>-        }<br>-        <br>-        uint32_t<br>-        GetValue ()<br>-        {<br>-            return m_flags;<br>-        }<br>-        <br>-        void<br>-        SetValue (uint32_t value)<br>-        {<br>-            m_flags = value;<br>-        }<br>-                <br>-    private:<br>-        uint32_t m_flags;<br>-    };<br>-    <br>-    typedef enum Type<br>-    {<br>-        eTypeUnknown,<br>-        eTypeString,<br>-        eTypeScript,<br>-        eTypeCallback<br>-    } Type;<br>-    <br>-    TypeSummaryImpl (const TypeSummaryImpl::Flags& flags);<br>-    <br>-    bool<br>-    Cascades () const<br>-    {<br>-        return m_flags.GetCascades();<br>-    }<br>-    bool<br>-    SkipsPointers () const<br>-    {<br>-        return m_flags.GetSkipPointers();<br>-    }<br>-    bool<br>-    SkipsReferences () const<br>-    {<br>-        return m_flags.GetSkipReferences();<br>-    }<br>-    <br>-    bool<br>-    DoesPrintChildren () const<br>-    {<br>-        return !m_flags.GetDontShowChildren();<br>-    }<br>-    <br>-    bool<br>-    DoesPrintValue () const<br>-    {<br>-        return !m_flags.GetDontShowValue();<br>-    }<br>-    <br>-    bool<br>-    IsOneliner () const<br>-    {<br>-        return m_flags.GetShowMembersOneLiner();<br>-    }<br>-    <br>-    bool<br>-    HideNames () const<br>-    {<br>-        return m_flags.GetHideItemNames();<br>-    }<br>-    <br>-    void<br>-    SetCascades (bool value)<br>-    {<br>-        m_flags.SetCascades(value);<br>-    }<br>-    <br>-    void<br>-    SetSkipsPointers (bool value)<br>-    {<br>-        m_flags.SetSkipPointers(value);<br>-    }<br>-    <br>-    void<br>-    SetSkipsReferences (bool value)<br>-    {<br>-        m_flags.SetSkipReferences(value);<br>-    }<br>-    <br>-    void<br>-    SetDoesPrintChildren (bool value)<br>-    {<br>-        m_flags.SetDontShowChildren(!value);<br>-    }<br>-    <br>-    void<br>-    SetDoesPrintValue (bool value)<br>-    {<br>-        m_flags.SetDontShowValue(!value);<br>-    }<br>-    <br>-    void<br>-    SetIsOneliner (bool value)<br>-    {<br>-        m_flags.SetShowMembersOneLiner(value);<br>-    }<br>-    <br>-    void<br>-    SetHideNames (bool value)<br>-    {<br>-        m_flags.SetHideItemNames(value);<br>-    }<br>-    <br>-    uint32_t<br>-    GetOptions ()<br>-    {<br>-        return m_flags.GetValue();<br>-    }<br>-    <br>-    void<br>-    SetOptions (uint32_t value)<br>-    {<br>-        m_flags.SetValue(value);<br>-    }<br>-    <br>-    virtual<br>-    ~TypeSummaryImpl ()<br>-    {<br>-    }<br>-    <br>-    // we are using a ValueObject* instead of a ValueObjectSP because we do not need to hold on to this for<br>-    // extended periods of time and we trust the ValueObject to stay around for as long as it is required<br>-    // for us to generate its summary<br>-    virtual bool<br>-    FormatObject (ValueObject *valobj,<br>-                  std::string& dest) = 0;<br>-    <br>-    virtual std::string<br>-    GetDescription () = 0;<br>-    <br>-    virtual bool<br>-    IsScripted() = 0;<br>-    <br>-    virtual Type<br>-    GetType () = 0;<br>-    <br>-    uint32_t&<br>-    GetRevision ()<br>-    {<br>-        return m_my_revision;<br>-    }<br>-    <br>-    typedef STD_SHARED_PTR(TypeSummaryImpl) SharedPointer;<br>-    typedef bool(*SummaryCallback)(void*, ConstString, const lldb::TypeSummaryImplSP&);<br>-    typedef bool(*RegexSummaryCallback)(void*, lldb::RegularExpressionSP, const lldb::TypeSummaryImplSP&);<br>-<br>-protected:<br>-    uint32_t m_my_revision;<br>-    Flags m_flags;<br>-    <br>-private:<br>-    DISALLOW_COPY_AND_ASSIGN(TypeSummaryImpl);<br>-};<br>-<br>-// simple string-based summaries, using ${var to show data<br>-struct StringSummaryFormat : public TypeSummaryImpl<br>-{<br>-    std::string m_format;<br>-    <br>-    StringSummaryFormat(const TypeSummaryImpl::Flags& flags,<br>-                        const char* f);<br>-    <br>-    const char*<br>-    GetSummaryString () const<br>-    {<br>-        return m_format.c_str();<br>-    }<br>-    <br>-    void<br>-    SetSummaryString (const char* data)<br>-    {<br>-        if (data)<br>-                m_format.assign(data);<br>-        else<br>-                m_format.clear();<br>-    }<br>-    <br>-    virtual<br>-    ~StringSummaryFormat()<br>-    {<br>-    }<br>-    <br>-    virtual bool<br>-    FormatObject(ValueObject *valobj,<br>-                 std::string& dest);<br>-    <br>-    virtual std::string<br>-    GetDescription();<br>-    <br>-    virtual bool<br>-    IsScripted()<br>-    {<br>-        return false;<br>-    }<br>-<br>-    <br>-    virtual Type<br>-    GetType ()<br>-    {<br>-        return TypeSummaryImpl::eTypeString;<br>-    }<br>-    <br>-private:<br>-    DISALLOW_COPY_AND_ASSIGN(StringSummaryFormat);<br>-};<br>-<br>-// summaries implemented via a C++ function<br>-struct CXXFunctionSummaryFormat : public TypeSummaryImpl<br>-{<br>-    <br>-    // we should convert these to SBValue and SBStream if we ever cross<br>-    // the boundary towards the external world<br>-    typedef bool (*Callback)(ValueObject& valobj,<br>-                             Stream& dest);<br>-    <br>-    <br>-    Callback m_impl;<br>-    std::string m_description;<br>-    <br>-    CXXFunctionSummaryFormat(const TypeSummaryImpl::Flags& flags,<br>-                             Callback impl,<br>-                             const char* description);<br>-    <br>-    Callback<br>-    GetBackendFunction () const<br>-    {<br>-        return m_impl;<br>-    }<br>-    <br>-    const char*<br>-    GetTextualInfo () const<br>-    {<br>-        return m_description.c_str();<br>-    }<br>-    <br>-    void<br>-    SetBackendFunction (Callback cb_func)<br>-    {<br>-        m_impl = cb_func;<br>-    }<br>-    <br>-    void<br>-    SetTextualInfo (const char* descr)<br>-    {<br>-        if (descr)<br>-            m_description.assign(descr);<br>-        else<br>-            m_description.clear();<br>-    }<br>-    <br>-    virtual<br>-    ~CXXFunctionSummaryFormat()<br>-    {<br>-    }<br>-    <br>-    virtual bool<br>-    FormatObject(ValueObject *valobj,<br>-                 std::string& dest);<br>-    <br>-    virtual std::string<br>-    GetDescription();<br>-    <br>-    virtual bool<br>-    IsScripted()<br>-    {<br>-        return false;<br>-    }<br>-    <br>-    virtual Type<br>-    GetType ()<br>-    {<br>-        return TypeSummaryImpl::eTypeCallback;<br>-    }<br>-    <br>-    typedef STD_SHARED_PTR(CXXFunctionSummaryFormat) SharedPointer;<br>-<br>-private:<br>-    DISALLOW_COPY_AND_ASSIGN(CXXFunctionSummaryFormat);<br>-};<br>-    <br>-#ifndef LLDB_DISABLE_PYTHON<br>-<br>-// Python-based summaries, running script code to show data<br>-struct ScriptSummaryFormat : public TypeSummaryImpl<br>-{<br>-    std::string m_function_name;<br>-    std::string m_python_script;<br>-    lldb::ScriptInterpreterObjectSP m_script_function_sp;<br>-    <br>-    ScriptSummaryFormat(const TypeSummaryImpl::Flags& flags,<br>-                        const char *function_name,<br>-                        const char* python_script = NULL);<br>-    <br>-    const char*<br>-    GetFunctionName () const<br>-    {<br>-        return m_function_name.c_str();<br>-    }<br>-    <br>-    const char*<br>-    GetPythonScript () const<br>-    {<br>-        return m_python_script.c_str();<br>-    }<br>-    <br>-    void<br>-    SetFunctionName (const char* function_name)<br>-    {<br>-        if (function_name)<br>-                m_function_name.assign(function_name);<br>-        else<br>-                m_function_name.clear();<br>-        m_python_script.clear();<br>-    }<br>-    <br>-    void<br>-    SetPythonScript (const char* script)<br>-    {<br>-        if (script)<br>-                m_python_script.assign(script);<br>-        else<br>-                m_python_script.clear();<br>-    }<br>-    <br>-    virtual<br>-    ~ScriptSummaryFormat()<br>-    {<br>-    }<br>-    <br>-    virtual bool<br>-    FormatObject(ValueObject *valobj,<br>-                 std::string& dest);<br>-    <br>-    virtual std::string<br>-    GetDescription();<br>-    <br>-    virtual bool<br>-    IsScripted()<br>-    {<br>-        return true;<br>-    }<br>-    <br>-    virtual Type<br>-    GetType ()<br>-    {<br>-        return TypeSummaryImpl::eTypeScript;<br>-    }<br>-    <br>-    typedef STD_SHARED_PTR(ScriptSummaryFormat) SharedPointer;<br>-<br>-    <br>-private:<br>-    DISALLOW_COPY_AND_ASSIGN(ScriptSummaryFormat);<br>-};<br>+#include "lldb/DataFormatters/TypeFormat.h"<br>+#include "lldb/DataFormatters/TypeSummary.h"<br>+#include "lldb/DataFormatters/TypeSynthetic.h"<br><br>-#endif // #ifndef LLDB_DISABLE_PYTHON<br>+namespace lldb_private {<br><br>-// TODO: at the moment, this class is only used as a backing store for SBTypeNameSpecifier in the public API<br>-// In the future, this might be used as the basic unit for typename-to-formatter matching, replacing<br>-// the current plain/regexp distinction in FormatNavigator<><br> class TypeNameSpecifierImpl<br> {<br> public:<br>-    <br>     TypeNameSpecifierImpl() :<br>     m_is_regex(false),<br>     m_type()<br><br>Copied: lldb/trunk/include/lldb/DataFormatters/FormatManager.h (from r173281, lldb/trunk/include/lldb/Core/FormatManager.h)<br>URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/FormatManager.h?p2=lldb/trunk/include/lldb/DataFormatters/FormatManager.h&p1=lldb/trunk/include/lldb/Core/FormatManager.h&r1=173281&r2=173728&rev=173728&view=diff">http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/FormatManager.h?p2=lldb/trunk/include/lldb/DataFormatters/FormatManager.h&p1=lldb/trunk/include/lldb/Core/FormatManager.h&r1=173281&r2=173728&rev=173728&view=diff</a><br>==============================================================================<br>--- lldb/trunk/include/lldb/Core/FormatManager.h (original)<br>+++ lldb/trunk/include/lldb/DataFormatters/FormatManager.h Mon Jan 28 17:47:25 2013<br>@@ -18,12 +18,10 @@<br> #include "lldb/lldb-public.h"<br> #include "lldb/lldb-enumerations.h"<br><br>-#include "lldb/Core/FormatNavigator.h"<br>-#include "lldb/Interpreter/ScriptInterpreterPython.h"<br>-#include "lldb/Target/ExecutionContext.h"<br>-#include "lldb/Target/Platform.h"<br>-<br>-using lldb::LogSP;<br>+#include "lldb/DataFormatters/FormatCache.h"<br>+#include "lldb/DataFormatters/FormatNavigator.h"<br>+#include "lldb/DataFormatters/TypeCategory.h"<br>+#include "lldb/DataFormatters/TypeCategoryMap.h"<br><br> namespace lldb_private {<br><br>@@ -31,535 +29,16 @@ namespace lldb_private {<br> // class DataVisualization is the high-level front-end of this feature<br> // clients should refer to that class as the entry-point into the data formatters<br> // unless they have a good reason to bypass it and prefer to use this file's objects directly<br>-    <br>-class CategoryMap;<br>-    <br>-class TypeCategoryImpl<br>-{<br>-private:<br>-    <br>-    typedef FormatNavigator<ConstString, TypeSummaryImpl> SummaryNavigator;<br>-    typedef FormatNavigator<lldb::RegularExpressionSP, TypeSummaryImpl> RegexSummaryNavigator;<br>-    <br>-    typedef FormatNavigator<ConstString, TypeFilterImpl> FilterNavigator;<br>-    typedef FormatNavigator<lldb::RegularExpressionSP, TypeFilterImpl> RegexFilterNavigator;<br>-    <br>-#ifndef LLDB_DISABLE_PYTHON<br>-    typedef FormatNavigator<ConstString, TypeSyntheticImpl> SynthNavigator;<br>-    typedef FormatNavigator<lldb::RegularExpressionSP, TypeSyntheticImpl> RegexSynthNavigator;<br>-#endif // #ifndef LLDB_DISABLE_PYTHON<br>-<br>-    typedef SummaryNavigator::MapType SummaryMap;<br>-    typedef RegexSummaryNavigator::MapType RegexSummaryMap;<br>-    typedef FilterNavigator::MapType FilterMap;<br>-    typedef RegexFilterNavigator::MapType RegexFilterMap;<br>-#ifndef LLDB_DISABLE_PYTHON<br>-    typedef SynthNavigator::MapType SynthMap;<br>-    typedef RegexSynthNavigator::MapType RegexSynthMap;<br>-#endif // #ifndef LLDB_DISABLE_PYTHON<br>-<br>-public:<br>-        <br>-    typedef uint16_t FormatCategoryItems;<br>-    static const uint16_t ALL_ITEM_TYPES = UINT16_MAX;<br>-    <br>-    typedef SummaryNavigator::SharedPointer SummaryNavigatorSP;<br>-    typedef RegexSummaryNavigator::SharedPointer RegexSummaryNavigatorSP;<br>-    typedef FilterNavigator::SharedPointer FilterNavigatorSP;<br>-    typedef RegexFilterNavigator::SharedPointer RegexFilterNavigatorSP;<br>-#ifndef LLDB_DISABLE_PYTHON<br>-    typedef SynthNavigator::SharedPointer SynthNavigatorSP;<br>-    typedef RegexSynthNavigator::SharedPointer RegexSynthNavigatorSP;<br>-#endif // #ifndef LLDB_DISABLE_PYTHON<br>-<br>-    TypeCategoryImpl (IFormatChangeListener* clist,<br>-                      ConstString name);<br>-    <br>-    SummaryNavigatorSP<br>-    GetSummaryNavigator ()<br>-    {<br>-        return SummaryNavigatorSP(m_summary_nav);<br>-    }<br>-    <br>-    RegexSummaryNavigatorSP<br>-    GetRegexSummaryNavigator ()<br>-    {<br>-        return RegexSummaryNavigatorSP(m_regex_summary_nav);<br>-    }<br>-    <br>-    FilterNavigatorSP<br>-    GetFilterNavigator ()<br>-    {<br>-        return FilterNavigatorSP(m_filter_nav);<br>-    }<br>-    <br>-    RegexFilterNavigatorSP<br>-    GetRegexFilterNavigator ()<br>-    {<br>-        return RegexFilterNavigatorSP(m_regex_filter_nav);<br>-    }<br>-    <br>-    SummaryNavigator::MapValueType<br>-    GetSummaryForType (lldb::TypeNameSpecifierImplSP type_sp)<br>-    {<br>-        SummaryNavigator::MapValueType retval;<br>-        <br>-        if (type_sp)<br>-        {<br>-            if (type_sp->IsRegex())<br>-                m_regex_summary_nav->GetExact(ConstString(type_sp->GetName()),retval);<br>-            else<br>-                m_summary_nav->GetExact(ConstString(type_sp->GetName()),retval);<br>-        }<br>-<br>-        return retval;<br>-    }<br>-    <br>-    FilterNavigator::MapValueType<br>-    GetFilterForType (lldb::TypeNameSpecifierImplSP type_sp)<br>-    {<br>-        FilterNavigator::MapValueType retval;<br>-        <br>-        if (type_sp)<br>-        {<br>-            if (type_sp->IsRegex())<br>-                m_regex_filter_nav->GetExact(ConstString(type_sp->GetName()),retval);<br>-            else<br>-                m_filter_nav->GetExact(ConstString(type_sp->GetName()),retval);<br>-        }<br>-        <br>-        return retval;<br>-    }<br>-    <br>-#ifndef LLDB_DISABLE_PYTHON<br>-    SynthNavigator::MapValueType<br>-    GetSyntheticForType (lldb::TypeNameSpecifierImplSP type_sp)<br>-    {<br>-        SynthNavigator::MapValueType retval;<br>-        <br>-        if (type_sp)<br>-        {<br>-            if (type_sp->IsRegex())<br>-                m_regex_synth_nav->GetExact(ConstString(type_sp->GetName()),retval);<br>-            else<br>-                m_synth_nav->GetExact(ConstString(type_sp->GetName()),retval);<br>-        }<br>-        <br>-        return retval;<br>-    }<br>-#endif<br>-    <br>-    lldb::TypeNameSpecifierImplSP<br>-    GetTypeNameSpecifierForSummaryAtIndex (uint32_t index)<br>-    {<br>-        if (index < m_summary_nav->GetCount())<br>-            return m_summary_nav->GetTypeNameSpecifierAtIndex(index);<br>-        else<br>-            return m_regex_summary_nav->GetTypeNameSpecifierAtIndex(index-m_summary_nav->GetCount());<br>-    }<br>-    <br>-    SummaryNavigator::MapValueType<br>-    GetSummaryAtIndex (uint32_t index)<br>-    {<br>-        if (index < m_summary_nav->GetCount())<br>-            return m_summary_nav->GetAtIndex(index);<br>-        else<br>-            return m_regex_summary_nav->GetAtIndex(index-m_summary_nav->GetCount());<br>-    }<br>-<br>-    FilterNavigator::MapValueType<br>-    GetFilterAtIndex (uint32_t index)<br>-    {<br>-        if (index < m_filter_nav->GetCount())<br>-            return m_filter_nav->GetAtIndex(index);<br>-        else<br>-            return m_regex_filter_nav->GetAtIndex(index-m_filter_nav->GetCount());<br>-    }<br>-    <br>-    lldb::TypeNameSpecifierImplSP<br>-    GetTypeNameSpecifierForFilterAtIndex (uint32_t index)<br>-    {<br>-        if (index < m_filter_nav->GetCount())<br>-            return m_filter_nav->GetTypeNameSpecifierAtIndex(index);<br>-        else<br>-            return m_regex_filter_nav->GetTypeNameSpecifierAtIndex(index-m_filter_nav->GetCount());<br>-    }<br>-<br>-#ifndef LLDB_DISABLE_PYTHON<br>-    SynthNavigatorSP<br>-    GetSyntheticNavigator ()<br>-    {<br>-        return SynthNavigatorSP(m_synth_nav);<br>-    }<br>-    <br>-    RegexSynthNavigatorSP<br>-    GetRegexSyntheticNavigator ()<br>-    {<br>-        return RegexSynthNavigatorSP(m_regex_synth_nav);<br>-    }<br>-    <br>-    SynthNavigator::MapValueType<br>-    GetSyntheticAtIndex (uint32_t index)<br>-    {<br>-        if (index < m_synth_nav->GetCount())<br>-            return m_synth_nav->GetAtIndex(index);<br>-        else<br>-            return m_regex_synth_nav->GetAtIndex(index-m_synth_nav->GetCount());<br>-    }<br>-    <br>-    lldb::TypeNameSpecifierImplSP<br>-    GetTypeNameSpecifierForSyntheticAtIndex (uint32_t index)<br>-    {<br>-        if (index < m_synth_nav->GetCount())<br>-            return m_synth_nav->GetTypeNameSpecifierAtIndex(index);<br>-        else<br>-            return m_regex_synth_nav->GetTypeNameSpecifierAtIndex(index - m_synth_nav->GetCount());<br>-    }<br>-    <br>-#endif // #ifndef LLDB_DISABLE_PYTHON<br>-<br>-    bool<br>-    IsEnabled () const<br>-    {<br>-        return m_enabled;<br>-    }<br>-    <br>-    uint32_t<br>-    GetEnabledPosition()<br>-    {<br>-        if (m_enabled == false)<br>-            return UINT32_MAX;<br>-        else<br>-            return m_enabled_position;<br>-    }<br>-    <br>-    bool<br>-    Get (ValueObject& valobj,<br>-         lldb::TypeSummaryImplSP& entry,<br>-         lldb::DynamicValueType use_dynamic,<br>-         uint32_t* reason = NULL);<br>-    <br>-    bool<br>-    Get (ValueObject& valobj,<br>-         lldb::SyntheticChildrenSP& entry,<br>-         lldb::DynamicValueType use_dynamic,<br>-         uint32_t* reason = NULL);<br>-        <br>-    void<br>-    Clear (FormatCategoryItems items = ALL_ITEM_TYPES);<br>-    <br>-    bool<br>-    Delete (ConstString name,<br>-            FormatCategoryItems items = ALL_ITEM_TYPES);<br>-    <br>-    uint32_t<br>-    GetCount (FormatCategoryItems items = ALL_ITEM_TYPES);<br>-    <br>-    const char*<br>-    GetName ()<br>-    {<br>-        return m_name.GetCString();<br>-    }<br>-    <br>-    bool<br>-    AnyMatches (ConstString type_name,<br>-                FormatCategoryItems items = ALL_ITEM_TYPES,<br>-                bool only_enabled = true,<br>-                const char** matching_category = NULL,<br>-                FormatCategoryItems* matching_type = NULL);<br>-    <br>-    typedef STD_SHARED_PTR(TypeCategoryImpl) SharedPointer;<br>-    <br>-private:<br>-    SummaryNavigator::SharedPointer m_summary_nav;<br>-    RegexSummaryNavigator::SharedPointer m_regex_summary_nav;<br>-    FilterNavigator::SharedPointer m_filter_nav;<br>-    RegexFilterNavigator::SharedPointer m_regex_filter_nav;<br>-#ifndef LLDB_DISABLE_PYTHON<br>-    SynthNavigator::SharedPointer m_synth_nav;<br>-    RegexSynthNavigator::SharedPointer m_regex_synth_nav;<br>-#endif // #ifndef LLDB_DISABLE_PYTHON<br>-    <br>-    bool m_enabled;<br>-    <br>-    IFormatChangeListener* m_change_listener;<br>-    <br>-    Mutex m_mutex;<br>-    <br>-    ConstString m_name;<br>-    <br>-    uint32_t m_enabled_position;<br>-    <br>-    void<br>-    Enable (bool value,<br>-            uint32_t position)<br>-    {<br>-        Mutex::Locker locker(m_mutex);<br>-        m_enabled = value;<br>-        m_enabled_position = position;<br>-        if (m_change_listener)<br>-            m_change_listener->Changed();<br>-    }<br>-    <br>-    void<br>-    Disable ()<br>-    {<br>-        Enable(false, UINT32_MAX);<br>-    }<br>-    <br>-    friend class CategoryMap;<br>-    <br>-    friend class FormatNavigator<ConstString, TypeSummaryImpl>;<br>-    friend class FormatNavigator<lldb::RegularExpressionSP, TypeSummaryImpl>;<br>-    <br>-    friend class FormatNavigator<ConstString, TypeFilterImpl>;<br>-    friend class FormatNavigator<lldb::RegularExpressionSP, TypeFilterImpl>;<br>-    <br>-#ifndef LLDB_DISABLE_PYTHON<br>-    friend class FormatNavigator<ConstString, TypeSyntheticImpl>;<br>-    friend class FormatNavigator<lldb::RegularExpressionSP, TypeSyntheticImpl>;<br>-#endif // #ifndef LLDB_DISABLE_PYTHON<br>-    <br>-<br>-};<br>-<br>-class CategoryMap<br>-{<br>-private:<br>-    typedef ConstString KeyType;<br>-    typedef TypeCategoryImpl ValueType;<br>-    typedef ValueType::SharedPointer ValueSP;<br>-    typedef std::list<lldb::TypeCategoryImplSP> ActiveCategoriesList;<br>-    typedef ActiveCategoriesList::iterator ActiveCategoriesIterator;<br>-        <br>-public:<br>-    typedef std::map<KeyType, ValueSP> MapType;<br>-    typedef MapType::iterator MapIterator;<br>-    typedef bool(*CallbackType)(void*, const ValueSP&);<br>-    typedef uint32_t Position;<br>-    <br>-    static const Position First = 0;<br>-    static const Position Default = 1;<br>-    static const Position Last = UINT32_MAX;<br>-    <br>-    CategoryMap (IFormatChangeListener* lst) :<br>-        m_map_mutex(Mutex::eMutexTypeRecursive),<br>-        listener(lst),<br>-        m_map(),<br>-        m_active_categories()<br>-    {<br>-        ConstString default_cs("default");<br>-        lldb::TypeCategoryImplSP default_sp = lldb::TypeCategoryImplSP(new TypeCategoryImpl(listener, default_cs));<br>-        Add(default_cs,default_sp);<br>-        Enable(default_cs,First);<br>-    }<br>-    <br>-    void<br>-    Add (KeyType name,<br>-         const ValueSP& entry)<br>-    {<br>-        Mutex::Locker locker(m_map_mutex);<br>-        m_map[name] = entry;<br>-        if (listener)<br>-            listener->Changed();<br>-    }<br>-    <br>-    bool<br>-    Delete (KeyType name)<br>-    {<br>-        Mutex::Locker locker(m_map_mutex);<br>-        MapIterator iter = m_map.find(name);<br>-        if (iter == m_map.end())<br>-            return false;<br>-        m_map.erase(name);<br>-        Disable(name);<br>-        if (listener)<br>-            listener->Changed();<br>-        return true;<br>-    }<br>-    <br>-    bool<br>-    Enable (KeyType category_name,<br>-            Position pos = Default)<br>-    {<br>-        Mutex::Locker locker(m_map_mutex);<br>-        ValueSP category;<br>-        if (!Get(category_name,category))<br>-            return false;<br>-        return Enable(category, pos);<br>-    }<br>-    <br>-    bool<br>-    Disable (KeyType category_name)<br>-    {<br>-        Mutex::Locker locker(m_map_mutex);<br>-        ValueSP category;<br>-        if (!Get(category_name,category))<br>-            return false;<br>-        return Disable(category);<br>-    }<br>-    <br>-    bool<br>-    Enable (ValueSP category,<br>-            Position pos = Default)<br>-    {<br>-        Mutex::Locker locker(m_map_mutex);<br>-        if (category.get())<br>-        {<br>-            Position pos_w = pos;<br>-            if (pos == First || m_active_categories.size() == 0)<br>-                m_active_categories.push_front(category);<br>-            else if (pos == Last || pos == m_active_categories.size())<br>-                m_active_categories.push_back(category);<br>-            else if (pos < m_active_categories.size())<br>-            {<br>-                ActiveCategoriesList::iterator iter = m_active_categories.begin();<br>-                while (pos_w)<br>-                {<br>-                    pos_w--,iter++;<br>-                }<br>-                m_active_categories.insert(iter,category);<br>-            }<br>-            else<br>-                return false;<br>-            category->Enable(true,<br>-                             pos);<br>-            return true;<br>-        }<br>-        return false;<br>-    }<br>-    <br>-    bool<br>-    Disable (ValueSP category)<br>-    {<br>-        Mutex::Locker locker(m_map_mutex);<br>-        if (category.get())<br>-        {<br>-            m_active_categories.remove_if(delete_matching_categories(category));<br>-            category->Disable();<br>-            return true;<br>-        }<br>-        return false;<br>-    }<br>-    <br>-    void<br>-    Clear ()<br>-    {<br>-        Mutex::Locker locker(m_map_mutex);<br>-        m_map.clear();<br>-        m_active_categories.clear();<br>-        if (listener)<br>-            listener->Changed();<br>-    }<br>-    <br>-    bool<br>-    Get (KeyType name,<br>-         ValueSP& entry)<br>-    {<br>-        Mutex::Locker locker(m_map_mutex);<br>-        MapIterator iter = m_map.find(name);<br>-        if (iter == m_map.end())<br>-            return false;<br>-        entry = iter->second;<br>-        return true;<br>-    }<br>-    <br>-    bool<br>-    Get (uint32_t pos,<br>-         ValueSP& entry)<br>-    {<br>-        Mutex::Locker locker(m_map_mutex);<br>-        MapIterator iter = m_map.begin();<br>-        MapIterator end = m_map.end();<br>-        while (pos > 0)<br>-        {<br>-            iter++;<br>-            pos--;<br>-            if (iter == end)<br>-                return false;<br>-        }<br>-        entry = iter->second;<br>-        return false;<br>-    }<br>-    <br>-    void<br>-    LoopThrough (CallbackType callback, void* param);<br>-    <br>-    lldb::TypeCategoryImplSP<br>-    GetAtIndex (uint32_t);<br>-    <br>-    bool<br>-    AnyMatches (ConstString type_name,<br>-                TypeCategoryImpl::FormatCategoryItems items = TypeCategoryImpl::ALL_ITEM_TYPES,<br>-                bool only_enabled = true,<br>-                const char** matching_category = NULL,<br>-                TypeCategoryImpl::FormatCategoryItems* matching_type = NULL);<br>-    <br>-    uint32_t<br>-    GetCount ()<br>-    {<br>-        return m_map.size();<br>-    }<br>-    <br>-    lldb::TypeSummaryImplSP<br>-    GetSummaryFormat (ValueObject& valobj,<br>-         lldb::DynamicValueType use_dynamic);<br>-    <br>-#ifndef LLDB_DISABLE_PYTHON<br>-    lldb::SyntheticChildrenSP<br>-    GetSyntheticChildren (ValueObject& valobj,<br>-                          lldb::DynamicValueType use_dynamic);<br>-#endif<br>-    <br>-private:<br>-    <br>-    class delete_matching_categories<br>-    {<br>-        lldb::TypeCategoryImplSP ptr;<br>-    public:<br>-        delete_matching_categories(lldb::TypeCategoryImplSP p) : ptr(p)<br>-        {}<br>-        <br>-        bool operator()(const lldb::TypeCategoryImplSP& other)<br>-        {<br>-            return ptr.get() == other.get();<br>-        }<br>-    };<br>-    <br>-    Mutex m_map_mutex;<br>-    IFormatChangeListener* listener;<br>-    <br>-    MapType m_map;<br>-    ActiveCategoriesList m_active_categories;<br>-    <br>-    MapType& map ()<br>-    {<br>-        return m_map;<br>-    }<br>-    <br>-    ActiveCategoriesList& active_list ()<br>-    {<br>-        return m_active_categories;<br>-    }<br>-    <br>-    Mutex& mutex ()<br>-    {<br>-        return m_map_mutex;<br>-    }<br>-    <br>-    friend class FormatNavigator<KeyType, ValueType>;<br>-    friend class FormatManager;<br>-};<br><br> class FormatManager : public IFormatChangeListener<br> {<br>     typedef FormatNavigator<ConstString, TypeFormatImpl> ValueNavigator;<br>     typedef ValueNavigator::MapType ValueMap;<br>     typedef FormatMap<ConstString, TypeSummaryImpl> NamedSummariesMap;<br>-    typedef CategoryMap::MapType::iterator CategoryMapIterator;<br>+    typedef TypeCategoryMap::MapType::iterator CategoryMapIterator;<br> public:<br><br>-    typedef CategoryMap::CallbackType CategoryCallback;<br>+    typedef TypeCategoryMap::CallbackType CategoryCallback;<br><br>     FormatManager ();<br><br>@@ -577,7 +56,7 @@ public:<br><br>     void<br>     EnableCategory (const ConstString& category_name,<br>-                    CategoryMap::Position pos = CategoryMap::Default)<br>+                    TypeCategoryMap::Position pos = TypeCategoryMap::Default)<br>     {<br>         m_categories_map.Enable(category_name,<br>                                 pos);<br>@@ -591,7 +70,7 @@ public:<br><br>     void<br>     EnableCategory (const lldb::TypeCategoryImplSP& category,<br>-                    CategoryMap::Position pos = CategoryMap::Default)<br>+                    TypeCategoryMap::Position pos = TypeCategoryMap::Default)<br>     {<br>         m_categories_map.Enable(category,<br>                                 pos);<br>@@ -622,7 +101,7 @@ public:<br>     }<br><br>     lldb::TypeCategoryImplSP<br>-    GetCategoryAtIndex (uint32_t index)<br>+    GetCategoryAtIndex (size_t index)<br>     {<br>         return m_categories_map.GetAtIndex(index);<br>     }<br>@@ -647,20 +126,13 @@ public:<br>                  bool can_create = true);<br><br>     lldb::TypeSummaryImplSP<br>-    GetSummaryFormat (ValueObject& valobj,<br>-                      lldb::DynamicValueType use_dynamic)<br>-    {<br>-        return m_categories_map.GetSummaryFormat(valobj, use_dynamic);<br>-    }<br>-    <br>-    lldb::TypeSummaryImplSP<br>     GetSummaryForType (lldb::TypeNameSpecifierImplSP type_sp);<br><br>     lldb::TypeFilterImplSP<br>     GetFilterForType (lldb::TypeNameSpecifierImplSP type_sp);<br><br> #ifndef LLDB_DISABLE_PYTHON<br>-    lldb::TypeSyntheticImplSP<br>+    lldb::ScriptedSyntheticChildrenSP<br>     GetSyntheticForType (lldb::TypeNameSpecifierImplSP type_sp);<br> #endif<br><br>@@ -669,13 +141,14 @@ public:<br>     GetSyntheticChildrenForType (lldb::TypeNameSpecifierImplSP type_sp);<br> #endif<br><br>+    lldb::TypeSummaryImplSP<br>+    GetSummaryFormat (ValueObject& valobj,<br>+                      lldb::DynamicValueType use_dynamic);<br>+<br> #ifndef LLDB_DISABLE_PYTHON<br>     lldb::SyntheticChildrenSP<br>     GetSyntheticChildren (ValueObject& valobj,<br>-                          lldb::DynamicValueType use_dynamic)<br>-    {<br>-        return m_categories_map.GetSyntheticChildren(valobj, use_dynamic);<br>-    }<br>+                          lldb::DynamicValueType use_dynamic);<br> #endif<br><br>     bool<br>@@ -719,6 +192,7 @@ public:<br>     Changed ()<br>     {<br>         __sync_add_and_fetch(&m_last_revision, +1);<br>+        m_format_cache.Clear ();<br>     }<br><br>     uint32_t<br>@@ -731,11 +205,12 @@ public:<br>     {<br>     }<br><br>-private:    <br>+private:<br>+    FormatCache m_format_cache;<br>     ValueNavigator m_value_nav;<br>     NamedSummariesMap m_named_summaries_map;<br>     uint32_t m_last_revision;<br>-    CategoryMap m_categories_map;<br>+    TypeCategoryMap m_categories_map;<br><br>     ConstString m_default_category_name;<br>     ConstString m_system_category_name;<br>@@ -748,7 +223,7 @@ private:    <br>     ConstString m_vectortypes_category_name;<br>     ConstString m_appkit_category_name;<br><br>-    CategoryMap&<br>+    TypeCategoryMap&<br>     GetCategories ()<br>     {<br>         return m_categories_map;<br><br>Copied: lldb/trunk/include/lldb/DataFormatters/FormatNavigator.h (from r173281, lldb/trunk/include/lldb/Core/FormatNavigator.h)<br>URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/FormatNavigator.h?p2=lldb/trunk/include/lldb/DataFormatters/FormatNavigator.h&p1=lldb/trunk/include/lldb/Core/FormatNavigator.h&r1=173281&r2=173728&rev=173728&view=diff">http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/FormatNavigator.h?p2=lldb/trunk/include/lldb/DataFormatters/FormatNavigator.h&p1=lldb/trunk/include/lldb/Core/FormatNavigator.h&r1=173281&r2=173728&rev=173728&view=diff</a><br>==============================================================================<br>--- lldb/trunk/include/lldb/Core/FormatNavigator.h (original)<br>+++ lldb/trunk/include/lldb/DataFormatters/FormatNavigator.h Mon Jan 28 17:47:25 2013<br>@@ -21,11 +21,12 @@<br> // Project includes<br> #include "lldb/lldb-public.h"<br><br>-#include "lldb/Core/FormatClasses.h"<br> #include "lldb/Core/Log.h"<br> #include "lldb/Core/RegularExpression.h"<br> #include "lldb/Core/ValueObject.h"<br><br>+#include "lldb/DataFormatters/FormatClasses.h"<br>+<br> #include "lldb/Symbol/ClangASTContext.h"<br><br> #include "lldb/Target/ObjCLanguageRuntime.h"<br>@@ -192,7 +193,7 @@ public:<br>     }<br><br>     ValueSP<br>-    GetValueAtIndex (uint32_t index)<br>+    GetValueAtIndex (size_t index)<br>     {<br>         Mutex::Locker locker(m_map_mutex);<br>         MapIterator iter = m_map.begin();<br>@@ -208,7 +209,7 @@ public:<br>     }<br><br>     KeyType<br>-    GetKeyAtIndex (uint32_t index)<br>+    GetKeyAtIndex (size_t index)<br>     {<br>         Mutex::Locker locker(m_map_mutex);<br>         MapIterator iter = m_map.begin();<br>@@ -316,13 +317,13 @@ public:<br>     }<br><br>     MapValueType<br>-    GetAtIndex (uint32_t index)<br>+    GetAtIndex (size_t index)<br>     {<br>         return m_format_map.GetValueAtIndex(index);<br>     }<br><br>     lldb::TypeNameSpecifierImplSP<br>-    GetTypeNameSpecifierAtIndex (uint32_t index)<br>+    GetTypeNameSpecifierAtIndex (size_t index)<br>     {<br>         return GetTypeNameSpecifierAtIndex_Impl(index, (KeyType*)NULL);<br>     }<br>@@ -405,7 +406,7 @@ protected:<br>     }<br><br>     lldb::TypeNameSpecifierImplSP<br>-    GetTypeNameSpecifierAtIndex_Impl (uint32_t index, ConstString *dummy)<br>+    GetTypeNameSpecifierAtIndex_Impl (size_t index, ConstString *dummy)<br>     {<br>         ConstString key = m_format_map.GetKeyAtIndex(index);<br>         if (key)<br>@@ -416,7 +417,7 @@ protected:<br>     }<br><br>     lldb::TypeNameSpecifierImplSP<br>-    GetTypeNameSpecifierAtIndex_Impl (uint32_t index, lldb::RegularExpressionSP *dummy)<br>+    GetTypeNameSpecifierAtIndex_Impl (size_t index, lldb::RegularExpressionSP *dummy)<br>     {<br>         lldb::RegularExpressionSP regex = m_format_map.GetKeyAtIndex(index);<br>         if (regex.get() == NULL)<br>@@ -525,28 +526,28 @@ protected:<br>         return false;<br>     }<br><br>-    // we are separately passing in valobj and type because the valobj is fixed (and is used for ObjC discovery and bitfield size)<br>-    // but the type can change (e.g. stripping pointers, ...)<br>-    bool Get (ValueObject& valobj,<br>+    bool<br>+    Get_Impl (ValueObject& valobj,<br>               clang::QualType type,<br>               MapValueType& entry,<br>               lldb::DynamicValueType use_dynamic,<br>               uint32_t& reason)<br>     {<br>         LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_TYPES));<br>+<br>         if (type.isNull())<br>         {<br>             if (log)<br>-                log->Printf("[Get] type is NULL, returning");<br>+                log->Printf("[Get_Impl] type is NULL, returning");<br>             return false;<br>         }<br>-<br>+        <br>         type.removeLocalConst(); type.removeLocalVolatile(); type.removeLocalRestrict();<br>         const clang::Type* typePtr = type.getTypePtrOrNull();<br>         if (!typePtr)<br>         {<br>             if (log)<br>-                log->Printf("[Get] type is NULL, returning");<br>+                log->Printf("[Get_Impl] type is NULL, returning");<br>             return false;<br>         }<br>         ConstString typeName(ClangASTType::GetTypeNameForQualType(valobj.GetClangAST(), type).c_str());<br>@@ -558,7 +559,7 @@ protected:<br>         }<br><br>         if (log)<br>-            log->Printf("[Get] trying to get %s for VO name %s of type %s",<br>+            log->Printf("[Get_Impl] trying to get %s for VO name %s of type %s",<br>                         m_name.c_str(),<br>                         valobj.GetName().AsCString(),<br>                         typeName.AsCString());<br>@@ -570,14 +571,14 @@ protected:<br>             return true;<br>         }<br>         if (log)<br>-            log->Printf("[Get] no direct match");<br>-<br>+            log->Printf("[Get_Impl] no direct match");<br>+        <br>         // strip pointers and references and see if that helps<br>         if (typePtr->isReferenceType())<br>         {<br>             if (log)<br>-                log->Printf("[Get] stripping reference");<br>-            if (Get(valobj,type.getNonReferenceType(),entry, use_dynamic, reason) && !entry->SkipsReferences())<br>+                log->Printf("[Get_Impl] stripping reference");<br>+            if (Get_Impl(valobj,type.getNonReferenceType(),entry, use_dynamic, reason) && !entry->SkipsReferences())<br>             {<br>                 reason |= lldb_private::eFormatterChoiceCriterionStrippedPointerReference;<br>                 return true;<br>@@ -586,15 +587,15 @@ protected:<br>         else if (typePtr->isPointerType())<br>         {<br>             if (log)<br>-                log->Printf("[Get] stripping pointer");<br>+                log->Printf("[Get_Impl] stripping pointer");<br>             clang::QualType pointee = typePtr->getPointeeType();<br>-            if (Get(valobj, pointee, entry, use_dynamic, reason) && !entry->SkipsPointers())<br>+            if (Get_Impl(valobj, pointee, entry, use_dynamic, reason) && !entry->SkipsPointers())<br>             {<br>                 reason |= lldb_private::eFormatterChoiceCriterionStrippedPointerReference;<br>                 return true;<br>             }<br>         }<br>-<br>+        <br>         bool canBeObjCDynamic = ClangASTContext::IsPossibleDynamicType (valobj.GetClangAST(),<br>                                                                         type.getAsOpaquePtr(),<br>                                                                         NULL,<br>@@ -606,7 +607,7 @@ protected:<br>             if (use_dynamic != lldb::eNoDynamicValues)<br>             {<br>                 if (log)<br>-                    log->Printf("[Get] allowed to figure out dynamic ObjC type");<br>+                    log->Printf("[Get_Impl] allowed to figure out dynamic ObjC type");<br>                 if (Get_ObjC(valobj,entry))<br>                 {<br>                     reason |= lldb_private::eFormatterChoiceCriterionDynamicObjCDiscovery;<br>@@ -614,28 +615,45 @@ protected:<br>                 }<br>             }<br>             if (log)<br>-                log->Printf("[Get] dynamic disabled or failed - stripping ObjC pointer");<br>+                log->Printf("[Get_Impl] dynamic disabled or failed - stripping ObjC pointer");<br>             clang::QualType pointee = typePtr->getPointeeType();<br>-            if (Get(valobj, pointee, entry, use_dynamic, reason) && !entry->SkipsPointers())<br>+            if (Get_Impl(valobj, pointee, entry, use_dynamic, reason) && !entry->SkipsPointers())<br>             {<br>                 reason |= lldb_private::eFormatterChoiceCriterionStrippedPointerReference;<br>                 return true;<br>             }<br>         }<br>-    <br>+        <br>         // try to strip typedef chains<br>         const clang::TypedefType* type_tdef = type->getAs<clang::TypedefType>();<br>         if (type_tdef)<br>         {<br>             if (log)<br>-                log->Printf("[Get] stripping typedef");<br>-            if ((Get(valobj, type_tdef->getDecl()->getUnderlyingType(), entry, use_dynamic, reason)) && entry->Cascades())<br>+                log->Printf("[Get_Impl] stripping typedef");<br>+            if ((Get_Impl(valobj, type_tdef->getDecl()->getUnderlyingType(), entry, use_dynamic, reason)) && entry->Cascades())<br>             {<br>                 reason |= lldb_private::eFormatterChoiceCriterionNavigatedTypedefs;<br>                 return true;<br>             }<br>         }<br><br>+        // out of luck here<br>+        return false;<br>+    }<br>+    <br>+    // we are separately passing in valobj and type because the valobj is fixed (and is used for ObjC discovery and bitfield size)<br>+    // but the type can change (e.g. stripping pointers, ...)<br>+    bool Get (ValueObject& valobj,<br>+              clang::QualType type,<br>+              MapValueType& entry,<br>+              lldb::DynamicValueType use_dynamic,<br>+              uint32_t& reason)<br>+    {<br>+        LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_TYPES));<br>+        <br>+        if (Get_Impl (valobj,type,entry,use_dynamic,reason))<br>+            return true;<br>+        <br>         // if all else fails, go to static type<br>         if (valobj.IsDynamic())<br>         {<br><br>Added: lldb/trunk/include/lldb/DataFormatters/TypeCategory.h<br>URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/TypeCategory.h?rev=173728&view=auto">http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/TypeCategory.h?rev=173728&view=auto</a><br>==============================================================================<br>--- lldb/trunk/include/lldb/DataFormatters/TypeCategory.h (added)<br>+++ lldb/trunk/include/lldb/DataFormatters/TypeCategory.h Mon Jan 28 17:47:25 2013<br>@@ -0,0 +1,230 @@<br>+//===-- TypeCategory.h -------------------------------------------*- C++ -*-===//<br>+//<br>+//                     The LLVM Compiler Infrastructure<br>+//<br>+// This file is distributed under the University of Illinois Open Source<br>+// License. See LICENSE.TXT for details.<br>+//<br>+//===----------------------------------------------------------------------===//<br>+<br>+#ifndef lldb_TypeCategory_h_<br>+#define lldb_TypeCategory_h_<br>+<br>+// C Includes<br>+// C++ Includes<br>+<br>+// Other libraries and framework includes<br>+// Project includes<br>+#include "lldb/lldb-public.h"<br>+#include "lldb/lldb-enumerations.h"<br>+<br>+#include "lldb/DataFormatters/FormatNavigator.h"<br>+<br>+namespace lldb_private {    <br>+    class TypeCategoryImpl<br>+    {<br>+    private:<br>+        <br>+        typedef FormatNavigator<ConstString, TypeSummaryImpl> SummaryNavigator;<br>+        typedef FormatNavigator<lldb::RegularExpressionSP, TypeSummaryImpl> RegexSummaryNavigator;<br>+        <br>+        typedef FormatNavigator<ConstString, TypeFilterImpl> FilterNavigator;<br>+        typedef FormatNavigator<lldb::RegularExpressionSP, TypeFilterImpl> RegexFilterNavigator;<br>+        <br>+#ifndef LLDB_DISABLE_PYTHON<br>+        typedef FormatNavigator<ConstString, ScriptedSyntheticChildren> SynthNavigator;<br>+        typedef FormatNavigator<lldb::RegularExpressionSP, ScriptedSyntheticChildren> RegexSynthNavigator;<br>+#endif // #ifndef LLDB_DISABLE_PYTHON<br>+        <br>+        typedef SummaryNavigator::MapType SummaryMap;<br>+        typedef RegexSummaryNavigator::MapType RegexSummaryMap;<br>+        typedef FilterNavigator::MapType FilterMap;<br>+        typedef RegexFilterNavigator::MapType RegexFilterMap;<br>+#ifndef LLDB_DISABLE_PYTHON<br>+        typedef SynthNavigator::MapType SynthMap;<br>+        typedef RegexSynthNavigator::MapType RegexSynthMap;<br>+#endif // #ifndef LLDB_DISABLE_PYTHON<br>+        <br>+    public:<br>+        <br>+        typedef uint16_t FormatCategoryItems;<br>+        static const uint16_t ALL_ITEM_TYPES = UINT16_MAX;<br>+        <br>+        typedef SummaryNavigator::SharedPointer SummaryNavigatorSP;<br>+        typedef RegexSummaryNavigator::SharedPointer RegexSummaryNavigatorSP;<br>+        typedef FilterNavigator::SharedPointer FilterNavigatorSP;<br>+        typedef RegexFilterNavigator::SharedPointer RegexFilterNavigatorSP;<br>+#ifndef LLDB_DISABLE_PYTHON<br>+        typedef SynthNavigator::SharedPointer SynthNavigatorSP;<br>+        typedef RegexSynthNavigator::SharedPointer RegexSynthNavigatorSP;<br>+#endif // #ifndef LLDB_DISABLE_PYTHON<br>+        <br>+        TypeCategoryImpl (IFormatChangeListener* clist,<br>+                          ConstString name);<br>+        <br>+        SummaryNavigatorSP<br>+        GetSummaryNavigator ()<br>+        {<br>+            return SummaryNavigatorSP(m_summary_nav);<br>+        }<br>+        <br>+        RegexSummaryNavigatorSP<br>+        GetRegexSummaryNavigator ()<br>+        {<br>+            return RegexSummaryNavigatorSP(m_regex_summary_nav);<br>+        }<br>+        <br>+        FilterNavigatorSP<br>+        GetFilterNavigator ()<br>+        {<br>+            return FilterNavigatorSP(m_filter_nav);<br>+        }<br>+        <br>+        RegexFilterNavigatorSP<br>+        GetRegexFilterNavigator ()<br>+        {<br>+            return RegexFilterNavigatorSP(m_regex_filter_nav);<br>+        }<br>+        <br>+        SummaryNavigator::MapValueType<br>+        GetSummaryForType (lldb::TypeNameSpecifierImplSP type_sp);<br>+        <br>+        FilterNavigator::MapValueType<br>+        GetFilterForType (lldb::TypeNameSpecifierImplSP type_sp);<br>+        <br>+#ifndef LLDB_DISABLE_PYTHON<br>+        SynthNavigator::MapValueType<br>+        GetSyntheticForType (lldb::TypeNameSpecifierImplSP type_sp);<br>+#endif<br>+        <br>+        lldb::TypeNameSpecifierImplSP<br>+        GetTypeNameSpecifierForSummaryAtIndex (size_t index);<br>+        <br>+        SummaryNavigator::MapValueType<br>+        GetSummaryAtIndex (size_t index);<br>+        <br>+        FilterNavigator::MapValueType<br>+        GetFilterAtIndex (size_t index);<br>+        <br>+        lldb::TypeNameSpecifierImplSP<br>+        GetTypeNameSpecifierForFilterAtIndex (size_t index);<br>+        <br>+#ifndef LLDB_DISABLE_PYTHON<br>+        SynthNavigatorSP<br>+        GetSyntheticNavigator ()<br>+        {<br>+            return SynthNavigatorSP(m_synth_nav);<br>+        }<br>+        <br>+        RegexSynthNavigatorSP<br>+        GetRegexSyntheticNavigator ()<br>+        {<br>+            return RegexSynthNavigatorSP(m_regex_synth_nav);<br>+        }<br>+        <br>+        SynthNavigator::MapValueType<br>+        GetSyntheticAtIndex (size_t index);<br>+        <br>+        lldb::TypeNameSpecifierImplSP<br>+        GetTypeNameSpecifierForSyntheticAtIndex (size_t index);<br>+        <br>+#endif // #ifndef LLDB_DISABLE_PYTHON<br>+        <br>+        bool<br>+        IsEnabled () const<br>+        {<br>+            return m_enabled;<br>+        }<br>+        <br>+        uint32_t<br>+        GetEnabledPosition()<br>+        {<br>+            if (m_enabled == false)<br>+                return UINT32_MAX;<br>+            else<br>+                return m_enabled_position;<br>+        }<br>+        <br>+        bool<br>+        Get (ValueObject& valobj,<br>+             lldb::TypeSummaryImplSP& entry,<br>+             lldb::DynamicValueType use_dynamic,<br>+             uint32_t* reason = NULL);<br>+        <br>+        bool<br>+        Get (ValueObject& valobj,<br>+             lldb::SyntheticChildrenSP& entry,<br>+             lldb::DynamicValueType use_dynamic,<br>+             uint32_t* reason = NULL);<br>+        <br>+        void<br>+        Clear (FormatCategoryItems items = ALL_ITEM_TYPES);<br>+        <br>+        bool<br>+        Delete (ConstString name,<br>+                FormatCategoryItems items = ALL_ITEM_TYPES);<br>+        <br>+        uint32_t<br>+        GetCount (FormatCategoryItems items = ALL_ITEM_TYPES);<br>+        <br>+        const char*<br>+        GetName ()<br>+        {<br>+            return m_name.GetCString();<br>+        }<br>+        <br>+        bool<br>+        AnyMatches (ConstString type_name,<br>+                    FormatCategoryItems items = ALL_ITEM_TYPES,<br>+                    bool only_enabled = true,<br>+                    const char** matching_category = NULL,<br>+                    FormatCategoryItems* matching_type = NULL);<br>+        <br>+        typedef STD_SHARED_PTR(TypeCategoryImpl) SharedPointer;<br>+        <br>+    private:<br>+        SummaryNavigator::SharedPointer m_summary_nav;<br>+        RegexSummaryNavigator::SharedPointer m_regex_summary_nav;<br>+        FilterNavigator::SharedPointer m_filter_nav;<br>+        RegexFilterNavigator::SharedPointer m_regex_filter_nav;<br>+#ifndef LLDB_DISABLE_PYTHON<br>+        SynthNavigator::SharedPointer m_synth_nav;<br>+        RegexSynthNavigator::SharedPointer m_regex_synth_nav;<br>+#endif // #ifndef LLDB_DISABLE_PYTHON<br>+        <br>+        bool m_enabled;<br>+        <br>+        IFormatChangeListener* m_change_listener;<br>+        <br>+        Mutex m_mutex;<br>+        <br>+        ConstString m_name;<br>+        <br>+        uint32_t m_enabled_position;<br>+        <br>+        void<br>+        Enable (bool value, uint32_t position);<br>+        <br>+        void<br>+        Disable ()<br>+        {<br>+            Enable(false, UINT32_MAX);<br>+        }<br>+        <br>+        friend class TypeCategoryMap;<br>+        <br>+        friend class FormatNavigator<ConstString, TypeSummaryImpl>;<br>+        friend class FormatNavigator<lldb::RegularExpressionSP, TypeSummaryImpl>;<br>+        <br>+        friend class FormatNavigator<ConstString, TypeFilterImpl>;<br>+        friend class FormatNavigator<lldb::RegularExpressionSP, TypeFilterImpl>;<br>+        <br>+#ifndef LLDB_DISABLE_PYTHON<br>+        friend class FormatNavigator<ConstString, ScriptedSyntheticChildren>;<br>+        friend class FormatNavigator<lldb::RegularExpressionSP, ScriptedSyntheticChildren>;<br>+#endif // #ifndef LLDB_DISABLE_PYTHON<br>+    };<br>+    <br>+} // namespace lldb_private<br>+<br>+#endif<span class="Apple-tab-span" style="white-space:pre">     </span>// lldb_TypeCategory_h_<br><br>Added: lldb/trunk/include/lldb/DataFormatters/TypeCategoryMap.h<br>URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/TypeCategoryMap.h?rev=173728&view=auto">http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/TypeCategoryMap.h?rev=173728&view=auto</a><br>==============================================================================<br>--- lldb/trunk/include/lldb/DataFormatters/TypeCategoryMap.h (added)<br>+++ lldb/trunk/include/lldb/DataFormatters/TypeCategoryMap.h Mon Jan 28 17:47:25 2013<br>@@ -0,0 +1,148 @@<br>+//===-- TypeCategoryMap.h ----------------------------------------*- C++ -*-===//<br>+//<br>+//                     The LLVM Compiler Infrastructure<br>+//<br>+// This file is distributed under the University of Illinois Open Source<br>+// License. See LICENSE.TXT for details.<br>+//<br>+//===----------------------------------------------------------------------===//<br>+<br>+#ifndef lldb_TypeCategoryMap_h_<br>+#define lldb_TypeCategoryMap_h_<br>+<br>+// C Includes<br>+// C++ Includes<br>+<br>+// Other libraries and framework includes<br>+// Project includes<br>+#include "lldb/lldb-public.h"<br>+#include "lldb/lldb-enumerations.h"<br>+<br>+#include "lldb/DataFormatters/FormatNavigator.h"<br>+#include "lldb/DataFormatters/TypeCategory.h"<br>+<br>+namespace lldb_private {<br>+    class TypeCategoryMap<br>+    {<br>+    private:<br>+        typedef ConstString KeyType;<br>+        typedef TypeCategoryImpl ValueType;<br>+        typedef ValueType::SharedPointer ValueSP;<br>+        typedef std::list<lldb::TypeCategoryImplSP> ActiveCategoriesList;<br>+        typedef ActiveCategoriesList::iterator ActiveCategoriesIterator;<br>+        <br>+    public:<br>+        typedef std::map<KeyType, ValueSP> MapType;<br>+        typedef MapType::iterator MapIterator;<br>+        typedef bool(*CallbackType)(void*, const ValueSP&);<br>+        typedef uint32_t Position;<br>+        <br>+        static const Position First = 0;<br>+        static const Position Default = 1;<br>+        static const Position Last = UINT32_MAX;<br>+        <br>+        TypeCategoryMap (IFormatChangeListener* lst);<br>+        <br>+        void<br>+        Add (KeyType name,<br>+             const ValueSP& entry);<br>+        <br>+        bool<br>+        Delete (KeyType name);<br>+        <br>+        bool<br>+        Enable (KeyType category_name,<br>+                Position pos = Default);<br>+        <br>+        bool<br>+        Disable (KeyType category_name);<br>+        <br>+        bool<br>+        Enable (ValueSP category,<br>+                Position pos = Default);<br>+        <br>+        bool<br>+        Disable (ValueSP category);<br>+        <br>+        void<br>+        Clear ();<br>+        <br>+        bool<br>+        Get (KeyType name,<br>+             ValueSP& entry);<br>+        <br>+        bool<br>+        Get (uint32_t pos,<br>+             ValueSP& entry);<br>+        <br>+        void<br>+        LoopThrough (CallbackType callback, void* param);<br>+        <br>+        lldb::TypeCategoryImplSP<br>+        GetAtIndex (uint32_t);<br>+        <br>+        bool<br>+        AnyMatches (ConstString type_name,<br>+                    TypeCategoryImpl::FormatCategoryItems items = TypeCategoryImpl::ALL_ITEM_TYPES,<br>+                    bool only_enabled = true,<br>+                    const char** matching_category = NULL,<br>+                    TypeCategoryImpl::FormatCategoryItems* matching_type = NULL);<br>+        <br>+        uint32_t<br>+        GetCount ()<br>+        {<br>+            return m_map.size();<br>+        }<br>+        <br>+        lldb::TypeSummaryImplSP<br>+        GetSummaryFormat (ValueObject& valobj,<br>+                          lldb::DynamicValueType use_dynamic);<br>+        <br>+#ifndef LLDB_DISABLE_PYTHON<br>+        lldb::SyntheticChildrenSP<br>+        GetSyntheticChildren (ValueObject& valobj,<br>+                              lldb::DynamicValueType use_dynamic);<br>+#endif<br>+        <br>+    private:<br>+        <br>+        class delete_matching_categories<br>+        {<br>+            lldb::TypeCategoryImplSP ptr;<br>+        public:<br>+            delete_matching_categories(lldb::TypeCategoryImplSP p) : ptr(p)<br>+            {}<br>+            <br>+            bool operator()(const lldb::TypeCategoryImplSP& other)<br>+            {<br>+                return ptr.get() == other.get();<br>+            }<br>+        };<br>+        <br>+        Mutex m_map_mutex;<br>+        IFormatChangeListener* listener;<br>+        <br>+        MapType m_map;<br>+        ActiveCategoriesList m_active_categories;<br>+        <br>+        MapType& map ()<br>+        {<br>+            return m_map;<br>+        }<br>+        <br>+        ActiveCategoriesList& active_list ()<br>+        {<br>+            return m_active_categories;<br>+        }<br>+        <br>+        Mutex& mutex ()<br>+        {<br>+            return m_map_mutex;<br>+        }<br>+        <br>+        friend class FormatNavigator<KeyType, ValueType>;<br>+        friend class FormatManager;<br>+    };<br>+} // namespace lldb_private<br>+<br>+#endif<span class="Apple-tab-span" style="white-space:pre">     </span>// lldb_TypeCategoryMap_h_<br><br>Added: lldb/trunk/include/lldb/DataFormatters/TypeFormat.h<br>URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/TypeFormat.h?rev=173728&view=auto">http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/TypeFormat.h?rev=173728&view=auto</a><br>==============================================================================<br>--- lldb/trunk/include/lldb/DataFormatters/TypeFormat.h (added)<br>+++ lldb/trunk/include/lldb/DataFormatters/TypeFormat.h Mon Jan 28 17:47:25 2013<br>@@ -0,0 +1,220 @@<br>+//===-- TypeFormat.h ----------------------------------------------*- C++ -*-===//<br>+//<br>+//                     The LLVM Compiler Infrastructure<br>+//<br>+// This file is distributed under the University of Illinois Open Source<br>+// License. See LICENSE.TXT for details.<br>+//<br>+//===----------------------------------------------------------------------===//<br>+<br>+#ifndef lldb_TypeFormat_h_<br>+#define lldb_TypeFormat_h_<br>+<br>+// C Includes<br>+<br>+// C++ Includes<br>+#include <string><br>+<br>+// Other libraries and framework includes<br>+<br>+// Project includes<br>+#include "lldb/lldb-public.h"<br>+#include "lldb/lldb-enumerations.h"<br>+<br>+#include "lldb/Core/ValueObject.h"<br>+<br>+namespace lldb_private {<br>+    class TypeFormatImpl<br>+    {<br>+    public:<br>+        class Flags<br>+        {<br>+        public:<br>+            <br>+            Flags () :<br>+            m_flags (lldb::eTypeOptionCascade)<br>+            {}<br>+            <br>+            Flags (const Flags& other) :<br>+            m_flags (other.m_flags)<br>+            {}<br>+            <br>+            Flags (uint32_t value) :<br>+            m_flags (value)<br>+            {}<br>+            <br>+            Flags&<br>+            operator = (const Flags& rhs)<br>+            {<br>+                if (&rhs != this)<br>+                    m_flags = rhs.m_flags;<br>+                <br>+                return *this;<br>+            }<br>+            <br>+            Flags&<br>+            operator = (const uint32_t& rhs)<br>+            {<br>+                m_flags = rhs;<br>+                return *this;<br>+            }<br>+            <br>+            Flags&<br>+            Clear()<br>+            {<br>+                m_flags = 0;<br>+                return *this;<br>+            }<br>+            <br>+            bool<br>+            GetCascades () const<br>+            {<br>+                return (m_flags & lldb::eTypeOptionCascade) == lldb::eTypeOptionCascade;<br>+            }<br>+            <br>+            Flags&<br>+            SetCascades (bool value = true)<br>+            {<br>+                if (value)<br>+                    m_flags |= lldb::eTypeOptionCascade;<br>+                else<br>+                    m_flags &= ~lldb::eTypeOptionCascade;<br>+                return *this;<br>+            }<br>+            <br>+            bool<br>+            GetSkipPointers () const<br>+            {<br>+                return (m_flags & lldb::eTypeOptionSkipPointers) == lldb::eTypeOptionSkipPointers;<br>+            }<br>+            <br>+            Flags&<br>+            SetSkipPointers (bool value = true)<br>+            {<br>+                if (value)<br>+                    m_flags |= lldb::eTypeOptionSkipPointers;<br>+                else<br>+                    m_flags &= ~lldb::eTypeOptionSkipPointers;<br>+                return *this;<br>+            }<br>+            <br>+            bool<br>+            GetSkipReferences () const<br>+            {<br>+                return (m_flags & lldb::eTypeOptionSkipReferences) == lldb::eTypeOptionSkipReferences;<br>+            }<br>+            <br>+            Flags&<br>+            SetSkipReferences (bool value = true)<br>+            {<br>+                if (value)<br>+                    m_flags |= lldb::eTypeOptionSkipReferences;<br>+                else<br>+                    m_flags &= ~lldb::eTypeOptionSkipReferences;<br>+                return *this;<br>+            }<br>+            <br>+            uint32_t<br>+            GetValue ()<br>+            {<br>+                return m_flags;<br>+            }<br>+            <br>+            void<br>+            SetValue (uint32_t value)<br>+            {<br>+                m_flags = value;<br>+            }<br>+            <br>+        private:<br>+            uint32_t m_flags;<br>+        };<br>+        <br>+        TypeFormatImpl (lldb::Format f = lldb::eFormatInvalid,<br>+                        const Flags& flags = Flags());<br>+        <br>+        typedef STD_SHARED_PTR(TypeFormatImpl) SharedPointer;<br>+        typedef bool(*ValueCallback)(void*, ConstString, const lldb::TypeFormatImplSP&);<br>+        <br>+        ~TypeFormatImpl ()<br>+        {<br>+        }<br>+        <br>+        bool<br>+        Cascades () const<br>+        {<br>+            return m_flags.GetCascades();<br>+        }<br>+        bool<br>+        SkipsPointers () const<br>+        {<br>+            return m_flags.GetSkipPointers();<br>+        }<br>+        bool<br>+        SkipsReferences () const<br>+        {<br>+            return m_flags.GetSkipReferences();<br>+        }<br>+        <br>+        void<br>+        SetCascades (bool value)<br>+        {<br>+            m_flags.SetCascades(value);<br>+        }<br>+        <br>+        void<br>+        SetSkipsPointers (bool value)<br>+        {<br>+            m_flags.SetSkipPointers(value);<br>+        }<br>+        <br>+        void<br>+        SetSkipsReferences (bool value)<br>+        {<br>+            m_flags.SetSkipReferences(value);<br>+        }<br>+        <br>+        lldb::Format<br>+        GetFormat () const<br>+        {<br>+            return m_format;<br>+        }<br>+        <br>+        void<br>+        SetFormat (lldb::Format fmt)<br>+        {<br>+            m_format = fmt;<br>+        }<br>+        <br>+        uint32_t<br>+        GetOptions ()<br>+        {<br>+            return m_flags.GetValue();<br>+        }<br>+        <br>+        void<br>+        SetOptions (uint32_t value)<br>+        {<br>+            m_flags.SetValue(value);<br>+        }<br>+        <br>+        uint32_t&<br>+        GetRevision ()<br>+        {<br>+            return m_my_revision;<br>+        }<br>+        <br>+        std::string<br>+        GetDescription();<br>+        <br>+    protected:<br>+        Flags m_flags;<br>+        lldb::Format m_format;<br>+        uint32_t m_my_revision;<br>+        <br>+    private:<br>+        DISALLOW_COPY_AND_ASSIGN(TypeFormatImpl);<br>+    };    <br>+} // namespace lldb_private<br>+<br>+#endif<span class="Apple-tab-span" style="white-space:pre">      </span>// lldb_TypeFormat_h_<br><br>Added: lldb/trunk/include/lldb/DataFormatters/TypeSummary.h<br>URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/TypeSummary.h?rev=173728&view=auto">http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/TypeSummary.h?rev=173728&view=auto</a><br>==============================================================================<br>--- lldb/trunk/include/lldb/DataFormatters/TypeSummary.h (added)<br>+++ lldb/trunk/include/lldb/DataFormatters/TypeSummary.h Mon Jan 28 17:47:25 2013<br>@@ -0,0 +1,547 @@<br>+//===-- TypeSummary.h --------------------------------------------*- C++ -*-===//<br>+//<br>+//                     The LLVM Compiler Infrastructure<br>+//<br>+// This file is distributed under the University of Illinois Open Source<br>+// License. See LICENSE.TXT for details.<br>+//<br>+//===----------------------------------------------------------------------===//<br>+<br>+#ifndef lldb_TypeSummary_h_<br>+#define lldb_TypeSummary_h_<br>+<br>+// C Includes<br>+#include <stdint.h><br>+#include <unistd.h><br>+<br>+// C++ Includes<br>+#include <string><br>+#include <vector><br>+<br>+// Other libraries and framework includes<br>+<br>+// Project includes<br>+#include "lldb/lldb-public.h"<br>+#include "lldb/lldb-enumerations.h"<br>+<br>+#include "lldb/Core/ValueObject.h"<br>+#include "lldb/Interpreter/ScriptInterpreterPython.h"<br>+#include "lldb/Symbol/Type.h"<br>+<br>+namespace lldb_private {<br>+    <br>+    class TypeSummaryImpl<br>+    {<br>+    public:<br>+        class Flags<br>+        {<br>+        public:<br>+            <br>+            Flags () :<br>+            m_flags (lldb::eTypeOptionCascade)<br>+            {}<br>+            <br>+            Flags (const Flags& other) :<br>+            m_flags (other.m_flags)<br>+            {}<br>+            <br>+            Flags (uint32_t value) :<br>+            m_flags (value)<br>+            {}<br>+            <br>+            Flags&<br>+            operator = (const Flags& rhs)<br>+            {<br>+                if (&rhs != this)<br>+                    m_flags = rhs.m_flags;<br>+                <br>+                return *this;<br>+            }<br>+            <br>+            Flags&<br>+            operator = (const uint32_t& rhs)<br>+            {<br>+                m_flags = rhs;<br>+                return *this;<br>+            }<br>+            <br>+            Flags&<br>+            Clear()<br>+            {<br>+                m_flags = 0;<br>+                return *this;<br>+            }<br>+            <br>+            bool<br>+            GetCascades () const<br>+            {<br>+                return (m_flags & lldb::eTypeOptionCascade) == lldb::eTypeOptionCascade;<br>+            }<br>+            <br>+            Flags&<br>+            SetCascades (bool value = true)<br>+            {<br>+                if (value)<br>+                    m_flags |= lldb::eTypeOptionCascade;<br>+                else<br>+                    m_flags &= ~lldb::eTypeOptionCascade;<br>+                return *this;<br>+            }<br>+            <br>+            bool<br>+            GetSkipPointers () const<br>+            {<br>+                return (m_flags & lldb::eTypeOptionSkipPointers) == lldb::eTypeOptionSkipPointers;<br>+            }<br>+            <br>+            Flags&<br>+            SetSkipPointers (bool value = true)<br>+            {<br>+                if (value)<br>+                    m_flags |= lldb::eTypeOptionSkipPointers;<br>+                else<br>+                    m_flags &= ~lldb::eTypeOptionSkipPointers;<br>+                return *this;<br>+            }<br>+            <br>+            bool<br>+            GetSkipReferences () const<br>+            {<br>+                return (m_flags & lldb::eTypeOptionSkipReferences) == lldb::eTypeOptionSkipReferences;<br>+            }<br>+            <br>+            Flags&<br>+            SetSkipReferences (bool value = true)<br>+            {<br>+                if (value)<br>+                    m_flags |= lldb::eTypeOptionSkipReferences;<br>+                else<br>+                    m_flags &= ~lldb::eTypeOptionSkipReferences;<br>+                return *this;<br>+            }<br>+            <br>+            bool<br>+            GetDontShowChildren () const<br>+            {<br>+                return (m_flags & lldb::eTypeOptionHideChildren) == lldb::eTypeOptionHideChildren;<br>+            }<br>+            <br>+            Flags&<br>+            SetDontShowChildren (bool value = true)<br>+            {<br>+                if (value)<br>+                    m_flags |= lldb::eTypeOptionHideChildren;<br>+                else<br>+                    m_flags &= ~lldb::eTypeOptionHideChildren;<br>+                return *this;<br>+            }<br>+            <br>+            bool<br>+            GetDontShowValue () const<br>+            {<br>+                return (m_flags & lldb::eTypeOptionHideValue) == lldb::eTypeOptionHideValue;<br>+            }<br>+            <br>+            Flags&<br>+            SetDontShowValue (bool value = true)<br>+            {<br>+                if (value)<br>+                    m_flags |= lldb::eTypeOptionHideValue;<br>+                else<br>+                    m_flags &= ~lldb::eTypeOptionHideValue;<br>+                return *this;<br>+            }<br>+            <br>+            bool<br>+            GetShowMembersOneLiner () const<br>+            {<br>+                return (m_flags & lldb::eTypeOptionShowOneLiner) == lldb::eTypeOptionShowOneLiner;<br>+            }<br>+            <br>+            Flags&<br>+            SetShowMembersOneLiner (bool value = true)<br>+            {<br>+                if (value)<br>+                    m_flags |= lldb::eTypeOptionShowOneLiner;<br>+                else<br>+                    m_flags &= ~lldb::eTypeOptionShowOneLiner;<br>+                return *this;<br>+            }<br>+            <br>+            bool<br>+            GetHideItemNames () const<br>+            {<br>+                return (m_flags & lldb::eTypeOptionHideNames) == lldb::eTypeOptionHideNames;<br>+            }<br>+            <br>+            Flags&<br>+            SetHideItemNames (bool value = true)<br>+            {<br>+                if (value)<br>+                    m_flags |= lldb::eTypeOptionHideNames;<br>+                else<br>+                    m_flags &= ~lldb::eTypeOptionHideNames;<br>+                return *this;<br>+            }<br>+            <br>+            uint32_t<br>+            GetValue ()<br>+            {<br>+                return m_flags;<br>+            }<br>+            <br>+            void<br>+            SetValue (uint32_t value)<br>+            {<br>+                m_flags = value;<br>+            }<br>+            <br>+        private:<br>+            uint32_t m_flags;<br>+        };<br>+        <br>+        typedef enum Type<br>+        {<br>+            eTypeUnknown,<br>+            eTypeString,<br>+            eTypeScript,<br>+            eTypeCallback<br>+        } Type;<br>+        <br>+        TypeSummaryImpl (const TypeSummaryImpl::Flags& flags);<br>+        <br>+        bool<br>+        Cascades () const<br>+        {<br>+            return m_flags.GetCascades();<br>+        }<br>+        bool<br>+        SkipsPointers () const<br>+        {<br>+            return m_flags.GetSkipPointers();<br>+        }<br>+        bool<br>+        SkipsReferences () const<br>+        {<br>+            return m_flags.GetSkipReferences();<br>+        }<br>+        <br>+        bool<br>+        DoesPrintChildren () const<br>+        {<br>+            return !m_flags.GetDontShowChildren();<br>+        }<br>+        <br>+        bool<br>+        DoesPrintValue () const<br>+        {<br>+            return !m_flags.GetDontShowValue();<br>+        }<br>+        <br>+        bool<br>+        IsOneliner () const<br>+        {<br>+            return m_flags.GetShowMembersOneLiner();<br>+        }<br>+        <br>+        bool<br>+        HideNames () const<br>+        {<br>+            return m_flags.GetHideItemNames();<br>+        }<br>+        <br>+        void<br>+        SetCascades (bool value)<br>+        {<br>+            m_flags.SetCascades(value);<br>+        }<br>+        <br>+        void<br>+        SetSkipsPointers (bool value)<br>+        {<br>+            m_flags.SetSkipPointers(value);<br>+        }<br>+        <br>+        void<br>+        SetSkipsReferences (bool value)<br>+        {<br>+            m_flags.SetSkipReferences(value);<br>+        }<br>+        <br>+        void<br>+        SetDoesPrintChildren (bool value)<br>+        {<br>+            m_flags.SetDontShowChildren(!value);<br>+        }<br>+        <br>+        void<br>+        SetDoesPrintValue (bool value)<br>+        {<br>+            m_flags.SetDontShowValue(!value);<br>+        }<br>+        <br>+        void<br>+        SetIsOneliner (bool value)<br>+        {<br>+            m_flags.SetShowMembersOneLiner(value);<br>+        }<br>+        <br>+        void<br>+        SetHideNames (bool value)<br>+        {<br>+            m_flags.SetHideItemNames(value);<br>+        }<br>+        <br>+        uint32_t<br>+        GetOptions ()<br>+        {<br>+            return m_flags.GetValue();<br>+        }<br>+        <br>+        void<br>+        SetOptions (uint32_t value)<br>+        {<br>+            m_flags.SetValue(value);<br>+        }<br>+        <br>+        virtual<br>+        ~TypeSummaryImpl ()<br>+        {<br>+        }<br>+        <br>+        // we are using a ValueObject* instead of a ValueObjectSP because we do not need to hold on to this for<br>+        // extended periods of time and we trust the ValueObject to stay around for as long as it is required<br>+        // for us to generate its summary<br>+        virtual bool<br>+        FormatObject (ValueObject *valobj,<br>+                      std::string& dest) = 0;<br>+        <br>+        virtual std::string<br>+        GetDescription () = 0;<br>+        <br>+        virtual bool<br>+        IsScripted () = 0;<br>+        <br>+        virtual Type<br>+        GetType () = 0;<br>+        <br>+        uint32_t&<br>+        GetRevision ()<br>+        {<br>+            return m_my_revision;<br>+        }<br>+        <br>+        typedef STD_SHARED_PTR(TypeSummaryImpl) SharedPointer;<br>+        typedef bool(*SummaryCallback)(void*, ConstString, const lldb::TypeSummaryImplSP&);<br>+        typedef bool(*RegexSummaryCallback)(void*, lldb::RegularExpressionSP, const lldb::TypeSummaryImplSP&);<br>+        <br>+    protected:<br>+        uint32_t m_my_revision;<br>+        Flags m_flags;<br>+        <br>+    private:<br>+        DISALLOW_COPY_AND_ASSIGN(TypeSummaryImpl);<br>+    };<br>+    <br>+    // simple string-based summaries, using ${var to show data<br>+    struct StringSummaryFormat : public TypeSummaryImpl<br>+    {<br>+        std::string m_format;<br>+        <br>+        StringSummaryFormat(const TypeSummaryImpl::Flags& flags,<br>+                            const char* f);<br>+        <br>+        const char*<br>+        GetSummaryString () const<br>+        {<br>+            return m_format.c_str();<br>+        }<br>+        <br>+        void<br>+        SetSummaryString (const char* data)<br>+        {<br>+            if (data)<br>+                m_format.assign(data);<br>+            else<br>+                m_format.clear();<br>+        }<br>+        <br>+        virtual<br>+        ~StringSummaryFormat()<br>+        {<br>+        }<br>+        <br>+        virtual bool<br>+        FormatObject(ValueObject *valobj,<br>+                     std::string& dest);<br>+        <br>+        virtual std::string<br>+        GetDescription();<br>+        <br>+        virtual bool<br>+        IsScripted ()<br>+        {<br>+            return false;<br>+        }<br>+        <br>+        <br>+        virtual Type<br>+        GetType ()<br>+        {<br>+            return TypeSummaryImpl::eTypeString;<br>+        }<br>+        <br>+    private:<br>+        DISALLOW_COPY_AND_ASSIGN(StringSummaryFormat);<br>+    };<br>+    <br>+    // summaries implemented via a C++ function<br>+    struct CXXFunctionSummaryFormat : public TypeSummaryImpl<br>+    {<br>+        <br>+        // we should convert these to SBValue and SBStream if we ever cross<br>+        // the boundary towards the external world<br>+        typedef bool (*Callback)(ValueObject& valobj, Stream& dest);<br>+        <br>+        Callback m_impl;<br>+        std::string m_description;<br>+        <br>+        CXXFunctionSummaryFormat (const TypeSummaryImpl::Flags& flags,<br>+                                  Callback impl,<br>+                                  const char* description);<br>+        <br>+        Callback<br>+        GetBackendFunction () const<br>+        {<br>+            return m_impl;<br>+        }<br>+        <br>+        const char*<br>+        GetTextualInfo () const<br>+        {<br>+            return m_description.c_str();<br>+        }<br>+        <br>+        void<br>+        SetBackendFunction (Callback cb_func)<br>+        {<br>+            m_impl = cb_func;<br>+        }<br>+        <br>+        void<br>+        SetTextualInfo (const char* descr)<br>+        {<br>+            if (descr)<br>+                m_description.assign(descr);<br>+            else<br>+                m_description.clear();<br>+        }<br>+        <br>+        virtual<br>+        ~CXXFunctionSummaryFormat ()<br>+        {<br>+        }<br>+        <br>+        virtual bool<br>+        FormatObject (ValueObject *valobj,<br>+                      std::string& dest);<br>+        <br>+        virtual std::string<br>+        GetDescription ();<br>+        <br>+        virtual bool<br>+        IsScripted ()<br>+        {<br>+            return false;<br>+        }<br>+        <br>+        virtual Type<br>+        GetType ()<br>+        {<br>+            return TypeSummaryImpl::eTypeCallback;<br>+        }<br>+        <br>+        typedef STD_SHARED_PTR(CXXFunctionSummaryFormat) SharedPointer;<br>+        <br>+    private:<br>+        DISALLOW_COPY_AND_ASSIGN(CXXFunctionSummaryFormat);<br>+    };<br>+    <br>+#ifndef LLDB_DISABLE_PYTHON<br>+    <br>+    // Python-based summaries, running script code to show data<br>+    struct ScriptSummaryFormat : public TypeSummaryImpl<br>+    {<br>+        std::string m_function_name;<br>+        std::string m_python_script;<br>+        lldb::ScriptInterpreterObjectSP m_script_function_sp;<br>+        <br>+        ScriptSummaryFormat(const TypeSummaryImpl::Flags& flags,<br>+                            const char *function_name,<br>+                            const char* python_script = NULL);<br>+        <br>+        const char*<br>+        GetFunctionName () const<br>+        {<br>+            return m_function_name.c_str();<br>+        }<br>+        <br>+        const char*<br>+        GetPythonScript () const<br>+        {<br>+            return m_python_script.c_str();<br>+        }<br>+        <br>+        void<br>+        SetFunctionName (const char* function_name)<br>+        {<br>+            if (function_name)<br>+                m_function_name.assign(function_name);<br>+            else<br>+                m_function_name.clear();<br>+            m_python_script.clear();<br>+        }<br>+        <br>+        void<br>+        SetPythonScript (const char* script)<br>+        {<br>+            if (script)<br>+                m_python_script.assign(script);<br>+            else<br>+                m_python_script.clear();<br>+        }<br>+        <br>+        virtual<br>+        ~ScriptSummaryFormat ()<br>+        {<br>+        }<br>+        <br>+        virtual bool<br>+        FormatObject (ValueObject *valobj,<br>+                      std::string& dest);<br>+        <br>+        virtual std::string<br>+        GetDescription ();<br>+        <br>+        virtual bool<br>+        IsScripted ()<br>+        {<br>+            return true;<br>+        }<br>+        <br>+        virtual Type<br>+        GetType ()<br>+        {<br>+            return TypeSummaryImpl::eTypeScript;<br>+        }<br>+        <br>+        typedef STD_SHARED_PTR(ScriptSummaryFormat) SharedPointer;<br>+        <br>+        <br>+    private:<br>+        DISALLOW_COPY_AND_ASSIGN(ScriptSummaryFormat);<br>+    };<br>+#endif<br>+} // namespace lldb_private<br>+<br>+#endif<span class="Apple-tab-span" style="white-space:pre">      </span>// lldb_TypeSummary_h_<br><br>Added: lldb/trunk/include/lldb/DataFormatters/TypeSynthetic.h<br>URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/TypeSynthetic.h?rev=173728&view=auto">http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/TypeSynthetic.h?rev=173728&view=auto</a><br>==============================================================================<br>--- lldb/trunk/include/lldb/DataFormatters/TypeSynthetic.h (added)<br>+++ lldb/trunk/include/lldb/DataFormatters/TypeSynthetic.h Mon Jan 28 17:47:25 2013<br>@@ -0,0 +1,585 @@<br>+//===-- TypeSynthetic.h -------------------------------------------*- C++ -*-===//<br>+//<br>+//                     The LLVM Compiler Infrastructure<br>+//<br>+// This file is distributed under the University of Illinois Open Source<br>+// License. See LICENSE.TXT for details.<br>+//<br>+//===----------------------------------------------------------------------===//<br>+<br>+#ifndef lldb_TypeSynthetic_h_<br>+#define lldb_TypeSynthetic_h_<br>+<br>+// C Includes<br>+#include <stdint.h><br>+#include <unistd.h><br>+<br>+// C++ Includes<br>+#include <string><br>+#include <vector><br>+<br>+// Other libraries and framework includes<br>+<br>+// Project includes<br>+#include "lldb/lldb-public.h"<br>+#include "lldb/lldb-enumerations.h"<br>+<br>+#include "lldb/Core/ValueObject.h"<br>+#include "lldb/Interpreter/ScriptInterpreterPython.h"<br>+#include "lldb/Symbol/Type.h"<br>+<br>+namespace lldb_private {<br>+    class SyntheticChildrenFrontEnd<br>+    {<br>+    protected:<br>+        ValueObject &m_backend;<br>+    public:<br>+        <br>+        SyntheticChildrenFrontEnd (ValueObject &backend) :<br>+        m_backend(backend)<br>+        {}<br>+        <br>+        virtual<br>+        ~SyntheticChildrenFrontEnd ()<br>+        {<br>+        }<br>+        <br>+        virtual size_t<br>+        CalculateNumChildren () = 0;<br>+        <br>+        virtual lldb::ValueObjectSP<br>+        GetChildAtIndex (size_t idx) = 0;<br>+        <br>+        virtual size_t<br>+        GetIndexOfChildWithName (const ConstString &name) = 0;<br>+        <br>+        // this function is assumed to always succeed and it if fails, the front-end should know to deal<br>+        // with it in the correct way (most probably, by refusing to return any children)<br>+        // the return value of Update() should actually be interpreted as "ValueObjectSyntheticFilter cache is good/bad"<br>+        // if =true, ValueObjectSyntheticFilter is allowed to use the children it fetched previously and cached<br>+        // if =false, ValueObjectSyntheticFilter must throw away its cache, and query again for children<br>+        virtual bool<br>+        Update () = 0;<br>+        <br>+        // if this function returns false, then CalculateNumChildren() MUST return 0 since UI frontends<br>+        // might validly decide not to inquire for children given a false return value from this call<br>+        // if it returns true, then CalculateNumChildren() can return any number >= 0 (0 being valid)<br>+        // it should if at all possible be more efficient than CalculateNumChildren()<br>+        virtual bool<br>+        MightHaveChildren () = 0;<br>+        <br>+        typedef STD_SHARED_PTR(SyntheticChildrenFrontEnd) SharedPointer;<br>+        typedef std::auto_ptr<SyntheticChildrenFrontEnd> AutoPointer;<br>+        <br>+    private:<br>+        DISALLOW_COPY_AND_ASSIGN(SyntheticChildrenFrontEnd);<br>+    };<br>+    <br>+    class SyntheticChildren<br>+    {<br>+    public:<br>+        <br>+        class Flags<br>+        {<br>+        public:<br>+            <br>+            Flags () :<br>+            m_flags (lldb::eTypeOptionCascade)<br>+            {}<br>+            <br>+            Flags (const Flags& other) :<br>+            m_flags (other.m_flags)<br>+            {}<br>+            <br>+            Flags (uint32_t value) :<br>+            m_flags (value)<br>+            {}<br>+            <br>+            Flags&<br>+            operator = (const Flags& rhs)<br>+            {<br>+                if (&rhs != this)<br>+                    m_flags = rhs.m_flags;<br>+                <br>+                return *this;<br>+            }<br>+            <br>+            Flags&<br>+            operator = (const uint32_t& rhs)<br>+            {<br>+                m_flags = rhs;<br>+                return *this;<br>+            }<br>+            <br>+            Flags&<br>+            Clear()<br>+            {<br>+                m_flags = 0;<br>+                return *this;<br>+            }<br>+            <br>+            bool<br>+            GetCascades () const<br>+            {<br>+                return (m_flags & lldb::eTypeOptionCascade) == lldb::eTypeOptionCascade;<br>+            }<br>+            <br>+            Flags&<br>+            SetCascades (bool value = true)<br>+            {<br>+                if (value)<br>+                    m_flags |= lldb::eTypeOptionCascade;<br>+                else<br>+                    m_flags &= ~lldb::eTypeOptionCascade;<br>+                return *this;<br>+            }<br>+            <br>+            bool<br>+            GetSkipPointers () const<br>+            {<br>+                return (m_flags & lldb::eTypeOptionSkipPointers) == lldb::eTypeOptionSkipPointers;<br>+            }<br>+            <br>+            Flags&<br>+            SetSkipPointers (bool value = true)<br>+            {<br>+                if (value)<br>+                    m_flags |= lldb::eTypeOptionSkipPointers;<br>+                else<br>+                    m_flags &= ~lldb::eTypeOptionSkipPointers;<br>+                return *this;<br>+            }<br>+            <br>+            bool<br>+            GetSkipReferences () const<br>+            {<br>+                return (m_flags & lldb::eTypeOptionSkipReferences) == lldb::eTypeOptionSkipReferences;<br>+            }<br>+            <br>+            Flags&<br>+            SetSkipReferences (bool value = true)<br>+            {<br>+                if (value)<br>+                    m_flags |= lldb::eTypeOptionSkipReferences;<br>+                else<br>+                    m_flags &= ~lldb::eTypeOptionSkipReferences;<br>+                return *this;<br>+            }<br>+            <br>+            uint32_t<br>+            GetValue ()<br>+            {<br>+                return m_flags;<br>+            }<br>+            <br>+            void<br>+            SetValue (uint32_t value)<br>+            {<br>+                m_flags = value;<br>+            }<br>+            <br>+        private:<br>+            uint32_t m_flags;<br>+        };<br>+        <br>+        SyntheticChildren (const Flags& flags) :<br>+        m_flags(flags)<br>+        {<br>+        }<br>+        <br>+        virtual<br>+        ~SyntheticChildren ()<br>+        {<br>+        }<br>+        <br>+        bool<br>+        Cascades () const<br>+        {<br>+            return m_flags.GetCascades();<br>+        }<br>+        bool<br>+        SkipsPointers () const<br>+        {<br>+            return m_flags.GetSkipPointers();<br>+        }<br>+        bool<br>+        SkipsReferences () const<br>+        {<br>+            return m_flags.GetSkipReferences();<br>+        }<br>+        <br>+        void<br>+        SetCascades (bool value)<br>+        {<br>+            m_flags.SetCascades(value);<br>+        }<br>+        <br>+        void<br>+        SetSkipsPointers (bool value)<br>+        {<br>+            m_flags.SetSkipPointers(value);<br>+        }<br>+        <br>+        void<br>+        SetSkipsReferences (bool value)<br>+        {<br>+            m_flags.SetSkipReferences(value);<br>+        }<br>+        <br>+        uint32_t<br>+        GetOptions ()<br>+        {<br>+            return m_flags.GetValue();<br>+        }<br>+        <br>+        void<br>+        SetOptions (uint32_t value)<br>+        {<br>+            m_flags.SetValue(value);<br>+        }<br>+        <br>+        virtual bool<br>+        IsScripted () = 0;<br>+        <br>+        virtual std::string<br>+        GetDescription () = 0;<br>+        <br>+        virtual SyntheticChildrenFrontEnd::AutoPointer<br>+        GetFrontEnd (ValueObject &backend) = 0;<br>+        <br>+        typedef STD_SHARED_PTR(SyntheticChildren) SharedPointer;<br>+        typedef bool(*SyntheticChildrenCallback)(void*, ConstString, const SyntheticChildren::SharedPointer&);<br>+        <br>+        uint32_t&<br>+        GetRevision ()<br>+        {<br>+            return m_my_revision;<br>+        }<br>+        <br>+    protected:<br>+        uint32_t m_my_revision;<br>+        Flags m_flags;<br>+        <br>+    private:<br>+        DISALLOW_COPY_AND_ASSIGN(SyntheticChildren);<br>+    };<br>+    <br>+    class TypeFilterImpl : public SyntheticChildren<br>+    {<br>+        std::vector<std::string> m_expression_paths;<br>+    public:<br>+        TypeFilterImpl(const SyntheticChildren::Flags& flags) :<br>+        SyntheticChildren(flags),<br>+        m_expression_paths()<br>+        {<br>+        }<br>+        <br>+        void<br>+        AddExpressionPath (const char* path)<br>+        {<br>+            AddExpressionPath(std::string(path));<br>+        }<br>+        <br>+        void<br>+        Clear()<br>+        {<br>+            m_expression_paths.clear();<br>+        }<br>+        <br>+        int<br>+        GetCount() const<br>+        {<br>+            return m_expression_paths.size();<br>+        }<br>+        <br>+        const char*<br>+        GetExpressionPathAtIndex(int i) const<br>+        {<br>+            return m_expression_paths[i].c_str();<br>+        }<br>+        <br>+        bool<br>+        SetExpressionPathAtIndex (int i, const char* path)<br>+        {<br>+            return SetExpressionPathAtIndex(i, std::string(path));<br>+        }<br>+        <br>+        void<br>+        AddExpressionPath (std::string path)<br>+        {<br>+            bool need_add_dot = true;<br>+            if (path[0] == '.' ||<br>+                (path[0] == '-' && path[1] == '>') ||<br>+                path[0] == '[')<br>+                need_add_dot = false;<br>+            // add a '.' symbol to help forgetful users<br>+            if(!need_add_dot)<br>+                m_expression_paths.push_back(path);<br>+            else<br>+                m_expression_paths.push_back(std::string(".") + path);<br>+        }<br>+        <br>+        bool<br>+        SetExpressionPathAtIndex (int i, std::string path)<br>+        {<br>+            if (i >= GetCount())<br>+                return false;<br>+            bool need_add_dot = true;<br>+            if (path[0] == '.' ||<br>+                (path[0] == '-' && path[1] == '>') ||<br>+                path[0] == '[')<br>+                need_add_dot = false;<br>+            // add a '.' symbol to help forgetful users<br>+            if(!need_add_dot)<br>+                m_expression_paths[i] = path;<br>+            else<br>+                m_expression_paths[i] = std::string(".") + path;<br>+            return true;<br>+        }<br>+        <br>+        bool<br>+        IsScripted ()<br>+        {<br>+            return false;<br>+        }<br>+        <br>+        std::string<br>+        GetDescription ();<br>+        <br>+        class FrontEnd : public SyntheticChildrenFrontEnd<br>+        {<br>+        private:<br>+            TypeFilterImpl* filter;<br>+        public:<br>+            <br>+            FrontEnd(TypeFilterImpl* flt,<br>+                     ValueObject &backend) :<br>+            SyntheticChildrenFrontEnd(backend),<br>+            filter(flt)<br>+            {}<br>+            <br>+            virtual<br>+            ~FrontEnd ()<br>+            {<br>+            }<br>+            <br>+            virtual size_t<br>+            CalculateNumChildren ()<br>+            {<br>+                return filter->GetCount();<br>+            }<br>+            <br>+            virtual lldb::ValueObjectSP<br>+            GetChildAtIndex (size_t idx)<br>+            {<br>+                if (idx >= filter->GetCount())<br>+                    return lldb::ValueObjectSP();<br>+                return m_backend.GetSyntheticExpressionPathChild(filter->GetExpressionPathAtIndex(idx), true);<br>+            }<br>+            <br>+            virtual bool<br>+            Update() { return false; }<br>+            <br>+            virtual bool<br>+            MightHaveChildren ()<br>+            {<br>+                return filter->GetCount() > 0;<br>+            }<br>+            <br>+            virtual size_t<br>+            GetIndexOfChildWithName (const ConstString &name)<br>+            {<br>+                const char* name_cstr = name.GetCString();<br>+                for (int i = 0; i < filter->GetCount(); i++)<br>+                {<br>+                    const char* expr_cstr = filter->GetExpressionPathAtIndex(i);<br>+                    if (expr_cstr)<br>+                    {<br>+                        if (*expr_cstr == '.')<br>+                            expr_cstr++;<br>+                        else if (*expr_cstr == '-' && *(expr_cstr+1) == '>')<br>+                            expr_cstr += 2;<br>+                    }<br>+                    if (!::strcmp(name_cstr, expr_cstr))<br>+                        return i;<br>+                }<br>+                return UINT32_MAX;<br>+            }<br>+            <br>+            typedef STD_SHARED_PTR(SyntheticChildrenFrontEnd) SharedPointer;<br>+            <br>+        private:<br>+            DISALLOW_COPY_AND_ASSIGN(FrontEnd);<br>+        };<br>+        <br>+        virtual SyntheticChildrenFrontEnd::AutoPointer<br>+        GetFrontEnd(ValueObject &backend)<br>+        {<br>+            return SyntheticChildrenFrontEnd::AutoPointer(new FrontEnd(this, backend));<br>+        }<br>+        <br>+    private:<br>+        DISALLOW_COPY_AND_ASSIGN(TypeFilterImpl);<br>+    };<br>+    <br>+    class CXXSyntheticChildren : public SyntheticChildren<br>+    {<br>+    public:<br>+        typedef SyntheticChildrenFrontEnd* (*CreateFrontEndCallback) (CXXSyntheticChildren*, lldb::ValueObjectSP);<br>+    protected:<br>+        CreateFrontEndCallback m_create_callback;<br>+        std::string m_description;<br>+    public:<br>+        CXXSyntheticChildren (const SyntheticChildren::Flags& flags,<br>+                              const char* description,<br>+                              CreateFrontEndCallback callback) :<br>+        SyntheticChildren(flags),<br>+        m_create_callback(callback),<br>+        m_description(description ? description : "")<br>+        {<br>+        }<br>+        <br>+        bool<br>+        IsScripted ()<br>+        {<br>+            return false;<br>+        }<br>+        <br>+        std::string<br>+        GetDescription ();<br>+        <br>+        virtual SyntheticChildrenFrontEnd::AutoPointer<br>+        GetFrontEnd (ValueObject &backend)<br>+        {<br>+            return SyntheticChildrenFrontEnd::AutoPointer(m_create_callback(this, backend.GetSP()));<br>+        }<br>+        <br>+    private:<br>+        DISALLOW_COPY_AND_ASSIGN(CXXSyntheticChildren);<br>+    };<br>+    <br>+#ifndef LLDB_DISABLE_PYTHON<br>+    <br>+    class ScriptedSyntheticChildren : public SyntheticChildren<br>+    {<br>+        std::string m_python_class;<br>+        std::string m_python_code;<br>+    public:<br>+        <br>+        ScriptedSyntheticChildren (const SyntheticChildren::Flags& flags,<br>+                                   const char* pclass,<br>+                                   const char* pcode = NULL) :<br>+        SyntheticChildren(flags),<br>+        m_python_class(),<br>+        m_python_code()<br>+        {<br>+            if (pclass)<br>+                m_python_class = pclass;<br>+            if (pcode)<br>+                m_python_code = pcode;<br>+        }<br>+        <br>+        const char*<br>+        GetPythonClassName ()<br>+        {<br>+            return m_python_class.c_str();<br>+        }<br>+        <br>+        const char*<br>+        GetPythonCode ()<br>+        {<br>+            return m_python_code.c_str();<br>+        }<br>+        <br>+        void<br>+        SetPythonClassName (const char* fname)<br>+        {<br>+            m_python_class.assign(fname);<br>+            m_python_code.clear();<br>+        }<br>+        <br>+        void<br>+        SetPythonCode (const char* script)<br>+        {<br>+            m_python_code.assign(script);<br>+        }<br>+        <br>+        std::string<br>+        GetDescription ();<br>+        <br>+        bool<br>+        IsScripted ()<br>+        {<br>+            return true;<br>+        }<br>+        <br>+        class FrontEnd : public SyntheticChildrenFrontEnd<br>+        {<br>+        private:<br>+            std::string m_python_class;<br>+            lldb::ScriptInterpreterObjectSP m_wrapper_sp;<br>+            ScriptInterpreter *m_interpreter;<br>+        public:<br>+            <br>+            FrontEnd (std::string pclass,<br>+                      ValueObject &backend);<br>+            <br>+            virtual<br>+            ~FrontEnd ();<br>+            <br>+            virtual size_t<br>+            CalculateNumChildren ()<br>+            {<br>+                if (!m_wrapper_sp || m_interpreter == NULL)<br>+                    return 0;<br>+                return m_interpreter->CalculateNumChildren(m_wrapper_sp);<br>+            }<br>+            <br>+            virtual lldb::ValueObjectSP<br>+            GetChildAtIndex (size_t idx);<br>+            <br>+            virtual bool<br>+            Update ()<br>+            {<br>+                if (!m_wrapper_sp || m_interpreter == NULL)<br>+                    return false;<br>+                <br>+                return m_interpreter->UpdateSynthProviderInstance(m_wrapper_sp);<br>+            }<br>+            <br>+            virtual bool<br>+            MightHaveChildren ()<br>+            {<br>+                if (!m_wrapper_sp || m_interpreter == NULL)<br>+                    return false;<br>+                <br>+                return m_interpreter->MightHaveChildrenSynthProviderInstance(m_wrapper_sp);<br>+            }<br>+            <br>+            virtual size_t<br>+            GetIndexOfChildWithName (const ConstString &name)<br>+            {<br>+                if (!m_wrapper_sp || m_interpreter == NULL)<br>+                    return UINT32_MAX;<br>+                return m_interpreter->GetIndexOfChildWithName(m_wrapper_sp, name.GetCString());<br>+            }<br>+            <br>+            typedef STD_SHARED_PTR(SyntheticChildrenFrontEnd) SharedPointer;<br>+            <br>+        private:<br>+            DISALLOW_COPY_AND_ASSIGN(FrontEnd);<br>+        };<br>+        <br>+        virtual SyntheticChildrenFrontEnd::AutoPointer<br>+        GetFrontEnd(ValueObject &backend)<br>+        {<br>+            return SyntheticChildrenFrontEnd::AutoPointer(new FrontEnd(m_python_class, backend));<br>+        }    <br>+        <br>+    private:<br>+        DISALLOW_COPY_AND_ASSIGN(ScriptedSyntheticChildren);<br>+    };<br>+#endif<br>+} // namespace lldb_private<br>+<br>+#endif<span class="Apple-tab-span" style="white-space:pre">    </span>// lldb_TypeSynthetic_h_<br><br>Modified: lldb/trunk/include/lldb/lldb-forward.h<br>URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/lldb-forward.h?rev=173728&r1=173727&r2=173728&view=diff">http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/lldb-forward.h?rev=173728&r1=173727&r2=173728&view=diff</a><br>==============================================================================<br>--- lldb/trunk/include/lldb/lldb-forward.h (original)<br>+++ lldb/trunk/include/lldb/lldb-forward.h Mon Jan 28 17:47:25 2013<br>@@ -218,7 +218,7 @@ class   SyntheticChildren;<br> class   SyntheticChildrenFrontEnd;<br> class   TypeFilterImpl;<br> #ifndef LLDB_DISABLE_PYTHON<br>-class   TypeSyntheticImpl;<br>+class   ScriptedSyntheticChildren;<br> #endif<br> class   Target;<br> class   TargetList;<br>@@ -236,6 +236,7 @@ class   ThreadPlanTracer;<br> class   ThreadSpec;<br> class   TimeValue;<br> class   Type;<br>+class   TypeCategoryMap;<br> class   TypeImpl;<br> class   TypeAndOrName;<br> class   TypeList;<br>@@ -373,7 +374,7 @@ namespace lldb {<br>     typedef STD_SHARED_PTR(lldb_private::TypeNameSpecifierImpl) TypeNameSpecifierImplSP;<br>     typedef STD_SHARED_PTR(lldb_private::TypeSummaryImpl) TypeSummaryImplSP;<br> #ifndef LLDB_DISABLE_PYTHON<br>-    typedef STD_SHARED_PTR(lldb_private::TypeSyntheticImpl) TypeSyntheticImplSP;<br>+    typedef STD_SHARED_PTR(lldb_private::ScriptedSyntheticChildren) ScriptedSyntheticChildrenSP;<br> #endif<br>     typedef STD_SHARED_PTR(lldb_private::UnwindPlan) UnwindPlanSP;<br>     typedef lldb_private::SharingPtr<lldb_private::ValueObject> ValueObjectSP;<br><br>Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj<br>URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=173728&r1=173727&r2=173728&view=diff">http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=173728&r1=173727&r2=173728&view=diff</a><br>==============================================================================<br>--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)<br>+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Mon Jan 28 17:47:25 2013<br>@@ -514,7 +514,6 @@<br> <span class="Apple-tab-span" style="white-space:pre">      </span><span class="Apple-tab-span" style="white-space:pre">    </span>4CF52AF8142829390051E832 /* SBFileSpecList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CF52AF7142829390051E832 /* SBFileSpecList.cpp */; };<br> <span class="Apple-tab-span" style="white-space:pre">      </span><span class="Apple-tab-span" style="white-space:pre">    </span>94031A9E13CF486700DCFF3C /* InputReaderEZ.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94031A9D13CF486600DCFF3C /* InputReaderEZ.cpp */; };<br> <span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">    </span>94094C6B163B6F840083A547 /* ValueObjectCast.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94094C69163B6CD90083A547 /* ValueObjectCast.cpp */; };<br>-<span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>9415F61813B2C0EF00A52B36 /* FormatManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9415F61713B2C0EF00A52B36 /* FormatManager.cpp */; };<br> <span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">    </span>941BCC7F14E48C4000BB969C /* SBTypeFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 9461568614E355F2003A195C /* SBTypeFilter.h */; settings = {ATTRIBUTES = (Public, ); }; };<br> <span class="Apple-tab-span" style="white-space:pre">      </span><span class="Apple-tab-span" style="white-space:pre">    </span>941BCC8014E48C4000BB969C /* SBTypeFormat.h in Headers */ = {isa = PBXBuildFile; fileRef = 9461568714E355F2003A195C /* SBTypeFormat.h */; settings = {ATTRIBUTES = (Public, ); }; };<br> <span class="Apple-tab-span" style="white-space:pre">      </span><span class="Apple-tab-span" style="white-space:pre">    </span>941BCC8114E48C4000BB969C /* SBTypeSummary.h in Headers */ = {isa = PBXBuildFile; fileRef = 9461568814E355F2003A195C /* SBTypeSummary.h */; settings = {ATTRIBUTES = (Public, ); }; };<br>@@ -530,7 +529,6 @@<br> <span class="Apple-tab-span" style="white-space:pre">       </span><span class="Apple-tab-span" style="white-space:pre">    </span>9461569D14E358A6003A195C /* SBTypeSynthetic.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9461568D14E35621003A195C /* SBTypeSynthetic.cpp */; };<br> <span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>9463D4CD13B1798800C230D4 /* CommandObjectType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9463D4CC13B1798800C230D4 /* CommandObjectType.cpp */; };<br> <span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">    </span>9467E65213C3D97600B3B6F3 /* TypeHierarchyNavigator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9467E65113C3D97600B3B6F3 /* TypeHierarchyNavigator.cpp */; };<br>-<span class="Apple-tab-span" style="white-space:pre">      </span><span class="Apple-tab-span" style="white-space:pre">    </span>9470A8F01402DFFB0056FF61 /* DataVisualization.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9470A8EF1402DFFB0056FF61 /* DataVisualization.cpp */; };<br> <span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">    </span>9475C18814E5E9FA001BFC6D /* SBTypeCategory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9475C18714E5E9FA001BFC6D /* SBTypeCategory.cpp */; };<br> <span class="Apple-tab-span" style="white-space:pre">      </span><span class="Apple-tab-span" style="white-space:pre">    </span>9475C18914E5EA08001BFC6D /* SBTypeCategory.h in Headers */ = {isa = PBXBuildFile; fileRef = 9475C18514E5E9C5001BFC6D /* SBTypeCategory.h */; settings = {ATTRIBUTES = (Public, ); }; };<br> <span class="Apple-tab-span" style="white-space:pre">  </span><span class="Apple-tab-span" style="white-space:pre">    </span>9475C18E14E5F834001BFC6D /* SBTypeNameSpecifier.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9475C18D14E5F834001BFC6D /* SBTypeNameSpecifier.cpp */; };<br>@@ -539,7 +537,16 @@<br> <span class="Apple-tab-span" style="white-space:pre">      </span><span class="Apple-tab-span" style="white-space:pre">    </span>947A1D651616476B0017C8D1 /* CommandObjectPlugin.h in Headers */ = {isa = PBXBuildFile; fileRef = 947A1D631616476A0017C8D1 /* CommandObjectPlugin.h */; };<br> <span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">    </span>949ADF031406F648004833E1 /* ValueObjectConstResultImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 949ADF021406F648004833E1 /* ValueObjectConstResultImpl.cpp */; };<br> <span class="Apple-tab-span" style="white-space:pre">      </span><span class="Apple-tab-span" style="white-space:pre">    </span>94B6E76213D88365005F417F /* ValueObjectSyntheticFilter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94B6E76113D88362005F417F /* ValueObjectSyntheticFilter.cpp */; };<br>-<span class="Apple-tab-span" style="white-space:pre">      </span><span class="Apple-tab-span" style="white-space:pre">    </span>94CDEB9D15F0258500DD2A7A /* CXXFormatterFunctions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94CDEB9C15F0258400DD2A7A /* CXXFormatterFunctions.cpp */; };<br>+<span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">    </span>94CB255B16B069770059775D /* CXXFormatterFunctions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94CB255716B069770059775D /* CXXFormatterFunctions.cpp */; };<br>+<span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">    </span>94CB255C16B069770059775D /* DataVisualization.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94CB255816B069770059775D /* DataVisualization.cpp */; };<br>+<span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">    </span>94CB255D16B069770059775D /* FormatClasses.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94CB255916B069770059775D /* FormatClasses.cpp */; };<br>+<span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">    </span>94CB255E16B069770059775D /* FormatManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94CB255A16B069770059775D /* FormatManager.cpp */; };<br>+<span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">    </span>94CB256616B096F10059775D /* TypeCategory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94CB256416B096F10059775D /* TypeCategory.cpp */; };<br>+<span class="Apple-tab-span" style="white-space:pre">  </span><span class="Apple-tab-span" style="white-space:pre">    </span>94CB256716B096F10059775D /* TypeCategoryMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94CB256516B096F10059775D /* TypeCategoryMap.cpp */; };<br>+<span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>94CB257016B0A4270059775D /* TypeFormat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94CB256D16B0A4260059775D /* TypeFormat.cpp */; };<br>+<span class="Apple-tab-span" style="white-space:pre">      </span><span class="Apple-tab-span" style="white-space:pre">    </span>94CB257116B0A4270059775D /* TypeSummary.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94CB256E16B0A4260059775D /* TypeSummary.cpp */; };<br>+<span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>94CB257216B0A4270059775D /* TypeSynthetic.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94CB256F16B0A4270059775D /* TypeSynthetic.cpp */; };<br>+<span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">    </span>94CB257416B1D3880059775D /* FormatCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94CB257316B1D3870059775D /* FormatCache.cpp */; };<br> <span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>94EA1D5C15E6C9B400D4171A /* PythonDataObjects.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94EA1D5B15E6C9B400D4171A /* PythonDataObjects.cpp */; };<br> <span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">    </span>94FA3DE01405D50400833217 /* ValueObjectConstResultChild.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94FA3DDF1405D50300833217 /* ValueObjectConstResultChild.cpp */; };<br> <span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>9A19A6AF1163BBB200E0D453 /* SBValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A19A6A51163BB7E00E0D453 /* SBValue.h */; settings = {ATTRIBUTES = (Public, ); }; };<br>@@ -568,7 +575,6 @@<br> <span class="Apple-tab-span" style="white-space:pre">   </span><span class="Apple-tab-span" style="white-space:pre">    </span>B207C4931429607D00F36E4E /* CommandObjectWatchpoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B207C4921429607D00F36E4E /* CommandObjectWatchpoint.cpp */; };<br> <span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>B21EB71515CC99F100E60059 /* cxa_demangle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B21EB71415CC99F100E60059 /* cxa_demangle.cpp */; settings = {COMPILER_FLAGS = "-frtti"; }; };<br> <span class="Apple-tab-span" style="white-space:pre">      </span><span class="Apple-tab-span" style="white-space:pre">    </span>B2462247141AD37D00F3D409 /* OptionGroupWatchpoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2462246141AD37D00F3D409 /* OptionGroupWatchpoint.cpp */; };<br>-<span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">    </span>B271B11413D6139300C3FEDB /* FormatClasses.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94A9112D13D5DF210046D8A6 /* FormatClasses.cpp */; };<br> <span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">    </span>B27318421416AC12006039C8 /* WatchpointList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B27318411416AC12006039C8 /* WatchpointList.cpp */; };<br> <span class="Apple-tab-span" style="white-space:pre">      </span><span class="Apple-tab-span" style="white-space:pre">    </span>B28058A1139988B0002D96D0 /* InferiorCallPOSIX.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B28058A0139988B0002D96D0 /* InferiorCallPOSIX.cpp */; };<br> <span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">    </span>B299580B14F2FA1400050A04 /* DisassemblerLLVMC.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B299580A14F2FA1400050A04 /* DisassemblerLLVMC.cpp */; };<br>@@ -1519,8 +1525,6 @@<br> <span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre">    </span>94031A9F13CF5B3D00DCFF3C /* PriorityPointerPair.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = PriorityPointerPair.h; path = include/lldb/Utility/PriorityPointerPair.h; sourceTree = "<group>"; };<br> <span class="Apple-tab-span" style="white-space:pre">  </span><span class="Apple-tab-span" style="white-space:pre">    </span>94094C68163B6CCC0083A547 /* ValueObjectCast.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ValueObjectCast.h; path = include/lldb/Core/ValueObjectCast.h; sourceTree = "<group>"; };<br> <span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre">    </span>94094C69163B6CD90083A547 /* ValueObjectCast.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ValueObjectCast.cpp; path = source/Core/ValueObjectCast.cpp; sourceTree = "<group>"; };<br>-<span class="Apple-tab-span" style="white-space:pre">   </span><span class="Apple-tab-span" style="white-space:pre">    </span>9415F61613B2C0DC00A52B36 /* FormatManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; lineEnding = 0; name = FormatManager.h; path = include/lldb/Core/FormatManager.h; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };<br>-<span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">    </span>9415F61713B2C0EF00A52B36 /* FormatManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; name = FormatManager.cpp; path = source/Core/FormatManager.cpp; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };<br> <span class="Apple-tab-span" style="white-space:pre">     </span><span class="Apple-tab-span" style="white-space:pre">    </span>9443B120140C18A90013457C /* SBData.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SBData.h; path = include/lldb/API/SBData.h; sourceTree = "<group>"; };<br> <span class="Apple-tab-span" style="white-space:pre">     </span><span class="Apple-tab-span" style="white-space:pre">    </span>9443B121140C18C10013457C /* SBData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBData.cpp; path = source/API/SBData.cpp; sourceTree = "<group>"; };<br> <span class="Apple-tab-span" style="white-space:pre">       </span><span class="Apple-tab-span" style="white-space:pre">    </span>9452573616262CD000325455 /* SBDeclaration.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBDeclaration.i; sourceTree = "<group>"; };<br>@@ -1546,8 +1550,6 @@<br> <span class="Apple-tab-span" style="white-space:pre">     </span><span class="Apple-tab-span" style="white-space:pre">    </span>9463D4CE13B179A500C230D4 /* CommandObjectType.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = CommandObjectType.h; path = source/Commands/CommandObjectType.h; sourceTree = "<group>"; };<br> <span class="Apple-tab-span" style="white-space:pre">     </span><span class="Apple-tab-span" style="white-space:pre">    </span>9467E65113C3D97600B3B6F3 /* TypeHierarchyNavigator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TypeHierarchyNavigator.cpp; path = source/Symbol/TypeHierarchyNavigator.cpp; sourceTree = "<group>"; };<br> <span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>9467E65413C3D98900B3B6F3 /* TypeHierarchyNavigator.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = TypeHierarchyNavigator.h; path = include/lldb/Symbol/TypeHierarchyNavigator.h; sourceTree = "<group>"; };<br>-<span class="Apple-tab-span" style="white-space:pre">  </span><span class="Apple-tab-span" style="white-space:pre">    </span>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; };<br>-<span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>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; };<br> <span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre">    </span>9475C18514E5E9C5001BFC6D /* SBTypeCategory.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SBTypeCategory.h; path = include/lldb/API/SBTypeCategory.h; sourceTree = "<group>"; };<br> <span class="Apple-tab-span" style="white-space:pre">     </span><span class="Apple-tab-span" style="white-space:pre">    </span>9475C18714E5E9FA001BFC6D /* SBTypeCategory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBTypeCategory.cpp; path = source/API/SBTypeCategory.cpp; sourceTree = "<group>"; };<br> <span class="Apple-tab-span" style="white-space:pre">       </span><span class="Apple-tab-span" style="white-space:pre">    </span>9475C18A14E5EA1C001BFC6D /* SBTypeCategory.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBTypeCategory.i; sourceTree = "<group>"; };<br>@@ -1558,13 +1560,29 @@<br> <span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre">    </span>947A1D631616476A0017C8D1 /* CommandObjectPlugin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandObjectPlugin.h; path = source/Commands/CommandObjectPlugin.h; sourceTree = "<group>"; };<br> <span class="Apple-tab-span" style="white-space:pre">     </span><span class="Apple-tab-span" style="white-space:pre">    </span>949ADF001406F62E004833E1 /* ValueObjectConstResultImpl.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ValueObjectConstResultImpl.h; path = include/lldb/Core/ValueObjectConstResultImpl.h; sourceTree = "<group>"; };<br> <span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">    </span>949ADF021406F648004833E1 /* ValueObjectConstResultImpl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ValueObjectConstResultImpl.cpp; path = source/Core/ValueObjectConstResultImpl.cpp; sourceTree = "<group>"; };<br>-<span class="Apple-tab-span" style="white-space:pre">  </span><span class="Apple-tab-span" style="white-space:pre">    </span>94A8287514031D05006C37A8 /* FormatNavigator.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = FormatNavigator.h; path = include/lldb/Core/FormatNavigator.h; sourceTree = "<group>"; };<br>-<span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre">    </span>94A9112B13D5DEF80046D8A6 /* FormatClasses.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = FormatClasses.h; path = include/lldb/Core/FormatClasses.h; sourceTree = "<group>"; };<br>-<span class="Apple-tab-span" style="white-space:pre">       </span><span class="Apple-tab-span" style="white-space:pre">    </span>94A9112D13D5DF210046D8A6 /* FormatClasses.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FormatClasses.cpp; path = source/Core/FormatClasses.cpp; sourceTree = "<group>"; };<br> <span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre">    </span>94B6E76013D8833C005F417F /* ValueObjectSyntheticFilter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ValueObjectSyntheticFilter.h; path = include/lldb/Core/ValueObjectSyntheticFilter.h; sourceTree = "<group>"; };<br> <span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">    </span>94B6E76113D88362005F417F /* ValueObjectSyntheticFilter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ValueObjectSyntheticFilter.cpp; path = source/Core/ValueObjectSyntheticFilter.cpp; sourceTree = "<group>"; };<br>-<span class="Apple-tab-span" style="white-space:pre">  </span><span class="Apple-tab-span" style="white-space:pre">    </span>94CDEB9A15F0226900DD2A7A /* CXXFormatterFunctions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = CXXFormatterFunctions.h; path = include/lldb/Core/CXXFormatterFunctions.h; sourceTree = "<group>"; };<br>-<span class="Apple-tab-span" style="white-space:pre">       </span><span class="Apple-tab-span" style="white-space:pre">    </span>94CDEB9C15F0258400DD2A7A /* CXXFormatterFunctions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CXXFormatterFunctions.cpp; path = source/Core/CXXFormatterFunctions.cpp; sourceTree = "<group>"; };<br>+<span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre">    </span>94CB255716B069770059775D /* CXXFormatterFunctions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CXXFormatterFunctions.cpp; path = source/DataFormatters/CXXFormatterFunctions.cpp; sourceTree = "<group>"; };<br>+<span class="Apple-tab-span" style="white-space:pre">       </span><span class="Apple-tab-span" style="white-space:pre">    </span>94CB255816B069770059775D /* DataVisualization.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DataVisualization.cpp; path = source/DataFormatters/DataVisualization.cpp; sourceTree = "<group>"; };<br>+<span class="Apple-tab-span" style="white-space:pre">   </span><span class="Apple-tab-span" style="white-space:pre">    </span>94CB255916B069770059775D /* FormatClasses.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FormatClasses.cpp; path = source/DataFormatters/FormatClasses.cpp; sourceTree = "<group>"; };<br>+<span class="Apple-tab-span" style="white-space:pre">       </span><span class="Apple-tab-span" style="white-space:pre">    </span>94CB255A16B069770059775D /* FormatManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FormatManager.cpp; path = source/DataFormatters/FormatManager.cpp; sourceTree = "<group>"; };<br>+<span class="Apple-tab-span" style="white-space:pre">       </span><span class="Apple-tab-span" style="white-space:pre">    </span>94CB255F16B069800059775D /* CXXFormatterFunctions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = CXXFormatterFunctions.h; path = include/lldb/DataFormatters/CXXFormatterFunctions.h; sourceTree = "<group>"; };<br>+<span class="Apple-tab-span" style="white-space:pre">     </span><span class="Apple-tab-span" style="white-space:pre">    </span>94CB256016B069800059775D /* DataVisualization.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = DataVisualization.h; path = include/lldb/DataFormatters/DataVisualization.h; sourceTree = "<group>"; };<br>+<span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre">    </span>94CB256116B069800059775D /* FormatClasses.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = FormatClasses.h; path = include/lldb/DataFormatters/FormatClasses.h; sourceTree = "<group>"; };<br>+<span class="Apple-tab-span" style="white-space:pre">     </span><span class="Apple-tab-span" style="white-space:pre">    </span>94CB256216B069800059775D /* FormatManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = FormatManager.h; path = include/lldb/DataFormatters/FormatManager.h; sourceTree = "<group>"; };<br>+<span class="Apple-tab-span" style="white-space:pre">     </span><span class="Apple-tab-span" style="white-space:pre">    </span>94CB256316B069800059775D /* FormatNavigator.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = FormatNavigator.h; path = include/lldb/DataFormatters/FormatNavigator.h; sourceTree = "<group>"; };<br>+<span class="Apple-tab-span" style="white-space:pre">       </span><span class="Apple-tab-span" style="white-space:pre">    </span>94CB256416B096F10059775D /* TypeCategory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TypeCategory.cpp; path = source/DataFormatters/TypeCategory.cpp; sourceTree = "<group>"; };<br>+<span class="Apple-tab-span" style="white-space:pre">  </span><span class="Apple-tab-span" style="white-space:pre">    </span>94CB256516B096F10059775D /* TypeCategoryMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TypeCategoryMap.cpp; path = source/DataFormatters/TypeCategoryMap.cpp; sourceTree = "<group>"; };<br>+<span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre">    </span>94CB256816B096F90059775D /* TypeCategory.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = TypeCategory.h; path = include/lldb/DataFormatters/TypeCategory.h; sourceTree = "<group>"; };<br>+<span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">    </span>94CB256916B096FA0059775D /* TypeCategoryMap.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = TypeCategoryMap.h; path = include/lldb/DataFormatters/TypeCategoryMap.h; sourceTree = "<group>"; };<br>+<span class="Apple-tab-span" style="white-space:pre">       </span><span class="Apple-tab-span" style="white-space:pre">    </span>94CB256A16B0A4030059775D /* TypeFormat.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = TypeFormat.h; path = include/lldb/DataFormatters/TypeFormat.h; sourceTree = "<group>"; };<br>+<span class="Apple-tab-span" style="white-space:pre">      </span><span class="Apple-tab-span" style="white-space:pre">    </span>94CB256B16B0A4030059775D /* TypeSummary.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = TypeSummary.h; path = include/lldb/DataFormatters/TypeSummary.h; sourceTree = "<group>"; };<br>+<span class="Apple-tab-span" style="white-space:pre">   </span><span class="Apple-tab-span" style="white-space:pre">    </span>94CB256C16B0A4040059775D /* TypeSynthetic.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = TypeSynthetic.h; path = include/lldb/DataFormatters/TypeSynthetic.h; sourceTree = "<group>"; };<br>+<span class="Apple-tab-span" style="white-space:pre">     </span><span class="Apple-tab-span" style="white-space:pre">    </span>94CB256D16B0A4260059775D /* TypeFormat.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TypeFormat.cpp; path = source/DataFormatters/TypeFormat.cpp; sourceTree = "<group>"; };<br>+<span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">    </span>94CB256E16B0A4260059775D /* TypeSummary.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TypeSummary.cpp; path = source/DataFormatters/TypeSummary.cpp; sourceTree = "<group>"; };<br>+<span class="Apple-tab-span" style="white-space:pre">     </span><span class="Apple-tab-span" style="white-space:pre">    </span>94CB256F16B0A4270059775D /* TypeSynthetic.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TypeSynthetic.cpp; path = source/DataFormatters/TypeSynthetic.cpp; sourceTree = "<group>"; };<br>+<span class="Apple-tab-span" style="white-space:pre">       </span><span class="Apple-tab-span" style="white-space:pre">    </span>94CB257316B1D3870059775D /* FormatCache.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FormatCache.cpp; path = source/DataFormatters/FormatCache.cpp; sourceTree = "<group>"; };<br>+<span class="Apple-tab-span" style="white-space:pre">     </span><span class="Apple-tab-span" style="white-space:pre">    </span>94CB257516B1D3910059775D /* FormatCache.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = FormatCache.h; path = include/lldb/DataFormatters/FormatCache.h; sourceTree = "<group>"; };<br> <span class="Apple-tab-span" style="white-space:pre">   </span><span class="Apple-tab-span" style="white-space:pre">    </span>94E367CC140C4EC4001C7A5A /* modify-python-lldb.py */ = {isa = PBXFileReference; lastKnownFileType = text.script.python; path = "modify-python-lldb.py"; sourceTree = "<group>"; };<br> <span class="Apple-tab-span" style="white-space:pre">     </span><span class="Apple-tab-span" style="white-space:pre">    </span>94E367CE140C4EEA001C7A5A /* python-typemaps.swig */ = {isa = PBXFileReference; lastKnownFileType = text; path = "python-typemaps.swig"; sourceTree = "<group>"; };<br> <span class="Apple-tab-span" style="white-space:pre">     </span><span class="Apple-tab-span" style="white-space:pre">    </span>94EA1D5A15E6C99B00D4171A /* PythonDataObjects.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = PythonDataObjects.h; path = include/lldb/Interpreter/PythonDataObjects.h; sourceTree = "<group>"; };<br>@@ -1785,6 +1803,7 @@<br> <span class="Apple-tab-span" style="white-space:pre">     </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>26BC7CEB10F1B70800F91463 /* Breakpoint */,<br> <span class="Apple-tab-span" style="white-space:pre">       </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>26BC7D0D10F1B71D00F91463 /* Commands */,<br> <span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>26BC7C1010F1B34800F91463 /* Core */,<br>+<span class="Apple-tab-span" style="white-space:pre">     </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>94CB255616B0683B0059775D /* DataFormatters */,<br> <span class="Apple-tab-span" style="white-space:pre">   </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>26BC7DBE10F1B78200F91463 /* Expression */,<br> <span class="Apple-tab-span" style="white-space:pre">       </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>26BC7DD010F1B7C100F91463 /* Host */,<br> <span class="Apple-tab-span" style="white-space:pre">     </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>26BC7DDF10F1B7E200F91463 /* Interpreter */,<br>@@ -2492,8 +2511,6 @@<br> <span class="Apple-tab-span" style="white-space:pre">       </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>266603C91345B5A8004DA8B6 /* ConnectionSharedMemory.cpp */,<br> <span class="Apple-tab-span" style="white-space:pre">       </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>26BC7D7C10F1B77400F91463 /* ConstString.h */,<br> <span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>26BC7E9410F1B85900F91463 /* ConstString.cpp */,<br>-<span class="Apple-tab-span" style="white-space:pre">  </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>94CDEB9A15F0226900DD2A7A /* CXXFormatterFunctions.h */,<br>-<span class="Apple-tab-span" style="white-space:pre">  </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>94CDEB9C15F0258400DD2A7A /* CXXFormatterFunctions.cpp */,<br> <span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>26BC7D5910F1B77400F91463 /* DataBuffer.h */,<br> <span class="Apple-tab-span" style="white-space:pre">     </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>26BC7D5B10F1B77400F91463 /* DataBufferHeap.h */,<br> <span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>26BC7E7210F1B85900F91463 /* DataBufferHeap.cpp */,<br>@@ -2503,8 +2520,6 @@<br> <span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>268ED0A4140FF54200DE830F /* DataEncoder.cpp */,<br> <span class="Apple-tab-span" style="white-space:pre">  </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>26BC7D5A10F1B77400F91463 /* DataExtractor.h */,<br> <span class="Apple-tab-span" style="white-space:pre">  </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>26BC7E7110F1B85900F91463 /* DataExtractor.cpp */,<br>-<span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>9470A8EE1402DF940056FF61 /* DataVisualization.h */,<br>-<span class="Apple-tab-span" style="white-space:pre">      </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>9470A8EF1402DFFB0056FF61 /* DataVisualization.cpp */,<br> <span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>263664941140A4C10075843B /* Debugger.h */,<br> <span class="Apple-tab-span" style="white-space:pre">       </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>263664921140A4930075843B /* Debugger.cpp */,<br> <span class="Apple-tab-span" style="white-space:pre">     </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>26BC7D5E10F1B77400F91463 /* Disassembler.h */,<br>@@ -2521,11 +2536,6 @@<br> <span class="Apple-tab-span" style="white-space:pre">   </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>26BC7D6310F1B77400F91463 /* FileSpecList.h */,<br> <span class="Apple-tab-span" style="white-space:pre">   </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>26BC7E7B10F1B85900F91463 /* FileSpecList.cpp */,<br> <span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>26BC7D6410F1B77400F91463 /* Flags.h */,<br>-<span class="Apple-tab-span" style="white-space:pre">  </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>94A9112B13D5DEF80046D8A6 /* FormatClasses.h */,<br>-<span class="Apple-tab-span" style="white-space:pre">  </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>94A9112D13D5DF210046D8A6 /* FormatClasses.cpp */,<br>-<span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>9415F61613B2C0DC00A52B36 /* FormatManager.h */,<br>-<span class="Apple-tab-span" style="white-space:pre">  </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>9415F61713B2C0EF00A52B36 /* FormatManager.cpp */,<br>-<span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>94A8287514031D05006C37A8 /* FormatNavigator.h */,<br> <span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>26F7305F139D8FC900FD51C7 /* History.h */,<br> <span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>26F73061139D8FDB00FD51C7 /* History.cpp */,<br> <span class="Apple-tab-span" style="white-space:pre">      </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>9AA69DBB118A029E00D753A0 /* InputReader.h */,<br>@@ -3328,6 +3338,34 @@<br> <span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>path = source/Host/common;<br> <span class="Apple-tab-span" style="white-space:pre">       </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>sourceTree = "<group>";<br> <span class="Apple-tab-span" style="white-space:pre">  </span><span class="Apple-tab-span" style="white-space:pre">    </span>};<br>+<span class="Apple-tab-span" style="white-space:pre">       </span><span class="Apple-tab-span" style="white-space:pre">    </span>94CB255616B0683B0059775D /* DataFormatters */ = {<br>+<span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>isa = PBXGroup;<br>+<span class="Apple-tab-span" style="white-space:pre">  </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>children = (<br>+<span class="Apple-tab-span" style="white-space:pre">     </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>94CB255F16B069800059775D /* CXXFormatterFunctions.h */,<br>+<span class="Apple-tab-span" style="white-space:pre">  </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>94CB255716B069770059775D /* CXXFormatterFunctions.cpp */,<br>+<span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>94CB256016B069800059775D /* DataVisualization.h */,<br>+<span class="Apple-tab-span" style="white-space:pre">      </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>94CB255816B069770059775D /* DataVisualization.cpp */,<br>+<span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>94CB257516B1D3910059775D /* FormatCache.h */,<br>+<span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>94CB257316B1D3870059775D /* FormatCache.cpp */,<br>+<span class="Apple-tab-span" style="white-space:pre">  </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>94CB256116B069800059775D /* FormatClasses.h */,<br>+<span class="Apple-tab-span" style="white-space:pre">  </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>94CB255916B069770059775D /* FormatClasses.cpp */,<br>+<span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>94CB256216B069800059775D /* FormatManager.h */,<br>+<span class="Apple-tab-span" style="white-space:pre">  </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>94CB255A16B069770059775D /* FormatManager.cpp */,<br>+<span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>94CB256316B069800059775D /* FormatNavigator.h */,<br>+<span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>94CB256816B096F90059775D /* TypeCategory.h */,<br>+<span class="Apple-tab-span" style="white-space:pre">   </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>94CB256416B096F10059775D /* TypeCategory.cpp */,<br>+<span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>94CB256916B096FA0059775D /* TypeCategoryMap.h */,<br>+<span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>94CB256516B096F10059775D /* TypeCategoryMap.cpp */,<br>+<span class="Apple-tab-span" style="white-space:pre">      </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>94CB256A16B0A4030059775D /* TypeFormat.h */,<br>+<span class="Apple-tab-span" style="white-space:pre">     </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>94CB256D16B0A4260059775D /* TypeFormat.cpp */,<br>+<span class="Apple-tab-span" style="white-space:pre">   </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>94CB256B16B0A4030059775D /* TypeSummary.h */,<br>+<span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>94CB256E16B0A4260059775D /* TypeSummary.cpp */,<br>+<span class="Apple-tab-span" style="white-space:pre">  </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>94CB256C16B0A4040059775D /* TypeSynthetic.h */,<br>+<span class="Apple-tab-span" style="white-space:pre">  </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>94CB256F16B0A4270059775D /* TypeSynthetic.cpp */,<br>+<span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>);<br>+<span class="Apple-tab-span" style="white-space:pre">       </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>name = DataFormatters;<br>+<span class="Apple-tab-span" style="white-space:pre">   </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>sourceTree = "<group>";<br>+<span class="Apple-tab-span" style="white-space:pre">  </span><span class="Apple-tab-span" style="white-space:pre">    </span>};<br> <span class="Apple-tab-span" style="white-space:pre">       </span><span class="Apple-tab-span" style="white-space:pre">    </span>EDC6D49114E5C15C001B75F8 /* launcherXPCService */ = {<br> <span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>isa = PBXGroup;<br> <span class="Apple-tab-span" style="white-space:pre">  </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>children = (<br>@@ -4094,7 +4132,6 @@<br> <span class="Apple-tab-span" style="white-space:pre">      </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>4CCA645613B40B82003BDF98 /* AppleObjCTrampolineHandler.cpp in Sources */,<br> <span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>4CCA645813B40B82003BDF98 /* AppleThreadPlanStepThroughObjCTrampoline.cpp in Sources */,<br> <span class="Apple-tab-span" style="white-space:pre">  </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>9463D4CD13B1798800C230D4 /* CommandObjectType.cpp in Sources */,<br>-<span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>9415F61813B2C0EF00A52B36 /* FormatManager.cpp in Sources */,<br> <span class="Apple-tab-span" style="white-space:pre">     </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>49D8FB3913B5598F00411094 /* ClangASTImporter.cpp in Sources */,<br> <span class="Apple-tab-span" style="white-space:pre">  </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>9467E65213C3D97600B3B6F3 /* TypeHierarchyNavigator.cpp in Sources */,<br> <span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>26ED3D6D13C563810017D45E /* OptionGroupVariable.cpp in Sources */,<br>@@ -4111,13 +4148,11 @@<br> <span class="Apple-tab-span" style="white-space:pre">      </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>265205AC13D3E3F700132FE2 /* RegisterContextKDP_x86_64.cpp in Sources */,<br> <span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>2628A4D513D4977900F5487A /* ThreadKDP.cpp in Sources */,<br> <span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>26D7E45D13D5E30A007FD12B /* SocketAddress.cpp in Sources */,<br>-<span class="Apple-tab-span" style="white-space:pre">     </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>B271B11413D6139300C3FEDB /* FormatClasses.cpp in Sources */,<br> <span class="Apple-tab-span" style="white-space:pre">     </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>94B6E76213D88365005F417F /* ValueObjectSyntheticFilter.cpp in Sources */,<br> <span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>262D24E613FB8710002D1960 /* RegisterContextMemory.cpp in Sources */,<br> <span class="Apple-tab-span" style="white-space:pre">     </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>26F4A21C13FBA31A0064B613 /* ThreadMemory.cpp in Sources */,<br> <span class="Apple-tab-span" style="white-space:pre">      </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>266DFE9713FD656E00D0C574 /* OperatingSystem.cpp in Sources */,<br> <span class="Apple-tab-span" style="white-space:pre">   </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>26954EBE1401EE8B00294D09 /* DynamicRegisterInfo.cpp in Sources */,<br>-<span class="Apple-tab-span" style="white-space:pre">       </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>9470A8F01402DFFB0056FF61 /* DataVisualization.cpp in Sources */,<br> <span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>26274FA214030EEF006BA130 /* OperatingSystemDarwinKernel.cpp in Sources */,<br> <span class="Apple-tab-span" style="white-space:pre">       </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>26274FA714030F79006BA130 /* DynamicLoaderDarwinKernel.cpp in Sources */,<br> <span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>94FA3DE01405D50400833217 /* ValueObjectConstResultChild.cpp in Sources */,<br>@@ -4165,10 +4200,19 @@<br> <span class="Apple-tab-span" style="white-space:pre">      </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>2697A39315E404B1003E682C /* OptionValueArch.cpp in Sources */,<br> <span class="Apple-tab-span" style="white-space:pre">   </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>94EA1D5C15E6C9B400D4171A /* PythonDataObjects.cpp in Sources */,<br> <span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>2698699B15E6CBD0002415FF /* OperatingSystemPython.cpp in Sources */,<br>-<span class="Apple-tab-span" style="white-space:pre">     </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>94CDEB9D15F0258500DD2A7A /* CXXFormatterFunctions.cpp in Sources */,<br> <span class="Apple-tab-span" style="white-space:pre">     </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>947A1D641616476B0017C8D1 /* CommandObjectPlugin.cpp in Sources */,<br> <span class="Apple-tab-span" style="white-space:pre">       </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>262ED0081631FA3A00879631 /* OptionGroupString.cpp in Sources */,<br> <span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>94094C6B163B6F840083A547 /* ValueObjectCast.cpp in Sources */,<br>+<span class="Apple-tab-span" style="white-space:pre">   </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>94CB255B16B069770059775D /* CXXFormatterFunctions.cpp in Sources */,<br>+<span class="Apple-tab-span" style="white-space:pre">     </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>94CB255C16B069770059775D /* DataVisualization.cpp in Sources */,<br>+<span class="Apple-tab-span" style="white-space:pre"> </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>94CB255D16B069770059775D /* FormatClasses.cpp in Sources */,<br>+<span class="Apple-tab-span" style="white-space:pre">     </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>94CB255E16B069770059775D /* FormatManager.cpp in Sources */,<br>+<span class="Apple-tab-span" style="white-space:pre">     </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>94CB256616B096F10059775D /* TypeCategory.cpp in Sources */,<br>+<span class="Apple-tab-span" style="white-space:pre">      </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>94CB256716B096F10059775D /* TypeCategoryMap.cpp in Sources */,<br>+<span class="Apple-tab-span" style="white-space:pre">   </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>94CB257016B0A4270059775D /* TypeFormat.cpp in Sources */,<br>+<span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>94CB257116B0A4270059775D /* TypeSummary.cpp in Sources */,<br>+<span class="Apple-tab-span" style="white-space:pre">       </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>94CB257216B0A4270059775D /* TypeSynthetic.cpp in Sources */,<br>+<span class="Apple-tab-span" style="white-space:pre">     </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>94CB257416B1D3880059775D /* FormatCache.cpp in Sources */,<br> <span class="Apple-tab-span" style="white-space:pre">       </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>);<br> <span class="Apple-tab-span" style="white-space:pre">       </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>runOnlyForDeploymentPostprocessing = 0;<br> <span class="Apple-tab-span" style="white-space:pre">  </span><span class="Apple-tab-span" style="white-space:pre">    </span>};<br><br>Modified: lldb/trunk/source/API/SBDebugger.cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBDebugger.cpp?rev=173728&r1=173727&r2=173728&view=diff">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBDebugger.cpp?rev=173728&r1=173727&r2=173728&view=diff</a><br>==============================================================================<br>--- lldb/trunk/source/API/SBDebugger.cpp (original)<br>+++ lldb/trunk/source/API/SBDebugger.cpp Mon Jan 28 17:47:25 2013<br>@@ -35,9 +35,9 @@<br> #include "lldb/API/SBTypeSynthetic.h"<br><br><br>-#include "lldb/Core/DataVisualization.h"<br> #include "lldb/Core/Debugger.h"<br> #include "lldb/Core/State.h"<br>+#include "lldb/DataFormatters/DataVisualization.h"<br> #include "lldb/Interpreter/Args.h"<br> #include "lldb/Interpreter/CommandInterpreter.h"<br> #include "lldb/Interpreter/OptionGroupPlatform.h"<br><br>Modified: lldb/trunk/source/API/SBTypeCategory.cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBTypeCategory.cpp?rev=173728&r1=173727&r2=173728&view=diff">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBTypeCategory.cpp?rev=173728&r1=173727&r2=173728&view=diff</a><br>==============================================================================<br>--- lldb/trunk/source/API/SBTypeCategory.cpp (original)<br>+++ lldb/trunk/source/API/SBTypeCategory.cpp Mon Jan 28 17:47:25 2013<br>@@ -18,8 +18,8 @@<br> #include "lldb/API/SBTypeNameSpecifier.h"<br> #include "lldb/API/SBStream.h"<br><br>-#include "lldb/Core/DataVisualization.h"<br> #include "lldb/Core/Debugger.h"<br>+#include "lldb/DataFormatters/DataVisualization.h"<br> #include "lldb/Interpreter/CommandInterpreter.h"<br> #include "lldb/Interpreter/ScriptInterpreter.h"<br><br>@@ -233,7 +233,7 @@ SBTypeCategory::GetSyntheticForType (SBT<br>     if (!children_sp)<br>         return lldb::SBTypeSynthetic();<br><br>-    TypeSyntheticImplSP synth_sp = STD_STATIC_POINTER_CAST(TypeSyntheticImpl,children_sp);<br>+    ScriptedSyntheticChildrenSP synth_sp = STD_STATIC_POINTER_CAST(ScriptedSyntheticChildren,children_sp);<br><br>     return lldb::SBTypeSynthetic(synth_sp);<br> }<br>@@ -285,7 +285,7 @@ SBTypeCategory::GetSyntheticAtIndex (uin<br>     if (!children_sp.get())<br>         return lldb::SBTypeSynthetic();<br><br>-    TypeSyntheticImplSP synth_sp = STD_STATIC_POINTER_CAST(TypeSyntheticImpl,children_sp);<br>+    ScriptedSyntheticChildrenSP synth_sp = STD_STATIC_POINTER_CAST(ScriptedSyntheticChildren,children_sp);<br><br>     return lldb::SBTypeSynthetic(synth_sp);<br> }<br><br>Modified: lldb/trunk/source/API/SBTypeFilter.cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBTypeFilter.cpp?rev=173728&r1=173727&r2=173728&view=diff">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBTypeFilter.cpp?rev=173728&r1=173727&r2=173728&view=diff</a><br>==============================================================================<br>--- lldb/trunk/source/API/SBTypeFilter.cpp (original)<br>+++ lldb/trunk/source/API/SBTypeFilter.cpp Mon Jan 28 17:47:25 2013<br>@@ -13,7 +13,7 @@<br><br> #include "lldb/API/SBStream.h"<br><br>-#include "lldb/Core/DataVisualization.h"<br>+#include "lldb/DataFormatters/DataVisualization.h"<br><br> using namespace lldb;<br> using namespace lldb_private;<br><br>Modified: lldb/trunk/source/API/SBTypeFormat.cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBTypeFormat.cpp?rev=173728&r1=173727&r2=173728&view=diff">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBTypeFormat.cpp?rev=173728&r1=173727&r2=173728&view=diff</a><br>==============================================================================<br>--- lldb/trunk/source/API/SBTypeFormat.cpp (original)<br>+++ lldb/trunk/source/API/SBTypeFormat.cpp Mon Jan 28 17:47:25 2013<br>@@ -13,7 +13,7 @@<br><br> #include "lldb/API/SBStream.h"<br><br>-#include "lldb/Core/DataVisualization.h"<br>+#include "lldb/DataFormatters/DataVisualization.h"<br><br> using namespace lldb;<br> using namespace lldb_private;<br><br>Modified: lldb/trunk/source/API/SBTypeNameSpecifier.cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBTypeNameSpecifier.cpp?rev=173728&r1=173727&r2=173728&view=diff">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBTypeNameSpecifier.cpp?rev=173728&r1=173727&r2=173728&view=diff</a><br>==============================================================================<br>--- lldb/trunk/source/API/SBTypeNameSpecifier.cpp (original)<br>+++ lldb/trunk/source/API/SBTypeNameSpecifier.cpp Mon Jan 28 17:47:25 2013<br>@@ -14,7 +14,7 @@<br> #include "lldb/API/SBStream.h"<br> #include "lldb/API/SBType.h"<br><br>-#include "lldb/Core/DataVisualization.h"<br>+#include "lldb/DataFormatters/DataVisualization.h"<br><br> using namespace lldb;<br> using namespace lldb_private;<br><br>Modified: lldb/trunk/source/API/SBTypeSummary.cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBTypeSummary.cpp?rev=173728&r1=173727&r2=173728&view=diff">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBTypeSummary.cpp?rev=173728&r1=173727&r2=173728&view=diff</a><br>==============================================================================<br>--- lldb/trunk/source/API/SBTypeSummary.cpp (original)<br>+++ lldb/trunk/source/API/SBTypeSummary.cpp Mon Jan 28 17:47:25 2013<br>@@ -13,7 +13,7 @@<br><br> #include "lldb/API/SBStream.h"<br><br>-#include "lldb/Core/DataVisualization.h"<br>+#include "lldb/DataFormatters/DataVisualization.h"<br><br> using namespace lldb;<br> using namespace lldb_private;<br><br>Modified: lldb/trunk/source/API/SBTypeSynthetic.cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBTypeSynthetic.cpp?rev=173728&r1=173727&r2=173728&view=diff">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBTypeSynthetic.cpp?rev=173728&r1=173727&r2=173728&view=diff</a><br>==============================================================================<br>--- lldb/trunk/source/API/SBTypeSynthetic.cpp (original)<br>+++ lldb/trunk/source/API/SBTypeSynthetic.cpp Mon Jan 28 17:47:25 2013<br>@@ -13,7 +13,7 @@<br><br> #include "lldb/API/SBStream.h"<br><br>-#include "lldb/Core/DataVisualization.h"<br>+#include "lldb/DataFormatters/DataVisualization.h"<br><br> using namespace lldb;<br> using namespace lldb_private;<br>@@ -30,7 +30,7 @@ SBTypeSynthetic::CreateWithClassName (co<br> {<br>     if (!data || data[0] == 0)<br>         return SBTypeSynthetic();<br>-    return SBTypeSynthetic(TypeSyntheticImplSP(new TypeSyntheticImpl(options, data, "")));<br>+    return SBTypeSynthetic(ScriptedSyntheticChildrenSP(new ScriptedSyntheticChildren(options, data, "")));<br> }<br><br> SBTypeSynthetic<br>@@ -38,7 +38,7 @@ SBTypeSynthetic::CreateWithScriptCode (c<br> {<br>     if (!data || data[0] == 0)<br>         return SBTypeSynthetic();<br>-    return SBTypeSynthetic(TypeSyntheticImplSP(new TypeSyntheticImpl(options, "", data)));<br>+    return SBTypeSynthetic(ScriptedSyntheticChildrenSP(new ScriptedSyntheticChildren(options, "", data)));<br> }<br><br> SBTypeSynthetic::SBTypeSynthetic (const lldb::SBTypeSynthetic &rhs) :<br>@@ -172,19 +172,19 @@ SBTypeSynthetic::operator != (lldb::SBTy<br>     return m_opaque_sp != rhs.m_opaque_sp;<br> }<br><br>-lldb::TypeSyntheticImplSP<br>+lldb::ScriptedSyntheticChildrenSP<br> SBTypeSynthetic::GetSP ()<br> {<br>     return m_opaque_sp;<br> }<br><br> void<br>-SBTypeSynthetic::SetSP (const lldb::TypeSyntheticImplSP &TypeSynthetic_impl_sp)<br>+SBTypeSynthetic::SetSP (const lldb::ScriptedSyntheticChildrenSP &TypeSynthetic_impl_sp)<br> {<br>     m_opaque_sp = TypeSynthetic_impl_sp;<br> }<br><br>-SBTypeSynthetic::SBTypeSynthetic (const lldb::TypeSyntheticImplSP &TypeSynthetic_impl_sp) :<br>+SBTypeSynthetic::SBTypeSynthetic (const lldb::ScriptedSyntheticChildrenSP &TypeSynthetic_impl_sp) :<br> m_opaque_sp(TypeSynthetic_impl_sp)<br> {<br> }<br>@@ -197,7 +197,7 @@ SBTypeSynthetic::CopyOnWrite_Impl()<br>     if (m_opaque_sp.unique())<br>         return true;<br><br>-    TypeSyntheticImplSP new_sp(new TypeSyntheticImpl(m_opaque_sp->GetOptions(),<br>+    ScriptedSyntheticChildrenSP new_sp(new ScriptedSyntheticChildren(m_opaque_sp->GetOptions(),<br>                                                      m_opaque_sp->GetPythonClassName(),<br>                                                      m_opaque_sp->GetPythonCode()));<br><br><br>Modified: lldb/trunk/source/API/SBValue.cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBValue.cpp?rev=173728&r1=173727&r2=173728&view=diff">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBValue.cpp?rev=173728&r1=173727&r2=173728&view=diff</a><br>==============================================================================<br>--- lldb/trunk/source/API/SBValue.cpp (original)<br>+++ lldb/trunk/source/API/SBValue.cpp Mon Jan 28 17:47:25 2013<br>@@ -20,7 +20,6 @@<br><br> #include "lldb/Breakpoint/Watchpoint.h"<br> #include "lldb/Core/DataExtractor.h"<br>-#include "lldb/Core/DataVisualization.h"<br> #include "lldb/Core/Log.h"<br> #include "lldb/Core/Module.h"<br> #include "lldb/Core/Scalar.h"<br>@@ -30,6 +29,7 @@<br> #include "lldb/Core/Value.h"<br> #include "lldb/Core/ValueObject.h"<br> #include "lldb/Core/ValueObjectConstResult.h"<br>+#include "lldb/DataFormatters/DataVisualization.h"<br> #include "lldb/Symbol/Block.h"<br> #include "lldb/Symbol/Declaration.h"<br> #include "lldb/Symbol/ObjectFile.h"<br>@@ -740,7 +740,7 @@ SBValue::GetTypeSynthetic ()<br><br>                     if (children_sp && children_sp->IsScripted())<br>                     {<br>-                        TypeSyntheticImplSP synth_sp = STD_STATIC_POINTER_CAST(TypeSyntheticImpl,children_sp);<br>+                        ScriptedSyntheticChildrenSP synth_sp = STD_STATIC_POINTER_CAST(ScriptedSyntheticChildren,children_sp);<br>                         synthetic.SetSP(synth_sp);<br>                     }<br>                 }<br><br>Modified: lldb/trunk/source/Commands/CommandObjectFrame.cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectFrame.cpp?rev=173728&r1=173727&r2=173728&view=diff">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectFrame.cpp?rev=173728&r1=173727&r2=173728&view=diff</a><br>==============================================================================<br>--- lldb/trunk/source/Commands/CommandObjectFrame.cpp (original)<br>+++ lldb/trunk/source/Commands/CommandObjectFrame.cpp Mon Jan 28 17:47:25 2013<br>@@ -16,7 +16,6 @@<br> #include <string><br> // Other libraries and framework includes<br> // Project includes<br>-#include "lldb/Core/DataVisualization.h"<br> #include "lldb/Core/Debugger.h"<br> #include "lldb/Core/Module.h"<br> #include "lldb/Core/StreamFile.h"<br>@@ -25,6 +24,7 @@<br> #include "lldb/Core/Value.h"<br> #include "lldb/Core/ValueObject.h"<br> #include "lldb/Core/ValueObjectVariable.h"<br>+#include "lldb/DataFormatters/DataVisualization.h"<br> #include "lldb/Host/Host.h"<br> #include "lldb/Interpreter/Args.h"<br> #include "lldb/Interpreter/CommandInterpreter.h"<br><br>Modified: lldb/trunk/source/Commands/CommandObjectType.cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectType.cpp?rev=173728&r1=173727&r2=173728&view=diff">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectType.cpp?rev=173728&r1=173727&r2=173728&view=diff</a><br>==============================================================================<br>--- lldb/trunk/source/Commands/CommandObjectType.cpp (original)<br>+++ lldb/trunk/source/Commands/CommandObjectType.cpp Mon Jan 28 17:47:25 2013<br>@@ -17,13 +17,13 @@<br><br> // C++ Includes<br><br>-#include "lldb/Core/DataVisualization.h"<br> #include "lldb/Core/ConstString.h"<br> #include "lldb/Core/Debugger.h"<br> #include "lldb/Core/InputReaderEZ.h"<br> #include "lldb/Core/RegularExpression.h"<br> #include "lldb/Core/State.h"<br> #include "lldb/Core/StringList.h"<br>+#include "lldb/DataFormatters/DataVisualization.h"<br> #include "lldb/Interpreter/CommandInterpreter.h"<br> #include "lldb/Interpreter/CommandObject.h"<br> #include "lldb/Interpreter/CommandReturnObject.h"<br>@@ -1961,7 +1961,7 @@ protected:<br>         if (argc == 1 && strcmp(command.GetArgumentAtIndex(0),"*") == 0)<br>         {<br>             // we want to make sure to enable "system" last and "default" first<br>-            DataVisualization::Categories::Enable(ConstString("default"), CategoryMap::First);<br>+            DataVisualization::Categories::Enable(ConstString("default"), TypeCategoryMap::First);<br>             uint32_t num_categories = DataVisualization::Categories::GetCount();<br>             for (uint32_t i = 0; i < num_categories; i++)<br>             {<br>@@ -1972,10 +1972,10 @@ protected:<br>                          ::strcmp(category_sp->GetName(), "default") == 0 )<br>                         continue;<br>                     else<br>-                        DataVisualization::Categories::Enable(category_sp, CategoryMap::Default);<br>+                        DataVisualization::Categories::Enable(category_sp, TypeCategoryMap::Default);<br>                 }<br>             }<br>-            DataVisualization::Categories::Enable(ConstString("system"), CategoryMap::Last);<br>+            DataVisualization::Categories::Enable(ConstString("system"), TypeCategoryMap::Last);<br>         }<br>         else<br>         {<br>@@ -3385,10 +3385,10 @@ public:<br>         // everything should be fine now, let's add the synth provider class<br><br>         SyntheticChildrenSP synth_provider;<br>-        synth_provider.reset(new TypeSyntheticImpl(SyntheticChildren::Flags().SetCascades(options->m_cascade).<br>-                                                         SetSkipPointers(options->m_skip_pointers).<br>-                                                         SetSkipReferences(options->m_skip_references),<br>-                                                         class_name_str.c_str()));<br>+        synth_provider.reset(new ScriptedSyntheticChildren(SyntheticChildren::Flags().SetCascades(options->m_cascade).<br>+                                                           SetSkipPointers(options->m_skip_pointers).<br>+                                                           SetSkipReferences(options->m_skip_references),<br>+                                                           class_name_str.c_str()));<br><br><br>         lldb::TypeCategoryImplSP category;<br>@@ -3504,11 +3504,11 @@ CommandObjectTypeSynthAdd::Execute_Pytho<br><br>     SyntheticChildrenSP entry;<br><br>-    TypeSyntheticImpl* impl = new TypeSyntheticImpl(SyntheticChildren::Flags().<br>-                                                    SetCascades(m_options.m_cascade).<br>-                                                    SetSkipPointers(m_options.m_skip_pointers).<br>-                                                    SetSkipReferences(m_options.m_skip_references),<br>-                                                    m_options.m_class_name.c_str());<br>+    ScriptedSyntheticChildren* impl = new ScriptedSyntheticChildren(SyntheticChildren::Flags().<br>+                                                                    SetCascades(m_options.m_cascade).<br>+                                                                    SetSkipPointers(m_options.m_skip_pointers).<br>+                                                                    SetSkipReferences(m_options.m_skip_references),<br>+                                                                    m_options.m_class_name.c_str());<br><br>     entry.reset(impl);<br><br><br>Removed: lldb/trunk/source/Core/CXXFormatterFunctions.cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/CXXFormatterFunctions.cpp?rev=173727&view=auto">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/CXXFormatterFunctions.cpp?rev=173727&view=auto</a><br>==============================================================================<br>--- lldb/trunk/source/Core/CXXFormatterFunctions.cpp (original)<br>+++ lldb/trunk/source/Core/CXXFormatterFunctions.cpp (removed)<br>@@ -1,1808 +0,0 @@<br>-//===-- CXXFormatterFunctions.cpp---------------------------------*- C++ -*-===//<br>-//<br>-//                     The LLVM Compiler Infrastructure<br>-//<br>-// This file is distributed under the University of Illinois Open Source<br>-// License. See LICENSE.TXT for details.<br>-//<br>-//===----------------------------------------------------------------------===//<br>-<br>-#include "lldb/lldb-python.h"<br>-<br>-#include "lldb/Core/CXXFormatterFunctions.h"<br>-<br>-// needed to get ConvertUTF16/32ToUTF8<br>-#define CLANG_NEEDS_THESE_ONE_DAY<br>-#include "clang/Basic/ConvertUTF.h"<br>-<br>-#include "lldb/Core/DataBufferHeap.h"<br>-#include "lldb/Core/Error.h"<br>-#include "lldb/Core/Stream.h"<br>-#include "lldb/Core/ValueObject.h"<br>-#include "lldb/Core/ValueObjectConstResult.h"<br>-#include "lldb/Host/Endian.h"<br>-#include "lldb/Symbol/ClangASTContext.h"<br>-#include "lldb/Target/ObjCLanguageRuntime.h"<br>-#include "lldb/Target/Target.h"<br>-<br>-using namespace lldb;<br>-using namespace lldb_private;<br>-using namespace lldb_private::formatters;<br>-<br>-bool<br>-lldb_private::formatters::ExtractValueFromObjCExpression (ValueObject &valobj,<br>-                                                          const char* target_type,<br>-                                                          const char* selector,<br>-                                                          uint64_t &value)<br>-{<br>-    if (!target_type || !*target_type)<br>-        return false;<br>-    if (!selector || !*selector)<br>-        return false;<br>-    StreamString expr;<br>-    expr.Printf("(%s)[(id)0x%" PRIx64 " %s]",target_type,valobj.GetPointerValue(),selector);<br>-    ExecutionContext exe_ctx (valobj.GetExecutionContextRef());<br>-    lldb::ValueObjectSP result_sp;<br>-    Target* target = exe_ctx.GetTargetPtr();<br>-    StackFrame* stack_frame = exe_ctx.GetFramePtr();<br>-    if (!target || !stack_frame)<br>-        return false;<br>-    <br>-    EvaluateExpressionOptions options;<br>-    options.SetCoerceToId(false)<br>-    .SetUnwindOnError(true)<br>-    .SetKeepInMemory(true);<br>-    <br>-    target->EvaluateExpression(expr.GetData(),<br>-                               stack_frame,<br>-                               result_sp,<br>-                               options);<br>-    if (!result_sp)<br>-        return false;<br>-    value = result_sp->GetValueAsUnsigned(0);<br>-    return true;<br>-}<br>-<br>-lldb::ValueObjectSP<br>-lldb_private::formatters::CallSelectorOnObject (ValueObject &valobj,<br>-                                                const char* return_type,<br>-                                                const char* selector,<br>-                                                uint64_t index)<br>-{<br>-    lldb::ValueObjectSP valobj_sp;<br>-    if (!return_type || !*return_type)<br>-        return valobj_sp;<br>-    if (!selector || !*selector)<br>-        return valobj_sp;<br>-    StreamString expr_path_stream;<br>-    valobj.GetExpressionPath(expr_path_stream, false);<br>-    StreamString expr;<br>-    expr.Printf("(%s)[%s %s:%" PRId64 "]",return_type,expr_path_stream.GetData(),selector,index);<br>-    ExecutionContext exe_ctx (valobj.GetExecutionContextRef());<br>-    lldb::ValueObjectSP result_sp;<br>-    Target* target = exe_ctx.GetTargetPtr();<br>-    StackFrame* stack_frame = exe_ctx.GetFramePtr();<br>-    if (!target || !stack_frame)<br>-        return valobj_sp;<br>-    <br>-    EvaluateExpressionOptions options;<br>-    options.SetCoerceToId(false)<br>-    .SetUnwindOnError(true)<br>-    .SetKeepInMemory(true)<br>-    .SetUseDynamic(lldb::eDynamicCanRunTarget);<br>-    <br>-    target->EvaluateExpression(expr.GetData(),<br>-                               stack_frame,<br>-                               valobj_sp,<br>-                               options);<br>-    return valobj_sp;<br>-}<br>-<br>-lldb::ValueObjectSP<br>-lldb_private::formatters::CallSelectorOnObject (ValueObject &valobj,<br>-                                                const char* return_type,<br>-                                                const char* selector,<br>-                                                const char* key)<br>-{<br>-    lldb::ValueObjectSP valobj_sp;<br>-    if (!return_type || !*return_type)<br>-        return valobj_sp;<br>-    if (!selector || !*selector)<br>-        return valobj_sp;<br>-    if (!key || !*key)<br>-        return valobj_sp;<br>-    StreamString expr_path_stream;<br>-    valobj.GetExpressionPath(expr_path_stream, false);<br>-    StreamString expr;<br>-    expr.Printf("(%s)[%s %s:%s]",return_type,expr_path_stream.GetData(),selector,key);<br>-    ExecutionContext exe_ctx (valobj.GetExecutionContextRef());<br>-    lldb::ValueObjectSP result_sp;<br>-    Target* target = exe_ctx.GetTargetPtr();<br>-    StackFrame* stack_frame = exe_ctx.GetFramePtr();<br>-    if (!target || !stack_frame)<br>-        return valobj_sp;<br>-    <br>-    EvaluateExpressionOptions options;<br>-    options.SetCoerceToId(false)<br>-    .SetUnwindOnError(true)<br>-    .SetKeepInMemory(true)<br>-    .SetUseDynamic(lldb::eDynamicCanRunTarget);<br>-    <br>-    target->EvaluateExpression(expr.GetData(),<br>-                               stack_frame,<br>-                               valobj_sp,<br>-                               options);<br>-    return valobj_sp;<br>-}<br>-<br>-// use this call if you already have an LLDB-side buffer for the data<br>-template<typename SourceDataType><br>-static bool<br>-DumpUTFBufferToStream (ConversionResult (*ConvertFunction) (const SourceDataType**,<br>-                                                            const SourceDataType*,<br>-                                                            UTF8**,<br>-                                                            UTF8*,<br>-                                                            ConversionFlags),<br>-                       DataExtractor& data,<br>-                       Stream& stream,<br>-                       char prefix_token = '@',<br>-                       char quote = '"',<br>-                       int sourceSize = 0)<br>-{<br>-    if (prefix_token != 0)<br>-        stream.Printf("%c",prefix_token);<br>-    if (quote != 0)<br>-        stream.Printf("%c",quote);<br>-    if (data.GetByteSize() && data.GetDataStart() && data.GetDataEnd())<br>-    {<br>-        const int bufferSPSize = data.GetByteSize();<br>-        if (sourceSize == 0)<br>-        {<br>-            const int origin_encoding = 8*sizeof(SourceDataType);<br>-            sourceSize = bufferSPSize/(origin_encoding >> 2);<br>-        }<br>-        <br>-        SourceDataType *data_ptr = (SourceDataType*)data.GetDataStart();<br>-        SourceDataType *data_end_ptr = data_ptr + sourceSize;<br>-        <br>-        while (data_ptr < data_end_ptr)<br>-        {<br>-            if (!*data_ptr)<br>-            {<br>-                data_end_ptr = data_ptr;<br>-                break;<br>-            }<br>-            data_ptr++;<br>-        }<br>-        <br>-        *data_ptr = 0;<br>-        data_ptr = (SourceDataType*)data.GetDataStart();<br>-        <br>-        lldb::DataBufferSP utf8_data_buffer_sp;<br>-        UTF8* utf8_data_ptr = nullptr;<br>-        UTF8* utf8_data_end_ptr = nullptr;<br>-        <br>-        if (ConvertFunction)<br>-        {<br>-            utf8_data_buffer_sp.reset(new DataBufferHeap(bufferSPSize,0));<br>-            utf8_data_ptr = (UTF8*)utf8_data_buffer_sp->GetBytes();<br>-            utf8_data_end_ptr = utf8_data_ptr + bufferSPSize;<br>-            ConvertFunction ( (const SourceDataType**)&data_ptr, data_end_ptr, &utf8_data_ptr, utf8_data_end_ptr, lenientConversion );<br>-            utf8_data_ptr = (UTF8*)utf8_data_buffer_sp->GetBytes(); // needed because the ConvertFunction will change the value of the data_ptr<br>-        }<br>-        else<br>-        {<br>-            // just copy the pointers - the cast is necessary to make the compiler happy<br>-            // but this should only happen if we are reading UTF8 data<br>-            utf8_data_ptr = (UTF8*)data_ptr;<br>-            utf8_data_end_ptr = (UTF8*)data_end_ptr;<br>-        }<br>-        <br>-        // since we tend to accept partial data (and even partially malformed data)<br>-        // we might end up with no NULL terminator before the end_ptr<br>-        // hence we need to take a slower route and ensure we stay within boundaries<br>-        for (;utf8_data_ptr != utf8_data_end_ptr; utf8_data_ptr++)<br>-        {<br>-            if (!*utf8_data_ptr)<br>-                break;<br>-            stream.Printf("%c",*utf8_data_ptr);<br>-        }<br>-    }<br>-    if (quote != 0)<br>-        stream.Printf("%c",quote);<br>-    return true;<br>-}<br>-<br>-template<typename SourceDataType><br>-static bool<br>-ReadUTFBufferAndDumpToStream (ConversionResult (*ConvertFunction) (const SourceDataType**,<br>-                                                                   const SourceDataType*,<br>-                                                                   UTF8**,<br>-                                                                   UTF8*,<br>-                                                                   ConversionFlags),<br>-                              uint64_t location,<br>-                              const ProcessSP& process_sp,<br>-                              Stream& stream,<br>-                              char prefix_token = '@',<br>-                              char quote = '"',<br>-                              int sourceSize = 0)<br>-{<br>-    if (location == 0 || location == LLDB_INVALID_ADDRESS)<br>-        return false;<br>-    if (!process_sp)<br>-        return false;<br>-<br>-    const int origin_encoding = 8*sizeof(SourceDataType);<br>-    if (origin_encoding != 8 && origin_encoding != 16 && origin_encoding != 32)<br>-        return false;<br>-    // if not UTF8, I need a conversion function to return proper UTF8<br>-    if (origin_encoding != 8 && !ConvertFunction)<br>-        return false;<br>-<br>-    if (sourceSize == 0)<br>-        sourceSize = process_sp->GetTarget().GetMaximumSizeOfStringSummary();<br>-    const int bufferSPSize = sourceSize * (origin_encoding >> 2);<br>-<br>-    Error error;<br>-    lldb::DataBufferSP buffer_sp(new DataBufferHeap(bufferSPSize,0));<br>-    <br>-    if (!buffer_sp->GetBytes())<br>-        return false;<br>-    <br>-    size_t data_read = process_sp->ReadMemoryFromInferior(location, (char*)buffer_sp->GetBytes(), bufferSPSize, error);<br>-    if (error.Fail() || data_read == 0)<br>-    {<br>-        stream.Printf("unable to read data");<br>-        return true;<br>-    }<br>-    <br>-    DataExtractor data(buffer_sp, process_sp->GetByteOrder(), process_sp->GetAddressByteSize());<br>-    <br>-    return DumpUTFBufferToStream(ConvertFunction, data, stream, prefix_token, quote, sourceSize);<br>-}<br>-<br>-bool<br>-lldb_private::formatters::Char16StringSummaryProvider (ValueObject& valobj, Stream& stream)<br>-{<br>-    ProcessSP process_sp = valobj.GetProcessSP();<br>-    if (!process_sp)<br>-        return false;<br>-    <br>-    lldb::addr_t valobj_addr = valobj.GetValueAsUnsigned(0);<br>-    <br>-    if (!valobj_addr)<br>-        return false;<br>-    <br>-    if (!ReadUTFBufferAndDumpToStream<UTF16>(ConvertUTF16toUTF8,valobj_addr,<br>-                                                                 process_sp,<br>-                                                                 stream,<br>-                                                                 'u'))<br>-    {<br>-        stream.Printf("Summary Unavailable");<br>-        return true;<br>-    }<br>-<br>-    return true;<br>-}<br>-<br>-bool<br>-lldb_private::formatters::Char32StringSummaryProvider (ValueObject& valobj, Stream& stream)<br>-{<br>-    ProcessSP process_sp = valobj.GetProcessSP();<br>-    if (!process_sp)<br>-        return false;<br>-    <br>-    lldb::addr_t valobj_addr = valobj.GetValueAsUnsigned(0);<br>-    <br>-    if (!valobj_addr)<br>-        return false;<br>-    <br>-    if (!ReadUTFBufferAndDumpToStream<UTF32>(ConvertUTF32toUTF8,valobj_addr,<br>-                                                                 process_sp,<br>-                                                                 stream,<br>-                                                                 'U'))<br>-    {<br>-        stream.Printf("Summary Unavailable");<br>-        return true;<br>-    }<br>-    <br>-    return true;<br>-}<br>-<br>-bool<br>-lldb_private::formatters::WCharStringSummaryProvider (ValueObject& valobj, Stream& stream)<br>-{<br>-    ProcessSP process_sp = valobj.GetProcessSP();<br>-    if (!process_sp)<br>-        return false;<br>-<br>-    lldb::addr_t data_addr = 0;<br>-    <br>-    if (valobj.IsPointerType())<br>-        data_addr = valobj.GetValueAsUnsigned(0);<br>-    else if (valobj.IsArrayType())<br>-        data_addr = valobj.GetAddressOf();<br>-<br>-    if (data_addr == 0 || data_addr == LLDB_INVALID_ADDRESS)<br>-        return false;<br>-<br>-    clang::ASTContext* ast = valobj.GetClangAST();<br>-<br>-    if (!ast)<br>-        return false;<br>-<br>-    uint32_t wchar_size = ClangASTType::GetClangTypeBitWidth(ast, ClangASTType::GetBasicType(ast, lldb::eBasicTypeWChar).GetOpaqueQualType());<br>-<br>-    switch (wchar_size)<br>-    {<br>-        case 8:<br>-            // utf 8<br>-            return ReadUTFBufferAndDumpToStream<UTF8>(nullptr, data_addr,<br>-                                                               process_sp,<br>-                                                               stream,<br>-                                                               'L');<br>-        case 16:<br>-            // utf 16<br>-            return ReadUTFBufferAndDumpToStream<UTF16>(ConvertUTF16toUTF8, data_addr,<br>-                                                                           process_sp,<br>-                                                                           stream,<br>-                                                                           'L');<br>-        case 32:<br>-            // utf 32<br>-            return ReadUTFBufferAndDumpToStream<UTF32>(ConvertUTF32toUTF8, data_addr,<br>-                                                                           process_sp,<br>-                                                                           stream,<br>-                                                                           'L');<br>-        default:<br>-            stream.Printf("size for wchar_t is not valid");<br>-            return true;<br>-    }<br>-    return true;<br>-}<br>-<br>-bool<br>-lldb_private::formatters::Char16SummaryProvider (ValueObject& valobj, Stream& stream)<br>-{<br>-    DataExtractor data;<br>-    valobj.GetData(data);<br>-    <br>-    std::string value;<br>-    valobj.GetValueAsCString(lldb::eFormatUnicode16, value);<br>-    if (!value.empty())<br>-        stream.Printf("%s ", value.c_str());<br>-<br>-    return DumpUTFBufferToStream<UTF16>(ConvertUTF16toUTF8,data,stream, 'u','\'',1);<br>-}<br>-<br>-bool<br>-lldb_private::formatters::Char32SummaryProvider (ValueObject& valobj, Stream& stream)<br>-{<br>-    DataExtractor data;<br>-    valobj.GetData(data);<br>-    <br>-    std::string value;<br>-    valobj.GetValueAsCString(lldb::eFormatUnicode32, value);<br>-    if (!value.empty())<br>-        stream.Printf("%s ", value.c_str());<br>-    <br>-    return DumpUTFBufferToStream<UTF32>(ConvertUTF32toUTF8,data,stream, 'U','\'',1);<br>-}<br>-<br>-bool<br>-lldb_private::formatters::WCharSummaryProvider (ValueObject& valobj, Stream& stream)<br>-{<br>-    DataExtractor data;<br>-    valobj.GetData(data);<br>-    <br>-    clang::ASTContext* ast = valobj.GetClangAST();<br>-    <br>-    if (!ast)<br>-        return false;<br>-    <br>-    std::string value;<br>-    <br>-    uint32_t wchar_size = ClangASTType::GetClangTypeBitWidth(ast, ClangASTType::GetBasicType(ast, lldb::eBasicTypeWChar).GetOpaqueQualType());<br>-    <br>-    switch (wchar_size)<br>-    {<br>-        case 8:<br>-            // utf 8<br>-            valobj.GetValueAsCString(lldb::eFormatChar, value);<br>-            if (!value.empty())<br>-                stream.Printf("%s ", value.c_str());<br>-            return DumpUTFBufferToStream<UTF8>(nullptr,<br>-                                               data,<br>-                                               stream,<br>-                                               'L',<br>-                                               '\'',<br>-                                               1);<br>-        case 16:<br>-            // utf 16<br>-            valobj.GetValueAsCString(lldb::eFormatUnicode16, value);<br>-            if (!value.empty())<br>-                stream.Printf("%s ", value.c_str());<br>-            return DumpUTFBufferToStream<UTF16>(ConvertUTF16toUTF8,<br>-                                                data,<br>-                                                stream,<br>-                                                'L',<br>-                                                '\'',<br>-                                                1);<br>-        case 32:<br>-            // utf 32<br>-            valobj.GetValueAsCString(lldb::eFormatUnicode32, value);<br>-            if (!value.empty())<br>-                stream.Printf("%s ", value.c_str());<br>-            return DumpUTFBufferToStream<UTF32>(ConvertUTF32toUTF8,<br>-                                                data,<br>-                                                stream,<br>-                                                'L',<br>-                                                '\'',<br>-                                                1);<br>-        default:<br>-            stream.Printf("size for wchar_t is not valid");<br>-            return true;<br>-    }<br>-    return true;<br>-}<br>-<br>-// this function extracts information from a libcxx std::basic_string<><br>-// irregardless of template arguments. it reports the size (in item count not bytes)<br>-// and the location in memory where the string data can be found<br>-static bool<br>-ExtractLibcxxStringInfo (ValueObject& valobj,<br>-                         ValueObjectSP &location_sp,<br>-                         uint64_t& size)<br>-{<br>-    ValueObjectSP D(valobj.GetChildAtIndexPath({0,0,0,0}));<br>-    if (!D)<br>-        return false;<br>-    <br>-    ValueObjectSP size_mode(D->GetChildAtIndexPath({1,0,0}));<br>-    if (!size_mode)<br>-        return false;<br>-    <br>-    uint64_t size_mode_value(size_mode->GetValueAsUnsigned(0));<br>-    <br>-    if ((size_mode_value & 1) == 0) // this means the string is in short-mode and the data is stored inline<br>-    {<br>-        ValueObjectSP s(D->GetChildAtIndex(1, true));<br>-        if (!s)<br>-            return false;<br>-        size = ((size_mode_value >> 1) % 256);<br>-        location_sp = s->GetChildAtIndex(1, true);<br>-        return (location_sp.get() != nullptr);<br>-    }<br>-    else<br>-    {<br>-        ValueObjectSP l(D->GetChildAtIndex(0, true));<br>-        if (!l)<br>-            return false;<br>-        location_sp = l->GetChildAtIndex(2, true);<br>-        ValueObjectSP size_vo(l->GetChildAtIndex(1, true));<br>-        if (!size_vo || !location_sp)<br>-            return false;<br>-        size = size_vo->GetValueAsUnsigned(0);<br>-        return true;<br>-    }<br>-}<br>-<br>-bool<br>-lldb_private::formatters::LibcxxWStringSummaryProvider (ValueObject& valobj, Stream& stream)<br>-{<br>-    uint64_t size = 0;<br>-    ValueObjectSP location_sp((ValueObject*)nullptr);<br>-    if (!ExtractLibcxxStringInfo(valobj, location_sp, size))<br>-        return false;<br>-    if (size == 0)<br>-    {<br>-        stream.Printf("L\"\"");<br>-        return true;<br>-    }<br>-    if (!location_sp)<br>-        return false;<br>-    return WCharStringSummaryProvider(*location_sp.get(), stream);<br>-}<br>-<br>-bool<br>-lldb_private::formatters::LibcxxStringSummaryProvider (ValueObject& valobj, Stream& stream)<br>-{<br>-    uint64_t size = 0;<br>-    ValueObjectSP location_sp((ValueObject*)nullptr);<br>-    if (!ExtractLibcxxStringInfo(valobj, location_sp, size))<br>-        return false;<br>-    if (size == 0)<br>-    {<br>-        stream.Printf("\"\"");<br>-        return true;<br>-    }<br>-    if (!location_sp)<br>-        return false;<br>-    Error error;<br>-    location_sp->ReadPointedString(stream,<br>-                                   error,<br>-                                   0, // max length is decided by the settings<br>-                                   false); // do not honor array (terminates on first 0 byte even for a char[])<br>-    return error.Success();<br>-}<br>-<br>-template<bool name_entries><br>-bool<br>-lldb_private::formatters::NSDictionarySummaryProvider (ValueObject& valobj, Stream& stream)<br>-{<br>-    ProcessSP process_sp = valobj.GetProcessSP();<br>-    if (!process_sp)<br>-        return false;<br>-    <br>-    ObjCLanguageRuntime* runtime = (ObjCLanguageRuntime*)process_sp->GetLanguageRuntime(lldb::eLanguageTypeObjC);<br>-    <br>-    if (!runtime)<br>-        return false;<br>-<br>-    ObjCLanguageRuntime::ClassDescriptorSP descriptor(runtime->GetClassDescriptor(valobj));<br>-    <br>-    if (!descriptor.get() || !descriptor->IsValid())<br>-        return false;<br>-    <br>-    uint32_t ptr_size = process_sp->GetAddressByteSize();<br>-    bool is_64bit = (ptr_size == 8);<br>-    <br>-    lldb::addr_t valobj_addr = valobj.GetValueAsUnsigned(0);<br>-    <br>-    if (!valobj_addr)<br>-        return false;<br>-    <br>-    uint64_t value = 0;<br>-    <br>-    const char* class_name = descriptor->GetClassName().GetCString();<br>-    <br>-    if (!class_name || !*class_name)<br>-        return false;<br>-    <br>-    if (!strcmp(class_name,"__NSDictionaryI"))<br>-    {<br>-        Error error;<br>-        value = process_sp->ReadUnsignedIntegerFromMemory(valobj_addr + ptr_size, ptr_size, 0, error);<br>-        if (error.Fail())<br>-            return false;<br>-        value &= (is_64bit ? ~0xFC00000000000000UL : ~0xFC000000U);<br>-    }<br>-    else if (!strcmp(class_name,"__NSDictionaryM"))<br>-    {<br>-        Error error;<br>-        value = process_sp->ReadUnsignedIntegerFromMemory(valobj_addr + ptr_size, ptr_size, 0, error);<br>-        if (error.Fail())<br>-            return false;<br>-        value &= (is_64bit ? ~0xFC00000000000000UL : ~0xFC000000U);<br>-    }<br>-    else if (!strcmp(class_name,"__NSCFDictionary"))<br>-    {<br>-        Error error;<br>-        value = process_sp->ReadUnsignedIntegerFromMemory(valobj_addr + (is_64bit ? 20 : 12), ptr_size, 0, error);<br>-        if (error.Fail())<br>-            return false;<br>-        if (is_64bit)<br>-            value &= ~0x0f1f000000000000UL;<br>-    }<br>-    else<br>-    {<br>-        if (!ExtractValueFromObjCExpression(valobj, "int", "count", value))<br>-            return false;<br>-    }<br>-    <br>-    stream.Printf("%s%" PRIu64 " %s%s",<br>-                  (name_entries ? "@\"" : ""),<br>-                  value,<br>-                  (name_entries ? (value == 1 ? "entry" : "entries") : (value == 1 ? "key/value pair" : "key/value pairs")),<br>-                  (name_entries ? "\"" : ""));<br>-    return true;<br>-}<br>-<br>-bool<br>-lldb_private::formatters::NSArraySummaryProvider (ValueObject& valobj, Stream& stream)<br>-{<br>-    ProcessSP process_sp = valobj.GetProcessSP();<br>-    if (!process_sp)<br>-        return false;<br>-    <br>-    ObjCLanguageRuntime* runtime = (ObjCLanguageRuntime*)process_sp->GetLanguageRuntime(lldb::eLanguageTypeObjC);<br>-    <br>-    if (!runtime)<br>-        return false;<br>-    <br>-    ObjCLanguageRuntime::ClassDescriptorSP descriptor(runtime->GetClassDescriptor(valobj));<br>-    <br>-    if (!descriptor.get() || !descriptor->IsValid())<br>-        return false;<br>-    <br>-    uint32_t ptr_size = process_sp->GetAddressByteSize();<br>-    <br>-    lldb::addr_t valobj_addr = valobj.GetValueAsUnsigned(0);<br>-    <br>-    if (!valobj_addr)<br>-        return false;<br>-    <br>-    uint64_t value = 0;<br>-    <br>-    const char* class_name = descriptor->GetClassName().GetCString();<br>-    <br>-    if (!class_name || !*class_name)<br>-        return false;<br>-    <br>-    if (!strcmp(class_name,"__NSArrayI"))<br>-    {<br>-        Error error;<br>-        value = process_sp->ReadUnsignedIntegerFromMemory(valobj_addr + ptr_size, ptr_size, 0, error);<br>-        if (error.Fail())<br>-            return false;<br>-    }<br>-    else if (!strcmp(class_name,"__NSArrayM"))<br>-    {<br>-        Error error;<br>-        value = process_sp->ReadUnsignedIntegerFromMemory(valobj_addr + ptr_size, ptr_size, 0, error);<br>-        if (error.Fail())<br>-            return false;<br>-    }<br>-    else if (!strcmp(class_name,"__NSCFArray"))<br>-    {<br>-        Error error;<br>-        value = process_sp->ReadUnsignedIntegerFromMemory(valobj_addr + 2 * ptr_size, ptr_size, 0, error);<br>-        if (error.Fail())<br>-            return false;<br>-    }<br>-    else<br>-    {<br>-        if (!ExtractValueFromObjCExpression(valobj, "int", "count", value))<br>-            return false;<br>-    }<br>-    <br>-    stream.Printf("@\"%" PRIu64 " object%s\"",<br>-                  value,<br>-                  value == 1 ? "" : "s");<br>-    return true;<br>-}<br>-<br>-template<bool needs_at><br>-bool<br>-lldb_private::formatters::NSDataSummaryProvider (ValueObject& valobj, Stream& stream)<br>-{<br>-    ProcessSP process_sp = valobj.GetProcessSP();<br>-    if (!process_sp)<br>-        return false;<br>-    <br>-    ObjCLanguageRuntime* runtime = (ObjCLanguageRuntime*)process_sp->GetLanguageRuntime(lldb::eLanguageTypeObjC);<br>-    <br>-    if (!runtime)<br>-        return false;<br>-    <br>-    ObjCLanguageRuntime::ClassDescriptorSP descriptor(runtime->GetClassDescriptor(valobj));<br>-    <br>-    if (!descriptor.get() || !descriptor->IsValid())<br>-        return false;<br>-    <br>-    bool is_64bit = (process_sp->GetAddressByteSize() == 8);<br>-    lldb::addr_t valobj_addr = valobj.GetValueAsUnsigned(0);<br>-    <br>-    if (!valobj_addr)<br>-        return false;<br>-    <br>-    uint64_t value = 0;<br>-    <br>-    const char* class_name = descriptor->GetClassName().GetCString();<br>-    <br>-    if (!class_name || !*class_name)<br>-        return false;<br>-    <br>-    if (!strcmp(class_name,"NSConcreteData") ||<br>-        !strcmp(class_name,"NSConcreteMutableData") ||<br>-        !strcmp(class_name,"__NSCFData"))<br>-    {<br>-        uint32_t offset = (is_64bit ? 16 : 8);<br>-        Error error;<br>-        value = process_sp->ReadUnsignedIntegerFromMemory(valobj_addr + offset, is_64bit ? 8 : 4, 0, error);<br>-        if (error.Fail())<br>-            return false;<br>-    }<br>-    else<br>-    {<br>-        if (!ExtractValueFromObjCExpression(valobj, "int", "length", value))<br>-            return false;<br>-    }<br>-    <br>-    stream.Printf("%s%" PRIu64 " byte%s%s",<br>-                  (needs_at ? "@\"" : ""),<br>-                  value,<br>-                  (value > 1 ? "s" : ""),<br>-                  (needs_at ? "\"" : ""));<br>-    <br>-    return true;<br>-}<br>-<br>-bool<br>-lldb_private::formatters::NSNumberSummaryProvider (ValueObject& valobj, Stream& stream)<br>-{<br>-    ProcessSP process_sp = valobj.GetProcessSP();<br>-    if (!process_sp)<br>-        return false;<br>-    <br>-    ObjCLanguageRuntime* runtime = (ObjCLanguageRuntime*)process_sp->GetLanguageRuntime(lldb::eLanguageTypeObjC);<br>-    <br>-    if (!runtime)<br>-        return false;<br>-    <br>-    ObjCLanguageRuntime::ClassDescriptorSP descriptor(runtime->GetClassDescriptor(valobj));<br>-    <br>-    if (!descriptor.get() || !descriptor->IsValid())<br>-        return false;<br>-    <br>-    uint32_t ptr_size = process_sp->GetAddressByteSize();<br>-    <br>-    lldb::addr_t valobj_addr = valobj.GetValueAsUnsigned(0);<br>-    <br>-    if (!valobj_addr)<br>-        return false;<br>-    <br>-    const char* class_name = descriptor->GetClassName().GetCString();<br>-    <br>-    if (!class_name || !*class_name)<br>-        return false;<br>-    <br>-    if (!strcmp(class_name,"NSNumber") || !strcmp(class_name,"__NSCFNumber"))<br>-    {<br>-        if (descriptor->IsTagged())<br>-        {<br>-            // we have a call to get info and value bits in the tagged descriptor. but we prefer not to cast and replicate them<br>-            int64_t value = (valobj_addr & ~0x0000000000000000FFL) >> 8;<br>-            uint64_t i_bits = (valobj_addr & 0xF0) >> 4;<br>-            <br>-            switch (i_bits)<br>-            {<br>-                case 0:<br>-                    stream.Printf("(char)%hhd",(char)value);<br>-                    break;<br>-                case 4:<br>-                    stream.Printf("(short)%hd",(short)value);<br>-                    break;<br>-                case 8:<br>-                    stream.Printf("(int)%d",(int)value);<br>-                    break;<br>-                case 12:<br>-                    stream.Printf("(long)%" PRId64,value);<br>-                    break;<br>-                default:<br>-                    stream.Printf("unexpected value:(info=%" PRIu64 ", value=%" PRIu64,i_bits,value);<br>-                    break;<br>-            }<br>-            return true;<br>-        }<br>-        else<br>-        {<br>-            Error error;<br>-            uint8_t data_type = (process_sp->ReadUnsignedIntegerFromMemory(valobj_addr + ptr_size, 1, 0, error) & 0x1F);<br>-            uint64_t data_location = valobj_addr + 2*ptr_size;<br>-            uint64_t value = 0;<br>-            if (error.Fail())<br>-                return false;<br>-            switch (data_type)<br>-            {<br>-                case 1: // 0B00001<br>-                    value = process_sp->ReadUnsignedIntegerFromMemory(data_location, 1, 0, error);<br>-                    if (error.Fail())<br>-                        return false;<br>-                    stream.Printf("(char)%hhd",(char)value);<br>-                    break;<br>-                case 2: // 0B0010<br>-                    value = process_sp->ReadUnsignedIntegerFromMemory(data_location, 2, 0, error);<br>-                    if (error.Fail())<br>-                        return false;<br>-                    stream.Printf("(short)%hd",(short)value);<br>-                    break;<br>-                case 3: // 0B0011<br>-                    value = process_sp->ReadUnsignedIntegerFromMemory(data_location, 4, 0, error);<br>-                    if (error.Fail())<br>-                        return false;<br>-                    stream.Printf("(int)%d",(int)value);<br>-                    break;<br>-                case 17: // 0B10001<br>-                    data_location += 8;<br>-                case 4: // 0B0100<br>-                    value = process_sp->ReadUnsignedIntegerFromMemory(data_location, 8, 0, error);<br>-                    if (error.Fail())<br>-                        return false;<br>-                    stream.Printf("(long)%" PRId64,value);<br>-                    break;<br>-                case 5: // 0B0101<br>-                {<br>-                    uint32_t flt_as_int = process_sp->ReadUnsignedIntegerFromMemory(data_location, 4, 0, error);<br>-                    if (error.Fail())<br>-                        return false;<br>-                    float flt_value = *((float*)&flt_as_int);<br>-                    stream.Printf("(float)%f",flt_value);<br>-                    break;<br>-                }<br>-                case 6: // 0B0110<br>-                {<br>-                    uint64_t dbl_as_lng = process_sp->ReadUnsignedIntegerFromMemory(data_location, 8, 0, error);<br>-                    if (error.Fail())<br>-                        return false;<br>-                    double dbl_value = *((double*)&dbl_as_lng);<br>-                    stream.Printf("(double)%g",dbl_value);<br>-                    break;<br>-                }<br>-                default:<br>-                    stream.Printf("absurd: dt=%d",data_type);<br>-                    break;<br>-            }<br>-            return true;<br>-        }<br>-    }<br>-    else<br>-    {<br>-        // similar to ExtractValueFromObjCExpression but uses summary instead of value<br>-        StreamString expr_path_stream;<br>-        valobj.GetExpressionPath(expr_path_stream, false);<br>-        StreamString expr;<br>-        expr.Printf("(NSString*)[%s stringValue]",expr_path_stream.GetData());<br>-        ExecutionContext exe_ctx (valobj.GetExecutionContextRef());<br>-        lldb::ValueObjectSP result_sp;<br>-        Target* target = exe_ctx.GetTargetPtr();<br>-        StackFrame* stack_frame = exe_ctx.GetFramePtr();<br>-        if (!target || !stack_frame)<br>-            return false;<br>-        <br>-        EvaluateExpressionOptions options;<br>-        options.SetCoerceToId(false)<br>-        .SetUnwindOnError(true)<br>-        .SetKeepInMemory(true)<br>-        .SetUseDynamic(lldb::eDynamicCanRunTarget);<br>-        <br>-        target->EvaluateExpression(expr.GetData(),<br>-                                   stack_frame,<br>-                                   result_sp,<br>-                                   options);<br>-        if (!result_sp)<br>-            return false;<br>-        stream.Printf("%s",result_sp->GetSummaryAsCString());<br>-        return true;<br>-    }<br>-}<br>-<br>-bool<br>-lldb_private::formatters::NSStringSummaryProvider (ValueObject& valobj, Stream& stream)<br>-{<br>-    ProcessSP process_sp = valobj.GetProcessSP();<br>-    if (!process_sp)<br>-        return false;<br>-    <br>-    ObjCLanguageRuntime* runtime = (ObjCLanguageRuntime*)process_sp->GetLanguageRuntime(lldb::eLanguageTypeObjC);<br>-    <br>-    if (!runtime)<br>-        return false;<br>-    <br>-    ObjCLanguageRuntime::ClassDescriptorSP descriptor(runtime->GetClassDescriptor(valobj));<br>-    <br>-    if (!descriptor.get() || !descriptor->IsValid())<br>-        return false;<br>-    <br>-    uint32_t ptr_size = process_sp->GetAddressByteSize();<br>-    <br>-    lldb::addr_t valobj_addr = valobj.GetValueAsUnsigned(0);<br>-    <br>-    if (!valobj_addr)<br>-        return false;<br>-    <br>-    const char* class_name = descriptor->GetClassName().GetCString();<br>-    <br>-    if (!class_name || !*class_name)<br>-        return false;<br>-    <br>-    uint64_t info_bits_location = valobj_addr + ptr_size;<br>-    if (process_sp->GetByteOrder() != lldb::eByteOrderLittle)<br>-        info_bits_location += 3;<br>-        <br>-        Error error;<br>-    <br>-    uint8_t info_bits = process_sp->ReadUnsignedIntegerFromMemory(info_bits_location, 1, 0, error);<br>-    if (error.Fail())<br>-        return false;<br>-    <br>-    bool is_mutable = (info_bits & 1) == 1;<br>-    bool is_inline = (info_bits & 0x60) == 0;<br>-    bool has_explicit_length = (info_bits & (1 | 4)) != 4;<br>-    bool is_unicode = (info_bits & 0x10) == 0x10;<br>-    bool is_special = strcmp(class_name,"NSPathStore2") == 0;<br>-    <br>-    if (strcmp(class_name,"NSString") &&<br>-        strcmp(class_name,"CFStringRef") &&<br>-        strcmp(class_name,"CFMutableStringRef") &&<br>-        strcmp(class_name,"__NSCFConstantString") &&<br>-        strcmp(class_name,"__NSCFString") &&<br>-        strcmp(class_name,"NSCFConstantString") &&<br>-        strcmp(class_name,"NSCFString") &&<br>-        strcmp(class_name,"NSPathStore2"))<br>-    {<br>-        // probably not one of us - bail out<br>-        return false;<br>-    }<br>-    <br>-    if (is_mutable)<br>-    {<br>-        uint64_t location = 2 * ptr_size + valobj_addr;<br>-        location = process_sp->ReadPointerFromMemory(location, error);<br>-        if (error.Fail())<br>-            return false;<br>-        if (has_explicit_length and is_unicode)<br>-            return ReadUTFBufferAndDumpToStream<UTF16> (ConvertUTF16toUTF8,location, process_sp, stream, '@');<br>-        else<br>-        {<br>-            location++;<br>-            lldb::DataBufferSP buffer_sp(new DataBufferHeap(1024,0));<br>-            size_t data_read = process_sp->ReadCStringFromMemory(location, (char*)buffer_sp->GetBytes(), 1024, error);<br>-            if (error.Fail())<br>-                return false;<br>-            if (data_read)<br>-                stream.Printf("@\"%s\"",(char*)buffer_sp->GetBytes());<br>-                return true;<br>-        }<br>-    }<br>-    else if (is_inline && has_explicit_length && !is_unicode && !is_special && !is_mutable)<br>-    {<br>-        uint64_t location = 3 * ptr_size + valobj_addr;<br>-        lldb::DataBufferSP buffer_sp(new DataBufferHeap(1024,0));<br>-        size_t data_read = process_sp->ReadCStringFromMemory(location, (char*)buffer_sp->GetBytes(), 1024, error);<br>-        if (error.Fail())<br>-            return false;<br>-        if (data_read)<br>-            stream.Printf("@\"%s\"",(char*)buffer_sp->GetBytes());<br>-            return true;<br>-    }<br>-    else if (is_unicode)<br>-    {<br>-        uint64_t location = valobj_addr + ptr_size + 4 + (ptr_size == 8 ? 4 : 0);<br>-        if (is_inline)<br>-        {<br>-            if (!has_explicit_length)<br>-            {<br>-                stream.Printf("found new combo");<br>-                return true;<br>-            }<br>-            else<br>-                location += ptr_size;<br>-                }<br>-        else<br>-        {<br>-            location = process_sp->ReadPointerFromMemory(location, error);<br>-            if (error.Fail())<br>-                return false;<br>-        }<br>-        return ReadUTFBufferAndDumpToStream<UTF16> (ConvertUTF16toUTF8, location, process_sp, stream, '@');<br>-    }<br>-    else if (is_special)<br>-    {<br>-        uint64_t location = valobj_addr + (ptr_size == 8 ? 12 : 8);<br>-        return ReadUTFBufferAndDumpToStream<UTF16> (ConvertUTF16toUTF8, location, process_sp, stream, '@');<br>-    }<br>-    else if (is_inline)<br>-    {<br>-        uint64_t location = valobj_addr + ptr_size + 4 + (ptr_size == 8 ? 4 : 0);<br>-        if (!has_explicit_length)<br>-            location++;<br>-        lldb::DataBufferSP buffer_sp(new DataBufferHeap(1024,0));<br>-        size_t data_read = process_sp->ReadCStringFromMemory(location, (char*)buffer_sp->GetBytes(), 1024, error);<br>-        if (error.Fail())<br>-            return false;<br>-        if (data_read)<br>-            stream.Printf("@\"%s\"",(char*)buffer_sp->GetBytes());<br>-            return true;<br>-    }<br>-    else<br>-    {<br>-        uint64_t location = valobj_addr + ptr_size + 4 + (ptr_size == 8 ? 4 : 0);<br>-        location = process_sp->ReadPointerFromMemory(location, error);<br>-        if (error.Fail())<br>-            return false;<br>-        lldb::DataBufferSP buffer_sp(new DataBufferHeap(1024,0));<br>-        size_t data_read = process_sp->ReadCStringFromMemory(location, (char*)buffer_sp->GetBytes(), 1024, error);<br>-        if (error.Fail())<br>-            return false;<br>-        if (data_read)<br>-            stream.Printf("@\"%s\"",(char*)buffer_sp->GetBytes());<br>-            return true;<br>-    }<br>-    <br>-    stream.Printf("class name = %s",class_name);<br>-    return true;<br>-    <br>-}<br>-<br>-bool<br>-lldb_private::formatters::RuntimeSpecificDescriptionSummaryProvider (ValueObject& valobj, Stream& stream)<br>-{<br>-    stream.Printf("%s",valobj.GetObjectDescription());<br>-    return true;<br>-}<br>-<br>-bool<br>-lldb_private::formatters::ObjCBOOLSummaryProvider (ValueObject& valobj, Stream& stream)<br>-{<br>-    const uint32_t type_info = ClangASTContext::GetTypeInfo(valobj.GetClangType(),<br>-                                                            valobj.GetClangAST(),<br>-                                                            NULL);<br>-    <br>-    ValueObjectSP real_guy_sp = valobj.GetSP();<br>-    <br>-    if (type_info & ClangASTContext::eTypeIsPointer)<br>-    {<br>-        Error err;<br>-        real_guy_sp = valobj.Dereference(err);<br>-        if (err.Fail() || !real_guy_sp)<br>-            return false;<br>-    }<br>-    else if (type_info & ClangASTContext::eTypeIsReference)<br>-    {<br>-        real_guy_sp =  valobj.GetChildAtIndex(0, true);<br>-        if (!real_guy_sp)<br>-            return false;<br>-    }<br>-    uint64_t value = real_guy_sp->GetValueAsUnsigned(0);<br>-    if (value == 0)<br>-    {<br>-        stream.Printf("NO");<br>-        return true;<br>-    }<br>-    stream.Printf("YES");<br>-    return true;<br>-}<br>-<br>-template <bool is_sel_ptr><br>-bool<br>-lldb_private::formatters::ObjCSELSummaryProvider (ValueObject& valobj, Stream& stream)<br>-{<br>-    lldb::addr_t data_address = LLDB_INVALID_ADDRESS;<br>-    <br>-    if (is_sel_ptr)<br>-        data_address = valobj.GetValueAsUnsigned(LLDB_INVALID_ADDRESS);<br>-    else<br>-        data_address = valobj.GetAddressOf();<br>-<br>-    if (data_address == LLDB_INVALID_ADDRESS)<br>-        return false;<br>-    <br>-    ExecutionContext exe_ctx(valobj.GetExecutionContextRef());<br>-    <br>-    void* char_opaque_type = valobj.GetClangAST()->CharTy.getAsOpaquePtr();<br>-    ClangASTType charstar(valobj.GetClangAST(),ClangASTType::GetPointerType(valobj.GetClangAST(), char_opaque_type));<br>-    <br>-    ValueObjectSP valobj_sp(ValueObject::CreateValueObjectFromAddress("text", data_address, exe_ctx, charstar));<br>-    <br>-    stream.Printf("%s",valobj_sp->GetSummaryAsCString());<br>-    return true;<br>-}<br>-<br>-lldb_private::formatters::NSArrayMSyntheticFrontEnd::NSArrayMSyntheticFrontEnd (lldb::ValueObjectSP valobj_sp) :<br>-SyntheticChildrenFrontEnd(*valobj_sp.get()),<br>-m_exe_ctx_ref(),<br>-m_ptr_size(8),<br>-m_data_32(NULL),<br>-m_data_64(NULL)<br>-{<br>-    if (valobj_sp)<br>-    {<br>-        m_id_type = ClangASTType(valobj_sp->GetClangAST(),valobj_sp->GetClangAST()->ObjCBuiltinIdTy.getAsOpaquePtr());<br>-        Update();<br>-    }<br>-}<br>-<br>-size_t<br>-lldb_private::formatters::NSArrayMSyntheticFrontEnd::CalculateNumChildren ()<br>-{<br>-    if (m_data_32)<br>-        return m_data_32->_used;<br>-    if (m_data_64)<br>-        return m_data_64->_used;<br>-    return 0;<br>-}<br>-<br>-lldb::ValueObjectSP<br>-lldb_private::formatters::NSArrayMSyntheticFrontEnd::GetChildAtIndex (size_t idx)<br>-{<br>-    if (!m_data_32 && !m_data_64)<br>-        return lldb::ValueObjectSP();<br>-    if (idx >= CalculateNumChildren())<br>-        return lldb::ValueObjectSP();<br>-    lldb::addr_t object_at_idx = (m_data_32 ? m_data_32->_data : m_data_64->_data);<br>-    object_at_idx += (idx * m_ptr_size);<br>-    StreamString idx_name;<br>-    idx_name.Printf("[%zu]",idx);<br>-    lldb::ValueObjectSP retval_sp = ValueObject::CreateValueObjectFromAddress(idx_name.GetData(),<br>-                                                                              object_at_idx,<br>-                                                                              m_exe_ctx_ref,<br>-                                                                              m_id_type);<br>-    m_children.push_back(retval_sp);<br>-    return retval_sp;<br>-}<br>-<br>-bool<br>-lldb_private::formatters::NSArrayMSyntheticFrontEnd::Update()<br>-{<br>-    m_children.clear();<br>-    ValueObjectSP valobj_sp = m_backend.GetSP();<br>-    m_ptr_size = 0;<br>-    delete m_data_32;<br>-    m_data_32 = NULL;<br>-    delete m_data_64;<br>-    m_data_64 = NULL;<br>-    if (valobj_sp->IsDynamic())<br>-        valobj_sp = valobj_sp->GetStaticValue();<br>-    if (!valobj_sp)<br>-        return false;<br>-    m_exe_ctx_ref = valobj_sp->GetExecutionContextRef();<br>-    Error error;<br>-    if (valobj_sp->IsPointerType())<br>-    {<br>-        valobj_sp = valobj_sp->Dereference(error);<br>-        if (error.Fail() || !valobj_sp)<br>-            return false;<br>-    }<br>-    error.Clear();<br>-    lldb::ProcessSP process_sp(valobj_sp->GetProcessSP());<br>-    if (!process_sp)<br>-        return false;<br>-    m_ptr_size = process_sp->GetAddressByteSize();<br>-    uint64_t data_location = valobj_sp->GetAddressOf() + m_ptr_size;<br>-    if (m_ptr_size == 4)<br>-    {<br>-        m_data_32 = new DataDescriptor_32();<br>-        process_sp->ReadMemory (data_location, m_data_32, sizeof(DataDescriptor_32), error);<br>-    }<br>-    else<br>-    {<br>-        m_data_64 = new DataDescriptor_64();<br>-        process_sp->ReadMemory (data_location, m_data_64, sizeof(DataDescriptor_64), error);<br>-    }<br>-    if (error.Fail())<br>-        return false;<br>-    return false;<br>-}<br>-<br>-bool<br>-lldb_private::formatters::NSArrayMSyntheticFrontEnd::MightHaveChildren ()<br>-{<br>-    return true;<br>-}<br>-<br>-static uint32_t<br>-ExtractIndexFromString (const char* item_name)<br>-{<br>-    if (!item_name || !*item_name)<br>-        return UINT32_MAX;<br>-    if (*item_name != '[')<br>-        return UINT32_MAX;<br>-    item_name++;<br>-    uint32_t idx = 0;<br>-    while(*item_name)<br>-    {<br>-        char x = *item_name;<br>-        if (x == ']')<br>-            break;<br>-        if (x < '0' || x > '9')<br>-            return UINT32_MAX;<br>-        idx = 10*idx + (x-'0');<br>-        item_name++;<br>-    }<br>-    return idx;<br>-}<br>-<br>-uint32_t<br>-lldb_private::formatters::NSArrayMSyntheticFrontEnd::GetIndexOfChildWithName (const ConstString &name)<br>-{<br>-    if (!m_data_32 && !m_data_64)<br>-        return UINT32_MAX;<br>-    const char* item_name = name.GetCString();<br>-    uint32_t idx = ExtractIndexFromString(item_name);<br>-    if (idx < UINT32_MAX && idx >= CalculateNumChildren())<br>-        return UINT32_MAX;<br>-    return idx;<br>-}<br>-<br>-lldb_private::formatters::NSArrayMSyntheticFrontEnd::~NSArrayMSyntheticFrontEnd ()<br>-{<br>-    delete m_data_32;<br>-    m_data_32 = NULL;<br>-    delete m_data_64;<br>-    m_data_64 = NULL;<br>-}<br>-<br>-lldb_private::formatters::NSArrayISyntheticFrontEnd::NSArrayISyntheticFrontEnd (lldb::ValueObjectSP valobj_sp) :<br>-SyntheticChildrenFrontEnd(*valobj_sp.get()),<br>-m_exe_ctx_ref(),<br>-m_ptr_size(8),<br>-m_items(0),<br>-m_data_ptr(0)<br>-{<br>-    if (valobj_sp)<br>-    {<br>-        m_id_type = ClangASTType(valobj_sp->GetClangAST(),valobj_sp->GetClangAST()->ObjCBuiltinIdTy.getAsOpaquePtr());<br>-        Update();<br>-    }<br>-}<br>-<br>-lldb_private::formatters::NSArrayISyntheticFrontEnd::~NSArrayISyntheticFrontEnd ()<br>-{<br>-}<br>-<br>-uint32_t<br>-lldb_private::formatters::NSArrayISyntheticFrontEnd::GetIndexOfChildWithName (const ConstString &name)<br>-{<br>-    const char* item_name = name.GetCString();<br>-    uint32_t idx = ExtractIndexFromString(item_name);<br>-    if (idx < UINT32_MAX && idx >= CalculateNumChildren())<br>-        return UINT32_MAX;<br>-    return idx;<br>-}<br>-<br>-size_t<br>-lldb_private::formatters::NSArrayISyntheticFrontEnd::CalculateNumChildren ()<br>-{<br>-    return m_items;<br>-}<br>-<br>-bool<br>-lldb_private::formatters::NSArrayISyntheticFrontEnd::Update()<br>-{<br>-    m_ptr_size = 0;<br>-    m_items = 0;<br>-    m_data_ptr = 0;<br>-    m_children.clear();<br>-    ValueObjectSP valobj_sp = m_backend.GetSP();<br>-    if (valobj_sp->IsDynamic())<br>-        valobj_sp = valobj_sp->GetStaticValue();<br>-    if (!valobj_sp)<br>-        return false;<br>-    m_exe_ctx_ref = valobj_sp->GetExecutionContextRef();<br>-    Error error;<br>-    if (valobj_sp->IsPointerType())<br>-    {<br>-        valobj_sp = valobj_sp->Dereference(error);<br>-        if (error.Fail() || !valobj_sp)<br>-            return false;<br>-    }<br>-    error.Clear();<br>-    lldb::ProcessSP process_sp(valobj_sp->GetProcessSP());<br>-    if (!process_sp)<br>-        return false;<br>-    m_ptr_size = process_sp->GetAddressByteSize();<br>-    uint64_t data_location = valobj_sp->GetAddressOf() + m_ptr_size;<br>-    m_items = process_sp->ReadPointerFromMemory(data_location, error);<br>-    if (error.Fail())<br>-        return false;<br>-    m_data_ptr = data_location+m_ptr_size;<br>-    return false;<br>-}<br>-<br>-bool<br>-lldb_private::formatters::NSArrayISyntheticFrontEnd::MightHaveChildren ()<br>-{<br>-    return true;<br>-}<br>-<br>-lldb::ValueObjectSP<br>-lldb_private::formatters::NSArrayISyntheticFrontEnd::GetChildAtIndex (size_t idx)<br>-{<br>-    if (idx >= CalculateNumChildren())<br>-        return lldb::ValueObjectSP();<br>-    lldb::addr_t object_at_idx = m_data_ptr;<br>-    object_at_idx += (idx * m_ptr_size);<br>-    ProcessSP process_sp = m_exe_ctx_ref.GetProcessSP();<br>-    if (!process_sp)<br>-        return lldb::ValueObjectSP();<br>-    Error error;<br>-    object_at_idx = process_sp->ReadPointerFromMemory(object_at_idx, error);<br>-    if (error.Fail())<br>-        return lldb::ValueObjectSP();<br>-    StreamString expr;<br>-    expr.Printf("(id)%" PRIu64,object_at_idx);<br>-    StreamString idx_name;<br>-    idx_name.Printf("[%zu]",idx);<br>-    lldb::ValueObjectSP retval_sp = ValueObject::CreateValueObjectFromExpression(idx_name.GetData(), expr.GetData(), m_exe_ctx_ref);<br>-    m_children.push_back(retval_sp);<br>-    return retval_sp;<br>-}<br>-<br>-SyntheticChildrenFrontEnd* lldb_private::formatters::NSArraySyntheticFrontEndCreator (CXXSyntheticChildren*, lldb::ValueObjectSP valobj_sp)<br>-{<br>-    lldb::ProcessSP process_sp (valobj_sp->GetProcessSP());<br>-    if (!process_sp)<br>-        return NULL;<br>-    ObjCLanguageRuntime *runtime = (ObjCLanguageRuntime*)process_sp->GetLanguageRuntime(lldb::eLanguageTypeObjC);<br>-    if (!runtime)<br>-        return NULL;<br>-    <br>-    if (!valobj_sp->IsPointerType())<br>-    {<br>-        Error error;<br>-        valobj_sp = valobj_sp->AddressOf(error);<br>-        if (error.Fail() || !valobj_sp)<br>-            return NULL;<br>-    }<br>-    <br>-    ObjCLanguageRuntime::ClassDescriptorSP descriptor(runtime->GetClassDescriptor(*valobj_sp.get()));<br>-    <br>-    if (!descriptor.get() || !descriptor->IsValid())<br>-        return NULL;<br>-    <br>-    const char* class_name = descriptor->GetClassName().GetCString();<br>-    <br>-    if (!class_name || !*class_name)<br>-        return NULL;<br>-    <br>-    if (!strcmp(class_name,"__NSArrayI"))<br>-    {<br>-        return (new NSArrayISyntheticFrontEnd(valobj_sp));<br>-    }<br>-    else if (!strcmp(class_name,"__NSArrayM"))<br>-    {<br>-        return (new NSArrayMSyntheticFrontEnd(valobj_sp));<br>-    }<br>-    else<br>-    {<br>-        return (new NSArrayCodeRunningSyntheticFrontEnd(valobj_sp));<br>-    }<br>-}<br>-<br>-lldb_private::formatters::NSArrayCodeRunningSyntheticFrontEnd::NSArrayCodeRunningSyntheticFrontEnd (lldb::ValueObjectSP valobj_sp) :<br>-SyntheticChildrenFrontEnd(*valobj_sp.get())<br>-{}<br>-<br>-size_t<br>-lldb_private::formatters::NSArrayCodeRunningSyntheticFrontEnd::CalculateNumChildren ()<br>-{<br>-    uint64_t count = 0;<br>-    if (ExtractValueFromObjCExpression(m_backend, "int", "count", count))<br>-        return count;<br>-    return 0;<br>-}<br>-<br>-lldb::ValueObjectSP<br>-lldb_private::formatters::NSArrayCodeRunningSyntheticFrontEnd::GetChildAtIndex (size_t idx)<br>-{<br>-    StreamString idx_name;<br>-    idx_name.Printf("[%zu]",idx);<br>-    lldb::ValueObjectSP valobj_sp = CallSelectorOnObject(m_backend,"id","objectAtIndex:",idx);<br>-    if (valobj_sp)<br>-        valobj_sp->SetName(ConstString(idx_name.GetData()));<br>-    return valobj_sp;<br>-}<br>-<br>-bool<br>-lldb_private::formatters::NSArrayCodeRunningSyntheticFrontEnd::Update()<br>-{<br>-    return false;<br>-}<br>-<br>-bool<br>-lldb_private::formatters::NSArrayCodeRunningSyntheticFrontEnd::MightHaveChildren ()<br>-{<br>-    return true;<br>-}<br>-<br>-uint32_t<br>-lldb_private::formatters::NSArrayCodeRunningSyntheticFrontEnd::GetIndexOfChildWithName (const ConstString &name)<br>-{<br>-    return 0;<br>-}<br>-<br>-lldb_private::formatters::NSArrayCodeRunningSyntheticFrontEnd::~NSArrayCodeRunningSyntheticFrontEnd ()<br>-{}<br>-<br>-SyntheticChildrenFrontEnd* lldb_private::formatters::NSDictionarySyntheticFrontEndCreator (CXXSyntheticChildren*, lldb::ValueObjectSP valobj_sp)<br>-{<br>-    <br>-    lldb::ProcessSP process_sp (valobj_sp->GetProcessSP());<br>-    if (!process_sp)<br>-        return NULL;<br>-    ObjCLanguageRuntime *runtime = (ObjCLanguageRuntime*)process_sp->GetLanguageRuntime(lldb::eLanguageTypeObjC);<br>-    if (!runtime)<br>-        return NULL;<br>-<br>-    if (!valobj_sp->IsPointerType())<br>-    {<br>-        Error error;<br>-        valobj_sp = valobj_sp->AddressOf(error);<br>-        if (error.Fail() || !valobj_sp)<br>-            return NULL;<br>-    }<br>-    <br>-    ObjCLanguageRuntime::ClassDescriptorSP descriptor(runtime->GetClassDescriptor(*valobj_sp.get()));<br>-    <br>-    if (!descriptor.get() || !descriptor->IsValid())<br>-        return NULL;<br>-    <br>-    const char* class_name = descriptor->GetClassName().GetCString();<br>-    <br>-    if (!class_name || !*class_name)<br>-        return NULL;<br>-    <br>-    if (!strcmp(class_name,"__NSDictionaryI"))<br>-    {<br>-        return (new NSDictionaryISyntheticFrontEnd(valobj_sp));<br>-    }<br>-    else if (!strcmp(class_name,"__NSDictionaryM"))<br>-    {<br>-        return (new NSDictionaryMSyntheticFrontEnd(valobj_sp));<br>-    }<br>-    else<br>-    {<br>-        return (new NSDictionaryCodeRunningSyntheticFrontEnd(valobj_sp));<br>-    }<br>-}<br>-<br>-lldb_private::formatters::NSDictionaryCodeRunningSyntheticFrontEnd::NSDictionaryCodeRunningSyntheticFrontEnd (lldb::ValueObjectSP valobj_sp) :<br>-SyntheticChildrenFrontEnd(*valobj_sp.get())<br>-{}<br>-<br>-size_t<br>-lldb_private::formatters::NSDictionaryCodeRunningSyntheticFrontEnd::CalculateNumChildren ()<br>-{<br>-    uint64_t count = 0;<br>-    if (ExtractValueFromObjCExpression(m_backend, "int", "count", count))<br>-        return count;<br>-    return 0;<br>-}<br>-<br>-lldb::ValueObjectSP<br>-lldb_private::formatters::NSDictionaryCodeRunningSyntheticFrontEnd::GetChildAtIndex (size_t idx)<br>-{<br>-    StreamString idx_name;<br>-    idx_name.Printf("[%zu]",idx);<br>-    StreamString valobj_expr_path;<br>-    m_backend.GetExpressionPath(valobj_expr_path, false);<br>-    StreamString key_fetcher_expr;<br>-    key_fetcher_expr.Printf("(id)[(NSArray*)[%s allKeys] objectAtIndex:%zu]",valobj_expr_path.GetData(),idx);<br>-    StreamString value_fetcher_expr;<br>-    value_fetcher_expr.Printf("(id)[%s objectForKey:%s]",valobj_expr_path.GetData(),key_fetcher_expr.GetData());<br>-    StreamString object_fetcher_expr;<br>-    object_fetcher_expr.Printf("struct __lldb_autogen_nspair { id key; id value; } _lldb_valgen_item; _lldb_valgen_item.key = %s; _lldb_valgen_item.value = %s; _lldb_valgen_item;",key_fetcher_expr.GetData(),value_fetcher_expr.GetData());<br>-    lldb::ValueObjectSP child_sp;<br>-    m_backend.GetTargetSP()->EvaluateExpression(object_fetcher_expr.GetData(), m_backend.GetFrameSP().get(), child_sp,<br>-                                                EvaluateExpressionOptions().SetKeepInMemory(true));<br>-    if (child_sp)<br>-        child_sp->SetName(ConstString(idx_name.GetData()));<br>-    return child_sp;<br>-}<br>-<br>-bool<br>-lldb_private::formatters::NSDictionaryCodeRunningSyntheticFrontEnd::Update()<br>-{<br>-    return false;<br>-}<br>-<br>-bool<br>-lldb_private::formatters::NSDictionaryCodeRunningSyntheticFrontEnd::MightHaveChildren ()<br>-{<br>-    return true;<br>-}<br>-<br>-uint32_t<br>-lldb_private::formatters::NSDictionaryCodeRunningSyntheticFrontEnd::GetIndexOfChildWithName (const ConstString &name)<br>-{<br>-    return 0;<br>-}<br>-<br>-lldb_private::formatters::NSDictionaryCodeRunningSyntheticFrontEnd::~NSDictionaryCodeRunningSyntheticFrontEnd ()<br>-{}<br>-<br>-lldb_private::formatters::NSDictionaryISyntheticFrontEnd::NSDictionaryISyntheticFrontEnd (lldb::ValueObjectSP valobj_sp) :<br>-    SyntheticChildrenFrontEnd(*valobj_sp.get()),<br>-    m_exe_ctx_ref(),<br>-    m_ptr_size(8),<br>-    m_data_32(NULL),<br>-    m_data_64(NULL)<br>-{<br>-    if (valobj_sp)<br>-        Update();<br>-}<br>-<br>-lldb_private::formatters::NSDictionaryISyntheticFrontEnd::~NSDictionaryISyntheticFrontEnd ()<br>-{<br>-    delete m_data_32;<br>-    m_data_32 = NULL;<br>-    delete m_data_64;<br>-    m_data_64 = NULL;<br>-}<br>-<br>-uint32_t<br>-lldb_private::formatters::NSDictionaryISyntheticFrontEnd::GetIndexOfChildWithName (const ConstString &name)<br>-{<br>-    const char* item_name = name.GetCString();<br>-    uint32_t idx = ExtractIndexFromString(item_name);<br>-    if (idx < UINT32_MAX && idx >= CalculateNumChildren())<br>-        return UINT32_MAX;<br>-    return idx;<br>-}<br>-<br>-size_t<br>-lldb_private::formatters::NSDictionaryISyntheticFrontEnd::CalculateNumChildren ()<br>-{<br>-    if (!m_data_32 && !m_data_64)<br>-        return 0;<br>-    return (m_data_32 ? m_data_32->_used : m_data_64->_used);<br>-}<br>-<br>-bool<br>-lldb_private::formatters::NSDictionaryISyntheticFrontEnd::Update()<br>-{<br>-    m_children.clear();<br>-    delete m_data_32;<br>-    m_data_32 = NULL;<br>-    delete m_data_64;<br>-    m_data_64 = NULL;<br>-    m_ptr_size = 0;<br>-    ValueObjectSP valobj_sp = m_backend.GetSP();<br>-    if (!valobj_sp)<br>-        return false;<br>-    if (valobj_sp->IsDynamic())<br>-        valobj_sp = valobj_sp->GetStaticValue();<br>-    if (!valobj_sp)<br>-        return false;<br>-    m_exe_ctx_ref = valobj_sp->GetExecutionContextRef();<br>-    Error error;<br>-    if (valobj_sp->IsPointerType())<br>-    {<br>-        valobj_sp = valobj_sp->Dereference(error);<br>-        if (error.Fail() || !valobj_sp)<br>-            return false;<br>-    }<br>-    error.Clear();<br>-    lldb::ProcessSP process_sp(valobj_sp->GetProcessSP());<br>-    if (!process_sp)<br>-        return false;<br>-    m_ptr_size = process_sp->GetAddressByteSize();<br>-    uint64_t data_location = valobj_sp->GetAddressOf() + m_ptr_size;<br>-    if (m_ptr_size == 4)<br>-    {<br>-        m_data_32 = new DataDescriptor_32();<br>-        process_sp->ReadMemory (data_location, m_data_32, sizeof(DataDescriptor_32), error);<br>-    }<br>-    else<br>-    {<br>-        m_data_64 = new DataDescriptor_64();<br>-        process_sp->ReadMemory (data_location, m_data_64, sizeof(DataDescriptor_64), error);<br>-    }<br>-    if (error.Fail())<br>-        return false;<br>-    m_data_ptr = data_location + m_ptr_size;<br>-    return false;<br>-}<br>-<br>-bool<br>-lldb_private::formatters::NSDictionaryISyntheticFrontEnd::MightHaveChildren ()<br>-{<br>-    return true;<br>-}<br>-<br>-lldb::ValueObjectSP<br>-lldb_private::formatters::NSDictionaryISyntheticFrontEnd::GetChildAtIndex (size_t idx)<br>-{<br>-    uint32_t num_children = CalculateNumChildren();<br>-    <br>-    if (idx >= num_children)<br>-        return lldb::ValueObjectSP();<br>-    <br>-    if (m_children.empty())<br>-    {<br>-        // do the scan phase<br>-        lldb::addr_t key_at_idx = 0, val_at_idx = 0;<br>-        <br>-        uint32_t tries = 0;<br>-        uint32_t test_idx = 0;<br>-        <br>-        while(tries < num_children)<br>-        {<br>-            key_at_idx = m_data_ptr + (2*test_idx * m_ptr_size);<br>-            val_at_idx = key_at_idx + m_ptr_size;<br>-            ProcessSP process_sp = m_exe_ctx_ref.GetProcessSP();<br>-            if (!process_sp)<br>-                return lldb::ValueObjectSP();<br>-            Error error;<br>-            key_at_idx = process_sp->ReadPointerFromMemory(key_at_idx, error);<br>-            if (error.Fail())<br>-                return lldb::ValueObjectSP();<br>-            val_at_idx = process_sp->ReadPointerFromMemory(val_at_idx, error);<br>-            if (error.Fail())<br>-                return lldb::ValueObjectSP();<br>-<br>-            test_idx++;<br>-            <br>-            if (!key_at_idx || !val_at_idx)<br>-                continue;<br>-            tries++;<br>-            <br>-            DictionaryItemDescriptor descriptor = {key_at_idx,val_at_idx,lldb::ValueObjectSP()};<br>-            <br>-            m_children.push_back(descriptor);<br>-        }<br>-    }<br>-    <br>-    if (idx >= m_children.size()) // should never happen<br>-        return lldb::ValueObjectSP();<br>-    <br>-    DictionaryItemDescriptor &dict_item = m_children[idx];<br>-    if (!dict_item.valobj_sp)<br>-    {<br>-        // make the new ValueObject<br>-        StreamString expr;<br>-        expr.Printf("struct __lldb_autogen_nspair { id key; id value; } _lldb_valgen_item; _lldb_valgen_item.key = (id)%" PRIu64 " ; _lldb_valgen_item.value = (id)%" PRIu64 "; _lldb_valgen_item;",dict_item.key_ptr,dict_item.val_ptr);<br>-        StreamString idx_name;<br>-        idx_name.Printf("[%zu]",idx);<br>-        dict_item.valobj_sp = ValueObject::CreateValueObjectFromExpression(idx_name.GetData(), expr.GetData(), m_exe_ctx_ref);<br>-    }<br>-    return dict_item.valobj_sp;<br>-}<br>-<br>-lldb_private::formatters::NSDictionaryMSyntheticFrontEnd::NSDictionaryMSyntheticFrontEnd (lldb::ValueObjectSP valobj_sp) :<br>-    SyntheticChildrenFrontEnd(*valobj_sp.get()),<br>-    m_exe_ctx_ref(),<br>-    m_ptr_size(8),<br>-    m_data_32(NULL),<br>-    m_data_64(NULL)<br>-{<br>-    if (valobj_sp)<br>-        Update ();<br>-}<br>-<br>-lldb_private::formatters::NSDictionaryMSyntheticFrontEnd::~NSDictionaryMSyntheticFrontEnd ()<br>-{<br>-    delete m_data_32;<br>-    m_data_32 = NULL;<br>-    delete m_data_64;<br>-    m_data_64 = NULL;<br>-}<br>-<br>-uint32_t<br>-lldb_private::formatters::NSDictionaryMSyntheticFrontEnd::GetIndexOfChildWithName (const ConstString &name)<br>-{<br>-    const char* item_name = name.GetCString();<br>-    uint32_t idx = ExtractIndexFromString(item_name);<br>-    if (idx < UINT32_MAX && idx >= CalculateNumChildren())<br>-        return UINT32_MAX;<br>-    return idx;<br>-}<br>-<br>-size_t<br>-lldb_private::formatters::NSDictionaryMSyntheticFrontEnd::CalculateNumChildren ()<br>-{<br>-    if (!m_data_32 && !m_data_64)<br>-        return 0;<br>-    return (m_data_32 ? m_data_32->_used : m_data_64->_used);<br>-}<br>-<br>-bool<br>-lldb_private::formatters::NSDictionaryMSyntheticFrontEnd::Update()<br>-{<br>-    m_children.clear();<br>-    ValueObjectSP valobj_sp = m_backend.GetSP();<br>-    m_ptr_size = 0;<br>-    delete m_data_32;<br>-    m_data_32 = NULL;<br>-    delete m_data_64;<br>-    m_data_64 = NULL;<br>-    if (!valobj_sp)<br>-        return false;<br>-    if (valobj_sp->IsDynamic())<br>-        valobj_sp = valobj_sp->GetStaticValue();<br>-    if (!valobj_sp)<br>-        return false;<br>-    m_exe_ctx_ref = valobj_sp->GetExecutionContextRef();<br>-    Error error;<br>-    if (valobj_sp->IsPointerType())<br>-    {<br>-        valobj_sp = valobj_sp->Dereference(error);<br>-        if (error.Fail() || !valobj_sp)<br>-            return false;<br>-    }<br>-    error.Clear();<br>-    lldb::ProcessSP process_sp(valobj_sp->GetProcessSP());<br>-    if (!process_sp)<br>-        return false;<br>-    m_ptr_size = process_sp->GetAddressByteSize();<br>-    uint64_t data_location = valobj_sp->GetAddressOf() + m_ptr_size;<br>-    if (m_ptr_size == 4)<br>-    {<br>-        m_data_32 = new DataDescriptor_32();<br>-        process_sp->ReadMemory (data_location, m_data_32, sizeof(DataDescriptor_32), error);<br>-    }<br>-    else<br>-    {<br>-        m_data_64 = new DataDescriptor_64();<br>-        process_sp->ReadMemory (data_location, m_data_64, sizeof(DataDescriptor_64), error);<br>-    }<br>-    if (error.Fail())<br>-        return false;<br>-    return false;<br>-}<br>-<br>-bool<br>-lldb_private::formatters::NSDictionaryMSyntheticFrontEnd::MightHaveChildren ()<br>-{<br>-    return true;<br>-}<br>-<br>-lldb::ValueObjectSP<br>-lldb_private::formatters::NSDictionaryMSyntheticFrontEnd::GetChildAtIndex (size_t idx)<br>-{<br>-    lldb::addr_t m_keys_ptr = (m_data_32 ? m_data_32->_keys_addr : m_data_64->_keys_addr);<br>-    lldb::addr_t m_values_ptr = (m_data_32 ? m_data_32->_objs_addr : m_data_64->_objs_addr);<br>-    <br>-    uint32_t num_children = CalculateNumChildren();<br>-    <br>-    if (idx >= num_children)<br>-        return lldb::ValueObjectSP();<br>-    <br>-    if (m_children.empty())<br>-    {<br>-        // do the scan phase<br>-        lldb::addr_t key_at_idx = 0, val_at_idx = 0;<br>-        <br>-        uint32_t tries = 0;<br>-        uint32_t test_idx = 0;<br>-        <br>-        while(tries < num_children)<br>-        {<br>-            key_at_idx = m_keys_ptr + (test_idx * m_ptr_size);<br>-            val_at_idx = m_values_ptr + (test_idx * m_ptr_size);;<br>-            ProcessSP process_sp = m_exe_ctx_ref.GetProcessSP();<br>-            if (!process_sp)<br>-                return lldb::ValueObjectSP();<br>-            Error error;<br>-            key_at_idx = process_sp->ReadPointerFromMemory(key_at_idx, error);<br>-            if (error.Fail())<br>-                return lldb::ValueObjectSP();<br>-            val_at_idx = process_sp->ReadPointerFromMemory(val_at_idx, error);<br>-            if (error.Fail())<br>-                return lldb::ValueObjectSP();<br>-            <br>-            test_idx++;<br>-            <br>-            if (!key_at_idx || !val_at_idx)<br>-                continue;<br>-            tries++;<br>-            <br>-            DictionaryItemDescriptor descriptor = {key_at_idx,val_at_idx,lldb::ValueObjectSP()};<br>-            <br>-            m_children.push_back(descriptor);<br>-        }<br>-    }<br>-    <br>-    if (idx >= m_children.size()) // should never happen<br>-        return lldb::ValueObjectSP();<br>-    <br>-    DictionaryItemDescriptor &dict_item = m_children[idx];<br>-    if (!dict_item.valobj_sp)<br>-    {<br>-        // make the new ValueObject<br>-        StreamString expr;<br>-        expr.Printf("struct __lldb_autogen_nspair { id key; id value; } _lldb_valgen_item; _lldb_valgen_item.key = (id)%" PRIu64 " ; _lldb_valgen_item.value = (id)%" PRIu64 "; _lldb_valgen_item;",dict_item.key_ptr,dict_item.val_ptr);<br>-        StreamString idx_name;<br>-        idx_name.Printf("[%zu]",idx);<br>-        dict_item.valobj_sp = ValueObject::CreateValueObjectFromExpression(idx_name.GetData(), expr.GetData(), m_exe_ctx_ref);<br>-    }<br>-    return dict_item.valobj_sp;<br>-}<br>-<br>-template bool<br>-lldb_private::formatters::NSDictionarySummaryProvider<true> (ValueObject&, Stream&) ;<br>-<br>-template bool<br>-lldb_private::formatters::NSDictionarySummaryProvider<false> (ValueObject&, Stream&) ;<br>-<br>-template bool<br>-lldb_private::formatters::NSDataSummaryProvider<true> (ValueObject&, Stream&) ;<br>-<br>-template bool<br>-lldb_private::formatters::NSDataSummaryProvider<false> (ValueObject&, Stream&) ;<br>-<br>-template bool<br>-lldb_private::formatters::ObjCSELSummaryProvider<true> (ValueObject&, Stream&) ;<br>-<br>-template bool<br>-lldb_private::formatters::ObjCSELSummaryProvider<false> (ValueObject&, Stream&) ;<br><br>Removed: lldb/trunk/source/Core/DataVisualization.cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/DataVisualization.cpp?rev=173727&view=auto">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/DataVisualization.cpp?rev=173727&view=auto</a><br>==============================================================================<br>--- lldb/trunk/source/Core/DataVisualization.cpp (original)<br>+++ lldb/trunk/source/Core/DataVisualization.cpp (removed)<br>@@ -1,279 +0,0 @@<br>-//===-- DataVisualization.cpp ---------------------------------------*- C++ -*-===//<br>-//<br>-//                     The LLVM Compiler Infrastructure<br>-//<br>-// This file is distributed under the University of Illinois Open Source<br>-// License. See LICENSE.TXT for details.<br>-//<br>-//===----------------------------------------------------------------------===//<br>-<br>-#include "lldb/lldb-python.h"<br>-<br>-#include "lldb/Core/DataVisualization.h"<br>-<br>-// C Includes<br>-// C++ Includes<br>-// Other libraries and framework includes<br>-// Project includes<br>-<br>-#include "lldb/Core/Debugger.h"<br>-<br>-using namespace lldb;<br>-using namespace lldb_private;<br>-<br>-static FormatManager&<br>-GetFormatManager()<br>-{<br>-    static FormatManager g_format_manager;<br>-    return g_format_manager;<br>-}<br>-<br>-void<br>-DataVisualization::ForceUpdate ()<br>-{<br>-    GetFormatManager().Changed();<br>-}<br>-<br>-uint32_t<br>-DataVisualization::GetCurrentRevision ()<br>-{<br>-    return GetFormatManager().GetCurrentRevision();<br>-}<br>-<br>-lldb::TypeFormatImplSP<br>-DataVisualization::ValueFormats::GetFormat (ValueObject& valobj, lldb::DynamicValueType use_dynamic)<br>-{<br>-    lldb::TypeFormatImplSP entry;<br>-    GetFormatManager().GetValueNavigator().Get(valobj, entry, use_dynamic);<br>-    return entry;<br>-}<br>-<br>-lldb::TypeFormatImplSP<br>-DataVisualization::ValueFormats::GetFormat (const ConstString &type)<br>-{<br>-    lldb::TypeFormatImplSP entry;<br>-    GetFormatManager().GetValueNavigator().Get(type, entry);<br>-    return entry;<br>-}<br>-<br>-void<br>-DataVisualization::ValueFormats::Add (const ConstString &type, const lldb::TypeFormatImplSP &entry)<br>-{<br>-    GetFormatManager().GetValueNavigator().Add(FormatManager::GetValidTypeName(type),entry);<br>-}<br>-<br>-bool<br>-DataVisualization::ValueFormats::Delete (const ConstString &type)<br>-{<br>-    return GetFormatManager().GetValueNavigator().Delete(type);<br>-}<br>-<br>-void<br>-DataVisualization::ValueFormats::Clear ()<br>-{<br>-    GetFormatManager().GetValueNavigator().Clear();<br>-}<br>-<br>-void<br>-DataVisualization::ValueFormats::LoopThrough (TypeFormatImpl::ValueCallback callback, void* callback_baton)<br>-{<br>-    GetFormatManager().GetValueNavigator().LoopThrough(callback, callback_baton);<br>-}<br>-<br>-uint32_t<br>-DataVisualization::ValueFormats::GetCount ()<br>-{<br>-    return GetFormatManager().GetValueNavigator().GetCount();<br>-}<br>-<br>-lldb::TypeNameSpecifierImplSP<br>-DataVisualization::ValueFormats::GetTypeNameSpecifierForFormatAtIndex (uint32_t index)<br>-{<br>-    return GetFormatManager().GetValueNavigator().GetTypeNameSpecifierAtIndex(index);<br>-}<br>-<br>-lldb::TypeFormatImplSP<br>-DataVisualization::ValueFormats::GetFormatAtIndex (uint32_t index)<br>-{<br>-    return GetFormatManager().GetValueNavigator().GetAtIndex(index);<br>-}<br>-<br>-lldb::TypeSummaryImplSP<br>-DataVisualization::GetSummaryFormat (ValueObject& valobj,<br>-                                     lldb::DynamicValueType use_dynamic)<br>-{<br>-    return GetFormatManager().GetSummaryFormat(valobj, use_dynamic);<br>-}<br>-<br>-lldb::TypeSummaryImplSP<br>-DataVisualization::GetSummaryForType (lldb::TypeNameSpecifierImplSP type_sp)<br>-{<br>-    return GetFormatManager().GetSummaryForType(type_sp);<br>-}<br>-<br>-#ifndef LLDB_DISABLE_PYTHON<br>-lldb::SyntheticChildrenSP<br>-DataVisualization::GetSyntheticChildren (ValueObject& valobj,<br>-                                         lldb::DynamicValueType use_dynamic)<br>-{<br>-    return GetFormatManager().GetSyntheticChildren(valobj, use_dynamic);<br>-}<br>-#endif<br>-<br>-#ifndef LLDB_DISABLE_PYTHON<br>-lldb::SyntheticChildrenSP<br>-DataVisualization::GetSyntheticChildrenForType (lldb::TypeNameSpecifierImplSP type_sp)<br>-{<br>-    return GetFormatManager().GetSyntheticChildrenForType(type_sp);<br>-}<br>-#endif<br>-<br>-lldb::TypeFilterImplSP<br>-DataVisualization::GetFilterForType (lldb::TypeNameSpecifierImplSP type_sp)<br>-{<br>-    return GetFormatManager().GetFilterForType(type_sp);<br>-}<br>-<br>-#ifndef LLDB_DISABLE_PYTHON<br>-lldb::TypeSyntheticImplSP<br>-DataVisualization::GetSyntheticForType (lldb::TypeNameSpecifierImplSP type_sp)<br>-{<br>-    return GetFormatManager().GetSyntheticForType(type_sp);<br>-}<br>-#endif<br>-<br>-bool<br>-DataVisualization::AnyMatches (ConstString type_name,<br>-                               TypeCategoryImpl::FormatCategoryItems items,<br>-                               bool only_enabled,<br>-                               const char** matching_category,<br>-                               TypeCategoryImpl::FormatCategoryItems* matching_type)<br>-{<br>-    return GetFormatManager().AnyMatches(type_name,<br>-                                         items,<br>-                                         only_enabled,<br>-                                         matching_category,<br>-                                         matching_type);<br>-}<br>-<br>-bool<br>-DataVisualization::Categories::GetCategory (const ConstString &category, lldb::TypeCategoryImplSP &entry,<br>-                                            bool allow_create)<br>-{<br>-    entry = GetFormatManager().GetCategory(category, allow_create);<br>-    return (entry.get() != NULL);<br>-}<br>-<br>-void<br>-DataVisualization::Categories::Add (const ConstString &category)<br>-{<br>-    GetFormatManager().GetCategory(category);<br>-}<br>-<br>-bool<br>-DataVisualization::Categories::Delete (const ConstString &category)<br>-{<br>-    GetFormatManager().DisableCategory(category);<br>-    return GetFormatManager().DeleteCategory(category);<br>-}<br>-<br>-void<br>-DataVisualization::Categories::Clear ()<br>-{<br>-    GetFormatManager().ClearCategories();<br>-}<br>-<br>-void<br>-DataVisualization::Categories::Clear (const ConstString &category)<br>-{<br>-    GetFormatManager().GetCategory(category)->Clear(eFormatCategoryItemSummary | eFormatCategoryItemRegexSummary);<br>-}<br>-<br>-void<br>-DataVisualization::Categories::Enable (const ConstString& category,<br>-                                       CategoryMap::Position pos)<br>-{<br>-    if (GetFormatManager().GetCategory(category)->IsEnabled())<br>-        GetFormatManager().DisableCategory(category);<br>-    GetFormatManager().EnableCategory(category, pos);<br>-}<br>-<br>-void<br>-DataVisualization::Categories::Disable (const ConstString& category)<br>-{<br>-    if (GetFormatManager().GetCategory(category)->IsEnabled() == true)<br>-        GetFormatManager().DisableCategory(category);<br>-}<br>-<br>-void<br>-DataVisualization::Categories::Enable (const lldb::TypeCategoryImplSP& category,<br>-                                       CategoryMap::Position pos)<br>-{<br>-    if (category.get())<br>-    {<br>-        if (category->IsEnabled())<br>-            GetFormatManager().DisableCategory(category);<br>-        GetFormatManager().EnableCategory(category, pos);<br>-    }<br>-}<br>-<br>-void<br>-DataVisualization::Categories::Disable (const lldb::TypeCategoryImplSP& category)<br>-{<br>-    if (category.get() && category->IsEnabled() == true)<br>-        GetFormatManager().DisableCategory(category);<br>-}<br>-<br>-void<br>-DataVisualization::Categories::LoopThrough (FormatManager::CategoryCallback callback, void* callback_baton)<br>-{<br>-    GetFormatManager().LoopThroughCategories(callback, callback_baton);<br>-}<br>-<br>-uint32_t<br>-DataVisualization::Categories::GetCount ()<br>-{<br>-    return GetFormatManager().GetCategoriesCount();<br>-}<br>-<br>-lldb::TypeCategoryImplSP<br>-DataVisualization::Categories::GetCategoryAtIndex (uint32_t index)<br>-{<br>-    return GetFormatManager().GetCategoryAtIndex(index);<br>-}<br>-<br>-bool<br>-DataVisualization::NamedSummaryFormats::GetSummaryFormat (const ConstString &type, lldb::TypeSummaryImplSP &entry)<br>-{<br>-    return GetFormatManager().GetNamedSummaryNavigator().Get(type,entry);<br>-}<br>-<br>-void<br>-DataVisualization::NamedSummaryFormats::Add (const ConstString &type, const lldb::TypeSummaryImplSP &entry)<br>-{<br>-    GetFormatManager().GetNamedSummaryNavigator().Add(FormatManager::GetValidTypeName(type),entry);<br>-}<br>-<br>-bool<br>-DataVisualization::NamedSummaryFormats::Delete (const ConstString &type)<br>-{<br>-    return GetFormatManager().GetNamedSummaryNavigator().Delete(type);<br>-}<br>-<br>-void<br>-DataVisualization::NamedSummaryFormats::Clear ()<br>-{<br>-    GetFormatManager().GetNamedSummaryNavigator().Clear();<br>-}<br>-<br>-void<br>-DataVisualization::NamedSummaryFormats::LoopThrough (TypeSummaryImpl::SummaryCallback callback, void* callback_baton)<br>-{<br>-    GetFormatManager().GetNamedSummaryNavigator().LoopThrough(callback, callback_baton);<br>-}<br>-<br>-uint32_t<br>-DataVisualization::NamedSummaryFormats::GetCount ()<br>-{<br>-    return GetFormatManager().GetNamedSummaryNavigator().GetCount();<br>-}<br><br>Modified: lldb/trunk/source/Core/Debugger.cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Debugger.cpp?rev=173728&r1=173727&r2=173728&view=diff">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Debugger.cpp?rev=173728&r1=173727&r2=173728&view=diff</a><br>==============================================================================<br>--- lldb/trunk/source/Core/Debugger.cpp (original)<br>+++ lldb/trunk/source/Core/Debugger.cpp Mon Jan 28 17:47:25 2013<br>@@ -20,8 +20,6 @@<br><br> #include "lldb/lldb-private.h"<br> #include "lldb/Core/ConnectionFileDescriptor.h"<br>-#include "lldb/Core/DataVisualization.h"<br>-#include "lldb/Core/FormatManager.h"<br> #include "lldb/Core/InputReader.h"<br> #include "lldb/Core/Module.h"<br> #include "lldb/Core/PluginManager.h"<br>@@ -33,6 +31,8 @@<br> #include "lldb/Core/Timer.h"<br> #include "lldb/Core/ValueObject.h"<br> #include "lldb/Core/ValueObjectVariable.h"<br>+#include "lldb/DataFormatters/DataVisualization.h"<br>+#include "lldb/DataFormatters/FormatManager.h"<br> #include "lldb/Host/DynamicLibrary.h"<br> #include "lldb/Host/Terminal.h"<br> #include "lldb/Interpreter/CommandInterpreter.h"<br><br>Removed: lldb/trunk/source/Core/FormatClasses.cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/FormatClasses.cpp?rev=173727&view=auto">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/FormatClasses.cpp?rev=173727&view=auto</a><br>==============================================================================<br>--- lldb/trunk/source/Core/FormatClasses.cpp (original)<br>+++ lldb/trunk/source/Core/FormatClasses.cpp (removed)<br>@@ -1,409 +0,0 @@<br>-//===-- FormatClasses.cpp ----------------------------------------*- C++ -*-===//<br>-//<br>-//                     The LLVM Compiler Infrastructure<br>-//<br>-// This file is distributed under the University of Illinois Open Source<br>-// License. See LICENSE.TXT for details.<br>-//<br>-//===----------------------------------------------------------------------===//<br>-<br>-#include "lldb/lldb-python.h"<br>-<br>-// C Includes<br>-<br>-// C++ Includes<br>-<br>-// Other libraries and framework includes<br>-<br>-// Project includes<br>-#include "lldb/lldb-public.h"<br>-#include "lldb/lldb-enumerations.h"<br>-<br>-#include "lldb/Core/Debugger.h"<br>-#include "lldb/Core/FormatClasses.h"<br>-#include "lldb/Core/StreamString.h"<br>-#include "lldb/Core/Timer.h"<br>-#include "lldb/Interpreter/CommandInterpreter.h"<br>-#include "lldb/Symbol/ClangASTType.h"<br>-#include "lldb/Target/StackFrame.h"<br>-#include "lldb/Target/Target.h"<br>-<br>-using namespace lldb;<br>-using namespace lldb_private;<br>-<br>-TypeFormatImpl::TypeFormatImpl (lldb::Format f,<br>-                          const Flags& flags) : <br>-    m_flags(flags),<br>-    m_format (f)<br>-{<br>-}<br>-<br>-std::string<br>-TypeFormatImpl::GetDescription()<br>-{<br>-    StreamString sstr;<br>-    sstr.Printf ("%s%s%s%s\n", <br>-                 FormatManager::GetFormatAsCString (GetFormat()),<br>-                 Cascades() ? "" : " (not cascading)",<br>-                 SkipsPointers() ? " (skip pointers)" : "",<br>-                 SkipsReferences() ? " (skip references)" : "");<br>-    return sstr.GetString();<br>-}<br>-<br>-TypeSummaryImpl::TypeSummaryImpl(const TypeSummaryImpl::Flags& flags) :<br>-    m_flags(flags)<br>-{<br>-}<br>-<br>-<br>-StringSummaryFormat::StringSummaryFormat(const TypeSummaryImpl::Flags& flags,<br>-                                         const char *format_cstr) :<br>-    TypeSummaryImpl(flags),<br>-    m_format()<br>-{<br>-  if (format_cstr)<br>-    m_format.assign(format_cstr);<br>-}<br>-<br>-bool<br>-StringSummaryFormat::FormatObject(ValueObject *valobj,<br>-                                  std::string& retval)<br>-{<br>-    if (!valobj)<br>-    {<br>-        retval.assign("NULL ValueObject");<br>-        return false;<br>-    }<br>-    <br>-    StreamString s;<br>-    ExecutionContext exe_ctx (valobj->GetExecutionContextRef());<br>-    SymbolContext sc;<br>-    StackFrame *frame = exe_ctx.GetFramePtr();<br>-    if (frame)<br>-        sc = frame->GetSymbolContext(lldb::eSymbolContextEverything);<br>-    <br>-    if (IsOneliner())<br>-    {<br>-        ValueObject* object;<br>-        <br>-        ValueObjectSP synth_valobj = valobj->GetSyntheticValue();<br>-        if (synth_valobj)<br>-            object = synth_valobj.get();<br>-        else<br>-            object = valobj;<br>-        <br>-        const uint32_t num_children = object->GetNumChildren();<br>-        if (num_children)<br>-        {<br>-            s.PutChar('(');<br>-            <br>-            for (uint32_t idx=0; idx<num_children; ++idx)<br>-            {<br>-                lldb::ValueObjectSP child_sp(object->GetChildAtIndex(idx, true));<br>-                if (child_sp.get())<br>-                {<br>-                    if (idx)<br>-                        s.PutCString(", ");<br>-                    if (!HideNames())<br>-                    {<br>-                        s.PutCString(child_sp.get()->GetName().AsCString());<br>-                        s.PutCString(" = ");<br>-                    }<br>-                    child_sp.get()->DumpPrintableRepresentation(s,<br>-                                                                ValueObject::eValueObjectRepresentationStyleSummary,<br>-                                                                lldb::eFormatInvalid,<br>-                                                                ValueObject::ePrintableRepresentationSpecialCasesDisable);<br>-                }<br>-            }<br>-            <br>-            s.PutChar(')');<br>-            <br>-            retval.assign(s.GetString());<br>-            return true;<br>-        }<br>-        else<br>-        {<br>-            retval.assign("error: oneliner for no children");<br>-            return false;<br>-        }<br>-        <br>-    }<br>-    else<br>-    {<br>-        if (Debugger::FormatPrompt(m_format.c_str(), &sc, &exe_ctx, &sc.line_entry.range.GetBaseAddress(), s, NULL, valobj))<br>-        {<br>-            retval.assign(s.GetString());<br>-            return true;<br>-        }<br>-        else<br>-        {<br>-            retval.assign("error: summary string parsing error");<br>-            return false;<br>-        }<br>-    }<br>-}<br>-<br>-std::string<br>-StringSummaryFormat::GetDescription()<br>-{<br>-    StreamString sstr;<br>-    <br>-    sstr.Printf ("`%s`%s%s%s%s%s%s%s",      m_format.c_str(),<br>-                 Cascades() ? "" : " (not cascading)",<br>-                 !DoesPrintChildren() ? "" : " (show children)",<br>-                 !DoesPrintValue() ? " (hide value)" : "",<br>-                 IsOneliner() ? " (one-line printout)" : "",<br>-                 SkipsPointers() ? " (skip pointers)" : "",<br>-                 SkipsReferences() ? " (skip references)" : "",<br>-                 HideNames() ? " (hide member names)" : "");<br>-    return sstr.GetString();<br>-}<br>-<br>-CXXFunctionSummaryFormat::CXXFunctionSummaryFormat (const TypeSummaryImpl::Flags& flags,<br>-                                                    Callback impl,<br>-                                                    const char* description) :<br>-                                                    TypeSummaryImpl(flags),<br>-                                                    m_impl(impl),<br>-                                                    m_description(description ? description : "")<br>-{<br>-}<br>-    <br>-bool<br>-CXXFunctionSummaryFormat::FormatObject(ValueObject *valobj,<br>-                                       std::string& dest)<br>-{<br>-    dest.clear();<br>-    StreamString stream;<br>-    if (!m_impl || m_impl(*valobj,stream) == false)<br>-        return false;<br>-    dest.assign(stream.GetData());<br>-    return true;<br>-}<br>-<br>-std::string<br>-CXXFunctionSummaryFormat::GetDescription()<br>-{<br>-    StreamString sstr;<br>-    sstr.Printf ("`%s (%p) `%s%s%s%s%s%s%s",      m_description.c_str(),m_impl,<br>-                 Cascades() ? "" : " (not cascading)",<br>-                 !DoesPrintChildren() ? "" : " (show children)",<br>-                 !DoesPrintValue() ? " (hide value)" : "",<br>-                 IsOneliner() ? " (one-line printout)" : "",<br>-                 SkipsPointers() ? " (skip pointers)" : "",<br>-                 SkipsReferences() ? " (skip references)" : "",<br>-                 HideNames() ? " (hide member names)" : "");<br>-    return sstr.GetString();<br>-}<br>-<br>-#ifndef LLDB_DISABLE_PYTHON<br>-<br>-<br>-ScriptSummaryFormat::ScriptSummaryFormat(const TypeSummaryImpl::Flags& flags,<br>-                                         const char * function_name,<br>-                                         const char * python_script) :<br>-    TypeSummaryImpl(flags),<br>-    m_function_name(),<br>-    m_python_script(),<br>-    m_script_function_sp()<br>-{<br>-   if (function_name)<br>-     m_function_name.assign(function_name);<br>-   if (python_script)<br>-     m_python_script.assign(python_script);<br>-}<br>-<br>-bool<br>-ScriptSummaryFormat::FormatObject(ValueObject *valobj,<br>-                                  std::string& retval)<br>-{<br>-    Timer scoped_timer (__PRETTY_FUNCTION__, __PRETTY_FUNCTION__);<br>-<br>-    TargetSP target_sp(valobj->GetTargetSP());<br>-<br>-    if (!target_sp)<br>-    {<br>-        retval.assign("error: no target");<br>-        return false;<br>-    }<br>-<br>-    ScriptInterpreter *script_interpreter = target_sp->GetDebugger().GetCommandInterpreter().GetScriptInterpreter();<br>-<br>-    if (!script_interpreter)<br>-    {<br>-        retval.assign("error: no ScriptInterpreter");<br>-        return false;<br>-    }<br>-        <br>-    return script_interpreter->GetScriptedSummary(m_function_name.c_str(),<br>-                                                  valobj->GetSP(),<br>-                                                  m_script_function_sp,<br>-                                                  retval);<br>-<br>-}<br>-<br>-std::string<br>-ScriptSummaryFormat::GetDescription()<br>-{<br>-    StreamString sstr;<br>-    sstr.Printf ("%s%s%s%s%s%s%s\n%s",       Cascades() ? "" : " (not cascading)",<br>-                 !DoesPrintChildren() ? "" : " (show children)",<br>-                 !DoesPrintValue() ? " (hide value)" : "",<br>-                 IsOneliner() ? " (one-line printout)" : "",<br>-                 SkipsPointers() ? " (skip pointers)" : "",<br>-                 SkipsReferences() ? " (skip references)" : "",<br>-                 HideNames() ? " (hide member names)" : "",<br>-                 m_python_script.c_str());<br>-    return sstr.GetString();<br>-    <br>-}<br>-<br>-#endif // #ifndef LLDB_DISABLE_PYTHON<br>-<br>-std::string<br>-TypeFilterImpl::GetDescription()<br>-{<br>-    StreamString sstr;<br>-    sstr.Printf("%s%s%s {\n",<br>-                Cascades() ? "" : " (not cascading)",<br>-                SkipsPointers() ? " (skip pointers)" : "",<br>-                SkipsReferences() ? " (skip references)" : "");<br>-    <br>-    for (int i = 0; i < GetCount(); i++)<br>-    {<br>-        sstr.Printf("    %s\n",<br>-                    GetExpressionPathAtIndex(i));<br>-    }<br>-                    <br>-    sstr.Printf("}");<br>-    return sstr.GetString();<br>-}<br>-<br>-std::string<br>-CXXSyntheticChildren::GetDescription()<br>-{<br>-    StreamString sstr;<br>-    sstr.Printf("%s%s%s Generator at %p - %s\n",<br>-                Cascades() ? "" : " (not cascading)",<br>-                SkipsPointers() ? " (skip pointers)" : "",<br>-                SkipsReferences() ? " (skip references)" : "",<br>-                m_create_callback,<br>-                m_description.c_str());<br>-    <br>-    return sstr.GetString();<br>-}<br>-<br>-std::string<br>-SyntheticArrayView::GetDescription()<br>-{<br>-    StreamString sstr;<br>-    sstr.Printf("%s%s%s {\n",<br>-                Cascades() ? "" : " (not cascading)",<br>-                SkipsPointers() ? " (skip pointers)" : "",<br>-                SkipsReferences() ? " (skip references)" : "");<br>-    <br>-    SyntheticArrayRange* ptr = &m_head;<br>-    while (ptr && ptr != m_tail)<br>-    {<br>-        if (ptr->GetLow() == ptr->GetHigh())<br>-            sstr.Printf("    [%d]\n",<br>-                        ptr->GetLow());<br>-        else<br>-            sstr.Printf("    [%d-%d]\n",<br>-                        ptr->GetLow(),<br>-                        ptr->GetHigh());<br>-        ptr = ptr->GetNext();<br>-    }<br>-    <br>-    sstr.Printf("}");<br>-    return sstr.GetString();<br>-}<br>-<br>-#ifndef LLDB_DISABLE_PYTHON<br>-<br>-TypeSyntheticImpl::FrontEnd::FrontEnd(std::string pclass, ValueObject &backend) :<br>-    SyntheticChildrenFrontEnd(backend),<br>-    m_python_class(pclass),<br>-    m_wrapper_sp(),<br>-    m_interpreter(NULL)<br>-{<br>-    if (backend == LLDB_INVALID_UID)<br>-        return;<br>-    <br>-    TargetSP target_sp = backend.GetTargetSP();<br>-    <br>-    if (!target_sp)<br>-        return;<br>-    <br>-    m_interpreter = target_sp->GetDebugger().GetCommandInterpreter().GetScriptInterpreter();<br>-    <br>-    if (m_interpreter != NULL)<br>-        m_wrapper_sp = m_interpreter->CreateSyntheticScriptedProvider(m_python_class.c_str(), backend.GetSP());<br>-}<br>-<br>-TypeSyntheticImpl::FrontEnd::~FrontEnd()<br>-{<br>-}<br>-<br>-lldb::ValueObjectSP<br>-TypeSyntheticImpl::FrontEnd::GetChildAtIndex (size_t idx)<br>-{<br>-    if (!m_wrapper_sp || !m_interpreter)<br>-        return lldb::ValueObjectSP();<br>-    <br>-    return m_interpreter->GetChildAtIndex(m_wrapper_sp, idx);<br>-}<br>-<br>-std::string<br>-TypeSyntheticImpl::GetDescription()<br>-{<br>-    StreamString sstr;<br>-    sstr.Printf("%s%s%s Python class %s",<br>-                Cascades() ? "" : " (not cascading)",<br>-                SkipsPointers() ? " (skip pointers)" : "",<br>-                SkipsReferences() ? " (skip references)" : "",<br>-                m_python_class.c_str());<br>-    <br>-    return sstr.GetString();<br>-}<br>-<br>-#endif // #ifndef LLDB_DISABLE_PYTHON<br>-<br>-int<br>-SyntheticArrayView::GetRealIndexForIndex(size_t i)<br>-{<br>-    if (i >= GetCount())<br>-        return -1;<br>-    <br>-    SyntheticArrayRange* ptr = &m_head;<br>-    <br>-    int residual = i;<br>-    <br>-    while(ptr && ptr != m_tail)<br>-    {<br>-        if (residual >= ptr->GetSelfCount())<br>-        {<br>-            residual -= ptr->GetSelfCount();<br>-            ptr = ptr->GetNext();<br>-        }<br>-        <br>-        return ptr->GetLow() + residual;<br>-    }<br>-    <br>-    return -1;<br>-}<br>-<br>-uint32_t<br>-SyntheticArrayView::FrontEnd::GetIndexOfChildWithName (const ConstString &name_cs)<br>-{<br>-    const char* name_cstr = name_cs.GetCString();<br>-    if (*name_cstr != '[')<br>-        return UINT32_MAX;<br>-    std::string name(name_cstr+1);<br>-    if (name[name.size()-1] != ']')<br>-        return UINT32_MAX;<br>-    name = name.erase(name.size()-1,1);<br>-    int index = Args::StringToSInt32 (name.c_str(), -1);<br>-    if (index < 0)<br>-        return UINT32_MAX;<br>-    return index;<br>-}<br><br>Removed: lldb/trunk/source/Core/FormatManager.cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/FormatManager.cpp?rev=173727&view=auto">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/FormatManager.cpp?rev=173727&view=auto</a><br>==============================================================================<br>--- lldb/trunk/source/Core/FormatManager.cpp (original)<br>+++ lldb/trunk/source/Core/FormatManager.cpp (removed)<br>@@ -1,1313 +0,0 @@<br>-//===-- FormatManager.cpp -------------------------------------------*- C++ -*-===//<br>-//<br>-//                     The LLVM Compiler Infrastructure<br>-//<br>-// This file is distributed under the University of Illinois Open Source<br>-// License. See LICENSE.TXT for details.<br>-//<br>-//===----------------------------------------------------------------------===//<br>-<br>-#include "lldb/lldb-python.h"<br>-<br>-#include "lldb/Core/FormatManager.h"<br>-<br>-// C Includes<br>-// C++ Includes<br>-// Other libraries and framework includes<br>-// Project includes<br>-<br>-#include "lldb/Core/CXXFormatterFunctions.h"<br>-#include "lldb/Core/Debugger.h"<br>-<br>-using namespace lldb;<br>-using namespace lldb_private;<br>-<br>-<br>-struct FormatInfo<br>-{<br>-    Format format;<br>-    const char format_char; // One or more format characters that can be used for this format.<br>-    const char *format_name;    // Long format name that can be used to specify the current format<br>-};<br>-<br>-static FormatInfo <br>-g_format_infos[] = <br>-{<br>-    { eFormatDefault        , '\0'  , "default"             },<br>-    { eFormatBoolean        , 'B'   , "boolean"             },<br>-    { eFormatBinary         , 'b'   , "binary"              },<br>-    { eFormatBytes          , 'y'   , "bytes"               },<br>-    { eFormatBytesWithASCII , 'Y'   , "bytes with ASCII"    },<br>-    { eFormatChar           , 'c'   , "character"           },<br>-    { eFormatCharPrintable  , 'C'   , "printable character" },<br>-    { eFormatComplexFloat   , 'F'   , "complex float"       },<br>-    { eFormatCString        , 's'   , "c-string"            },<br>-    { eFormatDecimal        , 'd'   , "decimal"             },<br>-    { eFormatEnum           , 'E'   , "enumeration"         },<br>-    { eFormatHex            , 'x'   , "hex"                 },<br>-    { eFormatHexUppercase   , 'X'   , "uppercase hex"       },<br>-    { eFormatFloat          , 'f'   , "float"               },<br>-    { eFormatOctal          , 'o'   , "octal"               },<br>-    { eFormatOSType         , 'O'   , "OSType"              },<br>-    { eFormatUnicode16      , 'U'   , "unicode16"           },<br>-    { eFormatUnicode32      , '\0'  , "unicode32"           },<br>-    { eFormatUnsigned       , 'u'   , "unsigned decimal"    },<br>-    { eFormatPointer        , 'p'   , "pointer"             },<br>-    { eFormatVectorOfChar   , '\0'  , "char[]"              },<br>-    { eFormatVectorOfSInt8  , '\0'  , "int8_t[]"            },<br>-    { eFormatVectorOfUInt8  , '\0'  , "uint8_t[]"           },<br>-    { eFormatVectorOfSInt16 , '\0'  , "int16_t[]"           },<br>-    { eFormatVectorOfUInt16 , '\0'  , "uint16_t[]"          },<br>-    { eFormatVectorOfSInt32 , '\0'  , "int32_t[]"           },<br>-    { eFormatVectorOfUInt32 , '\0'  , "uint32_t[]"          },<br>-    { eFormatVectorOfSInt64 , '\0'  , "int64_t[]"           },<br>-    { eFormatVectorOfUInt64 , '\0'  , "uint64_t[]"          },<br>-    { eFormatVectorOfFloat32, '\0'  , "float32[]"           },<br>-    { eFormatVectorOfFloat64, '\0'  , "float64[]"           },<br>-    { eFormatVectorOfUInt128, '\0'  , "uint128_t[]"         },<br>-    { eFormatComplexInteger , 'I'   , "complex integer"     },<br>-    { eFormatCharArray      , 'a'   , "character array"     },<br>-    { eFormatAddressInfo    , 'A'   , "address"             },<br>-    { eFormatHexFloat       , '\0'  , "hex float"           },<br>-    { eFormatInstruction    , 'i'   , "instruction"         },<br>-    { eFormatVoid           , 'v'   , "void"                }<br>-};<br>-<br>-static uint32_t <br>-g_num_format_infos = sizeof(g_format_infos)/sizeof(FormatInfo);<br>-<br>-static bool<br>-GetFormatFromFormatChar (char format_char, Format &format)<br>-{<br>-    for (uint32_t i=0; i<g_num_format_infos; ++i)<br>-    {<br>-        if (g_format_infos[i].format_char == format_char)<br>-        {<br>-            format = g_format_infos[i].format;<br>-            return true;<br>-        }<br>-    }<br>-    format = eFormatInvalid;<br>-    return false;<br>-}<br>-<br>-static bool<br>-GetFormatFromFormatName (const char *format_name, bool partial_match_ok, Format &format)<br>-{<br>-    uint32_t i;<br>-    for (i=0; i<g_num_format_infos; ++i)<br>-    {<br>-        if (strcasecmp (g_format_infos[i].format_name, format_name) == 0)<br>-        {<br>-            format = g_format_infos[i].format;<br>-            return true;<br>-        }<br>-    }<br>-    <br>-    if (partial_match_ok)<br>-    {<br>-        for (i=0; i<g_num_format_infos; ++i)<br>-        {<br>-            if (strcasestr (g_format_infos[i].format_name, format_name) == g_format_infos[i].format_name)<br>-            {<br>-                format = g_format_infos[i].format;<br>-                return true;<br>-            }<br>-        }<br>-    }<br>-    format = eFormatInvalid;<br>-    return false;<br>-}<br>-<br>-bool<br>-FormatManager::GetFormatFromCString (const char *format_cstr,<br>-                                     bool partial_match_ok,<br>-                                     lldb::Format &format)<br>-{<br>-    bool success = false;<br>-    if (format_cstr && format_cstr[0])<br>-    {<br>-        if (format_cstr[1] == '\0')<br>-        {<br>-            success = GetFormatFromFormatChar (format_cstr[0], format);<br>-            if (success)<br>-                return true;<br>-        }<br>-        <br>-        success = GetFormatFromFormatName (format_cstr, partial_match_ok, format);<br>-    }<br>-    if (!success)<br>-        format = eFormatInvalid;<br>-    return success;<br>-}<br>-<br>-char<br>-FormatManager::GetFormatAsFormatChar (lldb::Format format)<br>-{<br>-    for (uint32_t i=0; i<g_num_format_infos; ++i)<br>-    {<br>-        if (g_format_infos[i].format == format)<br>-            return g_format_infos[i].format_char;<br>-    }<br>-    return '\0';<br>-}<br>-    <br>-<br>-<br>-const char *<br>-FormatManager::GetFormatAsCString (Format format)<br>-{<br>-    if (format >= eFormatDefault && format < kNumFormats)<br>-        return g_format_infos[format].format_name;<br>-    return NULL;<br>-}<br>-<br>-TypeCategoryImpl::TypeCategoryImpl(IFormatChangeListener* clist,<br>-                                   ConstString name) :<br>-    m_summary_nav(new SummaryNavigator("summary",clist)),<br>-    m_regex_summary_nav(new RegexSummaryNavigator("regex-summary",clist)),<br>-    m_filter_nav(new FilterNavigator("filter",clist)),<br>-    m_regex_filter_nav(new RegexFilterNavigator("regex-filter",clist)),<br>-#ifndef LLDB_DISABLE_PYTHON<br>-    m_synth_nav(new SynthNavigator("synth",clist)),<br>-    m_regex_synth_nav(new RegexSynthNavigator("regex-synth",clist)),<br>-#endif<br>-    m_enabled(false),<br>-    m_change_listener(clist),<br>-    m_mutex(Mutex::eMutexTypeRecursive),<br>-    m_name(name)<br>-{}<br>-<br>-bool<br>-TypeCategoryImpl::Get (ValueObject& valobj,<br>-                     lldb::TypeSummaryImplSP& entry,<br>-                     lldb::DynamicValueType use_dynamic,<br>-                     uint32_t* reason)<br>-{<br>-    if (!IsEnabled())<br>-        return false;<br>-    if (GetSummaryNavigator()->Get(valobj, entry, use_dynamic, reason))<br>-        return true;<br>-    bool regex = GetRegexSummaryNavigator()->Get(valobj, entry, use_dynamic, reason);<br>-    if (regex && reason)<br>-        *reason |= lldb_private::eFormatterChoiceCriterionRegularExpressionSummary;<br>-    return regex;<br>-}<br>-<br>-bool<br>-TypeCategoryImpl::Get(ValueObject& valobj,<br>-                    lldb::SyntheticChildrenSP& entry_sp,<br>-                    lldb::DynamicValueType use_dynamic,<br>-                    uint32_t* reason)<br>-{<br>-    if (!IsEnabled())<br>-        return false;<br>-    TypeFilterImpl::SharedPointer filter_sp;<br>-    uint32_t reason_filter = 0;<br>-    bool regex_filter = false;<br>-    // first find both Filter and Synth, and then check which is most recent<br>-    <br>-    if (!GetFilterNavigator()->Get(valobj, filter_sp, use_dynamic, &reason_filter))<br>-        regex_filter = GetRegexFilterNavigator()->Get (valobj, filter_sp, use_dynamic, &reason_filter);<br>-<br>-#ifndef LLDB_DISABLE_PYTHON<br>-    bool regex_synth = false;<br>-    uint32_t reason_synth = 0;    <br>-    bool pick_synth = false;<br>-    TypeSyntheticImpl::SharedPointer synth;<br>-    if (!GetSyntheticNavigator()->Get(valobj, synth, use_dynamic, &reason_synth))<br>-        regex_synth = GetRegexSyntheticNavigator()->Get (valobj, synth, use_dynamic, &reason_synth);<br>-    if (!filter_sp.get() && !synth.get())<br>-        return false;<br>-    else if (!filter_sp.get() && synth.get())<br>-        pick_synth = true;<br>-    <br>-    else if (filter_sp.get() && !synth.get())<br>-        pick_synth = false;<br>-    <br>-    else /*if (filter_sp.get() && synth.get())*/<br>-    {<br>-        if (filter_sp->GetRevision() > synth->GetRevision())<br>-            pick_synth = false;<br>-        else<br>-            pick_synth = true;<br>-    }<br>-    if (pick_synth)<br>-    {<br>-        if (regex_synth && reason)<br>-            *reason |= lldb_private::eFormatterChoiceCriterionRegularExpressionFilter;<br>-        entry_sp = synth;<br>-        return true;<br>-    }<br>-    else<br>-    {<br>-        if (regex_filter && reason)<br>-            *reason |= lldb_private::eFormatterChoiceCriterionRegularExpressionFilter;<br>-        entry_sp = filter_sp;<br>-        return true;<br>-    }<br>-<br>-#else<br>-    if (filter_sp)<br>-    {<br>-        entry_sp = filter_sp;<br>-        return true;<br>-    }<br>-#endif<br>-<br>-    return false;    <br>-    <br>-}<br>-<br>-void<br>-TypeCategoryImpl::Clear (FormatCategoryItems items)<br>-{<br>-    if ( (items & eFormatCategoryItemSummary) == eFormatCategoryItemSummary )<br>-        m_summary_nav->Clear();<br>-    if ( (items & eFormatCategoryItemRegexSummary) == eFormatCategoryItemRegexSummary )<br>-        m_regex_summary_nav->Clear();<br>-    if ( (items & eFormatCategoryItemFilter)  == eFormatCategoryItemFilter )<br>-        m_filter_nav->Clear();<br>-    if ( (items & eFormatCategoryItemRegexFilter) == eFormatCategoryItemRegexFilter )<br>-        m_regex_filter_nav->Clear();<br>-#ifndef LLDB_DISABLE_PYTHON<br>-    if ( (items & eFormatCategoryItemSynth)  == eFormatCategoryItemSynth )<br>-        m_synth_nav->Clear();<br>-    if ( (items & eFormatCategoryItemRegexSynth) == eFormatCategoryItemRegexSynth )<br>-        m_regex_synth_nav->Clear();<br>-#endif<br>-}<br>-<br>-bool<br>-TypeCategoryImpl::Delete (ConstString name,<br>-                        FormatCategoryItems items)<br>-{<br>-    bool success = false;<br>-    if ( (items & eFormatCategoryItemSummary) == eFormatCategoryItemSummary )<br>-        success = m_summary_nav->Delete(name) || success;<br>-    if ( (items & eFormatCategoryItemRegexSummary) == eFormatCategoryItemRegexSummary )<br>-        success = m_regex_summary_nav->Delete(name) || success;<br>-    if ( (items & eFormatCategoryItemFilter)  == eFormatCategoryItemFilter )<br>-        success = m_filter_nav->Delete(name) || success;<br>-    if ( (items & eFormatCategoryItemRegexFilter) == eFormatCategoryItemRegexFilter )<br>-        success = m_regex_filter_nav->Delete(name) || success;<br>-#ifndef LLDB_DISABLE_PYTHON<br>-    if ( (items & eFormatCategoryItemSynth)  == eFormatCategoryItemSynth )<br>-        success = m_synth_nav->Delete(name) || success;<br>-    if ( (items & eFormatCategoryItemRegexSynth) == eFormatCategoryItemRegexSynth )<br>-        success = m_regex_synth_nav->Delete(name) || success;<br>-#endif<br>-    return success;<br>-}<br>-<br>-uint32_t<br>-TypeCategoryImpl::GetCount (FormatCategoryItems items)<br>-{<br>-    uint32_t count = 0;<br>-    if ( (items & eFormatCategoryItemSummary) == eFormatCategoryItemSummary )<br>-        count += m_summary_nav->GetCount();<br>-    if ( (items & eFormatCategoryItemRegexSummary) == eFormatCategoryItemRegexSummary )<br>-        count += m_regex_summary_nav->GetCount();<br>-    if ( (items & eFormatCategoryItemFilter)  == eFormatCategoryItemFilter )<br>-        count += m_filter_nav->GetCount();<br>-    if ( (items & eFormatCategoryItemRegexFilter) == eFormatCategoryItemRegexFilter )<br>-        count += m_regex_filter_nav->GetCount();<br>-#ifndef LLDB_DISABLE_PYTHON<br>-    if ( (items & eFormatCategoryItemSynth)  == eFormatCategoryItemSynth )<br>-        count += m_synth_nav->GetCount();<br>-    if ( (items & eFormatCategoryItemRegexSynth) == eFormatCategoryItemRegexSynth )<br>-        count += m_regex_synth_nav->GetCount();<br>-#endif<br>-    return count;<br>-}<br>-<br>-bool<br>-TypeCategoryImpl::AnyMatches(ConstString type_name,<br>-                           FormatCategoryItems items,<br>-                           bool only_enabled,<br>-                           const char** matching_category,<br>-                           FormatCategoryItems* matching_type)<br>-{<br>-    if (!IsEnabled() && only_enabled)<br>-        return false;<br>-    <br>-    lldb::TypeSummaryImplSP summary;<br>-    TypeFilterImpl::SharedPointer filter;<br>-#ifndef LLDB_DISABLE_PYTHON<br>-    TypeSyntheticImpl::SharedPointer synth;<br>-#endif<br>-    <br>-    if ( (items & eFormatCategoryItemSummary) == eFormatCategoryItemSummary )<br>-    {<br>-        if (m_summary_nav->Get(type_name, summary))<br>-        {<br>-            if (matching_category)<br>-                *matching_category = m_name.GetCString();<br>-            if (matching_type)<br>-                *matching_type = eFormatCategoryItemSummary;<br>-            return true;<br>-        }<br>-    }<br>-    if ( (items & eFormatCategoryItemRegexSummary) == eFormatCategoryItemRegexSummary )<br>-    {<br>-        if (m_regex_summary_nav->Get(type_name, summary))<br>-        {<br>-            if (matching_category)<br>-                *matching_category = m_name.GetCString();<br>-            if (matching_type)<br>-                *matching_type = eFormatCategoryItemRegexSummary;<br>-            return true;<br>-        }<br>-    }<br>-    if ( (items & eFormatCategoryItemFilter)  == eFormatCategoryItemFilter )<br>-    {<br>-        if (m_filter_nav->Get(type_name, filter))<br>-        {<br>-            if (matching_category)<br>-                *matching_category = m_name.GetCString();<br>-            if (matching_type)<br>-                *matching_type = eFormatCategoryItemFilter;<br>-            return true;<br>-        }<br>-    }<br>-    if ( (items & eFormatCategoryItemRegexFilter) == eFormatCategoryItemRegexFilter )<br>-    {<br>-        if (m_regex_filter_nav->Get(type_name, filter))<br>-        {<br>-            if (matching_category)<br>-                *matching_category = m_name.GetCString();<br>-            if (matching_type)<br>-                *matching_type = eFormatCategoryItemRegexFilter;<br>-            return true;<br>-        }<br>-    }<br>-#ifndef LLDB_DISABLE_PYTHON<br>-    if ( (items & eFormatCategoryItemSynth)  == eFormatCategoryItemSynth )<br>-    {<br>-        if (m_synth_nav->Get(type_name, synth))<br>-        {<br>-            if (matching_category)<br>-                *matching_category = m_name.GetCString();<br>-            if (matching_type)<br>-                *matching_type = eFormatCategoryItemSynth;<br>-            return true;<br>-        }<br>-    }<br>-    if ( (items & eFormatCategoryItemRegexSynth) == eFormatCategoryItemRegexSynth )<br>-    {<br>-        if (m_regex_synth_nav->Get(type_name, synth))<br>-        {<br>-            if (matching_category)<br>-                *matching_category = m_name.GetCString();<br>-            if (matching_type)<br>-                *matching_type = eFormatCategoryItemRegexSynth;<br>-            return true;<br>-        }<br>-    }<br>-#endif<br>-    return false;<br>-}<br>-<br>-bool<br>-CategoryMap::AnyMatches (ConstString type_name,<br>-                         TypeCategoryImpl::FormatCategoryItems items,<br>-                         bool only_enabled,<br>-                         const char** matching_category,<br>-                         TypeCategoryImpl::FormatCategoryItems* matching_type)<br>-{<br>-    Mutex::Locker locker(m_map_mutex);<br>-    <br>-    MapIterator pos, end = m_map.end();<br>-    for (pos = m_map.begin(); pos != end; pos++)<br>-    {<br>-        if (pos->second->AnyMatches(type_name,<br>-                                    items,<br>-                                    only_enabled,<br>-                                    matching_category,<br>-                                    matching_type))<br>-            return true;<br>-    }<br>-    return false;<br>-}<br>-<br>-lldb::TypeSummaryImplSP<br>-CategoryMap::GetSummaryFormat (ValueObject& valobj,<br>-                               lldb::DynamicValueType use_dynamic)<br>-{<br>-    Mutex::Locker locker(m_map_mutex);<br>-    <br>-    uint32_t reason_why;        <br>-    ActiveCategoriesIterator begin, end = m_active_categories.end();<br>-    <br>-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_TYPES));<br>-    <br>-    for (begin = m_active_categories.begin(); begin != end; begin++)<br>-    {<br>-        lldb::TypeCategoryImplSP category_sp = *begin;<br>-        lldb::TypeSummaryImplSP current_format;<br>-        if (log)<br>-            log->Printf("[CategoryMap::GetSummaryFormat] Trying to use category %s\n", category_sp->GetName());<br>-        if (!category_sp->Get(valobj, current_format, use_dynamic, &reason_why))<br>-            continue;<br>-        return current_format;<br>-    }<br>-    if (log)<br>-        log->Printf("[CategoryMap::GetSummaryFormat] nothing found - returning empty SP\n");<br>-    return lldb::TypeSummaryImplSP();<br>-}<br>-<br>-lldb::TypeSummaryImplSP<br>-FormatManager::GetSummaryForType (lldb::TypeNameSpecifierImplSP type_sp)<br>-{<br>-    if (!type_sp)<br>-        return lldb::TypeSummaryImplSP();<br>-    lldb::TypeSummaryImplSP summary_chosen_sp;<br>-    uint32_t num_categories = m_categories_map.GetCount();<br>-    lldb::TypeCategoryImplSP category_sp;<br>-    uint32_t prio_category = UINT32_MAX;<br>-    for (uint32_t category_id = 0;<br>-         category_id < num_categories;<br>-         category_id++)<br>-    {<br>-        category_sp = GetCategoryAtIndex(category_id);<br>-        if (category_sp->IsEnabled() == false)<br>-            continue;<br>-        lldb::TypeSummaryImplSP summary_current_sp = category_sp->GetSummaryForType(type_sp);<br>-        if (summary_current_sp && (summary_chosen_sp.get() == NULL || (prio_category > category_sp->GetEnabledPosition())))<br>-        {<br>-            prio_category = category_sp->GetEnabledPosition();<br>-            summary_chosen_sp = summary_current_sp;<br>-        }<br>-    }<br>-    return summary_chosen_sp;<br>-}<br>-<br>-lldb::TypeFilterImplSP<br>-FormatManager::GetFilterForType (lldb::TypeNameSpecifierImplSP type_sp)<br>-{<br>-    if (!type_sp)<br>-        return lldb::TypeFilterImplSP();<br>-    lldb::TypeFilterImplSP filter_chosen_sp;<br>-    uint32_t num_categories = m_categories_map.GetCount();<br>-    lldb::TypeCategoryImplSP category_sp;<br>-    uint32_t prio_category = UINT32_MAX;<br>-    for (uint32_t category_id = 0;<br>-         category_id < num_categories;<br>-         category_id++)<br>-    {<br>-        category_sp = GetCategoryAtIndex(category_id);<br>-        if (category_sp->IsEnabled() == false)<br>-            continue;<br>-        lldb::TypeFilterImplSP filter_current_sp((TypeFilterImpl*)category_sp->GetFilterForType(type_sp).get());<br>-        if (filter_current_sp && (filter_chosen_sp.get() == NULL || (prio_category > category_sp->GetEnabledPosition())))<br>-        {<br>-            prio_category = category_sp->GetEnabledPosition();<br>-            filter_chosen_sp = filter_current_sp;<br>-        }<br>-    }<br>-    return filter_chosen_sp;<br>-}<br>-<br>-#ifndef LLDB_DISABLE_PYTHON<br>-lldb::TypeSyntheticImplSP<br>-FormatManager::GetSyntheticForType (lldb::TypeNameSpecifierImplSP type_sp)<br>-{<br>-    if (!type_sp)<br>-        return lldb::TypeSyntheticImplSP();<br>-    lldb::TypeSyntheticImplSP synth_chosen_sp;<br>-    uint32_t num_categories = m_categories_map.GetCount();<br>-    lldb::TypeCategoryImplSP category_sp;<br>-    uint32_t prio_category = UINT32_MAX;<br>-    for (uint32_t category_id = 0;<br>-         category_id < num_categories;<br>-         category_id++)<br>-    {<br>-        category_sp = GetCategoryAtIndex(category_id);<br>-        if (category_sp->IsEnabled() == false)<br>-            continue;<br>-        lldb::TypeSyntheticImplSP synth_current_sp((TypeSyntheticImpl*)category_sp->GetSyntheticForType(type_sp).get());<br>-        if (synth_current_sp && (synth_chosen_sp.get() == NULL || (prio_category > category_sp->GetEnabledPosition())))<br>-        {<br>-            prio_category = category_sp->GetEnabledPosition();<br>-            synth_chosen_sp = synth_current_sp;<br>-        }<br>-    }<br>-    return synth_chosen_sp;<br>-}<br>-#endif<br>-<br>-#ifndef LLDB_DISABLE_PYTHON<br>-lldb::SyntheticChildrenSP<br>-FormatManager::GetSyntheticChildrenForType (lldb::TypeNameSpecifierImplSP type_sp)<br>-{<br>-    if (!type_sp)<br>-        return lldb::SyntheticChildrenSP();<br>-    lldb::TypeFilterImplSP filter_sp = GetFilterForType(type_sp);<br>-    lldb::TypeSyntheticImplSP synth_sp = GetSyntheticForType(type_sp);<br>-    if (filter_sp->GetRevision() > synth_sp->GetRevision())<br>-        return lldb::SyntheticChildrenSP(filter_sp.get());<br>-    else<br>-        return lldb::SyntheticChildrenSP(synth_sp.get());<br>-}<br>-#endif<br>-<br>-#ifndef LLDB_DISABLE_PYTHON<br>-lldb::SyntheticChildrenSP<br>-CategoryMap::GetSyntheticChildren (ValueObject& valobj,<br>-                                   lldb::DynamicValueType use_dynamic)<br>-{<br>-    Mutex::Locker locker(m_map_mutex);<br>-    <br>-    uint32_t reason_why;<br>-    <br>-    ActiveCategoriesIterator begin, end = m_active_categories.end();<br>-    <br>-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_TYPES));<br>-    <br>-    for (begin = m_active_categories.begin(); begin != end; begin++)<br>-    {<br>-        lldb::TypeCategoryImplSP category_sp = *begin;<br>-        lldb::SyntheticChildrenSP current_format;<br>-        if (log)<br>-            log->Printf("[CategoryMap::GetSyntheticChildren] Trying to use category %s\n", category_sp->GetName());<br>-        if (!category_sp->Get(valobj, current_format, use_dynamic, &reason_why))<br>-            continue;<br>-        return current_format;<br>-    }<br>-    if (log)<br>-        log->Printf("[CategoryMap::GetSyntheticChildren] nothing found - returning empty SP\n");<br>-    return lldb::SyntheticChildrenSP();<br>-}<br>-#endif<br>-<br>-void<br>-CategoryMap::LoopThrough(CallbackType callback, void* param)<br>-{<br>-    if (callback)<br>-    {<br>-        Mutex::Locker locker(m_map_mutex);<br>-        <br>-        // loop through enabled categories in respective order<br>-        {<br>-            ActiveCategoriesIterator begin, end = m_active_categories.end();<br>-            for (begin = m_active_categories.begin(); begin != end; begin++)<br>-            {<br>-                lldb::TypeCategoryImplSP category = *begin;<br>-                ConstString type = ConstString(category->GetName());<br>-                if (!callback(param, category))<br>-                    break;<br>-            }<br>-        }<br>-        <br>-        // loop through disabled categories in just any order<br>-        {<br>-            MapIterator pos, end = m_map.end();<br>-            for (pos = m_map.begin(); pos != end; pos++)<br>-            {<br>-                if (pos->second->IsEnabled())<br>-                    continue;<br>-                KeyType type = pos->first;<br>-                if (!callback(param, pos->second))<br>-                    break;<br>-            }<br>-        }<br>-    }<br>-}<br>-<br>-TypeCategoryImplSP<br>-CategoryMap::GetAtIndex (size_t index)<br>-{<br>-    Mutex::Locker locker(m_map_mutex);<br>-    <br>-    if (index < m_map.size())<br>-    {<br>-        MapIterator pos, end = m_map.end();<br>-        for (pos = m_map.begin(); pos != end; pos++)<br>-        {<br>-            if (index == 0)<br>-                return pos->second;<br>-            index--;<br>-        }<br>-    }<br>-    <br>-    return TypeCategoryImplSP();<br>-}<br>-<br>-lldb::TypeCategoryImplSP<br>-FormatManager::GetCategory (const ConstString& category_name,<br>-                         bool can_create)<br>-{<br>-    if (!category_name)<br>-        return GetCategory(m_default_category_name);<br>-    lldb::TypeCategoryImplSP category;<br>-    if (m_categories_map.Get(category_name, category))<br>-        return category;<br>-    <br>-    if (!can_create)<br>-        return lldb::TypeCategoryImplSP();<br>-    <br>-    m_categories_map.Add(category_name,lldb::TypeCategoryImplSP(new TypeCategoryImpl(this, category_name)));<br>-    return GetCategory(category_name);<br>-}<br>-<br>-lldb::Format<br>-FormatManager::GetSingleItemFormat(lldb::Format vector_format)<br>-{<br>-    switch(vector_format)<br>-    {<br>-        case eFormatVectorOfChar:<br>-            return eFormatCharArray;<br>-            <br>-        case eFormatVectorOfSInt8:<br>-        case eFormatVectorOfSInt16:<br>-        case eFormatVectorOfSInt32:<br>-        case eFormatVectorOfSInt64:<br>-            return eFormatDecimal;<br>-            <br>-        case eFormatVectorOfUInt8:<br>-        case eFormatVectorOfUInt16:<br>-        case eFormatVectorOfUInt32:<br>-        case eFormatVectorOfUInt64:<br>-        case eFormatVectorOfUInt128:<br>-            return eFormatHex;<br>-            <br>-        case eFormatVectorOfFloat32:<br>-        case eFormatVectorOfFloat64:<br>-            return eFormatFloat;<br>-            <br>-        default:<br>-            return lldb::eFormatInvalid;<br>-    }<br>-}<br>-<br>-ConstString<br>-FormatManager::GetValidTypeName (const ConstString& type)<br>-{<br>-    return ::GetValidTypeName_Impl(type);<br>-}<br>-<br>-FormatManager::FormatManager() : <br>-    m_value_nav("format",this),<br>-    m_named_summaries_map(this),<br>-    m_last_revision(0),<br>-    m_categories_map(this),<br>-    m_default_category_name(ConstString("default")),<br>-    m_system_category_name(ConstString("system")), <br>-    m_gnu_cpp_category_name(ConstString("gnu-libstdc++")),<br>-    m_libcxx_category_name(ConstString("libcxx")),<br>-    m_objc_category_name(ConstString("objc")),<br>-    m_corefoundation_category_name(ConstString("CoreFoundation")),<br>-    m_coregraphics_category_name(ConstString("CoreGraphics")),<br>-    m_coreservices_category_name(ConstString("CoreServices")),<br>-    m_vectortypes_category_name(ConstString("VectorTypes")),<br>-    m_appkit_category_name(ConstString("AppKit"))<br>-{<br>-    <br>-    LoadSystemFormatters();<br>-    LoadLibStdcppFormatters();<br>-    LoadLibcxxFormatters();<br>-    LoadObjCFormatters();<br>-    <br>-    EnableCategory(m_objc_category_name,CategoryMap::Last);<br>-    EnableCategory(m_corefoundation_category_name,CategoryMap::Last);<br>-    EnableCategory(m_appkit_category_name,CategoryMap::Last);<br>-    EnableCategory(m_coreservices_category_name,CategoryMap::Last);<br>-    EnableCategory(m_coregraphics_category_name,CategoryMap::Last);<br>-    EnableCategory(m_gnu_cpp_category_name,CategoryMap::Last);<br>-    EnableCategory(m_libcxx_category_name,CategoryMap::Last);<br>-    EnableCategory(m_vectortypes_category_name,CategoryMap::Last);<br>-    EnableCategory(m_system_category_name,CategoryMap::Last);<br>-}<br>-<br>-static void<br>-AddStringSummary(TypeCategoryImpl::SharedPointer category_sp,<br>-                 const char* string,<br>-                 ConstString type_name,<br>-                 TypeSummaryImpl::Flags flags)<br>-{<br>-    lldb::TypeSummaryImplSP summary_sp(new StringSummaryFormat(flags,<br>-                                                               string));<br>-    category_sp->GetSummaryNavigator()->Add(type_name,<br>-                                            summary_sp);<br>-}<br>-<br>-#ifndef LLDB_DISABLE_PYTHON<br>-static void<br>-AddScriptSummary(TypeCategoryImpl::SharedPointer category_sp,<br>-                 const char* funct_name,<br>-                 ConstString type_name,<br>-                 TypeSummaryImpl::Flags flags)<br>-{<br>-    <br>-    std::string code("     ");<br>-    code.append(funct_name).append("(valobj,internal_dict)");<br>-    <br>-    lldb::TypeSummaryImplSP summary_sp(new ScriptSummaryFormat(flags,<br>-                                                               funct_name,<br>-                                                               code.c_str()));<br>-    category_sp->GetSummaryNavigator()->Add(type_name,<br>-                                            summary_sp);<br>-}<br>-#endif<br>-<br>-#ifndef LLDB_DISABLE_PYTHON<br>-static void<br>-AddCXXSummary (TypeCategoryImpl::SharedPointer category_sp,<br>-               CXXFunctionSummaryFormat::Callback funct,<br>-               const char* description,<br>-               ConstString type_name,<br>-               TypeSummaryImpl::Flags flags)<br>-{<br>-    lldb::TypeSummaryImplSP summary_sp(new CXXFunctionSummaryFormat(flags,funct,description));<br>-    category_sp->GetSummaryNavigator()->Add(type_name,<br>-                                            summary_sp);<br>-}<br>-#endif<br>-<br>-#ifndef LLDB_DISABLE_PYTHON<br>-static void AddCXXSynthetic  (TypeCategoryImpl::SharedPointer category_sp,<br>-                              CXXSyntheticChildren::CreateFrontEndCallback generator,<br>-                              const char* description,<br>-                              ConstString type_name,<br>-                              TypeSyntheticImpl::Flags flags)<br>-{<br>-    lldb::SyntheticChildrenSP synth_sp(new CXXSyntheticChildren(flags,description,generator));<br>-    category_sp->GetSyntheticNavigator()->Add(type_name,synth_sp);<br>-}<br>-#endif<br>-<br>-void<br>-FormatManager::LoadLibStdcppFormatters()<br>-{<br>-    TypeSummaryImpl::Flags stl_summary_flags;<br>-    stl_summary_flags.SetCascades(true)<br>-    .SetSkipPointers(false)<br>-    .SetSkipReferences(false)<br>-    .SetDontShowChildren(true)<br>-    .SetDontShowValue(true)<br>-    .SetShowMembersOneLiner(false)<br>-    .SetHideItemNames(false);<br>-    <br>-    lldb::TypeSummaryImplSP std_string_summary_sp(new StringSummaryFormat(stl_summary_flags,<br>-                                                                          "${var._M_dataplus._M_p}"));<br>-    <br>-    TypeCategoryImpl::SharedPointer gnu_category_sp = GetCategory(m_gnu_cpp_category_name);<br>-    <br>-    gnu_category_sp->GetSummaryNavigator()->Add(ConstString("std::string"),<br>-                                                std_string_summary_sp);<br>-    gnu_category_sp->GetSummaryNavigator()->Add(ConstString("std::basic_string<char>"),<br>-                                                std_string_summary_sp);<br>-    gnu_category_sp->GetSummaryNavigator()->Add(ConstString("std::basic_string<char,std::char_traits<char>,std::allocator<char> >"),<br>-                                                std_string_summary_sp);<br>-    gnu_category_sp->GetSummaryNavigator()->Add(ConstString("std::basic_string<char, std::char_traits<char>, std::allocator<char> >"),<br>-                                                std_string_summary_sp);<br>-    <br>-    // making sure we force-pick the summary for printing wstring (_M_p is a wchar_t*)<br>-    lldb::TypeSummaryImplSP std_wstring_summary_sp(new StringSummaryFormat(stl_summary_flags,<br>-                                                                           "${var._M_dataplus._M_p%S}"));<br>-    <br>-    gnu_category_sp->GetSummaryNavigator()->Add(ConstString("std::wstring"),<br>-                                                std_wstring_summary_sp);<br>-    gnu_category_sp->GetSummaryNavigator()->Add(ConstString("std::basic_string<wchar_t>"),<br>-                                                std_wstring_summary_sp);<br>-    gnu_category_sp->GetSummaryNavigator()->Add(ConstString("std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >"),<br>-                                                std_wstring_summary_sp);<br>-    gnu_category_sp->GetSummaryNavigator()->Add(ConstString("std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >"),<br>-                                                std_wstring_summary_sp);<br>-    <br>-    <br>-#ifndef LLDB_DISABLE_PYTHON<br>-    <br>-    SyntheticChildren::Flags stl_synth_flags;<br>-    stl_synth_flags.SetCascades(true).SetSkipPointers(false).SetSkipReferences(false);<br>-    <br>-    gnu_category_sp->GetRegexSyntheticNavigator()->Add(RegularExpressionSP(new RegularExpression("^std::vector<.+>(( )?&)?$")),<br>-                                                       SyntheticChildrenSP(new TypeSyntheticImpl(stl_synth_flags,<br>-                                                                                                 "lldb.formatters.cpp.gnu_libstdcpp.StdVectorSynthProvider")));<br>-    gnu_category_sp->GetRegexSyntheticNavigator()->Add(RegularExpressionSP(new RegularExpression("^std::map<.+> >(( )?&)?$")),<br>-                                                       SyntheticChildrenSP(new TypeSyntheticImpl(stl_synth_flags,<br>-                                                                                                 "lldb.formatters.cpp.gnu_libstdcpp.StdMapSynthProvider")));<br>-    gnu_category_sp->GetRegexSyntheticNavigator()->Add(RegularExpressionSP(new RegularExpression("^std::list<.+>(( )?&)?$")),<br>-                                                       SyntheticChildrenSP(new TypeSyntheticImpl(stl_synth_flags,<br>-                                                                                                 "lldb.formatters.cpp.gnu_libstdcpp.StdListSynthProvider")));<br>-    <br>-    stl_summary_flags.SetDontShowChildren(false);<br>-    gnu_category_sp->GetRegexSummaryNavigator()->Add(RegularExpressionSP(new RegularExpression("^std::vector<.+>(( )?&)?$")),<br>-                                                     TypeSummaryImplSP(new StringSummaryFormat(stl_summary_flags,<br>-                                                                                               "size=${svar%#}")));<br>-    gnu_category_sp->GetRegexSummaryNavigator()->Add(RegularExpressionSP(new RegularExpression("^std::map<.+> >(( )?&)?$")),<br>-                                                     TypeSummaryImplSP(new StringSummaryFormat(stl_summary_flags,<br>-                                                                                               "size=${svar%#}")));<br>-    gnu_category_sp->GetRegexSummaryNavigator()->Add(RegularExpressionSP(new RegularExpression("^std::list<.+>(( )?&)?$")),<br>-                                                     TypeSummaryImplSP(new StringSummaryFormat(stl_summary_flags,<br>-                                                                                               "size=${svar%#}")));<br>-#endif<br>-}<br>-<br>-void<br>-FormatManager::LoadLibcxxFormatters()<br>-{<br>-    TypeSummaryImpl::Flags stl_summary_flags;<br>-    stl_summary_flags.SetCascades(true)<br>-    .SetSkipPointers(false)<br>-    .SetSkipReferences(false)<br>-    .SetDontShowChildren(true)<br>-    .SetDontShowValue(true)<br>-    .SetShowMembersOneLiner(false)<br>-    .SetHideItemNames(false);<br>-    <br>-#ifndef LLDB_DISABLE_PYTHON<br>-    //std::string code("     lldb.formatters.cpp.libcxx.stdstring_SummaryProvider(valobj,internal_dict)");<br>-    //lldb::TypeSummaryImplSP std_string_summary_sp(new ScriptSummaryFormat(stl_summary_flags, "lldb.formatters.cpp.libcxx.stdstring_SummaryProvider",code.c_str()));<br>-    <br>-    lldb::TypeSummaryImplSP std_string_summary_sp(new CXXFunctionSummaryFormat(stl_summary_flags, lldb_private::formatters::LibcxxStringSummaryProvider, "std::string summary provider"));<br>-    lldb::TypeSummaryImplSP std_wstring_summary_sp(new CXXFunctionSummaryFormat(stl_summary_flags, lldb_private::formatters::LibcxxWStringSummaryProvider, "std::wstring summary provider"));<br>-<br>-    TypeCategoryImpl::SharedPointer libcxx_category_sp = GetCategory(m_libcxx_category_name);<br>-    <br>-    libcxx_category_sp->GetSummaryNavigator()->Add(ConstString("std::__1::string"),<br>-                                                   std_string_summary_sp);<br>-    libcxx_category_sp->GetSummaryNavigator()->Add(ConstString("std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >"),<br>-                                                   std_string_summary_sp);<br>-<br>-    libcxx_category_sp->GetSummaryNavigator()->Add(ConstString("std::__1::wstring"),<br>-                                                   std_wstring_summary_sp);<br>-    libcxx_category_sp->GetSummaryNavigator()->Add(ConstString("std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> >"),<br>-                                                   std_wstring_summary_sp);<br>-    <br>-    SyntheticChildren::Flags stl_synth_flags;<br>-    stl_synth_flags.SetCascades(true).SetSkipPointers(false).SetSkipReferences(false);<br>-    <br>-    libcxx_category_sp->GetRegexSyntheticNavigator()->Add(RegularExpressionSP(new RegularExpression("^std::__1::vector<.+>(( )?&)?$")),<br>-                                                       SyntheticChildrenSP(new TypeSyntheticImpl(stl_synth_flags,<br>-                                                                                                 "lldb.formatters.cpp.libcxx.stdvector_SynthProvider")));<br>-    libcxx_category_sp->GetRegexSyntheticNavigator()->Add(RegularExpressionSP(new RegularExpression("^std::__1::list<.+>(( )?&)?$")),<br>-                                                       SyntheticChildrenSP(new TypeSyntheticImpl(stl_synth_flags,<br>-                                                                                                 "lldb.formatters.cpp.libcxx.stdlist_SynthProvider")));<br>-    libcxx_category_sp->GetRegexSyntheticNavigator()->Add(RegularExpressionSP(new RegularExpression("^std::__1::map<.+> >(( )?&)?$")),<br>-                                                       SyntheticChildrenSP(new TypeSyntheticImpl(stl_synth_flags,<br>-                                                                                                 "lldb.formatters.cpp.libcxx.stdmap_SynthProvider")));<br>-    libcxx_category_sp->GetRegexSyntheticNavigator()->Add(RegularExpressionSP(new RegularExpression("^(std::__1::)deque<.+>(( )?&)?$")),<br>-                                                          SyntheticChildrenSP(new TypeSyntheticImpl(stl_synth_flags,<br>-                                                                                                    "lldb.formatters.cpp.libcxx.stddeque_SynthProvider")));<br>-    libcxx_category_sp->GetRegexSyntheticNavigator()->Add(RegularExpressionSP(new RegularExpression("^(std::__1::)shared_ptr<.+>(( )?&)?$")),<br>-                                                          SyntheticChildrenSP(new TypeSyntheticImpl(stl_synth_flags,<br>-                                                                                                    "lldb.formatters.cpp.libcxx.stdsharedptr_SynthProvider")));<br>-    libcxx_category_sp->GetRegexSyntheticNavigator()->Add(RegularExpressionSP(new RegularExpression("^(std::__1::)weak_ptr<.+>(( )?&)?$")),<br>-                                                          SyntheticChildrenSP(new TypeSyntheticImpl(stl_synth_flags,<br>-                                                                                                    "lldb.formatters.cpp.libcxx.stdsharedptr_SynthProvider")));<br>-    <br>-    stl_summary_flags.SetDontShowChildren(false);stl_summary_flags.SetSkipPointers(true);<br>-    libcxx_category_sp->GetRegexSummaryNavigator()->Add(RegularExpressionSP(new RegularExpression("^std::__1::vector<.+>(( )?&)?$")),<br>-                                                        TypeSummaryImplSP(new StringSummaryFormat(stl_summary_flags, "size=${svar%#}")));<br>-    libcxx_category_sp->GetRegexSummaryNavigator()->Add(RegularExpressionSP(new RegularExpression("^std::__1::list<.+>(( )?&)?$")),<br>-                                                        TypeSummaryImplSP(new StringSummaryFormat(stl_summary_flags, "size=${svar%#}")));<br>-    libcxx_category_sp->GetRegexSummaryNavigator()->Add(RegularExpressionSP(new RegularExpression("^std::__1::map<.+> >(( )?&)?$")),<br>-                                                        TypeSummaryImplSP(new StringSummaryFormat(stl_summary_flags, "size=${svar%#}")));<br>-    libcxx_category_sp->GetRegexSummaryNavigator()->Add(RegularExpressionSP(new RegularExpression("^std::__1::deque<.+>(( )?&)?$")),<br>-                                                        TypeSummaryImplSP(new StringSummaryFormat(stl_summary_flags, "size=${svar%#}")));<br>-    libcxx_category_sp->GetRegexSummaryNavigator()->Add(RegularExpressionSP(new RegularExpression("^std::__1::shared_ptr<.+>(( )?&)?$")),<br>-                                                        TypeSummaryImplSP(new StringSummaryFormat(stl_summary_flags, "{${var.__ptr_%S}} (strong=${var.count} weak=${var.weak_count})")));<br>-    libcxx_category_sp->GetRegexSummaryNavigator()->Add(RegularExpressionSP(new RegularExpression("^std::__1::weak_ptr<.+>(( )?&)?$")),<br>-                                                        TypeSummaryImplSP(new StringSummaryFormat(stl_summary_flags, "{${var.__ptr_%S}} (strong=${var.count} weak=${var.weak_count})")));<br>-    <br>-    // this summary prevails on the regex std::vector<> because we do exact matches before regex ones<br>-    libcxx_category_sp->GetSummaryNavigator()->Add(ConstString("std::__1::vector<std::__1::allocator<bool> >"),<br>-                                                   TypeSummaryImplSP(new StringSummaryFormat(stl_summary_flags, "size=${var.__size_}")));<br>-<br>-#endif<br>-}<br>-<br>-void<br>-FormatManager::LoadSystemFormatters()<br>-{<br>-    <br>-    TypeSummaryImpl::Flags string_flags;<br>-    string_flags.SetCascades(false)<br>-    .SetSkipPointers(true)<br>-    .SetSkipReferences(false)<br>-    .SetDontShowChildren(true)<br>-    .SetDontShowValue(false)<br>-    .SetShowMembersOneLiner(false)<br>-    .SetHideItemNames(false);<br>-    <br>-    lldb::TypeSummaryImplSP string_format(new StringSummaryFormat(string_flags, "${var%s}"));<br>-    <br>-    <br>-    lldb::TypeSummaryImplSP string_array_format(new StringSummaryFormat(TypeSummaryImpl::Flags().SetCascades(false)<br>-                                                                        .SetSkipPointers(true)<br>-                                                                        .SetSkipReferences(false)<br>-                                                                        .SetDontShowChildren(false)<br>-                                                                        .SetDontShowValue(true)<br>-                                                                        .SetShowMembersOneLiner(false)<br>-                                                                        .SetHideItemNames(false),<br>-                                                                        "${var%s}"));<br>-    <br>-    lldb::RegularExpressionSP any_size_char_arr(new RegularExpression("char \\[[0-9]+\\]"));<br>-    <br>-    TypeCategoryImpl::SharedPointer sys_category_sp = GetCategory(m_system_category_name);<br>-    <br>-    sys_category_sp->GetSummaryNavigator()->Add(ConstString("char *"), string_format);<br>-    sys_category_sp->GetSummaryNavigator()->Add(ConstString("const char *"), string_format);<br>-    sys_category_sp->GetRegexSummaryNavigator()->Add(any_size_char_arr, string_array_format);<br>-    <br>-    lldb::TypeSummaryImplSP ostype_summary(new StringSummaryFormat(TypeSummaryImpl::Flags().SetCascades(false)<br>-                                                                   .SetSkipPointers(true)<br>-                                                                   .SetSkipReferences(true)<br>-                                                                   .SetDontShowChildren(true)<br>-                                                                   .SetDontShowValue(false)<br>-                                                                   .SetShowMembersOneLiner(false)<br>-                                                                   .SetHideItemNames(false),<br>-                                                                   "${var%O}"));<br>-    <br>-    sys_category_sp->GetSummaryNavigator()->Add(ConstString("OSType"), ostype_summary);<br>-    <br>-#ifndef LLDB_DISABLE_PYTHON<br>-    // FIXME because of a bug in the FormatNavigator we need to add a summary for both X* and const X* (<<a href="rdar://problem/12717717">rdar://problem/12717717</a>>)<br>-    AddCXXSummary(sys_category_sp, lldb_private::formatters::Char16StringSummaryProvider, "char16_t * summary provider", ConstString("char16_t *"), string_flags);<br>-    AddCXXSummary(sys_category_sp, lldb_private::formatters::Char16StringSummaryProvider, "char16_t * summary provider", ConstString("const char16_t *"), string_flags);<br>-    <br>-    AddCXXSummary(sys_category_sp, lldb_private::formatters::Char32StringSummaryProvider, "char32_t * summary provider", ConstString("char32_t *"), string_flags);<br>-    AddCXXSummary(sys_category_sp, lldb_private::formatters::Char32StringSummaryProvider, "char32_t * summary provider", ConstString("const char32_t *"), string_flags);<br>-    <br>-    AddCXXSummary(sys_category_sp, lldb_private::formatters::WCharStringSummaryProvider, "wchar_t * summary provider", ConstString("wchar_t *"), string_flags);<br>-    AddCXXSummary(sys_category_sp, lldb_private::formatters::WCharStringSummaryProvider, "wchar_t * summary provider", ConstString("const wchar_t *"), string_flags);<br>-    <br>-    AddCXXSummary(sys_category_sp, lldb_private::formatters::Char16StringSummaryProvider, "unichar * summary provider", ConstString("unichar *"), string_flags);<br>-    AddCXXSummary(sys_category_sp, lldb_private::formatters::Char16StringSummaryProvider, "unichar * summary provider", ConstString("const unichar *"), string_flags);<br>-    <br>-    TypeSummaryImpl::Flags widechar_flags;<br>-    widechar_flags.SetDontShowValue(true)<br>-    .SetSkipPointers(true)<br>-    .SetSkipReferences(false)<br>-    .SetCascades(true)<br>-    .SetDontShowChildren(true)<br>-    .SetHideItemNames(true)<br>-    .SetShowMembersOneLiner(false);<br>-    <br>-    AddCXXSummary(sys_category_sp, lldb_private::formatters::Char16SummaryProvider, "char16_t summary provider", ConstString("char16_t"), widechar_flags);<br>-    AddCXXSummary(sys_category_sp, lldb_private::formatters::Char32SummaryProvider, "char32_t summary provider", ConstString("char32_t"), widechar_flags);<br>-    AddCXXSummary(sys_category_sp, lldb_private::formatters::WCharSummaryProvider, "wchar_t summary provider", ConstString("wchar_t"), widechar_flags);<br>-<br>-    AddCXXSummary(sys_category_sp, lldb_private::formatters::Char16SummaryProvider, "unichar summary provider", ConstString("unichar"), widechar_flags);<br>-    <br>-#endif<br>-}<br>-<br>-void<br>-FormatManager::LoadObjCFormatters()<br>-{<br>-    TypeSummaryImpl::Flags objc_flags;<br>-    objc_flags.SetCascades(false)<br>-    .SetSkipPointers(true)<br>-    .SetSkipReferences(true)<br>-    .SetDontShowChildren(true)<br>-    .SetDontShowValue(true)<br>-    .SetShowMembersOneLiner(false)<br>-    .SetHideItemNames(false);<br>-<br>-    TypeCategoryImpl::SharedPointer objc_category_sp = GetCategory(m_objc_category_name);<br>-    <br>-    lldb::TypeSummaryImplSP ObjC_BOOL_summary(new CXXFunctionSummaryFormat(objc_flags, lldb_private::formatters::ObjCBOOLSummaryProvider,""));<br>-    objc_category_sp->GetSummaryNavigator()->Add(ConstString("BOOL"),<br>-                                                 ObjC_BOOL_summary);<br>-    objc_category_sp->GetSummaryNavigator()->Add(ConstString("BOOL &"),<br>-                                                 ObjC_BOOL_summary);<br>-    objc_category_sp->GetSummaryNavigator()->Add(ConstString("BOOL *"),<br>-                                                 ObjC_BOOL_summary);<br>-<br>-#ifndef LLDB_DISABLE_PYTHON<br>-    // we need to skip pointers here since we are special casing a SEL* when retrieving its value<br>-    objc_flags.SetSkipPointers(true);<br>-    AddCXXSummary(objc_category_sp, lldb_private::formatters::ObjCSELSummaryProvider<false>, "SEL summary provider", ConstString("SEL"), objc_flags);<br>-    AddCXXSummary(objc_category_sp, lldb_private::formatters::ObjCSELSummaryProvider<false>, "SEL summary provider", ConstString("struct objc_selector"), objc_flags);<br>-    AddCXXSummary(objc_category_sp, lldb_private::formatters::ObjCSELSummaryProvider<false>, "SEL summary provider", ConstString("objc_selector"), objc_flags);<br>-    AddCXXSummary(objc_category_sp, lldb_private::formatters::ObjCSELSummaryProvider<true>, "SEL summary provider", ConstString("objc_selector *"), objc_flags);<br>-    <br>-    AddScriptSummary(objc_category_sp, "lldb.formatters.objc.Class.Class_Summary", ConstString("Class"), objc_flags);<br>-#endif // LLDB_DISABLE_PYTHON<br>-<br>-    objc_flags.SetSkipPointers(false);<br>-<br>-    TypeCategoryImpl::SharedPointer corefoundation_category_sp = GetCategory(m_corefoundation_category_name);<br>-<br>-    AddStringSummary(corefoundation_category_sp,<br>-                     "${var.years} years, ${var.months} months, ${var.days} days, ${var.hours} hours, ${var.minutes} minutes ${var.seconds} seconds",<br>-                     ConstString("CFGregorianUnits"),<br>-                     objc_flags);<br>-    AddStringSummary(corefoundation_category_sp,<br>-                     "location=${var.location} length=${var.length}",<br>-                     ConstString("CFRange"),<br>-                     objc_flags);<br>-    AddStringSummary(corefoundation_category_sp,<br>-                     "(x=${var.x}, y=${var.y})",<br>-                     ConstString("NSPoint"),<br>-                     objc_flags);<br>-    AddStringSummary(corefoundation_category_sp,<br>-                     "location=${var.location}, length=${var.length}",<br>-                     ConstString("NSRange"),<br>-                     objc_flags);<br>-    AddStringSummary(corefoundation_category_sp,<br>-                     "${var.origin}, ${var.size}",<br>-                     ConstString("NSRect"),<br>-                     objc_flags);<br>-    AddStringSummary(corefoundation_category_sp,<br>-                     "(${var.origin}, ${var.size}), ...",<br>-                     ConstString("NSRectArray"),<br>-                     objc_flags);<br>-    AddStringSummary(objc_category_sp,<br>-                     "(width=${var.width}, height=${var.height})",<br>-                     ConstString("NSSize"),<br>-                     objc_flags);<br>-    <br>-    TypeCategoryImpl::SharedPointer coregraphics_category_sp = GetCategory(m_coregraphics_category_name);<br>-    <br>-    AddStringSummary(coregraphics_category_sp,<br>-                     "(width=${var.width}, height=${var.height})",<br>-                     ConstString("CGSize"),<br>-                     objc_flags);<br>-    AddStringSummary(coregraphics_category_sp,<br>-                     "(x=${var.x}, y=${var.y})",<br>-                     ConstString("CGPoint"),<br>-                     objc_flags);<br>-    AddStringSummary(coregraphics_category_sp,<br>-                     "origin=${var.origin} size=${var.size}",<br>-                     ConstString("CGRect"),<br>-                     objc_flags);<br>-    <br>-    TypeCategoryImpl::SharedPointer coreservices_category_sp = GetCategory(m_coreservices_category_name);<br>-    <br>-    AddStringSummary(coreservices_category_sp,<br>-                     "red=${var.red} green=${var.green} blue=${var.blue}",<br>-                     ConstString("RGBColor"),<br>-                     objc_flags);<br>-    AddStringSummary(coreservices_category_sp,<br>-                     "(t=${var.top}, l=${var.left}, b=${var.bottom}, r=${var.right})",<br>-                     ConstString("Rect"),<br>-                     objc_flags);<br>-    AddStringSummary(coreservices_category_sp,<br>-                     "(v=${var.v}, h=${var.h})",<br>-                     ConstString("Point"),<br>-                     objc_flags);<br>-    AddStringSummary(coreservices_category_sp,<br>-                     "${var.month}/${var.day}/${var.year}  ${var.hour} :${var.minute} :${var.second} dayOfWeek:${var.dayOfWeek}",<br>-                     ConstString("DateTimeRect *"),<br>-                     objc_flags);<br>-    AddStringSummary(coreservices_category_sp,<br>-                     "${var.ld.month}/${var.ld.day}/${var.ld.year} ${var.ld.hour} :${var.ld.minute} :${var.ld.second} dayOfWeek:${var.ld.dayOfWeek}",<br>-                     ConstString("LongDateRect"),<br>-                     objc_flags);<br>-    AddStringSummary(coreservices_category_sp,<br>-                     "(x=${var.x}, y=${var.y})",<br>-                     ConstString("HIPoint"),<br>-                     objc_flags);<br>-    AddStringSummary(coreservices_category_sp,<br>-                     "origin=${var.origin} size=${var.size}",<br>-                     ConstString("HIRect"),<br>-                     objc_flags);<br>-    <br>-    TypeCategoryImpl::SharedPointer appkit_category_sp = GetCategory(m_appkit_category_name);<br>-    <br>-    TypeSummaryImpl::Flags appkit_flags;<br>-    appkit_flags.SetCascades(true)<br>-    .SetSkipPointers(false)<br>-    .SetSkipReferences(false)<br>-    .SetDontShowChildren(true)<br>-    .SetDontShowValue(false)<br>-    .SetShowMembersOneLiner(false)<br>-    .SetHideItemNames(false);<br>-<br>-    appkit_flags.SetDontShowChildren(false);<br>-    <br>-<br>-#ifndef LLDB_DISABLE_PYTHON<br>-    AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSArraySummaryProvider, "NSArray summary provider", ConstString("NSArray"), appkit_flags);<br>-    AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSArraySummaryProvider, "NSArray summary provider", ConstString("NSMutableArray"), appkit_flags);<br>-    AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSArraySummaryProvider, "NSArray summary provider", ConstString("__NSArrayI"), appkit_flags);<br>-    AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSArraySummaryProvider, "NSArray summary provider", ConstString("__NSArrayM"), appkit_flags);<br>-    AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSArraySummaryProvider, "NSArray summary provider", ConstString("__NSCFArray"), appkit_flags);<br>-    AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSArraySummaryProvider, "NSArray summary provider", ConstString("CFArrayRef"), appkit_flags);<br>-    AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSArraySummaryProvider, "NSArray summary provider", ConstString("CFMutableArrayRef"), appkit_flags);<br>-<br>-    AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSDictionarySummaryProvider<false>, "NSDictionary summary provider", ConstString("NSDictionary"), appkit_flags);<br>-    AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSDictionarySummaryProvider<false>, "NSDictionary summary provider", ConstString("NSMutableDictionary"), appkit_flags);<br>-    AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSDictionarySummaryProvider<false>, "NSDictionary summary provider", ConstString("__NSCFDictionary"), appkit_flags);<br>-    AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSDictionarySummaryProvider<false>, "NSDictionary summary provider", ConstString("__NSDictionaryI"), appkit_flags);<br>-    AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSDictionarySummaryProvider<false>, "NSDictionary summary provider", ConstString("__NSDictionaryM"), appkit_flags);<br>-    AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSDictionarySummaryProvider<true>, "NSDictionary summary provider", ConstString("CFDictionaryRef"), appkit_flags);<br>-    AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSDictionarySummaryProvider<true>, "NSDictionary summary provider", ConstString("CFMutableDictionaryRef"), appkit_flags);<br>-    <br>-    // AddSummary(appkit_category_sp, "${var.key%@} -> ${var.value%@}", ConstString("$_lldb_typegen_nspair"), appkit_flags);<br>-    <br>-    appkit_flags.SetDontShowChildren(true);<br>-    <br>-    AddCXXSynthetic(appkit_category_sp, lldb_private::formatters::NSArraySyntheticFrontEndCreator, "NSArray synthetic children", ConstString("__NSArrayM"), TypeSyntheticImpl::Flags());<br>-    AddCXXSynthetic(appkit_category_sp, lldb_private::formatters::NSArraySyntheticFrontEndCreator, "NSArray synthetic children", ConstString("__NSArrayI"), TypeSyntheticImpl::Flags());<br>-    AddCXXSynthetic(appkit_category_sp, lldb_private::formatters::NSArraySyntheticFrontEndCreator, "NSArray synthetic children", ConstString("NSArray"), TypeSyntheticImpl::Flags());<br>-    AddCXXSynthetic(appkit_category_sp, lldb_private::formatters::NSArraySyntheticFrontEndCreator, "NSArray synthetic children", ConstString("NSMutableArray"), TypeSyntheticImpl::Flags());<br>-    AddCXXSynthetic(appkit_category_sp, lldb_private::formatters::NSArraySyntheticFrontEndCreator, "NSArray synthetic children", ConstString("__NSCFArray"), TypeSyntheticImpl::Flags());<br>-<br>-    AddCXXSynthetic(appkit_category_sp, lldb_private::formatters::NSDictionarySyntheticFrontEndCreator, "NSDictionary synthetic children", ConstString("__NSDictionaryM"), TypeSyntheticImpl::Flags());<br>-    AddCXXSynthetic(appkit_category_sp, lldb_private::formatters::NSDictionarySyntheticFrontEndCreator, "NSDictionary synthetic children", ConstString("__NSDictionaryI"), TypeSyntheticImpl::Flags());<br>-    AddCXXSynthetic(appkit_category_sp, lldb_private::formatters::NSDictionarySyntheticFrontEndCreator, "NSDictionary synthetic children", ConstString("NSDictionary"), TypeSyntheticImpl::Flags());<br>-    AddCXXSynthetic(appkit_category_sp, lldb_private::formatters::NSDictionarySyntheticFrontEndCreator, "NSDictionary synthetic children", ConstString("NSMutableDictionary"), TypeSyntheticImpl::Flags());<br>-    AddCXXSynthetic(appkit_category_sp, lldb_private::formatters::NSDictionarySyntheticFrontEndCreator, "NSDictionary synthetic children", ConstString("CFDictionaryRef"), TypeSyntheticImpl::Flags());<br>-    AddCXXSynthetic(appkit_category_sp, lldb_private::formatters::NSDictionarySyntheticFrontEndCreator, "NSDictionary synthetic children", ConstString("CFMutableDictionaryRef"), TypeSyntheticImpl::Flags());<br>-<br>-    AddScriptSummary(appkit_category_sp, "lldb.formatters.objc.CFBag.CFBag_SummaryProvider", ConstString("CFBagRef"), appkit_flags);<br>-    AddScriptSummary(appkit_category_sp, "lldb.formatters.objc.CFBag.CFBag_SummaryProvider", ConstString("__CFBag"), appkit_flags);<br>-    AddScriptSummary(appkit_category_sp, "lldb.formatters.objc.CFBag.CFBag_SummaryProvider", ConstString("const struct __CFBag"), appkit_flags);<br>-    AddScriptSummary(appkit_category_sp, "lldb.formatters.objc.CFBag.CFBag_SummaryProvider", ConstString("CFMutableBagRef"), appkit_flags);<br>-    <br>-    AddScriptSummary(appkit_category_sp, "lldb.formatters.objc.CFBinaryHeap.CFBinaryHeap_SummaryProvider", ConstString("CFBinaryHeapRef"), appkit_flags);<br>-    AddScriptSummary(appkit_category_sp, "lldb.formatters.objc.CFBinaryHeap.CFBinaryHeap_SummaryProvider", ConstString("__CFBinaryHeap"), appkit_flags);<br>-<br>-    AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSStringSummaryProvider, "NSString summary provider", ConstString("NSString"), appkit_flags);<br>-    AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSStringSummaryProvider, "NSString summary provider", ConstString("CFStringRef"), appkit_flags);<br>-    AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSStringSummaryProvider, "NSString summary provider", ConstString("CFMutableStringRef"), appkit_flags);<br>-    AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSStringSummaryProvider, "NSString summary provider", ConstString("__NSCFConstantString"), appkit_flags);<br>-    AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSStringSummaryProvider, "NSString summary provider", ConstString("__NSCFString"), appkit_flags);<br>-    AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSStringSummaryProvider, "NSString summary provider", ConstString("NSCFConstantString"), appkit_flags);<br>-    AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSStringSummaryProvider, "NSString summary provider", ConstString("NSCFString"), appkit_flags);<br>-    AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSStringSummaryProvider, "NSString summary provider", ConstString("NSPathStore2"), appkit_flags);<br>-    <br>-    AddScriptSummary(appkit_category_sp, "lldb.formatters.objc.CFString.CFAttributedString_SummaryProvider", ConstString("NSAttributedString"), appkit_flags);<br>-    <br>-    AddScriptSummary(appkit_category_sp, "lldb.formatters.objc.NSBundle.NSBundle_SummaryProvider", ConstString("NSBundle"), appkit_flags);<br>-<br>-    AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSDataSummaryProvider<false>, "NSData summary provider", ConstString("NSData"), appkit_flags);<br>-    AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSDataSummaryProvider<false>, "NSData summary provider", ConstString("NSConcreteData"), appkit_flags);<br>-    AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSDataSummaryProvider<false>, "NSData summary provider", ConstString("NSConcreteMutableData"), appkit_flags);<br>-    AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSDataSummaryProvider<false>, "NSData summary provider", ConstString("__NSCFData"), appkit_flags);<br>-    AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSDataSummaryProvider<true>, "NSData summary provider", ConstString("CFDataRef"), appkit_flags);<br>-    AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSDataSummaryProvider<true>, "NSData summary provider", ConstString("CFMutableDataRef"), appkit_flags);<br>-<br>-    AddScriptSummary(appkit_category_sp, "lldb.formatters.objc.NSException.NSException_SummaryProvider", ConstString("NSException"), appkit_flags);<br>-<br>-    AddScriptSummary(appkit_category_sp, "lldb.formatters.objc.NSMachPort.NSMachPort_SummaryProvider", ConstString("NSMachPort"), appkit_flags);<br>-    <br>-    AddScriptSummary(appkit_category_sp, "lldb.formatters.objc.NSNotification.NSNotification_SummaryProvider", ConstString("NSNotification"), appkit_flags);<br>-    AddScriptSummary(appkit_category_sp, "lldb.formatters.objc.NSNotification.NSNotification_SummaryProvider", ConstString("NSConcreteNotification"), appkit_flags);<br>-<br>-    AddStringSummary(appkit_category_sp, "domain: ${var._domain} - code: ${var._code}", ConstString("NSError"), appkit_flags);<br>-    <br>-    AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSNumberSummaryProvider, "NSNumber summary provider", ConstString("NSNumber"), appkit_flags);<br>-    AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSNumberSummaryProvider, "NSNumber summary provider", ConstString("__NSCFBoolean"), appkit_flags);<br>-    AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSNumberSummaryProvider, "NSNumber summary provider", ConstString("__NSCFNumber"), appkit_flags);<br>-    AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSNumberSummaryProvider, "NSNumber summary provider", ConstString("NSCFBoolean"), appkit_flags);<br>-    AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSNumberSummaryProvider, "NSNumber summary provider", ConstString("NSCFNumber"), appkit_flags);<br>-    <br>-    AddCXXSummary(appkit_category_sp, lldb_private::formatters::RuntimeSpecificDescriptionSummaryProvider, "NSDecimalNumber summary provider", ConstString("NSDecimalNumber"), appkit_flags);<br>-    AddCXXSummary(appkit_category_sp, lldb_private::formatters::RuntimeSpecificDescriptionSummaryProvider, "NSHost summary provider", ConstString("NSHost"), appkit_flags);<br>-    AddCXXSummary(appkit_category_sp, lldb_private::formatters::RuntimeSpecificDescriptionSummaryProvider, "NSTask summary provider", ConstString("NSTask"), appkit_flags);<br>-    AddCXXSummary(appkit_category_sp, lldb_private::formatters::RuntimeSpecificDescriptionSummaryProvider, "NSValue summary provider", ConstString("NSValue"), appkit_flags);<br>-<br>-    AddScriptSummary(appkit_category_sp, "lldb.formatters.objc.NSSet.NSSet_SummaryProvider", ConstString("NSSet"), appkit_flags);<br>-    AddScriptSummary(appkit_category_sp, "lldb.formatters.objc.NSSet.NSSet_SummaryProvider2", ConstString("CFSetRef"), appkit_flags);<br>-    AddScriptSummary(appkit_category_sp, "lldb.formatters.objc.NSSet.NSSet_SummaryProvider2", ConstString("CFMutableSetRef"), appkit_flags);<br>-    AddScriptSummary(appkit_category_sp, "lldb.formatters.objc.NSSet.NSSet_SummaryProvider", ConstString("__NSCFSet"), appkit_flags);<br>-    AddScriptSummary(appkit_category_sp, "lldb.formatters.objc.NSSet.NSSet_SummaryProvider", ConstString("__NSSetI"), appkit_flags);<br>-    AddScriptSummary(appkit_category_sp, "lldb.formatters.objc.NSSet.NSSet_SummaryProvider", ConstString("__NSSetM"), appkit_flags);<br>-    AddScriptSummary(appkit_category_sp, "lldb.formatters.objc.NSSet.NSSet_SummaryProvider", ConstString("NSCountedSet"), appkit_flags);<br>-<br>-    AddScriptSummary(appkit_category_sp, "lldb.formatters.objc.NSURL.NSURL_SummaryProvider", ConstString("NSURL"), appkit_flags);<br>-    AddScriptSummary(appkit_category_sp, "lldb.formatters.objc.NSURL.NSURL_SummaryProvider", ConstString("CFURLRef"), appkit_flags);<br>-    <br>-    AddScriptSummary(appkit_category_sp, "lldb.formatters.objc.NSDate.NSDate_SummaryProvider", ConstString("NSDate"), appkit_flags);<br>-    AddScriptSummary(appkit_category_sp, "lldb.formatters.objc.NSDate.NSDate_SummaryProvider", ConstString("__NSDate"), appkit_flags);<br>-    AddScriptSummary(appkit_category_sp, "lldb.formatters.objc.NSDate.NSDate_SummaryProvider", ConstString("__NSTaggedDate"), appkit_flags);<br>-    AddScriptSummary(appkit_category_sp, "lldb.formatters.objc.NSDate.NSDate_SummaryProvider", ConstString("NSCalendarDate"), appkit_flags);<br>-<br>-    AddScriptSummary(appkit_category_sp, "lldb.formatters.objc.NSDate.NSTimeZone_SummaryProvider", ConstString("NSTimeZone"), appkit_flags);<br>-    AddScriptSummary(appkit_category_sp, "lldb.formatters.objc.NSDate.NSTimeZone_SummaryProvider", ConstString("CFTimeZoneRef"), appkit_flags);<br>-    AddScriptSummary(appkit_category_sp, "lldb.formatters.objc.NSDate.NSTimeZone_SummaryProvider", ConstString("__NSTimeZone"), appkit_flags);<br>-<br>-    // CFAbsoluteTime is actually a double rather than a pointer to an object<br>-    // we do not care about the numeric value, since it is probably meaningless to users<br>-    appkit_flags.SetDontShowValue(true);<br>-    AddScriptSummary(appkit_category_sp, "lldb.formatters.objc.NSDate.CFAbsoluteTime_SummaryProvider", ConstString("CFAbsoluteTime"), appkit_flags);<br>-    appkit_flags.SetDontShowValue(false);<br>-    <br>-    AddScriptSummary(appkit_category_sp, "lldb.formatters.objc.NSIndexSet.NSIndexSet_SummaryProvider", ConstString("NSIndexSet"), appkit_flags);<br>-    AddScriptSummary(appkit_category_sp, "lldb.formatters.objc.NSIndexSet.NSIndexSet_SummaryProvider", ConstString("NSMutableIndexSet"), appkit_flags);<br>-<br>-    AddStringSummary(appkit_category_sp,<br>-                     "@\"${var.month%d}/${var.day%d}/${var.year%d} ${var.hour%d}:${var.minute%d}:${var.second}\"",<br>-                     ConstString("CFGregorianDate"),<br>-                     appkit_flags);<br>-    <br>-    AddScriptSummary(appkit_category_sp, "lldb.formatters.objc.CFBitVector.CFBitVector_SummaryProvider", ConstString("CFBitVectorRef"), appkit_flags);<br>-    AddScriptSummary(appkit_category_sp, "lldb.formatters.objc.CFBitVector.CFBitVector_SummaryProvider", ConstString("CFMutableBitVectorRef"), appkit_flags);<br>-    AddScriptSummary(appkit_category_sp, "lldb.formatters.objc.CFBitVector.CFBitVector_SummaryProvider", ConstString("__CFBitVector"), appkit_flags);<br>-    AddScriptSummary(appkit_category_sp, "lldb.formatters.objc.CFBitVector.CFBitVector_SummaryProvider", ConstString("__CFMutableBitVector"), appkit_flags);<br>-#endif // LLDB_DISABLE_PYTHON<br>-    <br>-    TypeCategoryImpl::SharedPointer vectors_category_sp = GetCategory(m_vectortypes_category_name);<br>-<br>-    TypeSummaryImpl::Flags vector_flags;<br>-    vector_flags.SetCascades(true)<br>-    .SetSkipPointers(true)<br>-    .SetSkipReferences(false)<br>-    .SetDontShowChildren(true)<br>-    .SetDontShowValue(false)<br>-    .SetShowMembersOneLiner(true)<br>-    .SetHideItemNames(true);<br>-    <br>-    AddStringSummary(vectors_category_sp,<br>-                     "${var.uint128}",<br>-                     ConstString("builtin_type_vec128"),<br>-                     objc_flags);<br>-<br>-    AddStringSummary(vectors_category_sp,<br>-                     "",<br>-                     ConstString("float [4]"),<br>-                     vector_flags);<br>-    AddStringSummary(vectors_category_sp,<br>-                     "",<br>-                     ConstString("int32_t [4]"),<br>-                     vector_flags);<br>-    AddStringSummary(vectors_category_sp,<br>-                     "",<br>-                     ConstString("int16_t [8]"),<br>-                     vector_flags);<br>-    AddStringSummary(vectors_category_sp,<br>-                     "",<br>-                     ConstString("vDouble"),<br>-                     vector_flags);<br>-    AddStringSummary(vectors_category_sp,<br>-                     "",<br>-                     ConstString("vFloat"),<br>-                     vector_flags);<br>-    AddStringSummary(vectors_category_sp,<br>-                     "",<br>-                     ConstString("vSInt8"),<br>-                     vector_flags);<br>-    AddStringSummary(vectors_category_sp,<br>-                     "",<br>-                     ConstString("vSInt16"),<br>-                     vector_flags);<br>-    AddStringSummary(vectors_category_sp,<br>-                     "",<br>-                     ConstString("vSInt32"),<br>-                     vector_flags);<br>-    AddStringSummary(vectors_category_sp,<br>-                     "",<br>-                     ConstString("vUInt16"),<br>-                     vector_flags);<br>-    AddStringSummary(vectors_category_sp,<br>-                     "",<br>-                     ConstString("vUInt8"),<br>-                     vector_flags);<br>-    AddStringSummary(vectors_category_sp,<br>-                     "",<br>-                     ConstString("vUInt16"),<br>-                     vector_flags);<br>-    AddStringSummary(vectors_category_sp,<br>-                     "",<br>-                     ConstString("vUInt32"),<br>-                     vector_flags);<br>-    AddStringSummary(vectors_category_sp,<br>-                     "",<br>-                     ConstString("vBool32"),<br>-                     vector_flags);<br>-}<br><br>Modified: lldb/trunk/source/Core/Timer.cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Timer.cpp?rev=173728&r1=173727&r2=173728&view=diff">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Timer.cpp?rev=173728&r1=173727&r2=173728&view=diff</a><br>==============================================================================<br>--- lldb/trunk/source/Core/Timer.cpp (original)<br>+++ lldb/trunk/source/Core/Timer.cpp Mon Jan 28 17:47:25 2013<br>@@ -25,7 +25,7 @@ uint32_t Timer::g_depth = 0;<br> uint32_t Timer::g_display_depth = 0;<br> FILE * Timer::g_file = NULL;<br> typedef std::vector<Timer *> TimerStack;<br>-typedef std::map<const char *, uint64_t> CategoryMap;<br>+typedef std::map<const char *, uint64_t> TimerCategoryMap;<br> static pthread_key_t g_key;<br><br> static Mutex &<br>@@ -35,10 +35,10 @@ GetCategoryMutex()<br>     return g_category_mutex;<br> }<br><br>-static CategoryMap &<br>+static TimerCategoryMap &<br> GetCategoryMap()<br> {<br>-    static CategoryMap g_category_map;<br>+    static TimerCategoryMap g_category_map;<br>     return g_category_map;<br> }<br><br>@@ -153,7 +153,7 @@ Timer::~Timer()<br><br>         // Keep total results for each category so we can dump results.<br>         Mutex::Locker locker (GetCategoryMutex());<br>-        CategoryMap &category_map = GetCategoryMap();<br>+        TimerCategoryMap &category_map = GetCategoryMap();<br>         category_map[m_category] += timer_nsec_uint;<br>     }<br>     if (g_depth > 0)<br>@@ -214,7 +214,7 @@ Timer::SetDisplayDepth (uint32_t depth)<br>  * - returns whether a person is less than another person<br>  */<br> static bool<br>-CategoryMapIteratorSortCriterion (const CategoryMap::const_iterator& lhs, const CategoryMap::const_iterator& rhs)<br>+CategoryMapIteratorSortCriterion (const TimerCategoryMap::const_iterator& lhs, const TimerCategoryMap::const_iterator& rhs)<br> {<br>     return lhs->second > rhs->second;<br> }<br>@@ -224,7 +224,7 @@ void<br> Timer::ResetCategoryTimes ()<br> {<br>     Mutex::Locker locker (GetCategoryMutex());<br>-    CategoryMap &category_map = GetCategoryMap();<br>+    TimerCategoryMap &category_map = GetCategoryMap();<br>     category_map.clear();<br> }<br><br>@@ -232,9 +232,9 @@ void<br> Timer::DumpCategoryTimes (Stream *s)<br> {<br>     Mutex::Locker locker (GetCategoryMutex());<br>-    CategoryMap &category_map = GetCategoryMap();<br>-    std::vector<CategoryMap::const_iterator> sorted_iterators;<br>-    CategoryMap::const_iterator pos, end = category_map.end();<br>+    TimerCategoryMap &category_map = GetCategoryMap();<br>+    std::vector<TimerCategoryMap::const_iterator> sorted_iterators;<br>+    TimerCategoryMap::const_iterator pos, end = category_map.end();<br>     for (pos = category_map.begin(); pos != end; ++pos)<br>     {<br>         sorted_iterators.push_back (pos);<br><br>Modified: lldb/trunk/source/Core/ValueObject.cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObject.cpp?rev=173728&r1=173727&r2=173728&view=diff">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObject.cpp?rev=173728&r1=173727&r2=173728&view=diff</a><br>==============================================================================<br>--- lldb/trunk/source/Core/ValueObject.cpp (original)<br>+++ lldb/trunk/source/Core/ValueObject.cpp Mon Jan 28 17:47:25 2013<br>@@ -21,7 +21,6 @@<br><br> // Project includes<br> #include "lldb/Core/DataBufferHeap.h"<br>-#include "lldb/Core/DataVisualization.h"<br> #include "lldb/Core/Debugger.h"<br> #include "lldb/Core/Log.h"<br> #include "lldb/Core/Module.h"<br>@@ -34,6 +33,8 @@<br> #include "lldb/Core/ValueObjectMemory.h"<br> #include "lldb/Core/ValueObjectSyntheticFilter.h"<br><br>+#include "lldb/DataFormatters/DataVisualization.h"<br>+<br> #include "lldb/Host/Endian.h"<br><br> #include "lldb/Interpreter/CommandInterpreter.h"<br>@@ -83,7 +84,6 @@ ValueObject::ValueObject (ValueObject &p<br>     m_deref_valobj(NULL),<br>     m_format (eFormatDefault),<br>     m_last_format_mgr_revision(0),<br>-    m_last_format_mgr_dynamic(parent.m_last_format_mgr_dynamic),<br>     m_type_summary_sp(),<br>     m_type_format_sp(),<br>     m_synthetic_children_sp(),<br>@@ -129,7 +129,6 @@ ValueObject::ValueObject (ExecutionConte<br>     m_deref_valobj(NULL),<br>     m_format (eFormatDefault),<br>     m_last_format_mgr_revision(0),<br>-    m_last_format_mgr_dynamic(eNoDynamicValues),<br>     m_type_summary_sp(),<br>     m_type_format_sp(),<br>     m_synthetic_children_sp(),<br>@@ -161,17 +160,11 @@ ValueObject::~ValueObject ()<br> bool<br> ValueObject::UpdateValueIfNeeded (bool update_format)<br> {<br>-    return UpdateValueIfNeeded(m_last_format_mgr_dynamic, update_format);<br>-}<br>-<br>-bool<br>-ValueObject::UpdateValueIfNeeded (DynamicValueType use_dynamic, bool update_format)<br>-{<br><br>     bool did_change_formats = false;<br><br>     if (update_format)<br>-        did_change_formats = UpdateFormatsIfNeeded(use_dynamic);<br>+        did_change_formats = UpdateFormatsIfNeeded();<br><br>     // If this is a constant value, then our success is predicated on whether<br>     // we have an error or not<br>@@ -238,7 +231,7 @@ ValueObject::UpdateValueIfNeeded (Dynami<br> }<br><br> bool<br>-ValueObject::UpdateFormatsIfNeeded(DynamicValueType use_dynamic)<br>+ValueObject::UpdateFormatsIfNeeded()<br> {<br>     LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_TYPES));<br>     if (log)<br>@@ -250,17 +243,15 @@ ValueObject::UpdateFormatsIfNeeded(Dynam<br><br>     bool any_change = false;<br><br>-    if ( (m_last_format_mgr_revision != DataVisualization::GetCurrentRevision()) ||<br>-          m_last_format_mgr_dynamic != use_dynamic)<br>+    if ( (m_last_format_mgr_revision != DataVisualization::GetCurrentRevision()))<br>     {<br>         SetValueFormat(DataVisualization::ValueFormats::GetFormat (*this, eNoDynamicValues));<br>-        SetSummaryFormat(DataVisualization::GetSummaryFormat (*this, use_dynamic));<br>+        SetSummaryFormat(DataVisualization::GetSummaryFormat (*this, GetDynamicValueType()));<br> #ifndef LLDB_DISABLE_PYTHON<br>-        SetSyntheticChildren(DataVisualization::GetSyntheticChildren (*this, use_dynamic));<br>+        SetSyntheticChildren(DataVisualization::GetSyntheticChildren (*this, GetDynamicValueType()));<br> #endif<br><br>         m_last_format_mgr_revision = DataVisualization::GetCurrentRevision();<br>-        m_last_format_mgr_dynamic = use_dynamic;<br><br>         any_change = true;<br>     }<br>@@ -2033,42 +2024,6 @@ ValueObject::GetSyntheticBitFieldChild (<br> }<br><br> ValueObjectSP<br>-ValueObject::GetSyntheticArrayRangeChild (uint32_t from, uint32_t to, bool can_create)<br>-{<br>-    ValueObjectSP synthetic_child_sp;<br>-    if (IsArrayType () || IsPointerType ())<br>-    {<br>-        char index_str[64];<br>-        snprintf(index_str, sizeof(index_str), "[%i-%i]", from, to);<br>-        ConstString index_const_str(index_str);<br>-        // Check if we have already created a synthetic array member in this<br>-        // valid object. If we have we will re-use it.<br>-        synthetic_child_sp = GetSyntheticChild (index_const_str);<br>-        if (!synthetic_child_sp)<br>-        {<br>-            ValueObjectSynthetic *synthetic_child;<br>-            <br>-            // We haven't made a synthetic array member for INDEX yet, so<br>-            // lets make one and cache it for any future reference.<br>-            SyntheticArrayView *view = new SyntheticArrayView(SyntheticChildren::Flags());<br>-            view->AddRange(from,to);<br>-            SyntheticChildrenSP view_sp(view);<br>-            synthetic_child = new ValueObjectSynthetic(*this, view_sp);<br>-            <br>-            // Cache the value if we got one back...<br>-            if (synthetic_child)<br>-            {<br>-                AddSyntheticChild(index_const_str, synthetic_child);<br>-                synthetic_child_sp = synthetic_child->GetSP();<br>-                synthetic_child_sp->SetName(ConstString(index_str));<br>-                synthetic_child_sp->m_is_bitfield_for_scalar = true;<br>-            }<br>-        }<br>-    }<br>-    return synthetic_child_sp;<br>-}<br>-<br>-ValueObjectSP<br> ValueObject::GetSyntheticChildAtOffset(uint32_t offset, const ClangASTType& type, bool can_create)<br> {<br><br>@@ -2168,7 +2123,7 @@ ValueObject::CalculateSyntheticValue (bo<br><br>     lldb::SyntheticChildrenSP current_synth_sp(m_synthetic_children_sp);<br><br>-    if (!UpdateFormatsIfNeeded(m_last_format_mgr_dynamic) && m_synthetic_value)<br>+    if (!UpdateFormatsIfNeeded() && m_synthetic_value)<br>         return;<br><br>     if (m_synthetic_children_sp.get() == NULL)<br>@@ -2243,7 +2198,7 @@ ValueObject::GetSyntheticValue (bool use<br> bool<br> ValueObject::HasSyntheticValue()<br> {<br>-    UpdateFormatsIfNeeded(m_last_format_mgr_dynamic);<br>+    UpdateFormatsIfNeeded();<br><br>     if (m_synthetic_children_sp.get() == NULL)<br>         return false;<br>@@ -3285,7 +3240,7 @@ DumpValueObject_Impl (Stream &s,<br> {<br>     if (valobj)<br>     {<br>-        bool update_success = valobj->UpdateValueIfNeeded (options.m_use_dynamic, true);<br>+        bool update_success = valobj->UpdateValueIfNeeded (true);<br><br>         const char *root_valobj_name = <br>             options.m_root_valobj_name.empty() ? <br><br>Modified: lldb/trunk/source/Core/ValueObjectDynamicValue.cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObjectDynamicValue.cpp?rev=173728&r1=173727&r2=173728&view=diff">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObjectDynamicValue.cpp?rev=173728&r1=173727&r2=173728&view=diff</a><br>==============================================================================<br>--- lldb/trunk/source/Core/ValueObjectDynamicValue.cpp (original)<br>+++ lldb/trunk/source/Core/ValueObjectDynamicValue.cpp Mon Jan 28 17:47:25 2013<br>@@ -41,7 +41,6 @@ ValueObjectDynamicValue::ValueObjectDyna<br>     m_dynamic_type_info(),<br>     m_use_dynamic (use_dynamic)<br> {<br>-    m_last_format_mgr_dynamic = use_dynamic;<br>     SetName (parent.GetName());<br> }<br><br><br>Modified: lldb/trunk/source/Core/ValueObjectSyntheticFilter.cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObjectSyntheticFilter.cpp?rev=173728&r1=173727&r2=173728&view=diff">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObjectSyntheticFilter.cpp?rev=173728&r1=173727&r2=173728&view=diff</a><br>==============================================================================<br>--- lldb/trunk/source/Core/ValueObjectSyntheticFilter.cpp (original)<br>+++ lldb/trunk/source/Core/ValueObjectSyntheticFilter.cpp Mon Jan 28 17:47:25 2013<br>@@ -15,8 +15,8 @@<br> // C++ Includes<br> // Other libraries and framework includes<br> // Project includes<br>-#include "lldb/Core/FormatClasses.h"<br> #include "lldb/Core/ValueObject.h"<br>+#include "lldb/DataFormatters/FormatClasses.h"<br><br> using namespace lldb_private;<br><br>@@ -39,7 +39,7 @@ public:<br>         return lldb::ValueObjectSP();<br>     }<br><br>-    uint32_t<br>+    size_t<br>     GetIndexOfChildWithName (const ConstString &name)<br>     {<br>         return UINT32_MAX;<br>@@ -95,6 +95,12 @@ ValueObjectSynthetic::GetTypeName()<br>     return m_parent->GetTypeName();<br> }<br><br>+ConstString<br>+ValueObjectSynthetic::GetQualifiedTypeName()<br>+{<br>+    return m_parent->GetQualifiedTypeName();<br>+}<br>+<br> size_t<br> ValueObjectSynthetic::CalculateNumChildren()<br> {<br>@@ -104,6 +110,16 @@ ValueObjectSynthetic::CalculateNumChildr<br>     return (m_synthetic_children_count = m_synth_filter_ap->CalculateNumChildren());<br> }<br><br>+lldb::ValueObjectSP<br>+ValueObjectSynthetic::GetDynamicValue (lldb::DynamicValueType valueType)<br>+{<br>+    if (!m_parent)<br>+        return lldb::ValueObjectSP();<br>+    if (m_parent->IsDynamic() && m_parent->GetDynamicValueType() == valueType)<br>+        return m_parent->GetSP();<br>+    return ValueObject::GetDynamicValue(valueType);<br>+}<br>+<br> bool<br> ValueObjectSynthetic::MightHaveChildren()<br> {<br><br>Copied: lldb/trunk/source/DataFormatters/CXXFormatterFunctions.cpp (from r173281, lldb/trunk/source/Core/CXXFormatterFunctions.cpp)<br>URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/CXXFormatterFunctions.cpp?p2=lldb/trunk/source/DataFormatters/CXXFormatterFunctions.cpp&p1=lldb/trunk/source/Core/CXXFormatterFunctions.cpp&r1=173281&r2=173728&rev=173728&view=diff">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/CXXFormatterFunctions.cpp?p2=lldb/trunk/source/DataFormatters/CXXFormatterFunctions.cpp&p1=lldb/trunk/source/Core/CXXFormatterFunctions.cpp&r1=173281&r2=173728&rev=173728&view=diff</a><br>==============================================================================<br>--- lldb/trunk/source/Core/CXXFormatterFunctions.cpp (original)<br>+++ lldb/trunk/source/DataFormatters/CXXFormatterFunctions.cpp Mon Jan 28 17:47:25 2013<br>@@ -9,7 +9,7 @@<br><br> #include "lldb/lldb-python.h"<br><br>-#include "lldb/Core/CXXFormatterFunctions.h"<br>+#include "lldb/DataFormatters/CXXFormatterFunctions.h"<br><br> // needed to get ConvertUTF16/32ToUTF8<br> #define CLANG_NEEDS_THESE_ONE_DAY<br>@@ -1092,7 +1092,7 @@ m_data_64(NULL)<br>     }<br> }<br><br>-uint32_t<br>+size_t<br> lldb_private::formatters::NSArrayMSyntheticFrontEnd::CalculateNumChildren ()<br> {<br>     if (m_data_32)<br>@@ -1103,7 +1103,7 @@ lldb_private::formatters::NSArrayMSynthe<br> }<br><br> lldb::ValueObjectSP<br>-lldb_private::formatters::NSArrayMSyntheticFrontEnd::GetChildAtIndex (uint32_t idx)<br>+lldb_private::formatters::NSArrayMSyntheticFrontEnd::GetChildAtIndex (size_t idx)<br> {<br>     if (!m_data_32 && !m_data_64)<br>         return lldb::ValueObjectSP();<br>@@ -1112,7 +1112,7 @@ lldb_private::formatters::NSArrayMSynthe<br>     lldb::addr_t object_at_idx = (m_data_32 ? m_data_32->_data : m_data_64->_data);<br>     object_at_idx += (idx * m_ptr_size);<br>     StreamString idx_name;<br>-    idx_name.Printf("[%d]",idx);<br>+    idx_name.Printf("[%zu]",idx);<br>     lldb::ValueObjectSP retval_sp = ValueObject::CreateValueObjectFromAddress(idx_name.GetData(),<br>                                                                               object_at_idx,<br>                                                                               m_exe_ctx_ref,<br>@@ -1192,7 +1192,7 @@ ExtractIndexFromString (const char* item<br>     return idx;<br> }<br><br>-uint32_t<br>+size_t<br> lldb_private::formatters::NSArrayMSyntheticFrontEnd::GetIndexOfChildWithName (const ConstString &name)<br> {<br>     if (!m_data_32 && !m_data_64)<br>@@ -1230,7 +1230,7 @@ lldb_private::formatters::NSArrayISynthe<br> {<br> }<br><br>-uint32_t<br>+size_t<br> lldb_private::formatters::NSArrayISyntheticFrontEnd::GetIndexOfChildWithName (const ConstString &name)<br> {<br>     const char* item_name = name.GetCString();<br>@@ -1240,7 +1240,7 @@ lldb_private::formatters::NSArrayISynthe<br>     return idx;<br> }<br><br>-uint32_t<br>+size_t<br> lldb_private::formatters::NSArrayISyntheticFrontEnd::CalculateNumChildren ()<br> {<br>     return m_items;<br>@@ -1286,7 +1286,7 @@ lldb_private::formatters::NSArrayISynthe<br> }<br><br> lldb::ValueObjectSP<br>-lldb_private::formatters::NSArrayISyntheticFrontEnd::GetChildAtIndex (uint32_t idx)<br>+lldb_private::formatters::NSArrayISyntheticFrontEnd::GetChildAtIndex (size_t idx)<br> {<br>     if (idx >= CalculateNumChildren())<br>         return lldb::ValueObjectSP();<br>@@ -1302,7 +1302,7 @@ lldb_private::formatters::NSArrayISynthe<br>     StreamString expr;<br>     expr.Printf("(id)%" PRIu64,object_at_idx);<br>     StreamString idx_name;<br>-    idx_name.Printf("[%d]",idx);<br>+    idx_name.Printf("[%zu]",idx);<br>     lldb::ValueObjectSP retval_sp = ValueObject::CreateValueObjectFromExpression(idx_name.GetData(), expr.GetData(), m_exe_ctx_ref);<br>     m_children.push_back(retval_sp);<br>     return retval_sp;<br>@@ -1353,7 +1353,7 @@ lldb_private::formatters::NSArrayCodeRun<br> SyntheticChildrenFrontEnd(*valobj_sp.get())<br> {}<br><br>-uint32_t<br>+size_t<br> lldb_private::formatters::NSArrayCodeRunningSyntheticFrontEnd::CalculateNumChildren ()<br> {<br>     uint64_t count = 0;<br>@@ -1363,10 +1363,10 @@ lldb_private::formatters::NSArrayCodeRun<br> }<br><br> lldb::ValueObjectSP<br>-lldb_private::formatters::NSArrayCodeRunningSyntheticFrontEnd::GetChildAtIndex (uint32_t idx)<br>+lldb_private::formatters::NSArrayCodeRunningSyntheticFrontEnd::GetChildAtIndex (size_t idx)<br> {<br>     StreamString idx_name;<br>-    idx_name.Printf("[%d]",idx);<br>+    idx_name.Printf("[%zu]",idx);<br>     lldb::ValueObjectSP valobj_sp = CallSelectorOnObject(m_backend,"id","objectAtIndex:",idx);<br>     if (valobj_sp)<br>         valobj_sp->SetName(ConstString(idx_name.GetData()));<br>@@ -1385,7 +1385,7 @@ lldb_private::formatters::NSArrayCodeRun<br>     return true;<br> }<br><br>-uint32_t<br>+size_t<br> lldb_private::formatters::NSArrayCodeRunningSyntheticFrontEnd::GetIndexOfChildWithName (const ConstString &name)<br> {<br>     return 0;<br>@@ -1440,7 +1440,7 @@ lldb_private::formatters::NSDictionaryCo<br> SyntheticChildrenFrontEnd(*valobj_sp.get())<br> {}<br><br>-uint32_t<br>+size_t<br> lldb_private::formatters::NSDictionaryCodeRunningSyntheticFrontEnd::CalculateNumChildren ()<br> {<br>     uint64_t count = 0;<br>@@ -1450,14 +1450,14 @@ lldb_private::formatters::NSDictionaryCo<br> }<br><br> lldb::ValueObjectSP<br>-lldb_private::formatters::NSDictionaryCodeRunningSyntheticFrontEnd::GetChildAtIndex (uint32_t idx)<br>+lldb_private::formatters::NSDictionaryCodeRunningSyntheticFrontEnd::GetChildAtIndex (size_t idx)<br> {<br>     StreamString idx_name;<br>-    idx_name.Printf("[%d]",idx);<br>+    idx_name.Printf("[%zu]",idx);<br>     StreamString valobj_expr_path;<br>     m_backend.GetExpressionPath(valobj_expr_path, false);<br>     StreamString key_fetcher_expr;<br>-    key_fetcher_expr.Printf("(id)[(NSArray*)[%s allKeys] objectAtIndex:%d]",valobj_expr_path.GetData(),idx);<br>+    key_fetcher_expr.Printf("(id)[(NSArray*)[%s allKeys] objectAtIndex:%zu]",valobj_expr_path.GetData(),idx);<br>     StreamString value_fetcher_expr;<br>     value_fetcher_expr.Printf("(id)[%s objectForKey:%s]",valobj_expr_path.GetData(),key_fetcher_expr.GetData());<br>     StreamString object_fetcher_expr;<br>@@ -1482,7 +1482,7 @@ lldb_private::formatters::NSDictionaryCo<br>     return true;<br> }<br><br>-uint32_t<br>+size_t<br> lldb_private::formatters::NSDictionaryCodeRunningSyntheticFrontEnd::GetIndexOfChildWithName (const ConstString &name)<br> {<br>     return 0;<br>@@ -1510,7 +1510,7 @@ lldb_private::formatters::NSDictionaryIS<br>     m_data_64 = NULL;<br> }<br><br>-uint32_t<br>+size_t<br> lldb_private::formatters::NSDictionaryISyntheticFrontEnd::GetIndexOfChildWithName (const ConstString &name)<br> {<br>     const char* item_name = name.GetCString();<br>@@ -1520,7 +1520,7 @@ lldb_private::formatters::NSDictionaryIS<br>     return idx;<br> }<br><br>-uint32_t<br>+size_t<br> lldb_private::formatters::NSDictionaryISyntheticFrontEnd::CalculateNumChildren ()<br> {<br>     if (!m_data_32 && !m_data_64)<br>@@ -1581,7 +1581,7 @@ lldb_private::formatters::NSDictionaryIS<br> }<br><br> lldb::ValueObjectSP<br>-lldb_private::formatters::NSDictionaryISyntheticFrontEnd::GetChildAtIndex (uint32_t idx)<br>+lldb_private::formatters::NSDictionaryISyntheticFrontEnd::GetChildAtIndex (size_t idx)<br> {<br>     uint32_t num_children = CalculateNumChildren();<br><br>@@ -1633,7 +1633,7 @@ lldb_private::formatters::NSDictionaryIS<br>         StreamString expr;<br>         expr.Printf("struct __lldb_autogen_nspair { id key; id value; } _lldb_valgen_item; _lldb_valgen_item.key = (id)%" PRIu64 " ; _lldb_valgen_item.value = (id)%" PRIu64 "; _lldb_valgen_item;",dict_item.key_ptr,dict_item.val_ptr);<br>         StreamString idx_name;<br>-        idx_name.Printf("[%d]",idx);<br>+        idx_name.Printf("[%zu]",idx);<br>         dict_item.valobj_sp = ValueObject::CreateValueObjectFromExpression(idx_name.GetData(), expr.GetData(), m_exe_ctx_ref);<br>     }<br>     return dict_item.valobj_sp;<br>@@ -1658,7 +1658,7 @@ lldb_private::formatters::NSDictionaryMS<br>     m_data_64 = NULL;<br> }<br><br>-uint32_t<br>+size_t<br> lldb_private::formatters::NSDictionaryMSyntheticFrontEnd::GetIndexOfChildWithName (const ConstString &name)<br> {<br>     const char* item_name = name.GetCString();<br>@@ -1668,7 +1668,7 @@ lldb_private::formatters::NSDictionaryMS<br>     return idx;<br> }<br><br>-uint32_t<br>+size_t<br> lldb_private::formatters::NSDictionaryMSyntheticFrontEnd::CalculateNumChildren ()<br> {<br>     if (!m_data_32 && !m_data_64)<br>@@ -1728,7 +1728,7 @@ lldb_private::formatters::NSDictionaryMS<br> }<br><br> lldb::ValueObjectSP<br>-lldb_private::formatters::NSDictionaryMSyntheticFrontEnd::GetChildAtIndex (uint32_t idx)<br>+lldb_private::formatters::NSDictionaryMSyntheticFrontEnd::GetChildAtIndex (size_t idx)<br> {<br>     lldb::addr_t m_keys_ptr = (m_data_32 ? m_data_32->_keys_addr : m_data_64->_keys_addr);<br>     lldb::addr_t m_values_ptr = (m_data_32 ? m_data_32->_objs_addr : m_data_64->_objs_addr);<br>@@ -1783,7 +1783,7 @@ lldb_private::formatters::NSDictionaryMS<br>         StreamString expr;<br>         expr.Printf("struct __lldb_autogen_nspair { id key; id value; } _lldb_valgen_item; _lldb_valgen_item.key = (id)%" PRIu64 " ; _lldb_valgen_item.value = (id)%" PRIu64 "; _lldb_valgen_item;",dict_item.key_ptr,dict_item.val_ptr);<br>         StreamString idx_name;<br>-        idx_name.Printf("[%d]",idx);<br>+        idx_name.Printf("[%zu]",idx);<br>         dict_item.valobj_sp = ValueObject::CreateValueObjectFromExpression(idx_name.GetData(), expr.GetData(), m_exe_ctx_ref);<br>     }<br>     return dict_item.valobj_sp;<br><br>Copied: lldb/trunk/source/DataFormatters/DataVisualization.cpp (from r173281, lldb/trunk/source/Core/DataVisualization.cpp)<br>URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/DataVisualization.cpp?p2=lldb/trunk/source/DataFormatters/DataVisualization.cpp&p1=lldb/trunk/source/Core/DataVisualization.cpp&r1=173281&r2=173728&rev=173728&view=diff">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/DataVisualization.cpp?p2=lldb/trunk/source/DataFormatters/DataVisualization.cpp&p1=lldb/trunk/source/Core/DataVisualization.cpp&r1=173281&r2=173728&rev=173728&view=diff</a><br>==============================================================================<br>--- lldb/trunk/source/Core/DataVisualization.cpp (original)<br>+++ lldb/trunk/source/DataFormatters/DataVisualization.cpp Mon Jan 28 17:47:25 2013<br>@@ -9,7 +9,7 @@<br><br> #include "lldb/lldb-python.h"<br><br>-#include "lldb/Core/DataVisualization.h"<br>+#include "lldb/DataFormatters/DataVisualization.h"<br><br> // C Includes<br> // C++ Includes<br>@@ -80,20 +80,20 @@ DataVisualization::ValueFormats::LoopThr<br>     GetFormatManager().GetValueNavigator().LoopThrough(callback, callback_baton);<br> }<br><br>-uint32_t<br>+size_t<br> DataVisualization::ValueFormats::GetCount ()<br> {<br>     return GetFormatManager().GetValueNavigator().GetCount();<br> }<br><br> lldb::TypeNameSpecifierImplSP<br>-DataVisualization::ValueFormats::GetTypeNameSpecifierForFormatAtIndex (uint32_t index)<br>+DataVisualization::ValueFormats::GetTypeNameSpecifierForFormatAtIndex (size_t index)<br> {<br>     return GetFormatManager().GetValueNavigator().GetTypeNameSpecifierAtIndex(index);<br> }<br><br> lldb::TypeFormatImplSP<br>-DataVisualization::ValueFormats::GetFormatAtIndex (uint32_t index)<br>+DataVisualization::ValueFormats::GetFormatAtIndex (size_t index)<br> {<br>     return GetFormatManager().GetValueNavigator().GetAtIndex(index);<br> }<br>@@ -135,7 +135,7 @@ DataVisualization::GetFilterForType (lld<br> }<br><br> #ifndef LLDB_DISABLE_PYTHON<br>-lldb::TypeSyntheticImplSP<br>+lldb::ScriptedSyntheticChildrenSP<br> DataVisualization::GetSyntheticForType (lldb::TypeNameSpecifierImplSP type_sp)<br> {<br>     return GetFormatManager().GetSyntheticForType(type_sp);<br>@@ -191,7 +191,7 @@ DataVisualization::Categories::Clear (co<br><br> void<br> DataVisualization::Categories::Enable (const ConstString& category,<br>-                                       CategoryMap::Position pos)<br>+                                       TypeCategoryMap::Position pos)<br> {<br>     if (GetFormatManager().GetCategory(category)->IsEnabled())<br>         GetFormatManager().DisableCategory(category);<br>@@ -207,7 +207,7 @@ DataVisualization::Categories::Disable (<br><br> void<br> DataVisualization::Categories::Enable (const lldb::TypeCategoryImplSP& category,<br>-                                       CategoryMap::Position pos)<br>+                                       TypeCategoryMap::Position pos)<br> {<br>     if (category.get())<br>     {<br>@@ -237,7 +237,7 @@ DataVisualization::Categories::GetCount <br> }<br><br> lldb::TypeCategoryImplSP<br>-DataVisualization::Categories::GetCategoryAtIndex (uint32_t index)<br>+DataVisualization::Categories::GetCategoryAtIndex (size_t index)<br> {<br>     return GetFormatManager().GetCategoryAtIndex(index);<br> }<br><br>Added: lldb/trunk/source/DataFormatters/FormatCache.cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/FormatCache.cpp?rev=173728&view=auto">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/FormatCache.cpp?rev=173728&view=auto</a><br>==============================================================================<br>--- lldb/trunk/source/DataFormatters/FormatCache.cpp (added)<br>+++ lldb/trunk/source/DataFormatters/FormatCache.cpp Mon Jan 28 17:47:25 2013<br>@@ -0,0 +1,163 @@<br>+//===-- FormatCache.cpp ------------------------------------------*- C++ -*-===//<br>+//<br>+//                     The LLVM Compiler Infrastructure<br>+//<br>+// This file is distributed under the University of Illinois Open Source<br>+// License. See LICENSE.TXT for details.<br>+//<br>+//===----------------------------------------------------------------------===//<br>+<br>+// C Includes<br>+<br>+// C++ Includes<br>+<br>+// Other libraries and framework includes<br>+<br>+// Project includes<br>+#include "lldb/DataFormatters/FormatCache.h"<br>+<br>+using namespace lldb;<br>+using namespace lldb_private;<br>+<br>+FormatCache::Entry::Entry () :<br>+m_summary_cached(false),<br>+m_synthetic_cached(false),<br>+m_summary_sp(nullptr),<br>+m_synthetic_sp(nullptr)<br>+{}<br>+<br>+FormatCache::Entry::Entry (lldb::TypeSummaryImplSP summary_sp) : FormatCache::Entry()<br>+{<br>+    SetSummary (summary_sp);<br>+}<br>+<br>+FormatCache::Entry::Entry (lldb::SyntheticChildrenSP synthetic_sp) : FormatCache::Entry()<br>+{<br>+    SetSynthetic (synthetic_sp);<br>+}<br>+<br>+FormatCache::Entry::Entry (lldb::TypeSummaryImplSP summary_sp,lldb::SyntheticChildrenSP synthetic_sp) : FormatCache::Entry()<br>+{<br>+    SetSummary (summary_sp);<br>+    SetSynthetic (synthetic_sp);<br>+}<br>+<br>+bool<br>+FormatCache::Entry::IsSummaryCached ()<br>+{<br>+    return m_summary_cached;<br>+}<br>+<br>+bool<br>+FormatCache::Entry::IsSyntheticCached ()<br>+{<br>+    return m_synthetic_cached;<br>+}<br>+<br>+lldb::TypeSummaryImplSP<br>+FormatCache::Entry::GetSummary ()<br>+{<br>+    return m_summary_sp;<br>+}<br>+<br>+lldb::SyntheticChildrenSP<br>+FormatCache::Entry::GetSynthetic ()<br>+{<br>+    return m_synthetic_sp;<br>+}<br>+<br>+void<br>+FormatCache::Entry::SetSummary (lldb::TypeSummaryImplSP summary_sp)<br>+{<br>+    m_summary_cached = true;<br>+    m_summary_sp = summary_sp;<br>+}<br>+<br>+void<br>+FormatCache::Entry::SetSynthetic (lldb::SyntheticChildrenSP synthetic_sp)<br>+{<br>+    m_synthetic_cached = true;<br>+    m_synthetic_sp = synthetic_sp;<br>+}<br>+<br>+FormatCache::FormatCache () :<br>+m_map(),<br>+m_mutex (Mutex::eMutexTypeRecursive)<br>+#ifdef LLDB_CONFIGURATION_DEBUG<br>+,m_cache_hits(0),m_cache_misses(0)<br>+#endif<br>+{<br>+}<br>+<br>+FormatCache::Entry&<br>+FormatCache::GetEntry (const ConstString& type)<br>+{<br>+    auto i = m_map.find(type),<br>+    e = m_map.end();<br>+    if (i != e)<br>+        return i->second;<br>+    m_map[type] = FormatCache::Entry();<br>+    return m_map[type];<br>+}<br>+<br>+bool<br>+FormatCache::GetSummary (const ConstString& type,lldb::TypeSummaryImplSP& summary_sp)<br>+{<br>+    Mutex::Locker lock(m_mutex);<br>+    auto entry = GetEntry(type);<br>+    if (entry.IsSummaryCached())<br>+    {<br>+#ifdef LLDB_CONFIGURATION_DEBUG<br>+        m_cache_hits++;<br>+#endif<br>+        summary_sp = entry.GetSummary();<br>+        return true;<br>+    }<br>+#ifdef LLDB_CONFIGURATION_DEBUG<br>+    m_cache_misses++;<br>+#endif<br>+    summary_sp.reset();<br>+    return false;<br>+}<br>+<br>+bool<br>+FormatCache::GetSynthetic (const ConstString& type,lldb::SyntheticChildrenSP& synthetic_sp)<br>+{<br>+    Mutex::Locker lock(m_mutex);<br>+    auto entry = GetEntry(type);<br>+    if (entry.IsSyntheticCached())<br>+    {<br>+#ifdef LLDB_CONFIGURATION_DEBUG<br>+        m_cache_hits++;<br>+#endif<br>+        synthetic_sp = entry.GetSynthetic();<br>+        return true;<br>+    }<br>+#ifdef LLDB_CONFIGURATION_DEBUG<br>+    m_cache_misses++;<br>+#endif<br>+    synthetic_sp.reset();<br>+    return false;<br>+}<br>+<br>+void<br>+FormatCache::SetSummary (const ConstString& type,lldb::TypeSummaryImplSP& summary_sp)<br>+{<br>+    Mutex::Locker lock(m_mutex);<br>+    GetEntry(type).SetSummary(summary_sp);<br>+}<br>+<br>+void<br>+FormatCache::SetSynthetic (const ConstString& type,lldb::SyntheticChildrenSP& synthetic_sp)<br>+{<br>+    Mutex::Locker lock(m_mutex);<br>+    GetEntry(type).SetSynthetic(synthetic_sp);<br>+}<br>+<br>+void<br>+FormatCache::Clear ()<br>+{<br>+    Mutex::Locker lock(m_mutex);<br>+    m_map.clear();<br>+}<br>+<br><br>Copied: lldb/trunk/source/DataFormatters/FormatClasses.cpp (from r173281, lldb/trunk/source/Core/FormatClasses.cpp)<br>URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/FormatClasses.cpp?p2=lldb/trunk/source/DataFormatters/FormatClasses.cpp&p1=lldb/trunk/source/Core/FormatClasses.cpp&r1=173281&r2=173728&rev=173728&view=diff">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/FormatClasses.cpp?p2=lldb/trunk/source/DataFormatters/FormatClasses.cpp&p1=lldb/trunk/source/Core/FormatClasses.cpp&r1=173281&r2=173728&rev=173728&view=diff</a><br>==============================================================================<br>--- lldb/trunk/source/Core/FormatClasses.cpp (original)<br>+++ lldb/trunk/source/DataFormatters/FormatClasses.cpp Mon Jan 28 17:47:25 2013<br>@@ -20,9 +20,9 @@<br> #include "lldb/lldb-enumerations.h"<br><br> #include "lldb/Core/Debugger.h"<br>-#include "lldb/Core/FormatClasses.h"<br> #include "lldb/Core/StreamString.h"<br> #include "lldb/Core/Timer.h"<br>+#include "lldb/DataFormatters/FormatClasses.h"<br> #include "lldb/Interpreter/CommandInterpreter.h"<br> #include "lldb/Symbol/ClangASTType.h"<br> #include "lldb/Target/StackFrame.h"<br>@@ -31,379 +31,3 @@<br> using namespace lldb;<br> using namespace lldb_private;<br><br>-TypeFormatImpl::TypeFormatImpl (lldb::Format f,<br>-                          const Flags& flags) : <br>-    m_flags(flags),<br>-    m_format (f)<br>-{<br>-}<br>-<br>-std::string<br>-TypeFormatImpl::GetDescription()<br>-{<br>-    StreamString sstr;<br>-    sstr.Printf ("%s%s%s%s\n", <br>-                 FormatManager::GetFormatAsCString (GetFormat()),<br>-                 Cascades() ? "" : " (not cascading)",<br>-                 SkipsPointers() ? " (skip pointers)" : "",<br>-                 SkipsReferences() ? " (skip references)" : "");<br>-    return sstr.GetString();<br>-}<br>-<br>-TypeSummaryImpl::TypeSummaryImpl(const TypeSummaryImpl::Flags& flags) :<br>-    m_flags(flags)<br>-{<br>-}<br>-<br>-<br>-StringSummaryFormat::StringSummaryFormat(const TypeSummaryImpl::Flags& flags,<br>-                                         const char *format_cstr) :<br>-    TypeSummaryImpl(flags),<br>-    m_format()<br>-{<br>-  if (format_cstr)<br>-    m_format.assign(format_cstr);<br>-}<br>-<br>-bool<br>-StringSummaryFormat::FormatObject(ValueObject *valobj,<br>-                                  std::string& retval)<br>-{<br>-    if (!valobj)<br>-    {<br>-        retval.assign("NULL ValueObject");<br>-        return false;<br>-    }<br>-    <br>-    StreamString s;<br>-    ExecutionContext exe_ctx (valobj->GetExecutionContextRef());<br>-    SymbolContext sc;<br>-    StackFrame *frame = exe_ctx.GetFramePtr();<br>-    if (frame)<br>-        sc = frame->GetSymbolContext(lldb::eSymbolContextEverything);<br>-    <br>-    if (IsOneliner())<br>-    {<br>-        ValueObject* object;<br>-        <br>-        ValueObjectSP synth_valobj = valobj->GetSyntheticValue();<br>-        if (synth_valobj)<br>-            object = synth_valobj.get();<br>-        else<br>-            object = valobj;<br>-        <br>-        const uint32_t num_children = object->GetNumChildren();<br>-        if (num_children)<br>-        {<br>-            s.PutChar('(');<br>-            <br>-            for (uint32_t idx=0; idx<num_children; ++idx)<br>-            {<br>-                lldb::ValueObjectSP child_sp(object->GetChildAtIndex(idx, true));<br>-                if (child_sp.get())<br>-                {<br>-                    if (idx)<br>-                        s.PutCString(", ");<br>-                    if (!HideNames())<br>-                    {<br>-                        s.PutCString(child_sp.get()->GetName().AsCString());<br>-                        s.PutCString(" = ");<br>-                    }<br>-                    child_sp.get()->DumpPrintableRepresentation(s,<br>-                                                                ValueObject::eValueObjectRepresentationStyleSummary,<br>-                                                                lldb::eFormatInvalid,<br>-                                                                ValueObject::ePrintableRepresentationSpecialCasesDisable);<br>-                }<br>-            }<br>-            <br>-            s.PutChar(')');<br>-            <br>-            retval.assign(s.GetString());<br>-            return true;<br>-        }<br>-        else<br>-        {<br>-            retval.assign("error: oneliner for no children");<br>-            return false;<br>-        }<br>-        <br>-    }<br>-    else<br>-    {<br>-        if (Debugger::FormatPrompt(m_format.c_str(), &sc, &exe_ctx, &sc.line_entry.range.GetBaseAddress(), s, NULL, valobj))<br>-        {<br>-            retval.assign(s.GetString());<br>-            return true;<br>-        }<br>-        else<br>-        {<br>-            retval.assign("error: summary string parsing error");<br>-            return false;<br>-        }<br>-    }<br>-}<br>-<br>-std::string<br>-StringSummaryFormat::GetDescription()<br>-{<br>-    StreamString sstr;<br>-    <br>-    sstr.Printf ("`%s`%s%s%s%s%s%s%s",      m_format.c_str(),<br>-                 Cascades() ? "" : " (not cascading)",<br>-                 !DoesPrintChildren() ? "" : " (show children)",<br>-                 !DoesPrintValue() ? " (hide value)" : "",<br>-                 IsOneliner() ? " (one-line printout)" : "",<br>-                 SkipsPointers() ? " (skip pointers)" : "",<br>-                 SkipsReferences() ? " (skip references)" : "",<br>-                 HideNames() ? " (hide member names)" : "");<br>-    return sstr.GetString();<br>-}<br>-<br>-CXXFunctionSummaryFormat::CXXFunctionSummaryFormat (const TypeSummaryImpl::Flags& flags,<br>-                                                    Callback impl,<br>-                                                    const char* description) :<br>-                                                    TypeSummaryImpl(flags),<br>-                                                    m_impl(impl),<br>-                                                    m_description(description ? description : "")<br>-{<br>-}<br>-    <br>-bool<br>-CXXFunctionSummaryFormat::FormatObject(ValueObject *valobj,<br>-                                       std::string& dest)<br>-{<br>-    dest.clear();<br>-    StreamString stream;<br>-    if (!m_impl || m_impl(*valobj,stream) == false)<br>-        return false;<br>-    dest.assign(stream.GetData());<br>-    return true;<br>-}<br>-<br>-std::string<br>-CXXFunctionSummaryFormat::GetDescription()<br>-{<br>-    StreamString sstr;<br>-    sstr.Printf ("`%s (%p) `%s%s%s%s%s%s%s",      m_description.c_str(),m_impl,<br>-                 Cascades() ? "" : " (not cascading)",<br>-                 !DoesPrintChildren() ? "" : " (show children)",<br>-                 !DoesPrintValue() ? " (hide value)" : "",<br>-                 IsOneliner() ? " (one-line printout)" : "",<br>-                 SkipsPointers() ? " (skip pointers)" : "",<br>-                 SkipsReferences() ? " (skip references)" : "",<br>-                 HideNames() ? " (hide member names)" : "");<br>-    return sstr.GetString();<br>-}<br>-<br>-#ifndef LLDB_DISABLE_PYTHON<br>-<br>-<br>-ScriptSummaryFormat::ScriptSummaryFormat(const TypeSummaryImpl::Flags& flags,<br>-                                         const char * function_name,<br>-                                         const char * python_script) :<br>-    TypeSummaryImpl(flags),<br>-    m_function_name(),<br>-    m_python_script(),<br>-    m_script_function_sp()<br>-{<br>-   if (function_name)<br>-     m_function_name.assign(function_name);<br>-   if (python_script)<br>-     m_python_script.assign(python_script);<br>-}<br>-<br>-bool<br>-ScriptSummaryFormat::FormatObject(ValueObject *valobj,<br>-                                  std::string& retval)<br>-{<br>-    Timer scoped_timer (__PRETTY_FUNCTION__, __PRETTY_FUNCTION__);<br>-<br>-    TargetSP target_sp(valobj->GetTargetSP());<br>-<br>-    if (!target_sp)<br>-    {<br>-        retval.assign("error: no target");<br>-        return false;<br>-    }<br>-<br>-    ScriptInterpreter *script_interpreter = target_sp->GetDebugger().GetCommandInterpreter().GetScriptInterpreter();<br>-<br>-    if (!script_interpreter)<br>-    {<br>-        retval.assign("error: no ScriptInterpreter");<br>-        return false;<br>-    }<br>-        <br>-    return script_interpreter->GetScriptedSummary(m_function_name.c_str(),<br>-                                                  valobj->GetSP(),<br>-                                                  m_script_function_sp,<br>-                                                  retval);<br>-<br>-}<br>-<br>-std::string<br>-ScriptSummaryFormat::GetDescription()<br>-{<br>-    StreamString sstr;<br>-    sstr.Printf ("%s%s%s%s%s%s%s\n%s",       Cascades() ? "" : " (not cascading)",<br>-                 !DoesPrintChildren() ? "" : " (show children)",<br>-                 !DoesPrintValue() ? " (hide value)" : "",<br>-                 IsOneliner() ? " (one-line printout)" : "",<br>-                 SkipsPointers() ? " (skip pointers)" : "",<br>-                 SkipsReferences() ? " (skip references)" : "",<br>-                 HideNames() ? " (hide member names)" : "",<br>-                 m_python_script.c_str());<br>-    return sstr.GetString();<br>-    <br>-}<br>-<br>-#endif // #ifndef LLDB_DISABLE_PYTHON<br>-<br>-std::string<br>-TypeFilterImpl::GetDescription()<br>-{<br>-    StreamString sstr;<br>-    sstr.Printf("%s%s%s {\n",<br>-                Cascades() ? "" : " (not cascading)",<br>-                SkipsPointers() ? " (skip pointers)" : "",<br>-                SkipsReferences() ? " (skip references)" : "");<br>-    <br>-    for (int i = 0; i < GetCount(); i++)<br>-    {<br>-        sstr.Printf("    %s\n",<br>-                    GetExpressionPathAtIndex(i));<br>-    }<br>-                    <br>-    sstr.Printf("}");<br>-    return sstr.GetString();<br>-}<br>-<br>-std::string<br>-CXXSyntheticChildren::GetDescription()<br>-{<br>-    StreamString sstr;<br>-    sstr.Printf("%s%s%s Generator at %p - %s\n",<br>-                Cascades() ? "" : " (not cascading)",<br>-                SkipsPointers() ? " (skip pointers)" : "",<br>-                SkipsReferences() ? " (skip references)" : "",<br>-                m_create_callback,<br>-                m_description.c_str());<br>-    <br>-    return sstr.GetString();<br>-}<br>-<br>-std::string<br>-SyntheticArrayView::GetDescription()<br>-{<br>-    StreamString sstr;<br>-    sstr.Printf("%s%s%s {\n",<br>-                Cascades() ? "" : " (not cascading)",<br>-                SkipsPointers() ? " (skip pointers)" : "",<br>-                SkipsReferences() ? " (skip references)" : "");<br>-    <br>-    SyntheticArrayRange* ptr = &m_head;<br>-    while (ptr && ptr != m_tail)<br>-    {<br>-        if (ptr->GetLow() == ptr->GetHigh())<br>-            sstr.Printf("    [%d]\n",<br>-                        ptr->GetLow());<br>-        else<br>-            sstr.Printf("    [%d-%d]\n",<br>-                        ptr->GetLow(),<br>-                        ptr->GetHigh());<br>-        ptr = ptr->GetNext();<br>-    }<br>-    <br>-    sstr.Printf("}");<br>-    return sstr.GetString();<br>-}<br>-<br>-#ifndef LLDB_DISABLE_PYTHON<br>-<br>-TypeSyntheticImpl::FrontEnd::FrontEnd(std::string pclass, ValueObject &backend) :<br>-    SyntheticChildrenFrontEnd(backend),<br>-    m_python_class(pclass),<br>-    m_wrapper_sp(),<br>-    m_interpreter(NULL)<br>-{<br>-    if (backend == LLDB_INVALID_UID)<br>-        return;<br>-    <br>-    TargetSP target_sp = backend.GetTargetSP();<br>-    <br>-    if (!target_sp)<br>-        return;<br>-    <br>-    m_interpreter = target_sp->GetDebugger().GetCommandInterpreter().GetScriptInterpreter();<br>-    <br>-    if (m_interpreter != NULL)<br>-        m_wrapper_sp = m_interpreter->CreateSyntheticScriptedProvider(m_python_class.c_str(), backend.GetSP());<br>-}<br>-<br>-TypeSyntheticImpl::FrontEnd::~FrontEnd()<br>-{<br>-}<br>-<br>-lldb::ValueObjectSP<br>-TypeSyntheticImpl::FrontEnd::GetChildAtIndex (uint32_t idx)<br>-{<br>-    if (!m_wrapper_sp || !m_interpreter)<br>-        return lldb::ValueObjectSP();<br>-    <br>-    return m_interpreter->GetChildAtIndex(m_wrapper_sp, idx);<br>-}<br>-<br>-std::string<br>-TypeSyntheticImpl::GetDescription()<br>-{<br>-    StreamString sstr;<br>-    sstr.Printf("%s%s%s Python class %s",<br>-                Cascades() ? "" : " (not cascading)",<br>-                SkipsPointers() ? " (skip pointers)" : "",<br>-                SkipsReferences() ? " (skip references)" : "",<br>-                m_python_class.c_str());<br>-    <br>-    return sstr.GetString();<br>-}<br>-<br>-#endif // #ifndef LLDB_DISABLE_PYTHON<br>-<br>-int<br>-SyntheticArrayView::GetRealIndexForIndex(int i)<br>-{<br>-    if (i >= GetCount())<br>-        return -1;<br>-    <br>-    SyntheticArrayRange* ptr = &m_head;<br>-    <br>-    int residual = i;<br>-    <br>-    while(ptr && ptr != m_tail)<br>-    {<br>-        if (residual >= ptr->GetSelfCount())<br>-        {<br>-            residual -= ptr->GetSelfCount();<br>-            ptr = ptr->GetNext();<br>-        }<br>-        <br>-        return ptr->GetLow() + residual;<br>-    }<br>-    <br>-    return -1;<br>-}<br>-<br>-uint32_t<br>-SyntheticArrayView::FrontEnd::GetIndexOfChildWithName (const ConstString &name_cs)<br>-{<br>-    const char* name_cstr = name_cs.GetCString();<br>-    if (*name_cstr != '[')<br>-        return UINT32_MAX;<br>-    std::string name(name_cstr+1);<br>-    if (name[name.size()-1] != ']')<br>-        return UINT32_MAX;<br>-    name = name.erase(name.size()-1,1);<br>-    int index = Args::StringToSInt32 (name.c_str(), -1);<br>-    if (index < 0)<br>-        return UINT32_MAX;<br>-    return index;<br>-}<br><br>Copied: lldb/trunk/source/DataFormatters/FormatManager.cpp (from r173281, lldb/trunk/source/Core/FormatManager.cpp)<br>URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/FormatManager.cpp?p2=lldb/trunk/source/DataFormatters/FormatManager.cpp&p1=lldb/trunk/source/Core/FormatManager.cpp&r1=173281&r2=173728&rev=173728&view=diff">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/FormatManager.cpp?p2=lldb/trunk/source/DataFormatters/FormatManager.cpp&p1=lldb/trunk/source/Core/FormatManager.cpp&r1=173281&r2=173728&rev=173728&view=diff</a><br>==============================================================================<br>--- lldb/trunk/source/Core/FormatManager.cpp (original)<br>+++ lldb/trunk/source/DataFormatters/FormatManager.cpp Mon Jan 28 17:47:25 2013<br>@@ -9,15 +9,18 @@<br><br> #include "lldb/lldb-python.h"<br><br>-#include "lldb/Core/FormatManager.h"<br>+#include "lldb/DataFormatters/FormatManager.h"<br><br> // C Includes<br> // C++ Includes<br> // Other libraries and framework includes<br> // Project includes<br><br>-#include "lldb/Core/CXXFormatterFunctions.h"<br> #include "lldb/Core/Debugger.h"<br>+#include "lldb/DataFormatters/CXXFormatterFunctions.h"<br>+#include "lldb/Interpreter/ScriptInterpreterPython.h"<br>+#include "lldb/Target/ExecutionContext.h"<br>+#include "lldb/Target/Platform.h"<br><br> using namespace lldb;<br> using namespace lldb_private;<br>@@ -151,8 +154,6 @@ FormatManager::GetFormatAsFormatChar (ll<br>     }<br>     return '\0';<br> }<br>-    <br>-<br><br> const char *<br> FormatManager::GetFormatAsCString (Format format)<br>@@ -162,300 +163,6 @@ FormatManager::GetFormatAsCString (Forma<br>     return NULL;<br> }<br><br>-TypeCategoryImpl::TypeCategoryImpl(IFormatChangeListener* clist,<br>-                                   ConstString name) :<br>-    m_summary_nav(new SummaryNavigator("summary",clist)),<br>-    m_regex_summary_nav(new RegexSummaryNavigator("regex-summary",clist)),<br>-    m_filter_nav(new FilterNavigator("filter",clist)),<br>-    m_regex_filter_nav(new RegexFilterNavigator("regex-filter",clist)),<br>-#ifndef LLDB_DISABLE_PYTHON<br>-    m_synth_nav(new SynthNavigator("synth",clist)),<br>-    m_regex_synth_nav(new RegexSynthNavigator("regex-synth",clist)),<br>-#endif<br>-    m_enabled(false),<br>-    m_change_listener(clist),<br>-    m_mutex(Mutex::eMutexTypeRecursive),<br>-    m_name(name)<br>-{}<br>-<br>-bool<br>-TypeCategoryImpl::Get (ValueObject& valobj,<br>-                     lldb::TypeSummaryImplSP& entry,<br>-                     lldb::DynamicValueType use_dynamic,<br>-                     uint32_t* reason)<br>-{<br>-    if (!IsEnabled())<br>-        return false;<br>-    if (GetSummaryNavigator()->Get(valobj, entry, use_dynamic, reason))<br>-        return true;<br>-    bool regex = GetRegexSummaryNavigator()->Get(valobj, entry, use_dynamic, reason);<br>-    if (regex && reason)<br>-        *reason |= lldb_private::eFormatterChoiceCriterionRegularExpressionSummary;<br>-    return regex;<br>-}<br>-<br>-bool<br>-TypeCategoryImpl::Get(ValueObject& valobj,<br>-                    lldb::SyntheticChildrenSP& entry_sp,<br>-                    lldb::DynamicValueType use_dynamic,<br>-                    uint32_t* reason)<br>-{<br>-    if (!IsEnabled())<br>-        return false;<br>-    TypeFilterImpl::SharedPointer filter_sp;<br>-    uint32_t reason_filter = 0;<br>-    bool regex_filter = false;<br>-    // first find both Filter and Synth, and then check which is most recent<br>-    <br>-    if (!GetFilterNavigator()->Get(valobj, filter_sp, use_dynamic, &reason_filter))<br>-        regex_filter = GetRegexFilterNavigator()->Get (valobj, filter_sp, use_dynamic, &reason_filter);<br>-<br>-#ifndef LLDB_DISABLE_PYTHON<br>-    bool regex_synth = false;<br>-    uint32_t reason_synth = 0;    <br>-    bool pick_synth = false;<br>-    TypeSyntheticImpl::SharedPointer synth;<br>-    if (!GetSyntheticNavigator()->Get(valobj, synth, use_dynamic, &reason_synth))<br>-        regex_synth = GetRegexSyntheticNavigator()->Get (valobj, synth, use_dynamic, &reason_synth);<br>-    if (!filter_sp.get() && !synth.get())<br>-        return false;<br>-    else if (!filter_sp.get() && synth.get())<br>-        pick_synth = true;<br>-    <br>-    else if (filter_sp.get() && !synth.get())<br>-        pick_synth = false;<br>-    <br>-    else /*if (filter_sp.get() && synth.get())*/<br>-    {<br>-        if (filter_sp->GetRevision() > synth->GetRevision())<br>-            pick_synth = false;<br>-        else<br>-            pick_synth = true;<br>-    }<br>-    if (pick_synth)<br>-    {<br>-        if (regex_synth && reason)<br>-            *reason |= lldb_private::eFormatterChoiceCriterionRegularExpressionFilter;<br>-        entry_sp = synth;<br>-        return true;<br>-    }<br>-    else<br>-    {<br>-        if (regex_filter && reason)<br>-            *reason |= lldb_private::eFormatterChoiceCriterionRegularExpressionFilter;<br>-        entry_sp = filter_sp;<br>-        return true;<br>-    }<br>-<br>-#else<br>-    if (filter_sp)<br>-    {<br>-        entry_sp = filter_sp;<br>-        return true;<br>-    }<br>-#endif<br>-<br>-    return false;    <br>-    <br>-}<br>-<br>-void<br>-TypeCategoryImpl::Clear (FormatCategoryItems items)<br>-{<br>-    if ( (items & eFormatCategoryItemSummary) == eFormatCategoryItemSummary )<br>-        m_summary_nav->Clear();<br>-    if ( (items & eFormatCategoryItemRegexSummary) == eFormatCategoryItemRegexSummary )<br>-        m_regex_summary_nav->Clear();<br>-    if ( (items & eFormatCategoryItemFilter)  == eFormatCategoryItemFilter )<br>-        m_filter_nav->Clear();<br>-    if ( (items & eFormatCategoryItemRegexFilter) == eFormatCategoryItemRegexFilter )<br>-        m_regex_filter_nav->Clear();<br>-#ifndef LLDB_DISABLE_PYTHON<br>-    if ( (items & eFormatCategoryItemSynth)  == eFormatCategoryItemSynth )<br>-        m_synth_nav->Clear();<br>-    if ( (items & eFormatCategoryItemRegexSynth) == eFormatCategoryItemRegexSynth )<br>-        m_regex_synth_nav->Clear();<br>-#endif<br>-}<br>-<br>-bool<br>-TypeCategoryImpl::Delete (ConstString name,<br>-                        FormatCategoryItems items)<br>-{<br>-    bool success = false;<br>-    if ( (items & eFormatCategoryItemSummary) == eFormatCategoryItemSummary )<br>-        success = m_summary_nav->Delete(name) || success;<br>-    if ( (items & eFormatCategoryItemRegexSummary) == eFormatCategoryItemRegexSummary )<br>-        success = m_regex_summary_nav->Delete(name) || success;<br>-    if ( (items & eFormatCategoryItemFilter)  == eFormatCategoryItemFilter )<br>-        success = m_filter_nav->Delete(name) || success;<br>-    if ( (items & eFormatCategoryItemRegexFilter) == eFormatCategoryItemRegexFilter )<br>-        success = m_regex_filter_nav->Delete(name) || success;<br>-#ifndef LLDB_DISABLE_PYTHON<br>-    if ( (items & eFormatCategoryItemSynth)  == eFormatCategoryItemSynth )<br>-        success = m_synth_nav->Delete(name) || success;<br>-    if ( (items & eFormatCategoryItemRegexSynth) == eFormatCategoryItemRegexSynth )<br>-        success = m_regex_synth_nav->Delete(name) || success;<br>-#endif<br>-    return success;<br>-}<br>-<br>-uint32_t<br>-TypeCategoryImpl::GetCount (FormatCategoryItems items)<br>-{<br>-    uint32_t count = 0;<br>-    if ( (items & eFormatCategoryItemSummary) == eFormatCategoryItemSummary )<br>-        count += m_summary_nav->GetCount();<br>-    if ( (items & eFormatCategoryItemRegexSummary) == eFormatCategoryItemRegexSummary )<br>-        count += m_regex_summary_nav->GetCount();<br>-    if ( (items & eFormatCategoryItemFilter)  == eFormatCategoryItemFilter )<br>-        count += m_filter_nav->GetCount();<br>-    if ( (items & eFormatCategoryItemRegexFilter) == eFormatCategoryItemRegexFilter )<br>-        count += m_regex_filter_nav->GetCount();<br>-#ifndef LLDB_DISABLE_PYTHON<br>-    if ( (items & eFormatCategoryItemSynth)  == eFormatCategoryItemSynth )<br>-        count += m_synth_nav->GetCount();<br>-    if ( (items & eFormatCategoryItemRegexSynth) == eFormatCategoryItemRegexSynth )<br>-        count += m_regex_synth_nav->GetCount();<br>-#endif<br>-    return count;<br>-}<br>-<br>-bool<br>-TypeCategoryImpl::AnyMatches(ConstString type_name,<br>-                           FormatCategoryItems items,<br>-                           bool only_enabled,<br>-                           const char** matching_category,<br>-                           FormatCategoryItems* matching_type)<br>-{<br>-    if (!IsEnabled() && only_enabled)<br>-        return false;<br>-    <br>-    lldb::TypeSummaryImplSP summary;<br>-    TypeFilterImpl::SharedPointer filter;<br>-#ifndef LLDB_DISABLE_PYTHON<br>-    TypeSyntheticImpl::SharedPointer synth;<br>-#endif<br>-    <br>-    if ( (items & eFormatCategoryItemSummary) == eFormatCategoryItemSummary )<br>-    {<br>-        if (m_summary_nav->Get(type_name, summary))<br>-        {<br>-            if (matching_category)<br>-                *matching_category = m_name.GetCString();<br>-            if (matching_type)<br>-                *matching_type = eFormatCategoryItemSummary;<br>-            return true;<br>-        }<br>-    }<br>-    if ( (items & eFormatCategoryItemRegexSummary) == eFormatCategoryItemRegexSummary )<br>-    {<br>-        if (m_regex_summary_nav->Get(type_name, summary))<br>-        {<br>-            if (matching_category)<br>-                *matching_category = m_name.GetCString();<br>-            if (matching_type)<br>-                *matching_type = eFormatCategoryItemRegexSummary;<br>-            return true;<br>-        }<br>-    }<br>-    if ( (items & eFormatCategoryItemFilter)  == eFormatCategoryItemFilter )<br>-    {<br>-        if (m_filter_nav->Get(type_name, filter))<br>-        {<br>-            if (matching_category)<br>-                *matching_category = m_name.GetCString();<br>-            if (matching_type)<br>-                *matching_type = eFormatCategoryItemFilter;<br>-            return true;<br>-        }<br>-    }<br>-    if ( (items & eFormatCategoryItemRegexFilter) == eFormatCategoryItemRegexFilter )<br>-    {<br>-        if (m_regex_filter_nav->Get(type_name, filter))<br>-        {<br>-            if (matching_category)<br>-                *matching_category = m_name.GetCString();<br>-            if (matching_type)<br>-                *matching_type = eFormatCategoryItemRegexFilter;<br>-            return true;<br>-        }<br>-    }<br>-#ifndef LLDB_DISABLE_PYTHON<br>-    if ( (items & eFormatCategoryItemSynth)  == eFormatCategoryItemSynth )<br>-    {<br>-        if (m_synth_nav->Get(type_name, synth))<br>-        {<br>-            if (matching_category)<br>-                *matching_category = m_name.GetCString();<br>-            if (matching_type)<br>-                *matching_type = eFormatCategoryItemSynth;<br>-            return true;<br>-        }<br>-    }<br>-    if ( (items & eFormatCategoryItemRegexSynth) == eFormatCategoryItemRegexSynth )<br>-    {<br>-        if (m_regex_synth_nav->Get(type_name, synth))<br>-        {<br>-            if (matching_category)<br>-                *matching_category = m_name.GetCString();<br>-            if (matching_type)<br>-                *matching_type = eFormatCategoryItemRegexSynth;<br>-            return true;<br>-        }<br>-    }<br>-#endif<br>-    return false;<br>-}<br>-<br>-bool<br>-CategoryMap::AnyMatches (ConstString type_name,<br>-                         TypeCategoryImpl::FormatCategoryItems items,<br>-                         bool only_enabled,<br>-                         const char** matching_category,<br>-                         TypeCategoryImpl::FormatCategoryItems* matching_type)<br>-{<br>-    Mutex::Locker locker(m_map_mutex);<br>-    <br>-    MapIterator pos, end = m_map.end();<br>-    for (pos = m_map.begin(); pos != end; pos++)<br>-    {<br>-        if (pos->second->AnyMatches(type_name,<br>-                                    items,<br>-                                    only_enabled,<br>-                                    matching_category,<br>-                                    matching_type))<br>-            return true;<br>-    }<br>-    return false;<br>-}<br>-<br>-lldb::TypeSummaryImplSP<br>-CategoryMap::GetSummaryFormat (ValueObject& valobj,<br>-                               lldb::DynamicValueType use_dynamic)<br>-{<br>-    Mutex::Locker locker(m_map_mutex);<br>-    <br>-    uint32_t reason_why;        <br>-    ActiveCategoriesIterator begin, end = m_active_categories.end();<br>-    <br>-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_TYPES));<br>-    <br>-    for (begin = m_active_categories.begin(); begin != end; begin++)<br>-    {<br>-        lldb::TypeCategoryImplSP category_sp = *begin;<br>-        lldb::TypeSummaryImplSP current_format;<br>-        if (log)<br>-            log->Printf("[CategoryMap::GetSummaryFormat] Trying to use category %s\n", category_sp->GetName());<br>-        if (!category_sp->Get(valobj, current_format, use_dynamic, &reason_why))<br>-            continue;<br>-        return current_format;<br>-    }<br>-    if (log)<br>-        log->Printf("[CategoryMap::GetSummaryFormat] nothing found - returning empty SP\n");<br>-    return lldb::TypeSummaryImplSP();<br>-}<br>-<br> lldb::TypeSummaryImplSP<br> FormatManager::GetSummaryForType (lldb::TypeNameSpecifierImplSP type_sp)<br> {<br>@@ -509,12 +216,12 @@ FormatManager::GetFilterForType (lldb::T<br> }<br><br> #ifndef LLDB_DISABLE_PYTHON<br>-lldb::TypeSyntheticImplSP<br>+lldb::ScriptedSyntheticChildrenSP<br> FormatManager::GetSyntheticForType (lldb::TypeNameSpecifierImplSP type_sp)<br> {<br>     if (!type_sp)<br>-        return lldb::TypeSyntheticImplSP();<br>-    lldb::TypeSyntheticImplSP synth_chosen_sp;<br>+        return lldb::ScriptedSyntheticChildrenSP();<br>+    lldb::ScriptedSyntheticChildrenSP synth_chosen_sp;<br>     uint32_t num_categories = m_categories_map.GetCount();<br>     lldb::TypeCategoryImplSP category_sp;<br>     uint32_t prio_category = UINT32_MAX;<br>@@ -525,7 +232,7 @@ FormatManager::GetSyntheticForType (lldb<br>         category_sp = GetCategoryAtIndex(category_id);<br>         if (category_sp->IsEnabled() == false)<br>             continue;<br>-        lldb::TypeSyntheticImplSP synth_current_sp((TypeSyntheticImpl*)category_sp->GetSyntheticForType(type_sp).get());<br>+        lldb::ScriptedSyntheticChildrenSP synth_current_sp((ScriptedSyntheticChildren*)category_sp->GetSyntheticForType(type_sp).get());<br>         if (synth_current_sp && (synth_chosen_sp.get() == NULL || (prio_category > category_sp->GetEnabledPosition())))<br>         {<br>             prio_category = category_sp->GetEnabledPosition();<br>@@ -543,7 +250,7 @@ FormatManager::GetSyntheticChildrenForTy<br>     if (!type_sp)<br>         return lldb::SyntheticChildrenSP();<br>     lldb::TypeFilterImplSP filter_sp = GetFilterForType(type_sp);<br>-    lldb::TypeSyntheticImplSP synth_sp = GetSyntheticForType(type_sp);<br>+    lldb::ScriptedSyntheticChildrenSP synth_sp = GetSyntheticForType(type_sp);<br>     if (filter_sp->GetRevision() > synth_sp->GetRevision())<br>         return lldb::SyntheticChildrenSP(filter_sp.get());<br>     else<br>@@ -551,88 +258,6 @@ FormatManager::GetSyntheticChildrenForTy<br> }<br> #endif<br><br>-#ifndef LLDB_DISABLE_PYTHON<br>-lldb::SyntheticChildrenSP<br>-CategoryMap::GetSyntheticChildren (ValueObject& valobj,<br>-                                   lldb::DynamicValueType use_dynamic)<br>-{<br>-    Mutex::Locker locker(m_map_mutex);<br>-    <br>-    uint32_t reason_why;<br>-    <br>-    ActiveCategoriesIterator begin, end = m_active_categories.end();<br>-    <br>-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_TYPES));<br>-    <br>-    for (begin = m_active_categories.begin(); begin != end; begin++)<br>-    {<br>-        lldb::TypeCategoryImplSP category_sp = *begin;<br>-        lldb::SyntheticChildrenSP current_format;<br>-        if (log)<br>-            log->Printf("[CategoryMap::GetSyntheticChildren] Trying to use category %s\n", category_sp->GetName());<br>-        if (!category_sp->Get(valobj, current_format, use_dynamic, &reason_why))<br>-            continue;<br>-        return current_format;<br>-    }<br>-    if (log)<br>-        log->Printf("[CategoryMap::GetSyntheticChildren] nothing found - returning empty SP\n");<br>-    return lldb::SyntheticChildrenSP();<br>-}<br>-#endif<br>-<br>-void<br>-CategoryMap::LoopThrough(CallbackType callback, void* param)<br>-{<br>-    if (callback)<br>-    {<br>-        Mutex::Locker locker(m_map_mutex);<br>-        <br>-        // loop through enabled categories in respective order<br>-        {<br>-            ActiveCategoriesIterator begin, end = m_active_categories.end();<br>-            for (begin = m_active_categories.begin(); begin != end; begin++)<br>-            {<br>-                lldb::TypeCategoryImplSP category = *begin;<br>-                ConstString type = ConstString(category->GetName());<br>-                if (!callback(param, category))<br>-                    break;<br>-            }<br>-        }<br>-        <br>-        // loop through disabled categories in just any order<br>-        {<br>-            MapIterator pos, end = m_map.end();<br>-            for (pos = m_map.begin(); pos != end; pos++)<br>-            {<br>-                if (pos->second->IsEnabled())<br>-                    continue;<br>-                KeyType type = pos->first;<br>-                if (!callback(param, pos->second))<br>-                    break;<br>-            }<br>-        }<br>-    }<br>-}<br>-<br>-TypeCategoryImplSP<br>-CategoryMap::GetAtIndex (uint32_t index)<br>-{<br>-    Mutex::Locker locker(m_map_mutex);<br>-    <br>-    if (index < m_map.size())<br>-    {<br>-        MapIterator pos, end = m_map.end();<br>-        for (pos = m_map.begin(); pos != end; pos++)<br>-        {<br>-            if (index == 0)<br>-                return pos->second;<br>-            index--;<br>-        }<br>-    }<br>-    <br>-    return TypeCategoryImplSP();<br>-}<br>-<br> lldb::TypeCategoryImplSP<br> FormatManager::GetCategory (const ConstString& category_name,<br>                          bool can_create)<br>@@ -686,7 +311,103 @@ FormatManager::GetValidTypeName (const C<br>     return ::GetValidTypeName_Impl(type);<br> }<br><br>-FormatManager::FormatManager() : <br>+ConstString<br>+GetTypeForCache (ValueObject& valobj,<br>+                 lldb::DynamicValueType use_dynamic)<br>+{<br>+    if (use_dynamic == lldb::eNoDynamicValues)<br>+    {<br>+        if (valobj.IsDynamic())<br>+        {<br>+            if (valobj.GetStaticValue())<br>+                return valobj.GetStaticValue()->GetQualifiedTypeName();<br>+            else<br>+                return ConstString();<br>+        }<br>+        else<br>+            return valobj.GetQualifiedTypeName();<br>+    }<br>+    if (valobj.IsDynamic())<br>+        return valobj.GetQualifiedTypeName();<br>+    if (valobj.GetDynamicValue(use_dynamic))<br>+        return valobj.GetDynamicValue(use_dynamic)->GetQualifiedTypeName();<br>+    return ConstString();<br>+}<br>+<br>+#define USE_CACHE 1<br>+lldb::TypeSummaryImplSP<br>+FormatManager::GetSummaryFormat (ValueObject& valobj,<br>+                                 lldb::DynamicValueType use_dynamic)<br>+{<br>+    TypeSummaryImplSP retval;<br>+#if USE_CACHE<br>+    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_TYPES));<br>+    ConstString valobj_type(GetTypeForCache(valobj, use_dynamic));<br>+    if (valobj_type)<br>+    {<br>+        if (log)<br>+            log->Printf("[FormatManager::GetSummaryFormat] Looking into cache for type %s", valobj_type.AsCString("<invalid>"));<br>+        if (m_format_cache.GetSummary(valobj_type,retval))<br>+            return retval;<br>+        if (log)<br>+            log->Printf("[FormatManager::GetSummaryFormat] Cache search failed. Going normal route");<br>+    }<br>+#endif<br>+    retval = m_categories_map.GetSummaryFormat(valobj, use_dynamic);<br>+#if USE_CACHE<br>+    if (valobj_type)<br>+    {<br>+        if (log)<br>+            log->Printf("[FormatManager::GetSummaryFormat] Caching %p for type %s",retval.get(),valobj_type.AsCString("<invalid>"));<br>+        m_format_cache.SetSummary(valobj_type,retval);<br>+    }<br>+#ifdef LLDB_CONFIGURATION_DEBUG<br>+    if (log)<br>+        log->Printf("[FormatManager::GetSummaryFormat] Cache hits: %llu - Cache Misses: %llu", m_format_cache.GetCacheHits(), m_format_cache.GetCacheMisses());<br>+#endif<br>+#endif<br>+    return retval;<br>+}<br>+<br>+#ifndef LLDB_DISABLE_PYTHON<br>+lldb::SyntheticChildrenSP<br>+FormatManager::GetSyntheticChildren (ValueObject& valobj,<br>+                      lldb::DynamicValueType use_dynamic)<br>+{<br>+    SyntheticChildrenSP retval;<br>+#if USE_CACHE<br>+    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_TYPES));<br>+    ConstString valobj_type(GetTypeForCache(valobj, use_dynamic));<br>+    if (valobj_type)<br>+    {<br>+        if (log)<br>+            log->Printf("[FormatManager::GetSyntheticChildren] Looking into cache for type %s\n", valobj_type.AsCString("<invalid>"));<br>+        if (m_format_cache.GetSynthetic(valobj_type,retval))<br>+            return retval;<br>+        if (log)<br>+            log->Printf("[FormatManager::GetSyntheticChildren] Cache search failed. Going normal route\n");<br>+    }<br>+#endif<br>+    retval = m_categories_map.GetSyntheticChildren(valobj, use_dynamic);<br>+#if USE_CACHE<br>+    if (valobj_type)<br>+    {<br>+        if (log)<br>+            log->Printf("[FormatManager::GetSyntheticChildren] Caching %p for type %s\n",retval.get(),valobj_type.AsCString("<invalid>"));<br>+        m_format_cache.SetSynthetic(valobj_type,retval);<br>+    }<br>+#ifdef LLDB_CONFIGURATION_DEBUG<br>+    if (log)<br>+        log->Printf("[FormatManager::GetSyntheticChildren] Cache hits: %llu - Cache Misses: %llu", m_format_cache.GetCacheHits(), m_format_cache.GetCacheMisses());<br>+#endif<br>+#endif<br>+    return retval;<br>+}<br>+#endif<br>+#undef USE_CACHE<br>+<br>+FormatManager::FormatManager() :<br>+    m_format_cache(),<br>     m_value_nav("format",this),<br>     m_named_summaries_map(this),<br>     m_last_revision(0),<br>@@ -702,21 +423,20 @@ FormatManager::FormatManager() : <br>     m_vectortypes_category_name(ConstString("VectorTypes")),<br>     m_appkit_category_name(ConstString("AppKit"))<br> {<br>-    <br>     LoadSystemFormatters();<br>     LoadLibStdcppFormatters();<br>     LoadLibcxxFormatters();<br>     LoadObjCFormatters();<br><br>-    EnableCategory(m_objc_category_name,CategoryMap::Last);<br>-    EnableCategory(m_corefoundation_category_name,CategoryMap::Last);<br>-    EnableCategory(m_appkit_category_name,CategoryMap::Last);<br>-    EnableCategory(m_coreservices_category_name,CategoryMap::Last);<br>-    EnableCategory(m_coregraphics_category_name,CategoryMap::Last);<br>-    EnableCategory(m_gnu_cpp_category_name,CategoryMap::Last);<br>-    EnableCategory(m_libcxx_category_name,CategoryMap::Last);<br>-    EnableCategory(m_vectortypes_category_name,CategoryMap::Last);<br>-    EnableCategory(m_system_category_name,CategoryMap::Last);<br>+    EnableCategory(m_objc_category_name,TypeCategoryMap::Last);<br>+    EnableCategory(m_corefoundation_category_name,TypeCategoryMap::Last);<br>+    EnableCategory(m_appkit_category_name,TypeCategoryMap::Last);<br>+    EnableCategory(m_coreservices_category_name,TypeCategoryMap::Last);<br>+    EnableCategory(m_coregraphics_category_name,TypeCategoryMap::Last);<br>+    EnableCategory(m_gnu_cpp_category_name,TypeCategoryMap::Last);<br>+    EnableCategory(m_libcxx_category_name,TypeCategoryMap::Last);<br>+    EnableCategory(m_vectortypes_category_name,TypeCategoryMap::Last);<br>+    EnableCategory(m_system_category_name,TypeCategoryMap::Last);<br> }<br><br> static void<br>@@ -769,7 +489,7 @@ static void AddCXXSynthetic  (TypeCatego<br>                               CXXSyntheticChildren::CreateFrontEndCallback generator,<br>                               const char* description,<br>                               ConstString type_name,<br>-                              TypeSyntheticImpl::Flags flags)<br>+                              ScriptedSyntheticChildren::Flags flags)<br> {<br>     lldb::SyntheticChildrenSP synth_sp(new CXXSyntheticChildren(flags,description,generator));<br>     category_sp->GetSyntheticNavigator()->Add(type_name,synth_sp);<br>@@ -822,13 +542,13 @@ FormatManager::LoadLibStdcppFormatters()<br>     stl_synth_flags.SetCascades(true).SetSkipPointers(false).SetSkipReferences(false);<br><br>     gnu_category_sp->GetRegexSyntheticNavigator()->Add(RegularExpressionSP(new RegularExpression("^std::vector<.+>(( )?&)?$")),<br>-                                                       SyntheticChildrenSP(new TypeSyntheticImpl(stl_synth_flags,<br>+                                                       SyntheticChildrenSP(new ScriptedSyntheticChildren(stl_synth_flags,<br>                                                                                                  "lldb.formatters.cpp.gnu_libstdcpp.StdVectorSynthProvider")));<br>     gnu_category_sp->GetRegexSyntheticNavigator()->Add(RegularExpressionSP(new RegularExpression("^std::map<.+> >(( )?&)?$")),<br>-                                                       SyntheticChildrenSP(new TypeSyntheticImpl(stl_synth_flags,<br>+                                                       SyntheticChildrenSP(new ScriptedSyntheticChildren(stl_synth_flags,<br>                                                                                                  "lldb.formatters.cpp.gnu_libstdcpp.StdMapSynthProvider")));<br>     gnu_category_sp->GetRegexSyntheticNavigator()->Add(RegularExpressionSP(new RegularExpression("^std::list<.+>(( )?&)?$")),<br>-                                                       SyntheticChildrenSP(new TypeSyntheticImpl(stl_synth_flags,<br>+                                                       SyntheticChildrenSP(new ScriptedSyntheticChildren(stl_synth_flags,<br>                                                                                                  "lldb.formatters.cpp.gnu_libstdcpp.StdListSynthProvider")));<br><br>     stl_summary_flags.SetDontShowChildren(false);<br>@@ -879,22 +599,22 @@ FormatManager::LoadLibcxxFormatters()<br>     stl_synth_flags.SetCascades(true).SetSkipPointers(false).SetSkipReferences(false);<br><br>     libcxx_category_sp->GetRegexSyntheticNavigator()->Add(RegularExpressionSP(new RegularExpression("^std::__1::vector<.+>(( )?&)?$")),<br>-                                                       SyntheticChildrenSP(new TypeSyntheticImpl(stl_synth_flags,<br>+                                                       SyntheticChildrenSP(new ScriptedSyntheticChildren(stl_synth_flags,<br>                                                                                                  "lldb.formatters.cpp.libcxx.stdvector_SynthProvider")));<br>     libcxx_category_sp->GetRegexSyntheticNavigator()->Add(RegularExpressionSP(new RegularExpression("^std::__1::list<.+>(( )?&)?$")),<br>-                                                       SyntheticChildrenSP(new TypeSyntheticImpl(stl_synth_flags,<br>+                                                       SyntheticChildrenSP(new ScriptedSyntheticChildren(stl_synth_flags,<br>                                                                                                  "lldb.formatters.cpp.libcxx.stdlist_SynthProvider")));<br>     libcxx_category_sp->GetRegexSyntheticNavigator()->Add(RegularExpressionSP(new RegularExpression("^std::__1::map<.+> >(( )?&)?$")),<br>-                                                       SyntheticChildrenSP(new TypeSyntheticImpl(stl_synth_flags,<br>+                                                       SyntheticChildrenSP(new ScriptedSyntheticChildren(stl_synth_flags,<br>                                                                                                  "lldb.formatters.cpp.libcxx.stdmap_SynthProvider")));<br>     libcxx_category_sp->GetRegexSyntheticNavigator()->Add(RegularExpressionSP(new RegularExpression("^(std::__1::)deque<.+>(( )?&)?$")),<br>-                                                          SyntheticChildrenSP(new TypeSyntheticImpl(stl_synth_flags,<br>+                                                          SyntheticChildrenSP(new ScriptedSyntheticChildren(stl_synth_flags,<br>                                                                                                     "lldb.formatters.cpp.libcxx.stddeque_SynthProvider")));<br>     libcxx_category_sp->GetRegexSyntheticNavigator()->Add(RegularExpressionSP(new RegularExpression("^(std::__1::)shared_ptr<.+>(( )?&)?$")),<br>-                                                          SyntheticChildrenSP(new TypeSyntheticImpl(stl_synth_flags,<br>+                                                          SyntheticChildrenSP(new ScriptedSyntheticChildren(stl_synth_flags,<br>                                                                                                     "lldb.formatters.cpp.libcxx.stdsharedptr_SynthProvider")));<br>     libcxx_category_sp->GetRegexSyntheticNavigator()->Add(RegularExpressionSP(new RegularExpression("^(std::__1::)weak_ptr<.+>(( )?&)?$")),<br>-                                                          SyntheticChildrenSP(new TypeSyntheticImpl(stl_synth_flags,<br>+                                                          SyntheticChildrenSP(new ScriptedSyntheticChildren(stl_synth_flags,<br>                                                                                                     "lldb.formatters.cpp.libcxx.stdsharedptr_SynthProvider")));<br><br>     stl_summary_flags.SetDontShowChildren(false);stl_summary_flags.SetSkipPointers(true);<br>@@ -1141,18 +861,18 @@ FormatManager::LoadObjCFormatters()<br><br>     appkit_flags.SetDontShowChildren(true);<br><br>-    AddCXXSynthetic(appkit_category_sp, lldb_private::formatters::NSArraySyntheticFrontEndCreator, "NSArray synthetic children", ConstString("__NSArrayM"), TypeSyntheticImpl::Flags());<br>-    AddCXXSynthetic(appkit_category_sp, lldb_private::formatters::NSArraySyntheticFrontEndCreator, "NSArray synthetic children", ConstString("__NSArrayI"), TypeSyntheticImpl::Flags());<br>-    AddCXXSynthetic(appkit_category_sp, lldb_private::formatters::NSArraySyntheticFrontEndCreator, "NSArray synthetic children", ConstString("NSArray"), TypeSyntheticImpl::Flags());<br>-    AddCXXSynthetic(appkit_category_sp, lldb_private::formatters::NSArraySyntheticFrontEndCreator, "NSArray synthetic children", ConstString("NSMutableArray"), TypeSyntheticImpl::Flags());<br>-    AddCXXSynthetic(appkit_category_sp, lldb_private::formatters::NSArraySyntheticFrontEndCreator, "NSArray synthetic children", ConstString("__NSCFArray"), TypeSyntheticImpl::Flags());<br>-<br>-    AddCXXSynthetic(appkit_category_sp, lldb_private::formatters::NSDictionarySyntheticFrontEndCreator, "NSDictionary synthetic children", ConstString("__NSDictionaryM"), TypeSyntheticImpl::Flags());<br>-    AddCXXSynthetic(appkit_category_sp, lldb_private::formatters::NSDictionarySyntheticFrontEndCreator, "NSDictionary synthetic children", ConstString("__NSDictionaryI"), TypeSyntheticImpl::Flags());<br>-    AddCXXSynthetic(appkit_category_sp, lldb_private::formatters::NSDictionarySyntheticFrontEndCreator, "NSDictionary synthetic children", ConstString("NSDictionary"), TypeSyntheticImpl::Flags());<br>-    AddCXXSynthetic(appkit_category_sp, lldb_private::formatters::NSDictionarySyntheticFrontEndCreator, "NSDictionary synthetic children", ConstString("NSMutableDictionary"), TypeSyntheticImpl::Flags());<br>-    AddCXXSynthetic(appkit_category_sp, lldb_private::formatters::NSDictionarySyntheticFrontEndCreator, "NSDictionary synthetic children", ConstString("CFDictionaryRef"), TypeSyntheticImpl::Flags());<br>-    AddCXXSynthetic(appkit_category_sp, lldb_private::formatters::NSDictionarySyntheticFrontEndCreator, "NSDictionary synthetic children", ConstString("CFMutableDictionaryRef"), TypeSyntheticImpl::Flags());<br>+    AddCXXSynthetic(appkit_category_sp, lldb_private::formatters::NSArraySyntheticFrontEndCreator, "NSArray synthetic children", ConstString("__NSArrayM"), ScriptedSyntheticChildren::Flags());<br>+    AddCXXSynthetic(appkit_category_sp, lldb_private::formatters::NSArraySyntheticFrontEndCreator, "NSArray synthetic children", ConstString("__NSArrayI"), ScriptedSyntheticChildren::Flags());<br>+    AddCXXSynthetic(appkit_category_sp, lldb_private::formatters::NSArraySyntheticFrontEndCreator, "NSArray synthetic children", ConstString("NSArray"), ScriptedSyntheticChildren::Flags());<br>+    AddCXXSynthetic(appkit_category_sp, lldb_private::formatters::NSArraySyntheticFrontEndCreator, "NSArray synthetic children", ConstString("NSMutableArray"), ScriptedSyntheticChildren::Flags());<br>+    AddCXXSynthetic(appkit_category_sp, lldb_private::formatters::NSArraySyntheticFrontEndCreator, "NSArray synthetic children", ConstString("__NSCFArray"), ScriptedSyntheticChildren::Flags());<br>+<br>+    AddCXXSynthetic(appkit_category_sp, lldb_private::formatters::NSDictionarySyntheticFrontEndCreator, "NSDictionary synthetic children", ConstString("__NSDictionaryM"), ScriptedSyntheticChildren::Flags());<br>+    AddCXXSynthetic(appkit_category_sp, lldb_private::formatters::NSDictionarySyntheticFrontEndCreator, "NSDictionary synthetic children", ConstString("__NSDictionaryI"), ScriptedSyntheticChildren::Flags());<br>+    AddCXXSynthetic(appkit_category_sp, lldb_private::formatters::NSDictionarySyntheticFrontEndCreator, "NSDictionary synthetic children", ConstString("NSDictionary"), ScriptedSyntheticChildren::Flags());<br>+    AddCXXSynthetic(appkit_category_sp, lldb_private::formatters::NSDictionarySyntheticFrontEndCreator, "NSDictionary synthetic children", ConstString("NSMutableDictionary"), ScriptedSyntheticChildren::Flags());<br>+    AddCXXSynthetic(appkit_category_sp, lldb_private::formatters::NSDictionarySyntheticFrontEndCreator, "NSDictionary synthetic children", ConstString("CFDictionaryRef"), ScriptedSyntheticChildren::Flags());<br>+    AddCXXSynthetic(appkit_category_sp, lldb_private::formatters::NSDictionarySyntheticFrontEndCreator, "NSDictionary synthetic children", ConstString("CFMutableDictionaryRef"), ScriptedSyntheticChildren::Flags());<br><br>     AddScriptSummary(appkit_category_sp, "lldb.formatters.objc.CFBag.CFBag_SummaryProvider", ConstString("CFBagRef"), appkit_flags);<br>     AddScriptSummary(appkit_category_sp, "lldb.formatters.objc.CFBag.CFBag_SummaryProvider", ConstString("__CFBag"), appkit_flags);<br>@@ -1182,15 +902,14 @@ FormatManager::LoadObjCFormatters()<br>     AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSDataSummaryProvider<true>, "NSData summary provider", ConstString("CFDataRef"), appkit_flags);<br>     AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSDataSummaryProvider<true>, "NSData summary provider", ConstString("CFMutableDataRef"), appkit_flags);<br><br>-    AddScriptSummary(appkit_category_sp, "lldb.formatters.objc.NSException.NSException_SummaryProvider", ConstString("NSException"), appkit_flags);<br>-<br>     AddScriptSummary(appkit_category_sp, "lldb.formatters.objc.NSMachPort.NSMachPort_SummaryProvider", ConstString("NSMachPort"), appkit_flags);<br><br>     AddScriptSummary(appkit_category_sp, "lldb.formatters.objc.NSNotification.NSNotification_SummaryProvider", ConstString("NSNotification"), appkit_flags);<br>     AddScriptSummary(appkit_category_sp, "lldb.formatters.objc.NSNotification.NSNotification_SummaryProvider", ConstString("NSConcreteNotification"), appkit_flags);<br><br>     AddStringSummary(appkit_category_sp, "domain: ${var._domain} - code: ${var._code}", ConstString("NSError"), appkit_flags);<br>-    <br>+    AddStringSummary(appkit_category_sp,"name:${var.name%S} reason:${var.reason%S}",ConstString("NSException"),appkit_flags);<br>+<br>     AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSNumberSummaryProvider, "NSNumber summary provider", ConstString("NSNumber"), appkit_flags);<br>     AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSNumberSummaryProvider, "NSNumber summary provider", ConstString("__NSCFBoolean"), appkit_flags);<br>     AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSNumberSummaryProvider, "NSNumber summary provider", ConstString("__NSCFNumber"), appkit_flags);<br>@@ -1202,6 +921,7 @@ FormatManager::LoadObjCFormatters()<br>     AddCXXSummary(appkit_category_sp, lldb_private::formatters::RuntimeSpecificDescriptionSummaryProvider, "NSTask summary provider", ConstString("NSTask"), appkit_flags);<br>     AddCXXSummary(appkit_category_sp, lldb_private::formatters::RuntimeSpecificDescriptionSummaryProvider, "NSValue summary provider", ConstString("NSValue"), appkit_flags);<br><br>+<br>     AddScriptSummary(appkit_category_sp, "lldb.formatters.objc.NSSet.NSSet_SummaryProvider", ConstString("NSSet"), appkit_flags);<br>     AddScriptSummary(appkit_category_sp, "lldb.formatters.objc.NSSet.NSSet_SummaryProvider2", ConstString("CFSetRef"), appkit_flags);<br>     AddScriptSummary(appkit_category_sp, "lldb.formatters.objc.NSSet.NSSet_SummaryProvider2", ConstString("CFMutableSetRef"), appkit_flags);<br><br>Added: lldb/trunk/source/DataFormatters/TypeCategory.cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/TypeCategory.cpp?rev=173728&view=auto">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/TypeCategory.cpp?rev=173728&view=auto</a><br>==============================================================================<br>--- lldb/trunk/source/DataFormatters/TypeCategory.cpp (added)<br>+++ lldb/trunk/source/DataFormatters/TypeCategory.cpp Mon Jan 28 17:47:25 2013<br>@@ -0,0 +1,378 @@<br>+//===-- TypeCategory.cpp -------------------------------------------*- C++ -*-===//<br>+//<br>+//                     The LLVM Compiler Infrastructure<br>+//<br>+// This file is distributed under the University of Illinois Open Source<br>+// License. See LICENSE.TXT for details.<br>+//<br>+//===----------------------------------------------------------------------===//<br>+<br>+#include "lldb/DataFormatters/TypeCategory.h"<br>+<br>+// C Includes<br>+// C++ Includes<br>+// Other libraries and framework includes<br>+// Project includes<br>+<br>+using namespace lldb;<br>+using namespace lldb_private;<br>+<br>+TypeCategoryImpl::TypeCategoryImpl(IFormatChangeListener* clist,<br>+                                   ConstString name) :<br>+m_summary_nav(new SummaryNavigator("summary",clist)),<br>+m_regex_summary_nav(new RegexSummaryNavigator("regex-summary",clist)),<br>+m_filter_nav(new FilterNavigator("filter",clist)),<br>+m_regex_filter_nav(new RegexFilterNavigator("regex-filter",clist)),<br>+#ifndef LLDB_DISABLE_PYTHON<br>+m_synth_nav(new SynthNavigator("synth",clist)),<br>+m_regex_synth_nav(new RegexSynthNavigator("regex-synth",clist)),<br>+#endif<br>+m_enabled(false),<br>+m_change_listener(clist),<br>+m_mutex(Mutex::eMutexTypeRecursive),<br>+m_name(name)<br>+{}<br>+<br>+bool<br>+TypeCategoryImpl::Get (ValueObject& valobj,<br>+                       lldb::TypeSummaryImplSP& entry,<br>+                       lldb::DynamicValueType use_dynamic,<br>+                       uint32_t* reason)<br>+{<br>+    if (!IsEnabled())<br>+        return false;<br>+    if (GetSummaryNavigator()->Get(valobj, entry, use_dynamic, reason))<br>+        return true;<br>+    bool regex = GetRegexSummaryNavigator()->Get(valobj, entry, use_dynamic, reason);<br>+    if (regex && reason)<br>+        *reason |= lldb_private::eFormatterChoiceCriterionRegularExpressionSummary;<br>+    return regex;<br>+}<br>+<br>+bool<br>+TypeCategoryImpl::Get(ValueObject& valobj,<br>+                      lldb::SyntheticChildrenSP& entry_sp,<br>+                      lldb::DynamicValueType use_dynamic,<br>+                      uint32_t* reason)<br>+{<br>+    if (!IsEnabled())<br>+        return false;<br>+    TypeFilterImpl::SharedPointer filter_sp;<br>+    uint32_t reason_filter = 0;<br>+    bool regex_filter = false;<br>+    // first find both Filter and Synth, and then check which is most recent<br>+    <br>+    if (!GetFilterNavigator()->Get(valobj, filter_sp, use_dynamic, &reason_filter))<br>+        regex_filter = GetRegexFilterNavigator()->Get (valobj, filter_sp, use_dynamic, &reason_filter);<br>+    <br>+#ifndef LLDB_DISABLE_PYTHON<br>+    bool regex_synth = false;<br>+    uint32_t reason_synth = 0;<br>+    bool pick_synth = false;<br>+    ScriptedSyntheticChildren::SharedPointer synth;<br>+    if (!GetSyntheticNavigator()->Get(valobj, synth, use_dynamic, &reason_synth))<br>+        regex_synth = GetRegexSyntheticNavigator()->Get (valobj, synth, use_dynamic, &reason_synth);<br>+    if (!filter_sp.get() && !synth.get())<br>+        return false;<br>+    else if (!filter_sp.get() && synth.get())<br>+        pick_synth = true;<br>+    <br>+    else if (filter_sp.get() && !synth.get())<br>+        pick_synth = false;<br>+    <br>+    else /*if (filter_sp.get() && synth.get())*/<br>+    {<br>+        if (filter_sp->GetRevision() > synth->GetRevision())<br>+            pick_synth = false;<br>+        else<br>+            pick_synth = true;<br>+    }<br>+    if (pick_synth)<br>+    {<br>+        if (regex_synth && reason)<br>+            *reason |= lldb_private::eFormatterChoiceCriterionRegularExpressionFilter;<br>+        entry_sp = synth;<br>+        return true;<br>+    }<br>+    else<br>+    {<br>+        if (regex_filter && reason)<br>+            *reason |= lldb_private::eFormatterChoiceCriterionRegularExpressionFilter;<br>+        entry_sp = filter_sp;<br>+        return true;<br>+    }<br>+    <br>+#else<br>+    if (filter_sp)<br>+    {<br>+        entry_sp = filter_sp;<br>+        return true;<br>+    }<br>+#endif<br>+    <br>+    return false;<br>+    <br>+}<br>+<br>+void<br>+TypeCategoryImpl::Clear (FormatCategoryItems items)<br>+{<br>+    if ( (items & eFormatCategoryItemSummary) == eFormatCategoryItemSummary )<br>+        m_summary_nav->Clear();<br>+    if ( (items & eFormatCategoryItemRegexSummary) == eFormatCategoryItemRegexSummary )<br>+        m_regex_summary_nav->Clear();<br>+    if ( (items & eFormatCategoryItemFilter)  == eFormatCategoryItemFilter )<br>+        m_filter_nav->Clear();<br>+    if ( (items & eFormatCategoryItemRegexFilter) == eFormatCategoryItemRegexFilter )<br>+        m_regex_filter_nav->Clear();<br>+#ifndef LLDB_DISABLE_PYTHON<br>+    if ( (items & eFormatCategoryItemSynth)  == eFormatCategoryItemSynth )<br>+        m_synth_nav->Clear();<br>+    if ( (items & eFormatCategoryItemRegexSynth) == eFormatCategoryItemRegexSynth )<br>+        m_regex_synth_nav->Clear();<br>+#endif<br>+}<br>+<br>+bool<br>+TypeCategoryImpl::Delete (ConstString name,<br>+                          FormatCategoryItems items)<br>+{<br>+    bool success = false;<br>+    if ( (items & eFormatCategoryItemSummary) == eFormatCategoryItemSummary )<br>+        success = m_summary_nav->Delete(name) || success;<br>+    if ( (items & eFormatCategoryItemRegexSummary) == eFormatCategoryItemRegexSummary )<br>+        success = m_regex_summary_nav->Delete(name) || success;<br>+    if ( (items & eFormatCategoryItemFilter)  == eFormatCategoryItemFilter )<br>+        success = m_filter_nav->Delete(name) || success;<br>+    if ( (items & eFormatCategoryItemRegexFilter) == eFormatCategoryItemRegexFilter )<br>+        success = m_regex_filter_nav->Delete(name) || success;<br>+#ifndef LLDB_DISABLE_PYTHON<br>+    if ( (items & eFormatCategoryItemSynth)  == eFormatCategoryItemSynth )<br>+        success = m_synth_nav->Delete(name) || success;<br>+    if ( (items & eFormatCategoryItemRegexSynth) == eFormatCategoryItemRegexSynth )<br>+        success = m_regex_synth_nav->Delete(name) || success;<br>+#endif<br>+    return success;<br>+}<br>+<br>+uint32_t<br>+TypeCategoryImpl::GetCount (FormatCategoryItems items)<br>+{<br>+    uint32_t count = 0;<br>+    if ( (items & eFormatCategoryItemSummary) == eFormatCategoryItemSummary )<br>+        count += m_summary_nav->GetCount();<br>+    if ( (items & eFormatCategoryItemRegexSummary) == eFormatCategoryItemRegexSummary )<br>+        count += m_regex_summary_nav->GetCount();<br>+    if ( (items & eFormatCategoryItemFilter)  == eFormatCategoryItemFilter )<br>+        count += m_filter_nav->GetCount();<br>+    if ( (items & eFormatCategoryItemRegexFilter) == eFormatCategoryItemRegexFilter )<br>+        count += m_regex_filter_nav->GetCount();<br>+#ifndef LLDB_DISABLE_PYTHON<br>+    if ( (items & eFormatCategoryItemSynth)  == eFormatCategoryItemSynth )<br>+        count += m_synth_nav->GetCount();<br>+    if ( (items & eFormatCategoryItemRegexSynth) == eFormatCategoryItemRegexSynth )<br>+        count += m_regex_synth_nav->GetCount();<br>+#endif<br>+    return count;<br>+}<br>+<br>+bool<br>+TypeCategoryImpl::AnyMatches(ConstString type_name,<br>+                             FormatCategoryItems items,<br>+                             bool only_enabled,<br>+                             const char** matching_category,<br>+                             FormatCategoryItems* matching_type)<br>+{<br>+    if (!IsEnabled() && only_enabled)<br>+        return false;<br>+    <br>+    lldb::TypeSummaryImplSP summary;<br>+    TypeFilterImpl::SharedPointer filter;<br>+#ifndef LLDB_DISABLE_PYTHON<br>+    ScriptedSyntheticChildren::SharedPointer synth;<br>+#endif<br>+    <br>+    if ( (items & eFormatCategoryItemSummary) == eFormatCategoryItemSummary )<br>+    {<br>+        if (m_summary_nav->Get(type_name, summary))<br>+        {<br>+            if (matching_category)<br>+                *matching_category = m_name.GetCString();<br>+            if (matching_type)<br>+                *matching_type = eFormatCategoryItemSummary;<br>+            return true;<br>+        }<br>+    }<br>+    if ( (items & eFormatCategoryItemRegexSummary) == eFormatCategoryItemRegexSummary )<br>+    {<br>+        if (m_regex_summary_nav->Get(type_name, summary))<br>+        {<br>+            if (matching_category)<br>+                *matching_category = m_name.GetCString();<br>+            if (matching_type)<br>+                *matching_type = eFormatCategoryItemRegexSummary;<br>+            return true;<br>+        }<br>+    }<br>+    if ( (items & eFormatCategoryItemFilter)  == eFormatCategoryItemFilter )<br>+    {<br>+        if (m_filter_nav->Get(type_name, filter))<br>+        {<br>+            if (matching_category)<br>+                *matching_category = m_name.GetCString();<br>+            if (matching_type)<br>+                *matching_type = eFormatCategoryItemFilter;<br>+            return true;<br>+        }<br>+    }<br>+    if ( (items & eFormatCategoryItemRegexFilter) == eFormatCategoryItemRegexFilter )<br>+    {<br>+        if (m_regex_filter_nav->Get(type_name, filter))<br>+        {<br>+            if (matching_category)<br>+                *matching_category = m_name.GetCString();<br>+            if (matching_type)<br>+                *matching_type = eFormatCategoryItemRegexFilter;<br>+            return true;<br>+        }<br>+    }<br>+#ifndef LLDB_DISABLE_PYTHON<br>+    if ( (items & eFormatCategoryItemSynth)  == eFormatCategoryItemSynth )<br>+    {<br>+        if (m_synth_nav->Get(type_name, synth))<br>+        {<br>+            if (matching_category)<br>+                *matching_category = m_name.GetCString();<br>+            if (matching_type)<br>+                *matching_type = eFormatCategoryItemSynth;<br>+            return true;<br>+        }<br>+    }<br>+    if ( (items & eFormatCategoryItemRegexSynth) == eFormatCategoryItemRegexSynth )<br>+    {<br>+        if (m_regex_synth_nav->Get(type_name, synth))<br>+        {<br>+            if (matching_category)<br>+                *matching_category = m_name.GetCString();<br>+            if (matching_type)<br>+                *matching_type = eFormatCategoryItemRegexSynth;<br>+            return true;<br>+        }<br>+    }<br>+#endif<br>+    return false;<br>+}<br>+<br>+TypeCategoryImpl::SummaryNavigator::MapValueType<br>+TypeCategoryImpl::GetSummaryForType (lldb::TypeNameSpecifierImplSP type_sp)<br>+{<br>+    SummaryNavigator::MapValueType retval;<br>+    <br>+    if (type_sp)<br>+    {<br>+        if (type_sp->IsRegex())<br>+            m_regex_summary_nav->GetExact(ConstString(type_sp->GetName()),retval);<br>+        else<br>+            m_summary_nav->GetExact(ConstString(type_sp->GetName()),retval);<br>+    }<br>+    <br>+    return retval;<br>+}<br>+<br>+TypeCategoryImpl::FilterNavigator::MapValueType<br>+TypeCategoryImpl::GetFilterForType (lldb::TypeNameSpecifierImplSP type_sp)<br>+{<br>+    FilterNavigator::MapValueType retval;<br>+    <br>+    if (type_sp)<br>+    {<br>+        if (type_sp->IsRegex())<br>+            m_regex_filter_nav->GetExact(ConstString(type_sp->GetName()),retval);<br>+        else<br>+            m_filter_nav->GetExact(ConstString(type_sp->GetName()),retval);<br>+    }<br>+    <br>+    return retval;<br>+}<br>+<br>+#ifndef LLDB_DISABLE_PYTHON<br>+TypeCategoryImpl::SynthNavigator::MapValueType<br>+TypeCategoryImpl::GetSyntheticForType (lldb::TypeNameSpecifierImplSP type_sp)<br>+{<br>+    SynthNavigator::MapValueType retval;<br>+    <br>+    if (type_sp)<br>+    {<br>+        if (type_sp->IsRegex())<br>+            m_regex_synth_nav->GetExact(ConstString(type_sp->GetName()),retval);<br>+        else<br>+            m_synth_nav->GetExact(ConstString(type_sp->GetName()),retval);<br>+    }<br>+    <br>+    return retval;<br>+}<br>+#endif<br>+<br>+lldb::TypeNameSpecifierImplSP<br>+TypeCategoryImpl::GetTypeNameSpecifierForSummaryAtIndex (size_t index)<br>+{<br>+    if (index < m_summary_nav->GetCount())<br>+        return m_summary_nav->GetTypeNameSpecifierAtIndex(index);<br>+    else<br>+        return m_regex_summary_nav->GetTypeNameSpecifierAtIndex(index-m_summary_nav->GetCount());<br>+}<br>+<br>+TypeCategoryImpl::SummaryNavigator::MapValueType<br>+TypeCategoryImpl::GetSummaryAtIndex (size_t index)<br>+{<br>+    if (index < m_summary_nav->GetCount())<br>+        return m_summary_nav->GetAtIndex(index);<br>+    else<br>+        return m_regex_summary_nav->GetAtIndex(index-m_summary_nav->GetCount());<br>+}<br>+<br>+TypeCategoryImpl::FilterNavigator::MapValueType<br>+TypeCategoryImpl::GetFilterAtIndex (size_t index)<br>+{<br>+    if (index < m_filter_nav->GetCount())<br>+        return m_filter_nav->GetAtIndex(index);<br>+    else<br>+        return m_regex_filter_nav->GetAtIndex(index-m_filter_nav->GetCount());<br>+}<br>+<br>+lldb::TypeNameSpecifierImplSP<br>+TypeCategoryImpl::GetTypeNameSpecifierForFilterAtIndex (size_t index)<br>+{<br>+    if (index < m_filter_nav->GetCount())<br>+        return m_filter_nav->GetTypeNameSpecifierAtIndex(index);<br>+    else<br>+        return m_regex_filter_nav->GetTypeNameSpecifierAtIndex(index-m_filter_nav->GetCount());<br>+}<br>+<br>+TypeCategoryImpl::SynthNavigator::MapValueType<br>+TypeCategoryImpl::GetSyntheticAtIndex (size_t index)<br>+{<br>+    if (index < m_synth_nav->GetCount())<br>+        return m_synth_nav->GetAtIndex(index);<br>+    else<br>+        return m_regex_synth_nav->GetAtIndex(index-m_synth_nav->GetCount());<br>+}<br>+<br>+lldb::TypeNameSpecifierImplSP<br>+TypeCategoryImpl::GetTypeNameSpecifierForSyntheticAtIndex (size_t index)<br>+{<br>+    if (index < m_synth_nav->GetCount())<br>+        return m_synth_nav->GetTypeNameSpecifierAtIndex(index);<br>+    else<br>+        return m_regex_synth_nav->GetTypeNameSpecifierAtIndex(index - m_synth_nav->GetCount());<br>+}<br>+<br>+void<br>+TypeCategoryImpl::Enable (bool value, uint32_t position)<br>+{<br>+    Mutex::Locker locker(m_mutex);<br>+    m_enabled = value;<br>+    m_enabled_position = position;<br>+    if (m_change_listener)<br>+        m_change_listener->Changed();<br>+}<br><br>Added: lldb/trunk/source/DataFormatters/TypeCategoryMap.cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/TypeCategoryMap.cpp?rev=173728&view=auto">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/TypeCategoryMap.cpp?rev=173728&view=auto</a><br>==============================================================================<br>--- lldb/trunk/source/DataFormatters/TypeCategoryMap.cpp (added)<br>+++ lldb/trunk/source/DataFormatters/TypeCategoryMap.cpp Mon Jan 28 17:47:25 2013<br>@@ -0,0 +1,283 @@<br>+//===-- TypeCategoryMap.cpp ----------------------------------------*- C++ -*-===//<br>+//<br>+//                     The LLVM Compiler Infrastructure<br>+//<br>+// This file is distributed under the University of Illinois Open Source<br>+// License. See LICENSE.TXT for details.<br>+//<br>+//===----------------------------------------------------------------------===//<br>+<br>+#include "lldb/DataFormatters/TypeCategoryMap.h"<br>+<br>+// C Includes<br>+// C++ Includes<br>+// Other libraries and framework includes<br>+// Project includes<br>+<br>+using namespace lldb;<br>+using namespace lldb_private;<br>+<br>+TypeCategoryMap::TypeCategoryMap (IFormatChangeListener* lst) :<br>+m_map_mutex(Mutex::eMutexTypeRecursive),<br>+listener(lst),<br>+m_map(),<br>+m_active_categories()<br>+{<br>+    ConstString default_cs("default");<br>+    lldb::TypeCategoryImplSP default_sp = lldb::TypeCategoryImplSP(new TypeCategoryImpl(listener, default_cs));<br>+    Add(default_cs,default_sp);<br>+    Enable(default_cs,First);<br>+}<br>+<br>+void<br>+TypeCategoryMap::Add (KeyType name, const ValueSP& entry)<br>+{<br>+    Mutex::Locker locker(m_map_mutex);<br>+    m_map[name] = entry;<br>+    if (listener)<br>+        listener->Changed();<br>+}<br>+<br>+bool<br>+TypeCategoryMap::Delete (KeyType name)<br>+{<br>+    Mutex::Locker locker(m_map_mutex);<br>+    MapIterator iter = m_map.find(name);<br>+    if (iter == m_map.end())<br>+        return false;<br>+    m_map.erase(name);<br>+    Disable(name);<br>+    if (listener)<br>+        listener->Changed();<br>+    return true;<br>+}<br>+<br>+bool<br>+TypeCategoryMap::Enable (KeyType category_name, Position pos)<br>+{<br>+    Mutex::Locker locker(m_map_mutex);<br>+    ValueSP category;<br>+    if (!Get(category_name,category))<br>+        return false;<br>+    return Enable(category, pos);<br>+}<br>+<br>+bool<br>+TypeCategoryMap::Disable (KeyType category_name)<br>+{<br>+    Mutex::Locker locker(m_map_mutex);<br>+    ValueSP category;<br>+    if (!Get(category_name,category))<br>+        return false;<br>+    return Disable(category);<br>+}<br>+<br>+bool<br>+TypeCategoryMap::Enable (ValueSP category, Position pos)<br>+{<br>+    Mutex::Locker locker(m_map_mutex);<br>+    if (category.get())<br>+    {<br>+        Position pos_w = pos;<br>+        if (pos == First || m_active_categories.size() == 0)<br>+            m_active_categories.push_front(category);<br>+        else if (pos == Last || pos == m_active_categories.size())<br>+            m_active_categories.push_back(category);<br>+        else if (pos < m_active_categories.size())<br>+        {<br>+            ActiveCategoriesList::iterator iter = m_active_categories.begin();<br>+            while (pos_w)<br>+            {<br>+                pos_w--,iter++;<br>+            }<br>+            m_active_categories.insert(iter,category);<br>+        }<br>+        else<br>+            return false;<br>+        category->Enable(true,<br>+                         pos);<br>+        return true;<br>+    }<br>+    return false;<br>+}<br>+<br>+bool<br>+TypeCategoryMap::Disable (ValueSP category)<br>+{<br>+    Mutex::Locker locker(m_map_mutex);<br>+    if (category.get())<br>+    {<br>+        m_active_categories.remove_if(delete_matching_categories(category));<br>+        category->Disable();<br>+        return true;<br>+    }<br>+    return false;<br>+}<br>+<br>+void<br>+TypeCategoryMap::Clear ()<br>+{<br>+    Mutex::Locker locker(m_map_mutex);<br>+    m_map.clear();<br>+    m_active_categories.clear();<br>+    if (listener)<br>+        listener->Changed();<br>+}<br>+<br>+bool<br>+TypeCategoryMap::Get (KeyType name, ValueSP& entry)<br>+{<br>+    Mutex::Locker locker(m_map_mutex);<br>+    MapIterator iter = m_map.find(name);<br>+    if (iter == m_map.end())<br>+        return false;<br>+    entry = iter->second;<br>+    return true;<br>+}<br>+<br>+bool<br>+TypeCategoryMap::Get (uint32_t pos, ValueSP& entry)<br>+{<br>+    Mutex::Locker locker(m_map_mutex);<br>+    MapIterator iter = m_map.begin();<br>+    MapIterator end = m_map.end();<br>+    while (pos > 0)<br>+    {<br>+        iter++;<br>+        pos--;<br>+        if (iter == end)<br>+            return false;<br>+    }<br>+    entry = iter->second;<br>+    return false;<br>+}<br>+<br>+bool<br>+TypeCategoryMap::AnyMatches (ConstString type_name,<br>+                             TypeCategoryImpl::FormatCategoryItems items,<br>+                             bool only_enabled,<br>+                             const char** matching_category,<br>+                             TypeCategoryImpl::FormatCategoryItems* matching_type)<br>+{<br>+    Mutex::Locker locker(m_map_mutex);<br>+    <br>+    MapIterator pos, end = m_map.end();<br>+    for (pos = m_map.begin(); pos != end; pos++)<br>+    {<br>+        if (pos->second->AnyMatches(type_name,<br>+                                    items,<br>+                                    only_enabled,<br>+                                    matching_category,<br>+                                    matching_type))<br>+            return true;<br>+    }<br>+    return false;<br>+}<br>+<br>+lldb::TypeSummaryImplSP<br>+TypeCategoryMap::GetSummaryFormat (ValueObject& valobj,<br>+                                   lldb::DynamicValueType use_dynamic)<br>+{<br>+    Mutex::Locker locker(m_map_mutex);<br>+    <br>+    uint32_t reason_why;<br>+    ActiveCategoriesIterator begin, end = m_active_categories.end();<br>+    <br>+    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_TYPES));<br>+    <br>+    for (begin = m_active_categories.begin(); begin != end; begin++)<br>+    {<br>+        lldb::TypeCategoryImplSP category_sp = *begin;<br>+        lldb::TypeSummaryImplSP current_format;<br>+        if (log)<br>+            log->Printf("[CategoryMap::GetSummaryFormat] Trying to use category %s\n", category_sp->GetName());<br>+        if (!category_sp->Get(valobj, current_format, use_dynamic, &reason_why))<br>+            continue;<br>+        return current_format;<br>+    }<br>+    if (log)<br>+        log->Printf("[CategoryMap::GetSummaryFormat] nothing found - returning empty SP\n");<br>+    return lldb::TypeSummaryImplSP();<br>+}<br>+<br>+#ifndef LLDB_DISABLE_PYTHON<br>+lldb::SyntheticChildrenSP<br>+TypeCategoryMap::GetSyntheticChildren (ValueObject& valobj,<br>+                                       lldb::DynamicValueType use_dynamic)<br>+{<br>+    Mutex::Locker locker(m_map_mutex);<br>+    <br>+    uint32_t reason_why;<br>+    <br>+    ActiveCategoriesIterator begin, end = m_active_categories.end();<br>+    <br>+    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_TYPES));<br>+    <br>+    for (begin = m_active_categories.begin(); begin != end; begin++)<br>+    {<br>+        lldb::TypeCategoryImplSP category_sp = *begin;<br>+        lldb::SyntheticChildrenSP current_format;<br>+        if (log)<br>+            log->Printf("[CategoryMap::GetSyntheticChildren] Trying to use category %s\n", category_sp->GetName());<br>+        if (!category_sp->Get(valobj, current_format, use_dynamic, &reason_why))<br>+            continue;<br>+        return current_format;<br>+    }<br>+    if (log)<br>+        log->Printf("[CategoryMap::GetSyntheticChildren] nothing found - returning empty SP\n");<br>+    return lldb::SyntheticChildrenSP();<br>+}<br>+#endif<br>+<br>+void<br>+TypeCategoryMap::LoopThrough(CallbackType callback, void* param)<br>+{<br>+    if (callback)<br>+    {<br>+        Mutex::Locker locker(m_map_mutex);<br>+        <br>+        // loop through enabled categories in respective order<br>+        {<br>+            ActiveCategoriesIterator begin, end = m_active_categories.end();<br>+            for (begin = m_active_categories.begin(); begin != end; begin++)<br>+            {<br>+                lldb::TypeCategoryImplSP category = *begin;<br>+                ConstString type = ConstString(category->GetName());<br>+                if (!callback(param, category))<br>+                    break;<br>+            }<br>+        }<br>+        <br>+        // loop through disabled categories in just any order<br>+        {<br>+            MapIterator pos, end = m_map.end();<br>+            for (pos = m_map.begin(); pos != end; pos++)<br>+            {<br>+                if (pos->second->IsEnabled())<br>+                    continue;<br>+                KeyType type = pos->first;<br>+                if (!callback(param, pos->second))<br>+                    break;<br>+            }<br>+        }<br>+    }<br>+}<br>+<br>+TypeCategoryImplSP<br>+TypeCategoryMap::GetAtIndex (uint32_t index)<br>+{<br>+    Mutex::Locker locker(m_map_mutex);<br>+    <br>+    if (index < m_map.size())<br>+    {<br>+        MapIterator pos, end = m_map.end();<br>+        for (pos = m_map.begin(); pos != end; pos++)<br>+        {<br>+            if (index == 0)<br>+                return pos->second;<br>+            index--;<br>+        }<br>+    }<br>+    <br>+    return TypeCategoryImplSP();<br>+}<br><br>Added: lldb/trunk/source/DataFormatters/TypeFormat.cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/TypeFormat.cpp?rev=173728&view=auto">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/TypeFormat.cpp?rev=173728&view=auto</a><br>==============================================================================<br>--- lldb/trunk/source/DataFormatters/TypeFormat.cpp (added)<br>+++ lldb/trunk/source/DataFormatters/TypeFormat.cpp Mon Jan 28 17:47:25 2013<br>@@ -0,0 +1,50 @@<br>+//===-- TypeFormat.cpp ----------------------------------------*- C++ -*-===//<br>+//<br>+//                     The LLVM Compiler Infrastructure<br>+//<br>+// This file is distributed under the University of Illinois Open Source<br>+// License. See LICENSE.TXT for details.<br>+//<br>+//===----------------------------------------------------------------------===//<br>+<br>+// C Includes<br>+<br>+// C++ Includes<br>+<br>+// Other libraries and framework includes<br>+<br>+// Project includes<br>+#include "lldb/lldb-public.h"<br>+#include "lldb/lldb-enumerations.h"<br>+<br>+#include "lldb/Core/Debugger.h"<br>+#include "lldb/Core/StreamString.h"<br>+#include "lldb/Core/Timer.h"<br>+#include "lldb/DataFormatters/TypeFormat.h"<br>+#include "lldb/Interpreter/CommandInterpreter.h"<br>+#include "lldb/Symbol/ClangASTType.h"<br>+#include "lldb/Target/StackFrame.h"<br>+#include "lldb/Target/Target.h"<br>+<br>+using namespace lldb;<br>+using namespace lldb_private;<br>+<br>+TypeFormatImpl::TypeFormatImpl (lldb::Format f,<br>+                                const Flags& flags) :<br>+m_flags(flags),<br>+m_format (f)<br>+{<br>+}<br>+<br>+std::string<br>+TypeFormatImpl::GetDescription()<br>+{<br>+    StreamString sstr;<br>+    sstr.Printf ("%s%s%s%s\n",<br>+                 FormatManager::GetFormatAsCString (GetFormat()),<br>+                 Cascades() ? "" : " (not cascading)",<br>+                 SkipsPointers() ? " (skip pointers)" : "",<br>+                 SkipsReferences() ? " (skip references)" : "");<br>+    return sstr.GetString();<br>+}<br>+<br><br>Added: lldb/trunk/source/DataFormatters/TypeSummary.cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/TypeSummary.cpp?rev=173728&view=auto">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/TypeSummary.cpp?rev=173728&view=auto</a><br>==============================================================================<br>--- lldb/trunk/source/DataFormatters/TypeSummary.cpp (added)<br>+++ lldb/trunk/source/DataFormatters/TypeSummary.cpp Mon Jan 28 17:47:25 2013<br>@@ -0,0 +1,239 @@<br>+//===-- TypeSummary.cpp ----------------------------------------*- C++ -*-===//<br>+//<br>+//                     The LLVM Compiler Infrastructure<br>+//<br>+// This file is distributed under the University of Illinois Open Source<br>+// License. See LICENSE.TXT for details.<br>+//<br>+//===----------------------------------------------------------------------===//<br>+<br>+// C Includes<br>+<br>+// C++ Includes<br>+<br>+// Other libraries and framework includes<br>+<br>+// Project includes<br>+#include "lldb/lldb-public.h"<br>+#include "lldb/lldb-enumerations.h"<br>+<br>+#include "lldb/Core/Debugger.h"<br>+#include "lldb/Core/StreamString.h"<br>+#include "lldb/Core/Timer.h"<br>+#include "lldb/DataFormatters/TypeSummary.h"<br>+#include "lldb/Interpreter/CommandInterpreter.h"<br>+#include "lldb/Symbol/ClangASTType.h"<br>+#include "lldb/Target/StackFrame.h"<br>+#include "lldb/Target/Target.h"<br>+<br>+using namespace lldb;<br>+using namespace lldb_private;<br>+<br>+TypeSummaryImpl::TypeSummaryImpl (const TypeSummaryImpl::Flags& flags) :<br>+m_flags(flags)<br>+{<br>+}<br>+<br>+<br>+StringSummaryFormat::StringSummaryFormat (const TypeSummaryImpl::Flags& flags,<br>+                                          const char *format_cstr) :<br>+TypeSummaryImpl(flags),<br>+m_format()<br>+{<br>+    if (format_cstr)<br>+        m_format.assign(format_cstr);<br>+}<br>+<br>+bool<br>+StringSummaryFormat::FormatObject (ValueObject *valobj,<br>+                                   std::string& retval)<br>+{<br>+    if (!valobj)<br>+    {<br>+        retval.assign("NULL ValueObject");<br>+        return false;<br>+    }<br>+    <br>+    StreamString s;<br>+    ExecutionContext exe_ctx (valobj->GetExecutionContextRef());<br>+    SymbolContext sc;<br>+    StackFrame *frame = exe_ctx.GetFramePtr();<br>+    if (frame)<br>+        sc = frame->GetSymbolContext(lldb::eSymbolContextEverything);<br>+    <br>+    if (IsOneliner())<br>+    {<br>+        ValueObject* object;<br>+        <br>+        ValueObjectSP synth_valobj = valobj->GetSyntheticValue();<br>+        if (synth_valobj)<br>+            object = synth_valobj.get();<br>+        else<br>+            object = valobj;<br>+        <br>+        const uint32_t num_children = object->GetNumChildren();<br>+        if (num_children)<br>+        {<br>+            s.PutChar('(');<br>+            <br>+            for (uint32_t idx=0; idx<num_children; ++idx)<br>+            {<br>+                lldb::ValueObjectSP child_sp(object->GetChildAtIndex(idx, true));<br>+                if (child_sp.get())<br>+                {<br>+                    if (idx)<br>+                        s.PutCString(", ");<br>+                    if (!HideNames())<br>+                    {<br>+                        s.PutCString(child_sp.get()->GetName().AsCString());<br>+                        s.PutCString(" = ");<br>+                    }<br>+                    child_sp.get()->DumpPrintableRepresentation(s,<br>+                                                                ValueObject::eValueObjectRepresentationStyleSummary,<br>+                                                                lldb::eFormatInvalid,<br>+                                                                ValueObject::ePrintableRepresentationSpecialCasesDisable);<br>+                }<br>+            }<br>+            <br>+            s.PutChar(')');<br>+            <br>+            retval.assign(s.GetString());<br>+            return true;<br>+        }<br>+        else<br>+        {<br>+            retval.assign("error: oneliner for no children");<br>+            return false;<br>+        }<br>+        <br>+    }<br>+    else<br>+    {<br>+        if (Debugger::FormatPrompt(m_format.c_str(), &sc, &exe_ctx, &sc.line_entry.range.GetBaseAddress(), s, NULL, valobj))<br>+        {<br>+            retval.assign(s.GetString());<br>+            return true;<br>+        }<br>+        else<br>+        {<br>+            retval.assign("error: summary string parsing error");<br>+            return false;<br>+        }<br>+    }<br>+}<br>+<br>+std::string<br>+StringSummaryFormat::GetDescription ()<br>+{<br>+    StreamString sstr;<br>+    <br>+    sstr.Printf ("`%s`%s%s%s%s%s%s%s",      m_format.c_str(),<br>+                 Cascades() ? "" : " (not cascading)",<br>+                 !DoesPrintChildren() ? "" : " (show children)",<br>+                 !DoesPrintValue() ? " (hide value)" : "",<br>+                 IsOneliner() ? " (one-line printout)" : "",<br>+                 SkipsPointers() ? " (skip pointers)" : "",<br>+                 SkipsReferences() ? " (skip references)" : "",<br>+                 HideNames() ? " (hide member names)" : "");<br>+    return sstr.GetString();<br>+}<br>+<br>+CXXFunctionSummaryFormat::CXXFunctionSummaryFormat (const TypeSummaryImpl::Flags& flags,<br>+                                                    Callback impl,<br>+                                                    const char* description) :<br>+TypeSummaryImpl(flags),<br>+m_impl(impl),<br>+m_description(description ? description : "")<br>+{<br>+}<br>+<br>+bool<br>+CXXFunctionSummaryFormat::FormatObject (ValueObject *valobj,<br>+                                        std::string& dest)<br>+{<br>+    dest.clear();<br>+    StreamString stream;<br>+    if (!m_impl || m_impl(*valobj,stream) == false)<br>+        return false;<br>+    dest.assign(stream.GetData());<br>+    return true;<br>+}<br>+<br>+std::string<br>+CXXFunctionSummaryFormat::GetDescription ()<br>+{<br>+    StreamString sstr;<br>+    sstr.Printf ("`%s (%p) `%s%s%s%s%s%s%s",      m_description.c_str(),m_impl,<br>+                 Cascades() ? "" : " (not cascading)",<br>+                 !DoesPrintChildren() ? "" : " (show children)",<br>+                 !DoesPrintValue() ? " (hide value)" : "",<br>+                 IsOneliner() ? " (one-line printout)" : "",<br>+                 SkipsPointers() ? " (skip pointers)" : "",<br>+                 SkipsReferences() ? " (skip references)" : "",<br>+                 HideNames() ? " (hide member names)" : "");<br>+    return sstr.GetString();<br>+}<br>+<br>+#ifndef LLDB_DISABLE_PYTHON<br>+<br>+<br>+ScriptSummaryFormat::ScriptSummaryFormat (const TypeSummaryImpl::Flags& flags,<br>+                                          const char * function_name,<br>+                                          const char * python_script) :<br>+TypeSummaryImpl(flags),<br>+m_function_name(),<br>+m_python_script(),<br>+m_script_function_sp()<br>+{<br>+    if (function_name)<br>+        m_function_name.assign(function_name);<br>+    if (python_script)<br>+        m_python_script.assign(python_script);<br>+}<br>+<br>+bool<br>+ScriptSummaryFormat::FormatObject (ValueObject *valobj,<br>+                                   std::string& retval)<br>+{<br>+    Timer scoped_timer (__PRETTY_FUNCTION__, __PRETTY_FUNCTION__);<br>+    <br>+    TargetSP target_sp(valobj->GetTargetSP());<br>+    <br>+    if (!target_sp)<br>+    {<br>+        retval.assign("error: no target");<br>+        return false;<br>+    }<br>+    <br>+    ScriptInterpreter *script_interpreter = target_sp->GetDebugger().GetCommandInterpreter().GetScriptInterpreter();<br>+    <br>+    if (!script_interpreter)<br>+    {<br>+        retval.assign("error: no ScriptInterpreter");<br>+        return false;<br>+    }<br>+    <br>+    return script_interpreter->GetScriptedSummary(m_function_name.c_str(),<br>+                                                  valobj->GetSP(),<br>+                                                  m_script_function_sp,<br>+                                                  retval);<br>+    <br>+}<br>+<br>+std::string<br>+ScriptSummaryFormat::GetDescription ()<br>+{<br>+    StreamString sstr;<br>+    sstr.Printf ("%s%s%s%s%s%s%s\n%s",       Cascades() ? "" : " (not cascading)",<br>+                 !DoesPrintChildren() ? "" : " (show children)",<br>+                 !DoesPrintValue() ? " (hide value)" : "",<br>+                 IsOneliner() ? " (one-line printout)" : "",<br>+                 SkipsPointers() ? " (skip pointers)" : "",<br>+                 SkipsReferences() ? " (skip references)" : "",<br>+                 HideNames() ? " (hide member names)" : "",<br>+                 m_python_script.c_str());<br>+    return sstr.GetString();<br>+    <br>+}<br>+<br>+#endif // #ifndef LLDB_DISABLE_PYTHON<br><br>Added: lldb/trunk/source/DataFormatters/TypeSynthetic.cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/TypeSynthetic.cpp?rev=173728&view=auto">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/TypeSynthetic.cpp?rev=173728&view=auto</a><br>==============================================================================<br>--- lldb/trunk/source/DataFormatters/TypeSynthetic.cpp (added)<br>+++ lldb/trunk/source/DataFormatters/TypeSynthetic.cpp Mon Jan 28 17:47:25 2013<br>@@ -0,0 +1,112 @@<br>+//===-- TypeSynthetic.cpp ----------------------------------------*- C++ -*-===//<br>+//<br>+//                     The LLVM Compiler Infrastructure<br>+//<br>+// This file is distributed under the University of Illinois Open Source<br>+// License. See LICENSE.TXT for details.<br>+//<br>+//===----------------------------------------------------------------------===//<br>+<br>+// C Includes<br>+<br>+// C++ Includes<br>+<br>+// Other libraries and framework includes<br>+<br>+// Project includes<br>+#include "lldb/lldb-public.h"<br>+#include "lldb/lldb-enumerations.h"<br>+<br>+#include "lldb/Core/Debugger.h"<br>+#include "lldb/Core/StreamString.h"<br>+#include "lldb/DataFormatters/TypeSynthetic.h"<br>+#include "lldb/Interpreter/CommandInterpreter.h"<br>+#include "lldb/Symbol/ClangASTType.h"<br>+#include "lldb/Target/StackFrame.h"<br>+#include "lldb/Target/Target.h"<br>+<br>+using namespace lldb;<br>+using namespace lldb_private;<br>+<br>+std::string<br>+TypeFilterImpl::GetDescription()<br>+{<br>+    StreamString sstr;<br>+    sstr.Printf("%s%s%s {\n",<br>+                Cascades() ? "" : " (not cascading)",<br>+                SkipsPointers() ? " (skip pointers)" : "",<br>+                SkipsReferences() ? " (skip references)" : "");<br>+    <br>+    for (int i = 0; i < GetCount(); i++)<br>+    {<br>+        sstr.Printf("    %s\n",<br>+                    GetExpressionPathAtIndex(i));<br>+    }<br>+    <br>+    sstr.Printf("}");<br>+    return sstr.GetString();<br>+}<br>+<br>+std::string<br>+CXXSyntheticChildren::GetDescription()<br>+{<br>+    StreamString sstr;<br>+    sstr.Printf("%s%s%s Generator at %p - %s\n",<br>+                Cascades() ? "" : " (not cascading)",<br>+                SkipsPointers() ? " (skip pointers)" : "",<br>+                SkipsReferences() ? " (skip references)" : "",<br>+                m_create_callback,<br>+                m_description.c_str());<br>+    <br>+    return sstr.GetString();<br>+}<br>+<br>+#ifndef LLDB_DISABLE_PYTHON<br>+<br>+ScriptedSyntheticChildren::FrontEnd::FrontEnd(std::string pclass, ValueObject &backend) :<br>+SyntheticChildrenFrontEnd(backend),<br>+m_python_class(pclass),<br>+m_wrapper_sp(),<br>+m_interpreter(NULL)<br>+{<br>+    if (backend == LLDB_INVALID_UID)<br>+        return;<br>+    <br>+    TargetSP target_sp = backend.GetTargetSP();<br>+    <br>+    if (!target_sp)<br>+        return;<br>+    <br>+    m_interpreter = target_sp->GetDebugger().GetCommandInterpreter().GetScriptInterpreter();<br>+    <br>+    if (m_interpreter != NULL)<br>+        m_wrapper_sp = m_interpreter->CreateSyntheticScriptedProvider(m_python_class.c_str(), backend.GetSP());<br>+}<br>+<br>+ScriptedSyntheticChildren::FrontEnd::~FrontEnd()<br>+{<br>+}<br>+<br>+lldb::ValueObjectSP<br>+ScriptedSyntheticChildren::FrontEnd::GetChildAtIndex (size_t idx)<br>+{<br>+    if (!m_wrapper_sp || !m_interpreter)<br>+        return lldb::ValueObjectSP();<br>+    <br>+    return m_interpreter->GetChildAtIndex(m_wrapper_sp, idx);<br>+}<br>+<br>+std::string<br>+ScriptedSyntheticChildren::GetDescription()<br>+{<br>+    StreamString sstr;<br>+    sstr.Printf("%s%s%s Python class %s",<br>+                Cascades() ? "" : " (not cascading)",<br>+                SkipsPointers() ? " (skip pointers)" : "",<br>+                SkipsReferences() ? " (skip references)" : "",<br>+                m_python_class.c_str());<br>+    <br>+    return sstr.GetString();<br>+}<br>+<br>+#endif // #ifndef LLDB_DISABLE_PYTHON<br><br>Modified: lldb/trunk/source/Interpreter/Args.cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/Args.cpp?rev=173728&r1=173727&r2=173728&view=diff">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/Args.cpp?rev=173728&r1=173727&r2=173728&view=diff</a><br>==============================================================================<br>--- lldb/trunk/source/Interpreter/Args.cpp (original)<br>+++ lldb/trunk/source/Interpreter/Args.cpp Mon Jan 28 17:47:25 2013<br>@@ -16,10 +16,10 @@<br> // Other libraries and framework includes<br> // Project includes<br> #include "lldb/Interpreter/Args.h"<br>-#include "lldb/Core/FormatManager.h"<br> #include "lldb/Core/Stream.h"<br> #include "lldb/Core/StreamFile.h"<br> #include "lldb/Core/StreamString.h"<br>+#include "lldb/DataFormatters/FormatManager.h"<br> #include "lldb/Interpreter/Options.h"<br> #include "lldb/Interpreter/CommandReturnObject.h"<br> #include "lldb/Target/Process.h"<br><br>Modified: lldb/trunk/source/Interpreter/CommandObjectScript.cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/CommandObjectScript.cpp?rev=173728&r1=173727&r2=173728&view=diff">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/CommandObjectScript.cpp?rev=173728&r1=173727&r2=173728&view=diff</a><br>==============================================================================<br>--- lldb/trunk/source/Interpreter/CommandObjectScript.cpp (original)<br>+++ lldb/trunk/source/Interpreter/CommandObjectScript.cpp Mon Jan 28 17:47:25 2013<br>@@ -16,13 +16,14 @@<br> // Other libraries and framework includes<br> // Project includes<br><br>-#include "lldb/Core/DataVisualization.h"<br> #include "lldb/Core/Debugger.h"<br>-#include "lldb/Interpreter/Args.h"<br><br>+#include "lldb/DataFormatters/DataVisualization.h"<br>+<br>+#include "lldb/Interpreter/Args.h"<br>+#include "lldb/Interpreter/CommandInterpreter.h"<br> #include "lldb/Interpreter/CommandReturnObject.h"<br> #include "lldb/Interpreter/ScriptInterpreter.h"<br>-#include "lldb/Interpreter/CommandInterpreter.h"<br><br> using namespace lldb;<br> using namespace lldb_private;<br><br>Modified: lldb/trunk/source/Interpreter/OptionGroupVariable.cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/OptionGroupVariable.cpp?rev=173728&r1=173727&r2=173728&view=diff">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/OptionGroupVariable.cpp?rev=173728&r1=173727&r2=173728&view=diff</a><br>==============================================================================<br>--- lldb/trunk/source/Interpreter/OptionGroupVariable.cpp (original)<br>+++ lldb/trunk/source/Interpreter/OptionGroupVariable.cpp Mon Jan 28 17:47:25 2013<br>@@ -15,10 +15,10 @@<br> // C++ Includes<br> // Other libraries and framework includes<br> // Project includes<br>-#include "lldb/Core/DataVisualization.h"<br> #include "lldb/Core/Error.h"<br>-#include "lldb/Target/Target.h"<br>+#include "lldb/DataFormatters/DataVisualization.h"<br> #include "lldb/Interpreter/CommandInterpreter.h"<br>+#include "lldb/Target/Target.h"<br> #include "lldb/Utility/Utils.h"<br><br> using namespace lldb;<br><br>Modified: lldb/trunk/source/Interpreter/OptionValueArch.cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/OptionValueArch.cpp?rev=173728&r1=173727&r2=173728&view=diff">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/OptionValueArch.cpp?rev=173728&r1=173727&r2=173728&view=diff</a><br>==============================================================================<br>--- lldb/trunk/source/Interpreter/OptionValueArch.cpp (original)<br>+++ lldb/trunk/source/Interpreter/OptionValueArch.cpp Mon Jan 28 17:47:25 2013<br>@@ -15,8 +15,8 @@<br> // C++ Includes<br> // Other libraries and framework includes<br> // Project includes<br>-#include "lldb/Core/FormatManager.h"<br> #include "lldb/Core/State.h"<br>+#include "lldb/DataFormatters/FormatManager.h"<br> #include "lldb/Interpreter/Args.h"<br> #include "lldb/Interpreter/CommandCompletions.h"<br><br><br>Modified: lldb/trunk/source/Interpreter/OptionValueDictionary.cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/OptionValueDictionary.cpp?rev=173728&r1=173727&r2=173728&view=diff">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/OptionValueDictionary.cpp?rev=173728&r1=173727&r2=173728&view=diff</a><br>==============================================================================<br>--- lldb/trunk/source/Interpreter/OptionValueDictionary.cpp (original)<br>+++ lldb/trunk/source/Interpreter/OptionValueDictionary.cpp Mon Jan 28 17:47:25 2013<br>@@ -16,8 +16,8 @@<br> // Other libraries and framework includes<br> #include "llvm/ADT/StringRef.h"<br> // Project includes<br>-#include "lldb/Core/FormatManager.h"<br> #include "lldb/Core/State.h"<br>+#include "lldb/DataFormatters/FormatManager.h"<br> #include "lldb/Interpreter/Args.h"<br> #include "lldb/Interpreter/OptionValueString.h"<br><br><br>Modified: lldb/trunk/source/Interpreter/OptionValueFileSpec.cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/OptionValueFileSpec.cpp?rev=173728&r1=173727&r2=173728&view=diff">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/OptionValueFileSpec.cpp?rev=173728&r1=173727&r2=173728&view=diff</a><br>==============================================================================<br>--- lldb/trunk/source/Interpreter/OptionValueFileSpec.cpp (original)<br>+++ lldb/trunk/source/Interpreter/OptionValueFileSpec.cpp Mon Jan 28 17:47:25 2013<br>@@ -15,8 +15,8 @@<br> // C++ Includes<br> // Other libraries and framework includes<br> // Project includes<br>-#include "lldb/Core/FormatManager.h"<br> #include "lldb/Core/State.h"<br>+#include "lldb/DataFormatters/FormatManager.h"<br> #include "lldb/Interpreter/Args.h"<br> #include "lldb/Interpreter/CommandCompletions.h"<br><br><br>Modified: lldb/trunk/source/Interpreter/OptionValueFormat.cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/OptionValueFormat.cpp?rev=173728&r1=173727&r2=173728&view=diff">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/OptionValueFormat.cpp?rev=173728&r1=173727&r2=173728&view=diff</a><br>==============================================================================<br>--- lldb/trunk/source/Interpreter/OptionValueFormat.cpp (original)<br>+++ lldb/trunk/source/Interpreter/OptionValueFormat.cpp Mon Jan 28 17:47:25 2013<br>@@ -15,8 +15,8 @@<br> // C++ Includes<br> // Other libraries and framework includes<br> // Project includes<br>-#include "lldb/Core/FormatManager.h"<br> #include "lldb/Core/Stream.h"<br>+#include "lldb/DataFormatters/FormatManager.h"<br> #include "lldb/Interpreter/Args.h"<br><br> using namespace lldb;<br><br>Modified: lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp?rev=173728&r1=173727&r2=173728&view=diff">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp?rev=173728&r1=173727&r2=173728&view=diff</a><br>==============================================================================<br>--- lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp (original)<br>+++ lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp Mon Jan 28 17:47:25 2013<br>@@ -49,13 +49,26 @@ AppleObjCRuntimeV1::AppleObjCRuntimeV1(P<br> {<br> }<br><br>+// for V1 runtime we just try to return a class name as that is the minimum level of support<br>+// required for the data formatters to work<br> bool<br> AppleObjCRuntimeV1::GetDynamicTypeAndAddress (ValueObject &in_value,<br>                                              lldb::DynamicValueType use_dynamic, <br>                                              TypeAndOrName &class_type_or_name, <br>                                              Address &address)<br> {<br>-    return false;<br>+    class_type_or_name.Clear();<br>+    if (CouldHaveDynamicValue(in_value))<br>+    {<br>+        auto class_descriptor(GetClassDescriptor(in_value));<br>+        if (class_descriptor && class_descriptor->IsValid() && class_descriptor->GetClassName())<br>+        {<br>+            const addr_t object_ptr = in_value.GetPointerValue();<br>+            address.SetRawAddress(object_ptr);<br>+            class_type_or_name.SetName(class_descriptor->GetClassName());<br>+        }<br>+    }<br>+    return class_type_or_name.IsEmpty() == false;<br> }<br><br> //------------------------------------------------------------------<br><br>Modified: lldb/trunk/test/functionalities/data-formatter/rdar-12437442/TestRdar12437442.py<br>URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/rdar-12437442/TestRdar12437442.py?rev=173728&r1=173727&r2=173728&view=diff">http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/rdar-12437442/TestRdar12437442.py?rev=173728&r1=173727&r2=173728&view=diff</a><br>==============================================================================<br>--- lldb/trunk/test/functionalities/data-formatter/rdar-12437442/TestRdar12437442.py (original)<br>+++ lldb/trunk/test/functionalities/data-formatter/rdar-12437442/TestRdar12437442.py Mon Jan 28 17:47:25 2013<br>@@ -69,6 +69,7 @@ class DataFormatterRdar12437442TestCase(<br>         self.assertTrue(id_x.GetSummary() == '@"5 objects"', "array does not get correct summary")<br><br>         self.runCmd("next")<br>+        self.runCmd("frame select 0")<br><br>         id_x = self.dbg.GetSelectedTarget().GetProcess().GetSelectedThread().GetSelectedFrame().FindVariable("x")<br>         id_x.SetPreferDynamicValue(lldb.eDynamicCanRunTarget)<br><br><br>_______________________________________________<br>lldb-commits mailing list<br><a href="mailto:lldb-commits@cs.uiuc.edu">lldb-commits@cs.uiuc.edu</a><br>http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits<br></blockquote></div><br></div></div></body></html>