[Lldb-commits] [lldb] r197795 - FormatNavigator has long stopped navigating anything - the generation of possible formatters matches is now done elsewhere
Enrico Granata
egranata at apple.com
Fri Dec 20 01:38:14 PST 2013
Author: enrico
Date: Fri Dec 20 03:38:13 2013
New Revision: 197795
URL: http://llvm.org/viewvc/llvm-project?rev=197795&view=rev
Log:
FormatNavigator has long stopped navigating anything - the generation of possible formatters matches is now done elsewhere
So, rename the class for what it truly is: a FormattersContainer
Also do a bunch of related text substitutions in the interest of overall naming clarity
Added:
lldb/trunk/include/lldb/DataFormatters/FormattersContainer.h
- copied, changed from r197791, lldb/trunk/include/lldb/DataFormatters/FormatNavigator.h
Removed:
lldb/trunk/include/lldb/DataFormatters/FormatNavigator.h
Modified:
lldb/trunk/include/lldb/DataFormatters/FormatManager.h
lldb/trunk/include/lldb/DataFormatters/TypeCategory.h
lldb/trunk/include/lldb/DataFormatters/TypeCategoryMap.h
lldb/trunk/lldb.xcodeproj/project.pbxproj
lldb/trunk/source/API/SBTypeCategory.cpp
lldb/trunk/source/Commands/CommandObjectType.cpp
lldb/trunk/source/DataFormatters/DataVisualization.cpp
lldb/trunk/source/DataFormatters/FormatManager.cpp
lldb/trunk/source/DataFormatters/TypeCategory.cpp
Modified: lldb/trunk/include/lldb/DataFormatters/FormatManager.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/FormatManager.h?rev=197795&r1=197794&r2=197795&view=diff
==============================================================================
--- lldb/trunk/include/lldb/DataFormatters/FormatManager.h (original)
+++ lldb/trunk/include/lldb/DataFormatters/FormatManager.h Fri Dec 20 03:38:13 2013
@@ -20,7 +20,7 @@
#include "lldb/DataFormatters/FormatCache.h"
#include "lldb/DataFormatters/FormatClasses.h"
-#include "lldb/DataFormatters/FormatNavigator.h"
+#include "lldb/DataFormatters/FormattersContainer.h"
#include "lldb/DataFormatters/TypeCategory.h"
#include "lldb/DataFormatters/TypeCategoryMap.h"
@@ -44,7 +44,7 @@ public:
FormatManager ();
NamedSummariesMap&
- GetNamedSummaryNavigator ()
+ GetNamedSummaryContainer ()
{
return m_named_summaries_map;
}
Removed: lldb/trunk/include/lldb/DataFormatters/FormatNavigator.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/FormatNavigator.h?rev=197794&view=auto
==============================================================================
--- lldb/trunk/include/lldb/DataFormatters/FormatNavigator.h (original)
+++ lldb/trunk/include/lldb/DataFormatters/FormatNavigator.h (removed)
@@ -1,494 +0,0 @@
-//===-- FormatNavigator.h ----------------------------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef lldb_FormatNavigator_h_
-#define lldb_FormatNavigator_h_
-
-// C Includes
-// C++ Includes
-
-// Other libraries and framework includes
-#include "clang/AST/DeclCXX.h"
-#include "clang/AST/Type.h"
-#include "clang/AST/DeclObjC.h"
-
-// Project includes
-#include "lldb/lldb-public.h"
-
-#include "lldb/Core/Log.h"
-#include "lldb/Core/RegularExpression.h"
-#include "lldb/Core/ValueObject.h"
-
-#include "lldb/DataFormatters/FormatClasses.h"
-#include "lldb/DataFormatters/TypeFormat.h"
-#include "lldb/DataFormatters/TypeSummary.h"
-#include "lldb/DataFormatters/TypeSynthetic.h"
-
-#include "lldb/Symbol/ClangASTContext.h"
-#include "lldb/Symbol/ClangASTType.h"
-
-#include "lldb/Target/ObjCLanguageRuntime.h"
-#include "lldb/Target/Process.h"
-#include "lldb/Target/StackFrame.h"
-#include "lldb/Target/TargetList.h"
-
-namespace lldb_private {
-
-// this file (and its. cpp) contain the low-level implementation of LLDB Data Visualization
-// class DataVisualization is the high-level front-end of this feature
-// clients should refer to that class as the entry-point into the data formatters
-// unless they have a good reason to bypass it and prefer to use this file's objects directly
-class IFormatChangeListener
-{
-public:
- virtual void
- Changed () = 0;
-
- virtual
- ~IFormatChangeListener () {}
-
- virtual uint32_t
- GetCurrentRevision () = 0;
-
-};
-
-static inline bool
-IsWhitespace (char c)
-{
- return ( (c == ' ') || (c == '\t') || (c == '\v') || (c == '\f') );
-}
-
-static inline bool
-HasPrefix (const char* str1, const char* str2)
-{
- return ( ::strstr(str1, str2) == str1 );
-}
-
-// if the user tries to add formatters for, say, "struct Foo"
-// those will not match any type because of the way we strip qualifiers from typenames
-// this method looks for the case where the user is adding a "class","struct","enum" or "union" Foo
-// and strips the unnecessary qualifier
-static inline ConstString
-GetValidTypeName_Impl (const ConstString& type)
-{
- int strip_len = 0;
-
- if ((bool)type == false)
- return type;
-
- const char* type_cstr = type.AsCString();
-
- if ( HasPrefix(type_cstr, "class ") )
- strip_len = 6;
- else if ( HasPrefix(type_cstr, "enum ") )
- strip_len = 5;
- else if ( HasPrefix(type_cstr, "struct ") )
- strip_len = 7;
- else if ( HasPrefix(type_cstr, "union ") )
- strip_len = 6;
-
- if (strip_len == 0)
- return type;
-
- type_cstr += strip_len;
- while (IsWhitespace(*type_cstr) && ++type_cstr)
- ;
-
- return ConstString(type_cstr);
-}
-
-template<typename KeyType, typename ValueType>
-class FormatNavigator;
-
-template<typename KeyType, typename ValueType>
-class FormatMap
-{
-public:
-
- typedef typename ValueType::SharedPointer ValueSP;
- typedef std::map<KeyType, ValueSP> MapType;
- typedef typename MapType::iterator MapIterator;
- typedef bool(*CallbackType)(void*, KeyType, const ValueSP&);
-
- FormatMap(IFormatChangeListener* lst) :
- m_map(),
- m_map_mutex(Mutex::eMutexTypeRecursive),
- listener(lst)
- {
- }
-
- void
- Add(KeyType name,
- const ValueSP& entry)
- {
- if (listener)
- entry->GetRevision() = listener->GetCurrentRevision();
- else
- entry->GetRevision() = 0;
-
- Mutex::Locker locker(m_map_mutex);
- m_map[name] = entry;
- if (listener)
- listener->Changed();
- }
-
- bool
- Delete (KeyType name)
- {
- Mutex::Locker locker(m_map_mutex);
- MapIterator iter = m_map.find(name);
- if (iter == m_map.end())
- return false;
- m_map.erase(name);
- if (listener)
- listener->Changed();
- return true;
- }
-
- void
- Clear ()
- {
- Mutex::Locker locker(m_map_mutex);
- m_map.clear();
- if (listener)
- listener->Changed();
- }
-
- bool
- Get(KeyType name,
- ValueSP& entry)
- {
- Mutex::Locker locker(m_map_mutex);
- MapIterator iter = m_map.find(name);
- if (iter == m_map.end())
- return false;
- entry = iter->second;
- return true;
- }
-
- void
- LoopThrough (CallbackType callback, void* param)
- {
- if (callback)
- {
- Mutex::Locker locker(m_map_mutex);
- MapIterator pos, end = m_map.end();
- for (pos = m_map.begin(); pos != end; pos++)
- {
- KeyType type = pos->first;
- if (!callback(param, type, pos->second))
- break;
- }
- }
- }
-
- uint32_t
- GetCount ()
- {
- return m_map.size();
- }
-
- ValueSP
- GetValueAtIndex (size_t index)
- {
- Mutex::Locker locker(m_map_mutex);
- MapIterator iter = m_map.begin();
- MapIterator end = m_map.end();
- while (index > 0)
- {
- iter++;
- index--;
- if (end == iter)
- return ValueSP();
- }
- return iter->second;
- }
-
- KeyType
- GetKeyAtIndex (size_t index)
- {
- Mutex::Locker locker(m_map_mutex);
- MapIterator iter = m_map.begin();
- MapIterator end = m_map.end();
- while (index > 0)
- {
- iter++;
- index--;
- if (end == iter)
- return KeyType();
- }
- return iter->first;
- }
-
-protected:
- MapType m_map;
- Mutex m_map_mutex;
- IFormatChangeListener* listener;
-
- MapType&
- map ()
- {
- return m_map;
- }
-
- Mutex&
- mutex ()
- {
- return m_map_mutex;
- }
-
- friend class FormatNavigator<KeyType, ValueType>;
- friend class FormatManager;
-
-};
-
-template<typename KeyType, typename ValueType>
-class FormatNavigator
-{
-protected:
- typedef FormatMap<KeyType,ValueType> BackEndType;
-
-public:
- typedef typename BackEndType::MapType MapType;
- typedef typename MapType::iterator MapIterator;
- typedef typename MapType::key_type MapKeyType;
- typedef typename MapType::mapped_type MapValueType;
- typedef typename BackEndType::CallbackType CallbackType;
- typedef typename std::shared_ptr<FormatNavigator<KeyType, ValueType> > SharedPointer;
-
- friend class TypeCategoryImpl;
-
- FormatNavigator(std::string name,
- IFormatChangeListener* lst) :
- m_format_map(lst),
- m_name(name),
- m_id_cs(ConstString("id"))
- {
- }
-
- void
- Add (const MapKeyType &type, const MapValueType& entry)
- {
- Add_Impl(type, entry, (KeyType*)NULL);
- }
-
- bool
- Delete (ConstString type)
- {
- return Delete_Impl(type, (KeyType*)NULL);
- }
-
- bool
- Get(ValueObject& valobj,
- MapValueType& entry,
- lldb::DynamicValueType use_dynamic,
- uint32_t* why = NULL)
- {
- uint32_t value = lldb_private::eFormatterChoiceCriterionDirectChoice;
- ClangASTType ast_type(valobj.GetClangType());
- bool ret = Get(valobj, ast_type, entry, use_dynamic, value);
- if (ret)
- entry = MapValueType(entry);
- else
- entry = MapValueType();
- if (why)
- *why = value;
- return ret;
- }
-
- bool
- Get (ConstString type, MapValueType& entry)
- {
- return Get_Impl(type, entry, (KeyType*)NULL);
- }
-
- bool
- GetExact (ConstString type, MapValueType& entry)
- {
- return GetExact_Impl(type, entry, (KeyType*)NULL);
- }
-
- MapValueType
- GetAtIndex (size_t index)
- {
- return m_format_map.GetValueAtIndex(index);
- }
-
- lldb::TypeNameSpecifierImplSP
- GetTypeNameSpecifierAtIndex (size_t index)
- {
- return GetTypeNameSpecifierAtIndex_Impl(index, (KeyType*)NULL);
- }
-
- void
- Clear ()
- {
- m_format_map.Clear();
- }
-
- void
- LoopThrough (CallbackType callback, void* param)
- {
- m_format_map.LoopThrough(callback,param);
- }
-
- uint32_t
- GetCount ()
- {
- return m_format_map.GetCount();
- }
-
-protected:
-
- BackEndType m_format_map;
-
- std::string m_name;
-
- DISALLOW_COPY_AND_ASSIGN(FormatNavigator);
-
- ConstString m_id_cs;
-
- void
- Add_Impl (const MapKeyType &type, const MapValueType& entry, lldb::RegularExpressionSP *dummy)
- {
- m_format_map.Add(type,entry);
- }
-
- void Add_Impl (const ConstString &type, const MapValueType& entry, ConstString *dummy)
- {
- m_format_map.Add(GetValidTypeName_Impl(type), entry);
- }
-
- bool
- Delete_Impl (ConstString type, ConstString *dummy)
- {
- return m_format_map.Delete(type);
- }
-
- bool
- Delete_Impl (ConstString type, lldb::RegularExpressionSP *dummy)
- {
- Mutex& x_mutex = m_format_map.mutex();
- lldb_private::Mutex::Locker locker(x_mutex);
- MapIterator pos, end = m_format_map.map().end();
- for (pos = m_format_map.map().begin(); pos != end; pos++)
- {
- lldb::RegularExpressionSP regex = pos->first;
- if ( ::strcmp(type.AsCString(),regex->GetText()) == 0)
- {
- m_format_map.map().erase(pos);
- if (m_format_map.listener)
- m_format_map.listener->Changed();
- return true;
- }
- }
- return false;
- }
-
- bool
- Get_Impl (ConstString type, MapValueType& entry, ConstString *dummy)
- {
- return m_format_map.Get(type, entry);
- }
-
- bool
- GetExact_Impl (ConstString type, MapValueType& entry, ConstString *dummy)
- {
- return Get_Impl(type,entry, (KeyType*)0);
- }
-
- lldb::TypeNameSpecifierImplSP
- GetTypeNameSpecifierAtIndex_Impl (size_t index, ConstString *dummy)
- {
- ConstString key = m_format_map.GetKeyAtIndex(index);
- if (key)
- return lldb::TypeNameSpecifierImplSP(new TypeNameSpecifierImpl(key.AsCString(),
- false));
- else
- return lldb::TypeNameSpecifierImplSP();
- }
-
- lldb::TypeNameSpecifierImplSP
- GetTypeNameSpecifierAtIndex_Impl (size_t index, lldb::RegularExpressionSP *dummy)
- {
- lldb::RegularExpressionSP regex = m_format_map.GetKeyAtIndex(index);
- if (regex.get() == NULL)
- return lldb::TypeNameSpecifierImplSP();
- return lldb::TypeNameSpecifierImplSP(new TypeNameSpecifierImpl(regex->GetText(),
- true));
- }
-
- bool
- Get_Impl (ConstString key, MapValueType& value, lldb::RegularExpressionSP *dummy)
- {
- const char* key_cstr = key.AsCString();
- if (!key_cstr)
- return false;
- Mutex& x_mutex = m_format_map.mutex();
- lldb_private::Mutex::Locker locker(x_mutex);
- MapIterator pos, end = m_format_map.map().end();
- for (pos = m_format_map.map().begin(); pos != end; pos++)
- {
- lldb::RegularExpressionSP regex = pos->first;
- if (regex->Execute(key_cstr))
- {
- value = pos->second;
- return true;
- }
- }
- return false;
- }
-
- bool
- GetExact_Impl (ConstString key, MapValueType& value, lldb::RegularExpressionSP *dummy)
- {
- Mutex& x_mutex = m_format_map.mutex();
- lldb_private::Mutex::Locker locker(x_mutex);
- MapIterator pos, end = m_format_map.map().end();
- for (pos = m_format_map.map().begin(); pos != end; pos++)
- {
- lldb::RegularExpressionSP regex = pos->first;
- if (strcmp(regex->GetText(),key.AsCString()) == 0)
- {
- value = pos->second;
- return true;
- }
- }
- return false;
- }
-
- bool
- Get (const FormattersMatchVector& candidates,
- MapValueType& entry,
- uint32_t *reason)
- {
- for (const FormattersMatchCandidate& candidate : candidates)
- {
- if (Get(candidate.GetTypeName(),entry))
- {
- if (candidate.IsMatch(entry) == false)
- {
- entry.reset();
- continue;
- }
- else
- {
- if(reason)
- *reason = candidate.GetReason();
- return true;
- }
- }
- }
- return false;
- }
-};
-
-} // namespace lldb_private
-
-#endif // lldb_FormatNavigator_h_
Copied: lldb/trunk/include/lldb/DataFormatters/FormattersContainer.h (from r197791, lldb/trunk/include/lldb/DataFormatters/FormatNavigator.h)
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/FormattersContainer.h?p2=lldb/trunk/include/lldb/DataFormatters/FormattersContainer.h&p1=lldb/trunk/include/lldb/DataFormatters/FormatNavigator.h&r1=197791&r2=197795&rev=197795&view=diff
==============================================================================
--- lldb/trunk/include/lldb/DataFormatters/FormatNavigator.h (original)
+++ lldb/trunk/include/lldb/DataFormatters/FormattersContainer.h Fri Dec 20 03:38:13 2013
@@ -1,4 +1,4 @@
-//===-- FormatNavigator.h ----------------------------------------*- C++ -*-===//
+//===-- FormattersContainer.h ----------------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
@@ -7,8 +7,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef lldb_FormatNavigator_h_
-#define lldb_FormatNavigator_h_
+#ifndef lldb_FormattersContainer_h_
+#define lldb_FormattersContainer_h_
// C Includes
// C++ Includes
@@ -104,7 +104,7 @@ GetValidTypeName_Impl (const ConstString
}
template<typename KeyType, typename ValueType>
-class FormatNavigator;
+class FormattersContainer;
template<typename KeyType, typename ValueType>
class FormatMap
@@ -243,13 +243,13 @@ protected:
return m_map_mutex;
}
- friend class FormatNavigator<KeyType, ValueType>;
+ friend class FormattersContainer<KeyType, ValueType>;
friend class FormatManager;
};
template<typename KeyType, typename ValueType>
-class FormatNavigator
+class FormattersContainer
{
protected:
typedef FormatMap<KeyType,ValueType> BackEndType;
@@ -260,11 +260,11 @@ public:
typedef typename MapType::key_type MapKeyType;
typedef typename MapType::mapped_type MapValueType;
typedef typename BackEndType::CallbackType CallbackType;
- typedef typename std::shared_ptr<FormatNavigator<KeyType, ValueType> > SharedPointer;
+ typedef typename std::shared_ptr<FormattersContainer<KeyType, ValueType> > SharedPointer;
friend class TypeCategoryImpl;
- FormatNavigator(std::string name,
+ FormattersContainer(std::string name,
IFormatChangeListener* lst) :
m_format_map(lst),
m_name(name),
@@ -350,7 +350,7 @@ protected:
std::string m_name;
- DISALLOW_COPY_AND_ASSIGN(FormatNavigator);
+ DISALLOW_COPY_AND_ASSIGN(FormattersContainer);
ConstString m_id_cs;
@@ -491,4 +491,4 @@ protected:
} // namespace lldb_private
-#endif // lldb_FormatNavigator_h_
+#endif // lldb_FormattersContainer_h_
Modified: lldb/trunk/include/lldb/DataFormatters/TypeCategory.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/TypeCategory.h?rev=197795&r1=197794&r2=197795&view=diff
==============================================================================
--- lldb/trunk/include/lldb/DataFormatters/TypeCategory.h (original)
+++ lldb/trunk/include/lldb/DataFormatters/TypeCategory.h Fri Dec 20 03:38:13 2013
@@ -19,38 +19,38 @@
#include "lldb/lldb-enumerations.h"
#include "lldb/DataFormatters/FormatClasses.h"
-#include "lldb/DataFormatters/FormatNavigator.h"
+#include "lldb/DataFormatters/FormattersContainer.h"
namespace lldb_private {
class TypeCategoryImpl
{
private:
- typedef FormatNavigator<ConstString, TypeFormatImpl> ValueNavigator;
- typedef FormatNavigator<lldb::RegularExpressionSP, TypeFormatImpl> RegexValueNavigator;
+ typedef FormattersContainer<ConstString, TypeFormatImpl> FormatContainer;
+ typedef FormattersContainer<lldb::RegularExpressionSP, TypeFormatImpl> RegexFormatContainer;
- typedef FormatNavigator<ConstString, TypeSummaryImpl> SummaryNavigator;
- typedef FormatNavigator<lldb::RegularExpressionSP, TypeSummaryImpl> RegexSummaryNavigator;
+ typedef FormattersContainer<ConstString, TypeSummaryImpl> SummaryContainer;
+ typedef FormattersContainer<lldb::RegularExpressionSP, TypeSummaryImpl> RegexSummaryContainer;
- typedef FormatNavigator<ConstString, TypeFilterImpl> FilterNavigator;
- typedef FormatNavigator<lldb::RegularExpressionSP, TypeFilterImpl> RegexFilterNavigator;
+ typedef FormattersContainer<ConstString, TypeFilterImpl> FilterContainer;
+ typedef FormattersContainer<lldb::RegularExpressionSP, TypeFilterImpl> RegexFilterContainer;
#ifndef LLDB_DISABLE_PYTHON
- typedef FormatNavigator<ConstString, ScriptedSyntheticChildren> SynthNavigator;
- typedef FormatNavigator<lldb::RegularExpressionSP, ScriptedSyntheticChildren> RegexSynthNavigator;
+ typedef FormattersContainer<ConstString, ScriptedSyntheticChildren> SynthContainer;
+ typedef FormattersContainer<lldb::RegularExpressionSP, ScriptedSyntheticChildren> RegexSynthContainer;
#endif // #ifndef LLDB_DISABLE_PYTHON
- typedef ValueNavigator::MapType ValueMap;
- typedef RegexValueNavigator::MapType RegexValueMap;
+ typedef FormatContainer::MapType FormatMap;
+ typedef RegexFormatContainer::MapType RegexFormatMap;
- typedef SummaryNavigator::MapType SummaryMap;
- typedef RegexSummaryNavigator::MapType RegexSummaryMap;
+ typedef SummaryContainer::MapType SummaryMap;
+ typedef RegexSummaryContainer::MapType RegexSummaryMap;
- typedef FilterNavigator::MapType FilterMap;
- typedef RegexFilterNavigator::MapType RegexFilterMap;
+ typedef FilterContainer::MapType FilterMap;
+ typedef RegexFilterContainer::MapType RegexFilterMap;
#ifndef LLDB_DISABLE_PYTHON
- typedef SynthNavigator::MapType SynthMap;
- typedef RegexSynthNavigator::MapType RegexSynthMap;
+ typedef SynthContainer::MapType SynthMap;
+ typedef RegexSynthContainer::MapType RegexSynthMap;
#endif // #ifndef LLDB_DISABLE_PYTHON
public:
@@ -58,69 +58,69 @@ namespace lldb_private {
typedef uint16_t FormatCategoryItems;
static const uint16_t ALL_ITEM_TYPES = UINT16_MAX;
- typedef ValueNavigator::SharedPointer ValueNavigatorSP;
- typedef RegexValueNavigator::SharedPointer RegexValueNavigatorSP;
+ typedef FormatContainer::SharedPointer FormatContainerSP;
+ typedef RegexFormatContainer::SharedPointer RegexFormatContainerSP;
- typedef SummaryNavigator::SharedPointer SummaryNavigatorSP;
- typedef RegexSummaryNavigator::SharedPointer RegexSummaryNavigatorSP;
+ typedef SummaryContainer::SharedPointer SummaryContainerSP;
+ typedef RegexSummaryContainer::SharedPointer RegexSummaryContainerSP;
- typedef FilterNavigator::SharedPointer FilterNavigatorSP;
- typedef RegexFilterNavigator::SharedPointer RegexFilterNavigatorSP;
+ typedef FilterContainer::SharedPointer FilterContainerSP;
+ typedef RegexFilterContainer::SharedPointer RegexFilterContainerSP;
#ifndef LLDB_DISABLE_PYTHON
- typedef SynthNavigator::SharedPointer SynthNavigatorSP;
- typedef RegexSynthNavigator::SharedPointer RegexSynthNavigatorSP;
+ typedef SynthContainer::SharedPointer SynthContainerSP;
+ typedef RegexSynthContainer::SharedPointer RegexSynthContainerSP;
#endif // #ifndef LLDB_DISABLE_PYTHON
TypeCategoryImpl (IFormatChangeListener* clist,
ConstString name);
- ValueNavigatorSP
- GetValueNavigator ()
+ FormatContainerSP
+ GetTypeFormatsContainer ()
{
- return ValueNavigatorSP(m_value_nav);
+ return FormatContainerSP(m_format_cont);
}
- RegexValueNavigatorSP
- GetRegexValueNavigator ()
+ RegexFormatContainerSP
+ GetRegexTypeFormatsContainer ()
{
- return RegexValueNavigatorSP(m_regex_value_nav);
+ return RegexFormatContainerSP(m_regex_format_cont);
}
- SummaryNavigatorSP
- GetSummaryNavigator ()
+ SummaryContainerSP
+ GetTypeSummariesContainer ()
{
- return SummaryNavigatorSP(m_summary_nav);
+ return SummaryContainerSP(m_summary_cont);
}
- RegexSummaryNavigatorSP
- GetRegexSummaryNavigator ()
+ RegexSummaryContainerSP
+ GetRegexTypeSummariesContainer ()
{
- return RegexSummaryNavigatorSP(m_regex_summary_nav);
+ return RegexSummaryContainerSP(m_regex_summary_cont);
}
- FilterNavigatorSP
- GetFilterNavigator ()
+ FilterContainerSP
+ GetTypeFiltersContainer ()
{
- return FilterNavigatorSP(m_filter_nav);
+ return FilterContainerSP(m_filter_cont);
}
- RegexFilterNavigatorSP
- GetRegexFilterNavigator ()
+ RegexFilterContainerSP
+ GetRegexTypeFiltersContainer ()
{
- return RegexFilterNavigatorSP(m_regex_filter_nav);
+ return RegexFilterContainerSP(m_regex_filter_cont);
}
- ValueNavigator::MapValueType
+ FormatContainer::MapValueType
GetFormatForType (lldb::TypeNameSpecifierImplSP type_sp);
- SummaryNavigator::MapValueType
+ SummaryContainer::MapValueType
GetSummaryForType (lldb::TypeNameSpecifierImplSP type_sp);
- FilterNavigator::MapValueType
+ FilterContainer::MapValueType
GetFilterForType (lldb::TypeNameSpecifierImplSP type_sp);
#ifndef LLDB_DISABLE_PYTHON
- SynthNavigator::MapValueType
+ SynthContainer::MapValueType
GetSyntheticForType (lldb::TypeNameSpecifierImplSP type_sp);
#endif
@@ -130,32 +130,32 @@ namespace lldb_private {
lldb::TypeNameSpecifierImplSP
GetTypeNameSpecifierForSummaryAtIndex (size_t index);
- ValueNavigator::MapValueType
+ FormatContainer::MapValueType
GetFormatAtIndex (size_t index);
- SummaryNavigator::MapValueType
+ SummaryContainer::MapValueType
GetSummaryAtIndex (size_t index);
- FilterNavigator::MapValueType
+ FilterContainer::MapValueType
GetFilterAtIndex (size_t index);
lldb::TypeNameSpecifierImplSP
GetTypeNameSpecifierForFilterAtIndex (size_t index);
#ifndef LLDB_DISABLE_PYTHON
- SynthNavigatorSP
- GetSyntheticNavigator ()
+ SynthContainerSP
+ GetTypeSyntheticsContainer ()
{
- return SynthNavigatorSP(m_synth_nav);
+ return SynthContainerSP(m_synth_cont);
}
- RegexSynthNavigatorSP
- GetRegexSyntheticNavigator ()
+ RegexSynthContainerSP
+ GetRegexTypeSyntheticsContainer ()
{
- return RegexSynthNavigatorSP(m_regex_synth_nav);
+ return RegexSynthContainerSP(m_regex_synth_cont);
}
- SynthNavigator::MapValueType
+ SynthContainer::MapValueType
GetSyntheticAtIndex (size_t index);
lldb::TypeNameSpecifierImplSP
@@ -222,18 +222,18 @@ namespace lldb_private {
typedef std::shared_ptr<TypeCategoryImpl> SharedPointer;
private:
- ValueNavigator::SharedPointer m_value_nav;
- RegexValueNavigator::SharedPointer m_regex_value_nav;
+ FormatContainer::SharedPointer m_format_cont;
+ RegexFormatContainer::SharedPointer m_regex_format_cont;
- SummaryNavigator::SharedPointer m_summary_nav;
- RegexSummaryNavigator::SharedPointer m_regex_summary_nav;
+ SummaryContainer::SharedPointer m_summary_cont;
+ RegexSummaryContainer::SharedPointer m_regex_summary_cont;
- FilterNavigator::SharedPointer m_filter_nav;
- RegexFilterNavigator::SharedPointer m_regex_filter_nav;
+ FilterContainer::SharedPointer m_filter_cont;
+ RegexFilterContainer::SharedPointer m_regex_filter_cont;
#ifndef LLDB_DISABLE_PYTHON
- SynthNavigator::SharedPointer m_synth_nav;
- RegexSynthNavigator::SharedPointer m_regex_synth_nav;
+ SynthContainer::SharedPointer m_synth_cont;
+ RegexSynthContainer::SharedPointer m_regex_synth_cont;
#endif // #ifndef LLDB_DISABLE_PYTHON
bool m_enabled;
@@ -257,18 +257,18 @@ namespace lldb_private {
friend class TypeCategoryMap;
- friend class FormatNavigator<ConstString, TypeFormatImpl>;
- friend class FormatNavigator<lldb::RegularExpressionSP, TypeFormatImpl>;
+ friend class FormattersContainer<ConstString, TypeFormatImpl>;
+ friend class FormattersContainer<lldb::RegularExpressionSP, TypeFormatImpl>;
- friend class FormatNavigator<ConstString, TypeSummaryImpl>;
- friend class FormatNavigator<lldb::RegularExpressionSP, TypeSummaryImpl>;
+ friend class FormattersContainer<ConstString, TypeSummaryImpl>;
+ friend class FormattersContainer<lldb::RegularExpressionSP, TypeSummaryImpl>;
- friend class FormatNavigator<ConstString, TypeFilterImpl>;
- friend class FormatNavigator<lldb::RegularExpressionSP, TypeFilterImpl>;
+ friend class FormattersContainer<ConstString, TypeFilterImpl>;
+ friend class FormattersContainer<lldb::RegularExpressionSP, TypeFilterImpl>;
#ifndef LLDB_DISABLE_PYTHON
- friend class FormatNavigator<ConstString, ScriptedSyntheticChildren>;
- friend class FormatNavigator<lldb::RegularExpressionSP, ScriptedSyntheticChildren>;
+ friend class FormattersContainer<ConstString, ScriptedSyntheticChildren>;
+ friend class FormattersContainer<lldb::RegularExpressionSP, ScriptedSyntheticChildren>;
#endif // #ifndef LLDB_DISABLE_PYTHON
};
Modified: lldb/trunk/include/lldb/DataFormatters/TypeCategoryMap.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/TypeCategoryMap.h?rev=197795&r1=197794&r2=197795&view=diff
==============================================================================
--- lldb/trunk/include/lldb/DataFormatters/TypeCategoryMap.h (original)
+++ lldb/trunk/include/lldb/DataFormatters/TypeCategoryMap.h Fri Dec 20 03:38:13 2013
@@ -18,7 +18,7 @@
#include "lldb/lldb-public.h"
#include "lldb/lldb-enumerations.h"
-#include "lldb/DataFormatters/FormatNavigator.h"
+#include "lldb/DataFormatters/FormattersContainer.h"
#include "lldb/DataFormatters/TypeCategory.h"
namespace lldb_private {
@@ -144,7 +144,7 @@ namespace lldb_private {
return m_map_mutex;
}
- friend class FormatNavigator<KeyType, ValueType>;
+ friend class FormattersContainer<KeyType, ValueType>;
friend class FormatManager;
};
} // namespace lldb_private
Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=197795&r1=197794&r2=197795&view=diff
==============================================================================
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Fri Dec 20 03:38:13 2013
@@ -1680,7 +1680,6 @@
94CB256016B069800059775D /* DataVisualization.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = DataVisualization.h; path = include/lldb/DataFormatters/DataVisualization.h; sourceTree = "<group>"; };
94CB256116B069800059775D /* FormatClasses.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = FormatClasses.h; path = include/lldb/DataFormatters/FormatClasses.h; sourceTree = "<group>"; };
94CB256216B069800059775D /* FormatManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = FormatManager.h; path = include/lldb/DataFormatters/FormatManager.h; sourceTree = "<group>"; };
- 94CB256316B069800059775D /* FormatNavigator.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = FormatNavigator.h; path = include/lldb/DataFormatters/FormatNavigator.h; sourceTree = "<group>"; };
94CB256416B096F10059775D /* TypeCategory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TypeCategory.cpp; path = source/DataFormatters/TypeCategory.cpp; sourceTree = "<group>"; };
94CB256516B096F10059775D /* TypeCategoryMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TypeCategoryMap.cpp; path = source/DataFormatters/TypeCategoryMap.cpp; sourceTree = "<group>"; };
94CB256816B096F90059775D /* TypeCategory.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = TypeCategory.h; path = include/lldb/DataFormatters/TypeCategory.h; sourceTree = "<group>"; };
@@ -1708,6 +1707,7 @@
94EA1D5B15E6C9B400D4171A /* PythonDataObjects.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PythonDataObjects.cpp; path = source/Interpreter/PythonDataObjects.cpp; sourceTree = "<group>"; };
94EA27CD17DE91750070F505 /* LibCxxUnorderedMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LibCxxUnorderedMap.cpp; path = source/DataFormatters/LibCxxUnorderedMap.cpp; sourceTree = "<group>"; };
94EBAC8313D9EE26009BA64E /* PythonPointer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = PythonPointer.h; path = include/lldb/Utility/PythonPointer.h; sourceTree = "<group>"; };
+ 94EE33F218643C6900CD703B /* FormattersContainer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = FormattersContainer.h; path = include/lldb/DataFormatters/FormattersContainer.h; sourceTree = "<group>"; };
94FA3DDD1405D4E500833217 /* ValueObjectConstResultChild.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ValueObjectConstResultChild.h; path = include/lldb/Core/ValueObjectConstResultChild.h; sourceTree = "<group>"; };
94FA3DDF1405D50300833217 /* ValueObjectConstResultChild.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ValueObjectConstResultChild.cpp; path = source/Core/ValueObjectConstResultChild.cpp; sourceTree = "<group>"; };
94FE476613FC1DA8001F8475 /* finish-swig-Python-LLDB.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = "finish-swig-Python-LLDB.sh"; sourceTree = "<group>"; };
@@ -3576,7 +3576,7 @@
94CB255916B069770059775D /* FormatClasses.cpp */,
94CB256216B069800059775D /* FormatManager.h */,
94CB255A16B069770059775D /* FormatManager.cpp */,
- 94CB256316B069800059775D /* FormatNavigator.h */,
+ 94EE33F218643C6900CD703B /* FormattersContainer.h */,
94D0B10A16D5535900EA9C70 /* LibCxx.cpp */,
94CD704F16F8DF1C00CF1E42 /* LibCxxList.cpp */,
94CD705116F8F5BC00CF1E42 /* LibCxxMap.cpp */,
Modified: lldb/trunk/source/API/SBTypeCategory.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBTypeCategory.cpp?rev=197795&r1=197794&r2=197795&view=diff
==============================================================================
--- lldb/trunk/source/API/SBTypeCategory.cpp (original)
+++ lldb/trunk/source/API/SBTypeCategory.cpp Fri Dec 20 03:38:13 2013
@@ -87,7 +87,7 @@ SBTypeCategory::GetNumFormats ()
if (!IsValid())
return 0;
- return m_opaque_sp->GetValueNavigator()->GetCount() + m_opaque_sp->GetRegexValueNavigator()->GetCount();
+ return m_opaque_sp->GetTypeFormatsContainer()->GetCount() + m_opaque_sp->GetRegexTypeFormatsContainer()->GetCount();
}
uint32_t
@@ -95,7 +95,7 @@ SBTypeCategory::GetNumSummaries ()
{
if (!IsValid())
return 0;
- return m_opaque_sp->GetSummaryNavigator()->GetCount() + m_opaque_sp->GetRegexSummaryNavigator()->GetCount();
+ return m_opaque_sp->GetTypeSummariesContainer()->GetCount() + m_opaque_sp->GetRegexTypeSummariesContainer()->GetCount();
}
uint32_t
@@ -103,7 +103,7 @@ SBTypeCategory::GetNumFilters ()
{
if (!IsValid())
return 0;
- return m_opaque_sp->GetFilterNavigator()->GetCount() + m_opaque_sp->GetRegexFilterNavigator()->GetCount();
+ return m_opaque_sp->GetTypeFiltersContainer()->GetCount() + m_opaque_sp->GetRegexTypeFiltersContainer()->GetCount();
}
#ifndef LLDB_DISABLE_PYTHON
@@ -112,7 +112,7 @@ SBTypeCategory::GetNumSynthetics ()
{
if (!IsValid())
return 0;
- return m_opaque_sp->GetSyntheticNavigator()->GetCount() + m_opaque_sp->GetRegexSyntheticNavigator()->GetCount();
+ return m_opaque_sp->GetTypeSyntheticsContainer()->GetCount() + m_opaque_sp->GetRegexTypeSyntheticsContainer()->GetCount();
}
#endif
@@ -162,9 +162,9 @@ SBTypeCategory::GetFilterForType (SBType
lldb::SyntheticChildrenSP children_sp;
if (spec.IsRegex())
- m_opaque_sp->GetRegexFilterNavigator()->GetExact(ConstString(spec.GetName()), children_sp);
+ m_opaque_sp->GetRegexTypeFiltersContainer()->GetExact(ConstString(spec.GetName()), children_sp);
else
- m_opaque_sp->GetFilterNavigator()->GetExact(ConstString(spec.GetName()), children_sp);
+ m_opaque_sp->GetTypeFiltersContainer()->GetExact(ConstString(spec.GetName()), children_sp);
if (!children_sp)
return lldb::SBTypeFilter();
@@ -186,9 +186,9 @@ SBTypeCategory::GetFormatForType (SBType
lldb::TypeFormatImplSP format_sp;
if (spec.IsRegex())
- m_opaque_sp->GetRegexValueNavigator()->GetExact(ConstString(spec.GetName()), format_sp);
+ m_opaque_sp->GetRegexTypeFormatsContainer()->GetExact(ConstString(spec.GetName()), format_sp);
else
- m_opaque_sp->GetValueNavigator()->GetExact(ConstString(spec.GetName()), format_sp);
+ m_opaque_sp->GetTypeFormatsContainer()->GetExact(ConstString(spec.GetName()), format_sp);
if (!format_sp)
return lldb::SBTypeFormat();
@@ -209,9 +209,9 @@ SBTypeCategory::GetSummaryForType (SBTyp
lldb::TypeSummaryImplSP summary_sp;
if (spec.IsRegex())
- m_opaque_sp->GetRegexSummaryNavigator()->GetExact(ConstString(spec.GetName()), summary_sp);
+ m_opaque_sp->GetRegexTypeSummariesContainer()->GetExact(ConstString(spec.GetName()), summary_sp);
else
- m_opaque_sp->GetSummaryNavigator()->GetExact(ConstString(spec.GetName()), summary_sp);
+ m_opaque_sp->GetTypeSummariesContainer()->GetExact(ConstString(spec.GetName()), summary_sp);
if (!summary_sp)
return lldb::SBTypeSummary();
@@ -233,9 +233,9 @@ SBTypeCategory::GetSyntheticForType (SBT
lldb::SyntheticChildrenSP children_sp;
if (spec.IsRegex())
- m_opaque_sp->GetRegexSyntheticNavigator()->GetExact(ConstString(spec.GetName()), children_sp);
+ m_opaque_sp->GetRegexTypeSyntheticsContainer()->GetExact(ConstString(spec.GetName()), children_sp);
else
- m_opaque_sp->GetSyntheticNavigator()->GetExact(ConstString(spec.GetName()), children_sp);
+ m_opaque_sp->GetTypeSyntheticsContainer()->GetExact(ConstString(spec.GetName()), children_sp);
if (!children_sp)
return lldb::SBTypeSynthetic();
@@ -312,9 +312,9 @@ SBTypeCategory::AddTypeFormat (SBTypeNam
return false;
if (type_name.IsRegex())
- m_opaque_sp->GetRegexValueNavigator()->Add(lldb::RegularExpressionSP(new RegularExpression(type_name.GetName())), format.GetSP());
+ m_opaque_sp->GetRegexTypeFormatsContainer()->Add(lldb::RegularExpressionSP(new RegularExpression(type_name.GetName())), format.GetSP());
else
- m_opaque_sp->GetValueNavigator()->Add(ConstString(type_name.GetName()), format.GetSP());
+ m_opaque_sp->GetTypeFormatsContainer()->Add(ConstString(type_name.GetName()), format.GetSP());
return true;
}
@@ -329,9 +329,9 @@ SBTypeCategory::DeleteTypeFormat (SBType
return false;
if (type_name.IsRegex())
- return m_opaque_sp->GetRegexValueNavigator()->Delete(ConstString(type_name.GetName()));
+ return m_opaque_sp->GetRegexTypeFormatsContainer()->Delete(ConstString(type_name.GetName()));
else
- return m_opaque_sp->GetValueNavigator()->Delete(ConstString(type_name.GetName()));
+ return m_opaque_sp->GetTypeFormatsContainer()->Delete(ConstString(type_name.GetName()));
}
#ifndef LLDB_DISABLE_PYTHON
@@ -383,9 +383,9 @@ SBTypeCategory::AddTypeSummary (SBTypeNa
}
if (type_name.IsRegex())
- m_opaque_sp->GetRegexSummaryNavigator()->Add(lldb::RegularExpressionSP(new RegularExpression(type_name.GetName())), summary.GetSP());
+ m_opaque_sp->GetRegexTypeSummariesContainer()->Add(lldb::RegularExpressionSP(new RegularExpression(type_name.GetName())), summary.GetSP());
else
- m_opaque_sp->GetSummaryNavigator()->Add(ConstString(type_name.GetName()), summary.GetSP());
+ m_opaque_sp->GetTypeSummariesContainer()->Add(ConstString(type_name.GetName()), summary.GetSP());
return true;
}
@@ -401,9 +401,9 @@ SBTypeCategory::DeleteTypeSummary (SBTyp
return false;
if (type_name.IsRegex())
- return m_opaque_sp->GetRegexSummaryNavigator()->Delete(ConstString(type_name.GetName()));
+ return m_opaque_sp->GetRegexTypeSummariesContainer()->Delete(ConstString(type_name.GetName()));
else
- return m_opaque_sp->GetSummaryNavigator()->Delete(ConstString(type_name.GetName()));
+ return m_opaque_sp->GetTypeSummariesContainer()->Delete(ConstString(type_name.GetName()));
}
bool
@@ -420,9 +420,9 @@ SBTypeCategory::AddTypeFilter (SBTypeNam
return false;
if (type_name.IsRegex())
- m_opaque_sp->GetRegexFilterNavigator()->Add(lldb::RegularExpressionSP(new RegularExpression(type_name.GetName())), filter.GetSP());
+ m_opaque_sp->GetRegexTypeFiltersContainer()->Add(lldb::RegularExpressionSP(new RegularExpression(type_name.GetName())), filter.GetSP());
else
- m_opaque_sp->GetFilterNavigator()->Add(ConstString(type_name.GetName()), filter.GetSP());
+ m_opaque_sp->GetTypeFiltersContainer()->Add(ConstString(type_name.GetName()), filter.GetSP());
return true;
}
@@ -437,9 +437,9 @@ SBTypeCategory::DeleteTypeFilter (SBType
return false;
if (type_name.IsRegex())
- return m_opaque_sp->GetRegexFilterNavigator()->Delete(ConstString(type_name.GetName()));
+ return m_opaque_sp->GetRegexTypeFiltersContainer()->Delete(ConstString(type_name.GetName()));
else
- return m_opaque_sp->GetFilterNavigator()->Delete(ConstString(type_name.GetName()));
+ return m_opaque_sp->GetTypeFiltersContainer()->Delete(ConstString(type_name.GetName()));
}
#ifndef LLDB_DISABLE_PYTHON
@@ -491,9 +491,9 @@ SBTypeCategory::AddTypeSynthetic (SBType
}
if (type_name.IsRegex())
- m_opaque_sp->GetRegexSyntheticNavigator()->Add(lldb::RegularExpressionSP(new RegularExpression(type_name.GetName())), synth.GetSP());
+ m_opaque_sp->GetRegexTypeSyntheticsContainer()->Add(lldb::RegularExpressionSP(new RegularExpression(type_name.GetName())), synth.GetSP());
else
- m_opaque_sp->GetSyntheticNavigator()->Add(ConstString(type_name.GetName()), synth.GetSP());
+ m_opaque_sp->GetTypeSyntheticsContainer()->Add(ConstString(type_name.GetName()), synth.GetSP());
return true;
}
@@ -508,9 +508,9 @@ SBTypeCategory::DeleteTypeSynthetic (SBT
return false;
if (type_name.IsRegex())
- return m_opaque_sp->GetRegexSyntheticNavigator()->Delete(ConstString(type_name.GetName()));
+ return m_opaque_sp->GetRegexTypeSyntheticsContainer()->Delete(ConstString(type_name.GetName()));
else
- return m_opaque_sp->GetSyntheticNavigator()->Delete(ConstString(type_name.GetName()));
+ return m_opaque_sp->GetTypeSyntheticsContainer()->Delete(ConstString(type_name.GetName()));
}
#endif // LLDB_DISABLE_PYTHON
Modified: lldb/trunk/source/Commands/CommandObjectType.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectType.cpp?rev=197795&r1=197794&r2=197795&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectType.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectType.cpp Fri Dec 20 03:38:13 2013
@@ -540,11 +540,11 @@ protected:
result.SetStatus(eReturnStatusFailed);
return false;
}
- category_sp->GetRegexSummaryNavigator()->Delete(typeCS);
- category_sp->GetRegexValueNavigator()->Add(typeRX, entry);
+ category_sp->GetRegexTypeSummariesContainer()->Delete(typeCS);
+ category_sp->GetRegexTypeFormatsContainer()->Add(typeRX, entry);
}
else
- category_sp->GetValueNavigator()->Add(typeCS, entry);
+ category_sp->GetTypeFormatsContainer()->Add(typeCS, entry);
}
else
{
@@ -817,8 +817,8 @@ private:
PerCategoryCallback(void* param,
const lldb::TypeCategoryImplSP& cate)
{
- cate->GetValueNavigator()->Clear();
- cate->GetRegexValueNavigator()->Clear();
+ cate->GetTypeFormatsContainer()->Clear();
+ cate->GetRegexTypeFormatsContainer()->Clear();
return true;
}
@@ -1029,12 +1029,12 @@ private:
cate_name,
(cate->IsEnabled() ? "enabled" : "disabled"));
- cate->GetValueNavigator()->LoopThrough(CommandObjectTypeFormatList_LoopCallback, param_vp);
+ cate->GetTypeFormatsContainer()->LoopThrough(CommandObjectTypeFormatList_LoopCallback, param_vp);
- if (cate->GetRegexSummaryNavigator()->GetCount() > 0)
+ if (cate->GetRegexTypeSummariesContainer()->GetCount() > 0)
{
result->GetOutputStream().Printf("Regex-based summaries (slower):\n");
- cate->GetRegexValueNavigator()->LoopThrough(CommandObjectTypeRXFormatList_LoopCallback, param_vp);
+ cate->GetRegexTypeFormatsContainer()->LoopThrough(CommandObjectTypeRXFormatList_LoopCallback, param_vp);
}
return true;
}
@@ -1720,8 +1720,8 @@ CommandObjectTypeSummaryAdd::AddSummary(
return false;
}
- category->GetRegexSummaryNavigator()->Delete(type_name);
- category->GetRegexSummaryNavigator()->Add(typeRX, entry);
+ category->GetRegexTypeSummariesContainer()->Delete(type_name);
+ category->GetRegexTypeSummariesContainer()->Add(typeRX, entry);
return true;
}
@@ -1733,7 +1733,7 @@ CommandObjectTypeSummaryAdd::AddSummary(
}
else
{
- category->GetSummaryNavigator()->Add(type_name, entry);
+ category->GetTypeSummariesContainer()->Add(type_name, entry);
return true;
}
}
@@ -1994,8 +1994,8 @@ private:
PerCategoryCallback(void* param,
const lldb::TypeCategoryImplSP& cate)
{
- cate->GetSummaryNavigator()->Clear();
- cate->GetRegexSummaryNavigator()->Clear();
+ cate->GetTypeSummariesContainer()->Clear();
+ cate->GetRegexTypeSummariesContainer()->Clear();
return true;
}
@@ -2226,12 +2226,12 @@ private:
cate_name,
(cate->IsEnabled() ? "enabled" : "disabled"));
- cate->GetSummaryNavigator()->LoopThrough(CommandObjectTypeSummaryList_LoopCallback, param_vp);
+ cate->GetTypeSummariesContainer()->LoopThrough(CommandObjectTypeSummaryList_LoopCallback, param_vp);
- if (cate->GetRegexSummaryNavigator()->GetCount() > 0)
+ if (cate->GetRegexTypeSummariesContainer()->GetCount() > 0)
{
result->GetOutputStream().Printf("Regex-based summaries (slower):\n");
- cate->GetRegexSummaryNavigator()->LoopThrough(CommandObjectTypeRXSummaryList_LoopCallback, param_vp);
+ cate->GetRegexTypeSummariesContainer()->LoopThrough(CommandObjectTypeRXSummaryList_LoopCallback, param_vp);
}
return true;
}
@@ -2774,12 +2774,12 @@ private:
cate_name,
(cate->IsEnabled() ? "enabled" : "disabled"));
- cate->GetFilterNavigator()->LoopThrough(CommandObjectTypeFilterList_LoopCallback, param_vp);
+ cate->GetTypeFiltersContainer()->LoopThrough(CommandObjectTypeFilterList_LoopCallback, param_vp);
- if (cate->GetRegexFilterNavigator()->GetCount() > 0)
+ if (cate->GetRegexTypeFiltersContainer()->GetCount() > 0)
{
result->GetOutputStream().Printf("Regex-based filters (slower):\n");
- cate->GetRegexFilterNavigator()->LoopThrough(CommandObjectTypeFilterRXList_LoopCallback, param_vp);
+ cate->GetRegexTypeFiltersContainer()->LoopThrough(CommandObjectTypeFilterRXList_LoopCallback, param_vp);
}
return true;
@@ -2988,12 +2988,12 @@ private:
cate_name,
(cate->IsEnabled() ? "enabled" : "disabled"));
- cate->GetSyntheticNavigator()->LoopThrough(CommandObjectTypeSynthList_LoopCallback, param_vp);
+ cate->GetTypeSyntheticsContainer()->LoopThrough(CommandObjectTypeSynthList_LoopCallback, param_vp);
- if (cate->GetRegexSyntheticNavigator()->GetCount() > 0)
+ if (cate->GetRegexTypeSyntheticsContainer()->GetCount() > 0)
{
result->GetOutputStream().Printf("Regex-based synthetic providers (slower):\n");
- cate->GetRegexSyntheticNavigator()->LoopThrough(CommandObjectTypeSynthRXList_LoopCallback, param_vp);
+ cate->GetRegexTypeSyntheticsContainer()->LoopThrough(CommandObjectTypeSynthRXList_LoopCallback, param_vp);
}
return true;
@@ -3179,8 +3179,8 @@ protected:
lldb::TypeCategoryImplSP category;
DataVisualization::Categories::GetCategory(ConstString(m_options.m_category.c_str()), category);
- bool delete_category = category->GetFilterNavigator()->Delete(typeCS);
- delete_category = category->GetRegexFilterNavigator()->Delete(typeCS) || delete_category;
+ bool delete_category = category->GetTypeFiltersContainer()->Delete(typeCS);
+ delete_category = category->GetRegexTypeFiltersContainer()->Delete(typeCS) || delete_category;
if (delete_category)
{
@@ -3345,8 +3345,8 @@ protected:
lldb::TypeCategoryImplSP category;
DataVisualization::Categories::GetCategory(ConstString(m_options.m_category.c_str()), category);
- bool delete_category = category->GetSyntheticNavigator()->Delete(typeCS);
- delete_category = category->GetRegexSyntheticNavigator()->Delete(typeCS) || delete_category;
+ bool delete_category = category->GetTypeSyntheticsContainer()->Delete(typeCS);
+ delete_category = category->GetRegexTypeSyntheticsContainer()->Delete(typeCS) || delete_category;
if (delete_category)
{
@@ -3484,8 +3484,8 @@ protected:
}
else
DataVisualization::Categories::GetCategory(ConstString(NULL), category);
- category->GetFilterNavigator()->Clear();
- category->GetRegexFilterNavigator()->Clear();
+ category->GetTypeFiltersContainer()->Clear();
+ category->GetRegexTypeFiltersContainer()->Clear();
}
result.SetStatus(eReturnStatusSuccessFinishResult);
@@ -3613,8 +3613,8 @@ protected:
}
else
DataVisualization::Categories::GetCategory(ConstString(NULL), category);
- category->GetSyntheticNavigator()->Clear();
- category->GetRegexSyntheticNavigator()->Clear();
+ category->GetTypeSyntheticsContainer()->Clear();
+ category->GetRegexTypeSyntheticsContainer()->Clear();
}
result.SetStatus(eReturnStatusSuccessFinishResult);
@@ -3979,14 +3979,14 @@ CommandObjectTypeSynthAdd::AddSynth(Cons
return false;
}
- category->GetRegexSyntheticNavigator()->Delete(type_name);
- category->GetRegexSyntheticNavigator()->Add(typeRX, entry);
+ category->GetRegexTypeSyntheticsContainer()->Delete(type_name);
+ category->GetRegexTypeSyntheticsContainer()->Add(typeRX, entry);
return true;
}
else
{
- category->GetSyntheticNavigator()->Add(type_name, entry);
+ category->GetTypeSyntheticsContainer()->Add(type_name, entry);
return true;
}
}
@@ -4173,14 +4173,14 @@ private:
return false;
}
- category->GetRegexFilterNavigator()->Delete(type_name);
- category->GetRegexFilterNavigator()->Add(typeRX, entry);
+ category->GetRegexTypeFiltersContainer()->Delete(type_name);
+ category->GetRegexTypeFiltersContainer()->Add(typeRX, entry);
return true;
}
else
{
- category->GetFilterNavigator()->Add(type_name, entry);
+ category->GetTypeFiltersContainer()->Add(type_name, entry);
return true;
}
}
Modified: lldb/trunk/source/DataFormatters/DataVisualization.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/DataVisualization.cpp?rev=197795&r1=197794&r2=197795&view=diff
==============================================================================
--- lldb/trunk/source/DataFormatters/DataVisualization.cpp (original)
+++ lldb/trunk/source/DataFormatters/DataVisualization.cpp Fri Dec 20 03:38:13 2013
@@ -204,35 +204,35 @@ DataVisualization::Categories::GetCatego
bool
DataVisualization::NamedSummaryFormats::GetSummaryFormat (const ConstString &type, lldb::TypeSummaryImplSP &entry)
{
- return GetFormatManager().GetNamedSummaryNavigator().Get(type,entry);
+ return GetFormatManager().GetNamedSummaryContainer().Get(type,entry);
}
void
DataVisualization::NamedSummaryFormats::Add (const ConstString &type, const lldb::TypeSummaryImplSP &entry)
{
- GetFormatManager().GetNamedSummaryNavigator().Add(FormatManager::GetValidTypeName(type),entry);
+ GetFormatManager().GetNamedSummaryContainer().Add(FormatManager::GetValidTypeName(type),entry);
}
bool
DataVisualization::NamedSummaryFormats::Delete (const ConstString &type)
{
- return GetFormatManager().GetNamedSummaryNavigator().Delete(type);
+ return GetFormatManager().GetNamedSummaryContainer().Delete(type);
}
void
DataVisualization::NamedSummaryFormats::Clear ()
{
- GetFormatManager().GetNamedSummaryNavigator().Clear();
+ GetFormatManager().GetNamedSummaryContainer().Clear();
}
void
DataVisualization::NamedSummaryFormats::LoopThrough (TypeSummaryImpl::SummaryCallback callback, void* callback_baton)
{
- GetFormatManager().GetNamedSummaryNavigator().LoopThrough(callback, callback_baton);
+ GetFormatManager().GetNamedSummaryContainer().LoopThrough(callback, callback_baton);
}
uint32_t
DataVisualization::NamedSummaryFormats::GetCount ()
{
- return GetFormatManager().GetNamedSummaryNavigator().GetCount();
+ return GetFormatManager().GetNamedSummaryContainer().GetCount();
}
Modified: lldb/trunk/source/DataFormatters/FormatManager.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/FormatManager.cpp?rev=197795&r1=197794&r2=197795&view=diff
==============================================================================
--- lldb/trunk/source/DataFormatters/FormatManager.cpp (original)
+++ lldb/trunk/source/DataFormatters/FormatManager.cpp Fri Dec 20 03:38:13 2013
@@ -744,9 +744,9 @@ AddFormat (TypeCategoryImpl::SharedPoint
lldb::TypeFormatImplSP format_sp(new TypeFormatImpl(format, flags));
if (regex)
- category_sp->GetRegexValueNavigator()->Add(RegularExpressionSP(new RegularExpression(type_name.AsCString())),format_sp);
+ category_sp->GetRegexTypeFormatsContainer()->Add(RegularExpressionSP(new RegularExpression(type_name.AsCString())),format_sp);
else
- category_sp->GetValueNavigator()->Add(type_name, format_sp);
+ category_sp->GetTypeFormatsContainer()->Add(type_name, format_sp);
}
@@ -761,9 +761,9 @@ AddStringSummary(TypeCategoryImpl::Share
string));
if (regex)
- category_sp->GetRegexSummaryNavigator()->Add(RegularExpressionSP(new RegularExpression(type_name.AsCString())),summary_sp);
+ category_sp->GetRegexTypeSummariesContainer()->Add(RegularExpressionSP(new RegularExpression(type_name.AsCString())),summary_sp);
else
- category_sp->GetSummaryNavigator()->Add(type_name, summary_sp);
+ category_sp->GetTypeSummariesContainer()->Add(type_name, summary_sp);
}
#ifndef LLDB_DISABLE_PYTHON
@@ -782,9 +782,9 @@ AddScriptSummary(TypeCategoryImpl::Share
funct_name,
code.c_str()));
if (regex)
- category_sp->GetRegexSummaryNavigator()->Add(RegularExpressionSP(new RegularExpression(type_name.AsCString())),summary_sp);
+ category_sp->GetRegexTypeSummariesContainer()->Add(RegularExpressionSP(new RegularExpression(type_name.AsCString())),summary_sp);
else
- category_sp->GetSummaryNavigator()->Add(type_name, summary_sp);
+ category_sp->GetTypeSummariesContainer()->Add(type_name, summary_sp);
}
#endif
@@ -799,9 +799,9 @@ AddCXXSummary (TypeCategoryImpl::SharedP
{
lldb::TypeSummaryImplSP summary_sp(new CXXFunctionSummaryFormat(flags,funct,description));
if (regex)
- category_sp->GetRegexSummaryNavigator()->Add(RegularExpressionSP(new RegularExpression(type_name.AsCString())),summary_sp);
+ category_sp->GetRegexTypeSummariesContainer()->Add(RegularExpressionSP(new RegularExpression(type_name.AsCString())),summary_sp);
else
- category_sp->GetSummaryNavigator()->Add(type_name, summary_sp);
+ category_sp->GetTypeSummariesContainer()->Add(type_name, summary_sp);
}
#endif
@@ -815,9 +815,9 @@ static void AddCXXSynthetic (TypeCatego
{
lldb::SyntheticChildrenSP synth_sp(new CXXSyntheticChildren(flags,description,generator));
if (regex)
- category_sp->GetRegexSyntheticNavigator()->Add(RegularExpressionSP(new RegularExpression(type_name.AsCString())), synth_sp);
+ category_sp->GetRegexTypeSyntheticsContainer()->Add(RegularExpressionSP(new RegularExpression(type_name.AsCString())), synth_sp);
else
- category_sp->GetSyntheticNavigator()->Add(type_name,synth_sp);
+ category_sp->GetTypeSyntheticsContainer()->Add(type_name,synth_sp);
}
#endif
@@ -838,26 +838,26 @@ FormatManager::LoadLibStdcppFormatters()
TypeCategoryImpl::SharedPointer gnu_category_sp = GetCategory(m_gnu_cpp_category_name);
- gnu_category_sp->GetSummaryNavigator()->Add(ConstString("std::string"),
+ gnu_category_sp->GetTypeSummariesContainer()->Add(ConstString("std::string"),
std_string_summary_sp);
- gnu_category_sp->GetSummaryNavigator()->Add(ConstString("std::basic_string<char>"),
+ gnu_category_sp->GetTypeSummariesContainer()->Add(ConstString("std::basic_string<char>"),
std_string_summary_sp);
- gnu_category_sp->GetSummaryNavigator()->Add(ConstString("std::basic_string<char,std::char_traits<char>,std::allocator<char> >"),
+ gnu_category_sp->GetTypeSummariesContainer()->Add(ConstString("std::basic_string<char,std::char_traits<char>,std::allocator<char> >"),
std_string_summary_sp);
- gnu_category_sp->GetSummaryNavigator()->Add(ConstString("std::basic_string<char, std::char_traits<char>, std::allocator<char> >"),
+ gnu_category_sp->GetTypeSummariesContainer()->Add(ConstString("std::basic_string<char, std::char_traits<char>, std::allocator<char> >"),
std_string_summary_sp);
// making sure we force-pick the summary for printing wstring (_M_p is a wchar_t*)
lldb::TypeSummaryImplSP std_wstring_summary_sp(new StringSummaryFormat(stl_summary_flags,
"${var._M_dataplus._M_p%S}"));
- gnu_category_sp->GetSummaryNavigator()->Add(ConstString("std::wstring"),
+ gnu_category_sp->GetTypeSummariesContainer()->Add(ConstString("std::wstring"),
std_wstring_summary_sp);
- gnu_category_sp->GetSummaryNavigator()->Add(ConstString("std::basic_string<wchar_t>"),
+ gnu_category_sp->GetTypeSummariesContainer()->Add(ConstString("std::basic_string<wchar_t>"),
std_wstring_summary_sp);
- gnu_category_sp->GetSummaryNavigator()->Add(ConstString("std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >"),
+ gnu_category_sp->GetTypeSummariesContainer()->Add(ConstString("std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >"),
std_wstring_summary_sp);
- gnu_category_sp->GetSummaryNavigator()->Add(ConstString("std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >"),
+ gnu_category_sp->GetTypeSummariesContainer()->Add(ConstString("std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >"),
std_wstring_summary_sp);
@@ -866,24 +866,24 @@ FormatManager::LoadLibStdcppFormatters()
SyntheticChildren::Flags stl_synth_flags;
stl_synth_flags.SetCascades(true).SetSkipPointers(false).SetSkipReferences(false);
- gnu_category_sp->GetRegexSyntheticNavigator()->Add(RegularExpressionSP(new RegularExpression("^std::vector<.+>(( )?&)?$")),
+ gnu_category_sp->GetRegexTypeSyntheticsContainer()->Add(RegularExpressionSP(new RegularExpression("^std::vector<.+>(( )?&)?$")),
SyntheticChildrenSP(new ScriptedSyntheticChildren(stl_synth_flags,
"lldb.formatters.cpp.gnu_libstdcpp.StdVectorSynthProvider")));
- gnu_category_sp->GetRegexSyntheticNavigator()->Add(RegularExpressionSP(new RegularExpression("^std::map<.+> >(( )?&)?$")),
+ gnu_category_sp->GetRegexTypeSyntheticsContainer()->Add(RegularExpressionSP(new RegularExpression("^std::map<.+> >(( )?&)?$")),
SyntheticChildrenSP(new ScriptedSyntheticChildren(stl_synth_flags,
"lldb.formatters.cpp.gnu_libstdcpp.StdMapSynthProvider")));
- gnu_category_sp->GetRegexSyntheticNavigator()->Add(RegularExpressionSP(new RegularExpression("^std::list<.+>(( )?&)?$")),
+ gnu_category_sp->GetRegexTypeSyntheticsContainer()->Add(RegularExpressionSP(new RegularExpression("^std::list<.+>(( )?&)?$")),
SyntheticChildrenSP(new ScriptedSyntheticChildren(stl_synth_flags,
"lldb.formatters.cpp.gnu_libstdcpp.StdListSynthProvider")));
stl_summary_flags.SetDontShowChildren(false);stl_summary_flags.SetSkipPointers(true);
- gnu_category_sp->GetRegexSummaryNavigator()->Add(RegularExpressionSP(new RegularExpression("^std::vector<.+>(( )?&)?$")),
+ gnu_category_sp->GetRegexTypeSummariesContainer()->Add(RegularExpressionSP(new RegularExpression("^std::vector<.+>(( )?&)?$")),
TypeSummaryImplSP(new StringSummaryFormat(stl_summary_flags,
"size=${svar%#}")));
- gnu_category_sp->GetRegexSummaryNavigator()->Add(RegularExpressionSP(new RegularExpression("^std::map<.+> >(( )?&)?$")),
+ gnu_category_sp->GetRegexTypeSummariesContainer()->Add(RegularExpressionSP(new RegularExpression("^std::map<.+> >(( )?&)?$")),
TypeSummaryImplSP(new StringSummaryFormat(stl_summary_flags,
"size=${svar%#}")));
- gnu_category_sp->GetRegexSummaryNavigator()->Add(RegularExpressionSP(new RegularExpression("^std::list<.+>(( )?&)?$")),
+ gnu_category_sp->GetRegexTypeSummariesContainer()->Add(RegularExpressionSP(new RegularExpression("^std::list<.+>(( )?&)?$")),
TypeSummaryImplSP(new StringSummaryFormat(stl_summary_flags,
"size=${svar%#}")));
@@ -891,10 +891,10 @@ FormatManager::LoadLibStdcppFormatters()
AddCXXSynthetic(gnu_category_sp, lldb_private::formatters::LibstdcppMapIteratorSyntheticFrontEndCreator, "std::map iterator synthetic children", ConstString("^std::_Rb_tree_iterator<.+>$"), stl_synth_flags, true);
- gnu_category_sp->GetSummaryNavigator()->Add(ConstString("std::vector<std::allocator<bool> >"),
+ gnu_category_sp->GetTypeSummariesContainer()->Add(ConstString("std::vector<std::allocator<bool> >"),
TypeSummaryImplSP(new StringSummaryFormat(stl_summary_flags, "size=${svar%#}")));
- gnu_category_sp->GetSyntheticNavigator()->Add(ConstString("std::vector<std::allocator<bool> >"),
+ gnu_category_sp->GetTypeSyntheticsContainer()->Add(ConstString("std::vector<std::allocator<bool> >"),
SyntheticChildrenSP(new CXXSyntheticChildren(stl_synth_flags,"libc++ std::vector<bool> synthetic children",lldb_private::formatters::LibstdcppVectorBoolSyntheticFrontEndCreator)));
#endif
@@ -921,14 +921,14 @@ FormatManager::LoadLibcxxFormatters()
TypeCategoryImpl::SharedPointer libcxx_category_sp = GetCategory(m_libcxx_category_name);
- libcxx_category_sp->GetSummaryNavigator()->Add(ConstString("std::__1::string"),
+ libcxx_category_sp->GetTypeSummariesContainer()->Add(ConstString("std::__1::string"),
std_string_summary_sp);
- libcxx_category_sp->GetSummaryNavigator()->Add(ConstString("std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >"),
+ libcxx_category_sp->GetTypeSummariesContainer()->Add(ConstString("std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >"),
std_string_summary_sp);
- libcxx_category_sp->GetSummaryNavigator()->Add(ConstString("std::__1::wstring"),
+ libcxx_category_sp->GetTypeSummariesContainer()->Add(ConstString("std::__1::wstring"),
std_wstring_summary_sp);
- libcxx_category_sp->GetSummaryNavigator()->Add(ConstString("std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> >"),
+ libcxx_category_sp->GetTypeSummariesContainer()->Add(ConstString("std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> >"),
std_wstring_summary_sp);
SyntheticChildren::Flags stl_synth_flags;
@@ -943,7 +943,7 @@ FormatManager::LoadLibcxxFormatters()
AddCXXSynthetic(libcxx_category_sp, lldb_private::formatters::LibcxxStdMapSyntheticFrontEndCreator, "libc++ std::multimap synthetic children", ConstString("^std::__1::multimap<.+> >(( )?&)?$"), stl_synth_flags, true);
AddCXXSynthetic(libcxx_category_sp, lldb_private::formatters::LibcxxStdUnorderedMapSyntheticFrontEndCreator, "libc++ std::unordered containers synthetic children", ConstString("^(std::__1::)unordered_(multi)?(map|set)<.+> >$"), stl_synth_flags, true);
- libcxx_category_sp->GetRegexSyntheticNavigator()->Add(RegularExpressionSP(new RegularExpression("^(std::__1::)deque<.+>(( )?&)?$")),
+ libcxx_category_sp->GetRegexTypeSyntheticsContainer()->Add(RegularExpressionSP(new RegularExpression("^(std::__1::)deque<.+>(( )?&)?$")),
SyntheticChildrenSP(new ScriptedSyntheticChildren(stl_synth_flags,
"lldb.formatters.cpp.libcxx.stddeque_SynthProvider")));
@@ -1002,9 +1002,9 @@ FormatManager::LoadSystemFormatters()
TypeCategoryImpl::SharedPointer sys_category_sp = GetCategory(m_system_category_name);
- sys_category_sp->GetSummaryNavigator()->Add(ConstString("char *"), string_format);
- sys_category_sp->GetSummaryNavigator()->Add(ConstString("unsigned char *"), string_format);
- sys_category_sp->GetRegexSummaryNavigator()->Add(any_size_char_arr, string_array_format);
+ sys_category_sp->GetTypeSummariesContainer()->Add(ConstString("char *"), string_format);
+ sys_category_sp->GetTypeSummariesContainer()->Add(ConstString("unsigned char *"), string_format);
+ sys_category_sp->GetRegexTypeSummariesContainer()->Add(any_size_char_arr, string_array_format);
lldb::TypeSummaryImplSP ostype_summary(new StringSummaryFormat(TypeSummaryImpl::Flags().SetCascades(false)
.SetSkipPointers(true)
@@ -1015,10 +1015,10 @@ FormatManager::LoadSystemFormatters()
.SetHideItemNames(false),
"${var%O}"));
- sys_category_sp->GetSummaryNavigator()->Add(ConstString("OSType"), ostype_summary);
+ sys_category_sp->GetTypeSummariesContainer()->Add(ConstString("OSType"), ostype_summary);
#ifndef LLDB_DISABLE_PYTHON
- // FIXME because of a bug in the FormatNavigator we need to add a summary for both X* and const X* (<rdar://problem/12717717>)
+ // FIXME because of a bug in the FormattersContainer we need to add a summary for both X* and const X* (<rdar://problem/12717717>)
AddCXXSummary(sys_category_sp, lldb_private::formatters::Char16StringSummaryProvider, "char16_t * summary provider", ConstString("char16_t *"), string_flags);
AddCXXSummary(sys_category_sp, lldb_private::formatters::Char32StringSummaryProvider, "char32_t * summary provider", ConstString("char32_t *"), string_flags);
@@ -1065,11 +1065,11 @@ FormatManager::LoadObjCFormatters()
TypeCategoryImpl::SharedPointer objc_category_sp = GetCategory(m_objc_category_name);
lldb::TypeSummaryImplSP ObjC_BOOL_summary(new CXXFunctionSummaryFormat(objc_flags, lldb_private::formatters::ObjCBOOLSummaryProvider,""));
- objc_category_sp->GetSummaryNavigator()->Add(ConstString("BOOL"),
+ objc_category_sp->GetTypeSummariesContainer()->Add(ConstString("BOOL"),
ObjC_BOOL_summary);
- objc_category_sp->GetSummaryNavigator()->Add(ConstString("BOOL &"),
+ objc_category_sp->GetTypeSummariesContainer()->Add(ConstString("BOOL &"),
ObjC_BOOL_summary);
- objc_category_sp->GetSummaryNavigator()->Add(ConstString("BOOL *"),
+ objc_category_sp->GetTypeSummariesContainer()->Add(ConstString("BOOL *"),
ObjC_BOOL_summary);
#ifndef LLDB_DISABLE_PYTHON
Modified: lldb/trunk/source/DataFormatters/TypeCategory.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/TypeCategory.cpp?rev=197795&r1=197794&r2=197795&view=diff
==============================================================================
--- lldb/trunk/source/DataFormatters/TypeCategory.cpp (original)
+++ lldb/trunk/source/DataFormatters/TypeCategory.cpp Fri Dec 20 03:38:13 2013
@@ -21,15 +21,15 @@ using namespace lldb_private;
TypeCategoryImpl::TypeCategoryImpl(IFormatChangeListener* clist,
ConstString name) :
-m_value_nav(new ValueNavigator("format",clist)),
-m_regex_value_nav(new RegexValueNavigator("regex-format",clist)),
-m_summary_nav(new SummaryNavigator("summary",clist)),
-m_regex_summary_nav(new RegexSummaryNavigator("regex-summary",clist)),
-m_filter_nav(new FilterNavigator("filter",clist)),
-m_regex_filter_nav(new RegexFilterNavigator("regex-filter",clist)),
+m_format_cont(new FormatContainer("format",clist)),
+m_regex_format_cont(new RegexFormatContainer("regex-format",clist)),
+m_summary_cont(new SummaryContainer("summary",clist)),
+m_regex_summary_cont(new RegexSummaryContainer("regex-summary",clist)),
+m_filter_cont(new FilterContainer("filter",clist)),
+m_regex_filter_cont(new RegexFilterContainer("regex-filter",clist)),
#ifndef LLDB_DISABLE_PYTHON
-m_synth_nav(new SynthNavigator("synth",clist)),
-m_regex_synth_nav(new RegexSynthNavigator("regex-synth",clist)),
+m_synth_cont(new SynthContainer("synth",clist)),
+m_regex_synth_cont(new RegexSynthContainer("regex-synth",clist)),
#endif
m_enabled(false),
m_change_listener(clist),
@@ -45,9 +45,9 @@ TypeCategoryImpl::Get (ValueObject& valo
{
if (!IsEnabled())
return false;
- if (GetValueNavigator()->Get(candidates, entry, reason))
+ if (GetTypeFormatsContainer()->Get(candidates, entry, reason))
return true;
- bool regex = GetRegexValueNavigator()->Get(candidates, entry, reason);
+ bool regex = GetRegexTypeFormatsContainer()->Get(candidates, entry, reason);
if (regex && reason)
*reason |= lldb_private::eFormatterChoiceCriterionRegularExpressionSummary;
return regex;
@@ -61,9 +61,9 @@ TypeCategoryImpl::Get (ValueObject& valo
{
if (!IsEnabled())
return false;
- if (GetSummaryNavigator()->Get(candidates, entry, reason))
+ if (GetTypeSummariesContainer()->Get(candidates, entry, reason))
return true;
- bool regex = GetRegexSummaryNavigator()->Get(candidates, entry, reason);
+ bool regex = GetRegexTypeSummariesContainer()->Get(candidates, entry, reason);
if (regex && reason)
*reason |= lldb_private::eFormatterChoiceCriterionRegularExpressionSummary;
return regex;
@@ -82,16 +82,16 @@ TypeCategoryImpl::Get (ValueObject& valo
bool regex_filter = false;
// first find both Filter and Synth, and then check which is most recent
- if (!GetFilterNavigator()->Get(candidates, filter_sp, &reason_filter))
- regex_filter = GetRegexFilterNavigator()->Get (candidates, filter_sp, &reason_filter);
+ if (!GetTypeFiltersContainer()->Get(candidates, filter_sp, &reason_filter))
+ regex_filter = GetRegexTypeFiltersContainer()->Get (candidates, filter_sp, &reason_filter);
#ifndef LLDB_DISABLE_PYTHON
bool regex_synth = false;
uint32_t reason_synth = 0;
bool pick_synth = false;
ScriptedSyntheticChildren::SharedPointer synth;
- if (!GetSyntheticNavigator()->Get(candidates, synth, &reason_synth))
- regex_synth = GetRegexSyntheticNavigator()->Get (candidates, synth, &reason_synth);
+ if (!GetTypeSyntheticsContainer()->Get(candidates, synth, &reason_synth))
+ regex_synth = GetRegexTypeSyntheticsContainer()->Get (candidates, synth, &reason_synth);
if (!filter_sp.get() && !synth.get())
return false;
else if (!filter_sp.get() && synth.get())
@@ -137,25 +137,25 @@ void
TypeCategoryImpl::Clear (FormatCategoryItems items)
{
if ( (items & eFormatCategoryItemValue) == eFormatCategoryItemValue )
- m_value_nav->Clear();
+ m_format_cont->Clear();
if ( (items & eFormatCategoryItemRegexValue) == eFormatCategoryItemRegexValue )
- m_regex_value_nav->Clear();
+ m_regex_format_cont->Clear();
if ( (items & eFormatCategoryItemSummary) == eFormatCategoryItemSummary )
- m_summary_nav->Clear();
+ m_summary_cont->Clear();
if ( (items & eFormatCategoryItemRegexSummary) == eFormatCategoryItemRegexSummary )
- m_regex_summary_nav->Clear();
+ m_regex_summary_cont->Clear();
if ( (items & eFormatCategoryItemFilter) == eFormatCategoryItemFilter )
- m_filter_nav->Clear();
+ m_filter_cont->Clear();
if ( (items & eFormatCategoryItemRegexFilter) == eFormatCategoryItemRegexFilter )
- m_regex_filter_nav->Clear();
+ m_regex_filter_cont->Clear();
#ifndef LLDB_DISABLE_PYTHON
if ( (items & eFormatCategoryItemSynth) == eFormatCategoryItemSynth )
- m_synth_nav->Clear();
+ m_synth_cont->Clear();
if ( (items & eFormatCategoryItemRegexSynth) == eFormatCategoryItemRegexSynth )
- m_regex_synth_nav->Clear();
+ m_regex_synth_cont->Clear();
#endif
}
@@ -166,25 +166,25 @@ TypeCategoryImpl::Delete (ConstString na
bool success = false;
if ( (items & eFormatCategoryItemValue) == eFormatCategoryItemValue )
- success = m_value_nav->Delete(name) || success;
+ success = m_format_cont->Delete(name) || success;
if ( (items & eFormatCategoryItemRegexValue) == eFormatCategoryItemRegexValue )
- success = m_regex_value_nav->Delete(name) || success;
+ success = m_regex_format_cont->Delete(name) || success;
if ( (items & eFormatCategoryItemSummary) == eFormatCategoryItemSummary )
- success = m_summary_nav->Delete(name) || success;
+ success = m_summary_cont->Delete(name) || success;
if ( (items & eFormatCategoryItemRegexSummary) == eFormatCategoryItemRegexSummary )
- success = m_regex_summary_nav->Delete(name) || success;
+ success = m_regex_summary_cont->Delete(name) || success;
if ( (items & eFormatCategoryItemFilter) == eFormatCategoryItemFilter )
- success = m_filter_nav->Delete(name) || success;
+ success = m_filter_cont->Delete(name) || success;
if ( (items & eFormatCategoryItemRegexFilter) == eFormatCategoryItemRegexFilter )
- success = m_regex_filter_nav->Delete(name) || success;
+ success = m_regex_filter_cont->Delete(name) || success;
#ifndef LLDB_DISABLE_PYTHON
if ( (items & eFormatCategoryItemSynth) == eFormatCategoryItemSynth )
- success = m_synth_nav->Delete(name) || success;
+ success = m_synth_cont->Delete(name) || success;
if ( (items & eFormatCategoryItemRegexSynth) == eFormatCategoryItemRegexSynth )
- success = m_regex_synth_nav->Delete(name) || success;
+ success = m_regex_synth_cont->Delete(name) || success;
#endif
return success;
}
@@ -195,25 +195,25 @@ TypeCategoryImpl::GetCount (FormatCatego
uint32_t count = 0;
if ( (items & eFormatCategoryItemValue) == eFormatCategoryItemValue )
- count += m_value_nav->GetCount();
+ count += m_format_cont->GetCount();
if ( (items & eFormatCategoryItemRegexValue) == eFormatCategoryItemRegexValue )
- count += m_regex_value_nav->GetCount();
+ count += m_regex_format_cont->GetCount();
if ( (items & eFormatCategoryItemSummary) == eFormatCategoryItemSummary )
- count += m_summary_nav->GetCount();
+ count += m_summary_cont->GetCount();
if ( (items & eFormatCategoryItemRegexSummary) == eFormatCategoryItemRegexSummary )
- count += m_regex_summary_nav->GetCount();
+ count += m_regex_summary_cont->GetCount();
if ( (items & eFormatCategoryItemFilter) == eFormatCategoryItemFilter )
- count += m_filter_nav->GetCount();
+ count += m_filter_cont->GetCount();
if ( (items & eFormatCategoryItemRegexFilter) == eFormatCategoryItemRegexFilter )
- count += m_regex_filter_nav->GetCount();
+ count += m_regex_filter_cont->GetCount();
#ifndef LLDB_DISABLE_PYTHON
if ( (items & eFormatCategoryItemSynth) == eFormatCategoryItemSynth )
- count += m_synth_nav->GetCount();
+ count += m_synth_cont->GetCount();
if ( (items & eFormatCategoryItemRegexSynth) == eFormatCategoryItemRegexSynth )
- count += m_regex_synth_nav->GetCount();
+ count += m_regex_synth_cont->GetCount();
#endif
return count;
}
@@ -237,7 +237,7 @@ TypeCategoryImpl::AnyMatches(ConstString
if ( (items & eFormatCategoryItemValue) == eFormatCategoryItemValue )
{
- if (m_value_nav->Get(type_name, format_sp))
+ if (m_format_cont->Get(type_name, format_sp))
{
if (matching_category)
*matching_category = m_name.GetCString();
@@ -248,7 +248,7 @@ TypeCategoryImpl::AnyMatches(ConstString
}
if ( (items & eFormatCategoryItemRegexValue) == eFormatCategoryItemRegexValue )
{
- if (m_regex_value_nav->Get(type_name, format_sp))
+ if (m_regex_format_cont->Get(type_name, format_sp))
{
if (matching_category)
*matching_category = m_name.GetCString();
@@ -260,7 +260,7 @@ TypeCategoryImpl::AnyMatches(ConstString
if ( (items & eFormatCategoryItemSummary) == eFormatCategoryItemSummary )
{
- if (m_summary_nav->Get(type_name, summary_sp))
+ if (m_summary_cont->Get(type_name, summary_sp))
{
if (matching_category)
*matching_category = m_name.GetCString();
@@ -271,7 +271,7 @@ TypeCategoryImpl::AnyMatches(ConstString
}
if ( (items & eFormatCategoryItemRegexSummary) == eFormatCategoryItemRegexSummary )
{
- if (m_regex_summary_nav->Get(type_name, summary_sp))
+ if (m_regex_summary_cont->Get(type_name, summary_sp))
{
if (matching_category)
*matching_category = m_name.GetCString();
@@ -283,7 +283,7 @@ TypeCategoryImpl::AnyMatches(ConstString
if ( (items & eFormatCategoryItemFilter) == eFormatCategoryItemFilter )
{
- if (m_filter_nav->Get(type_name, filter_sp))
+ if (m_filter_cont->Get(type_name, filter_sp))
{
if (matching_category)
*matching_category = m_name.GetCString();
@@ -294,7 +294,7 @@ TypeCategoryImpl::AnyMatches(ConstString
}
if ( (items & eFormatCategoryItemRegexFilter) == eFormatCategoryItemRegexFilter )
{
- if (m_regex_filter_nav->Get(type_name, filter_sp))
+ if (m_regex_filter_cont->Get(type_name, filter_sp))
{
if (matching_category)
*matching_category = m_name.GetCString();
@@ -307,7 +307,7 @@ TypeCategoryImpl::AnyMatches(ConstString
#ifndef LLDB_DISABLE_PYTHON
if ( (items & eFormatCategoryItemSynth) == eFormatCategoryItemSynth )
{
- if (m_synth_nav->Get(type_name, synth_sp))
+ if (m_synth_cont->Get(type_name, synth_sp))
{
if (matching_category)
*matching_category = m_name.GetCString();
@@ -318,7 +318,7 @@ TypeCategoryImpl::AnyMatches(ConstString
}
if ( (items & eFormatCategoryItemRegexSynth) == eFormatCategoryItemRegexSynth )
{
- if (m_regex_synth_nav->Get(type_name, synth_sp))
+ if (m_regex_synth_cont->Get(type_name, synth_sp))
{
if (matching_category)
*matching_category = m_name.GetCString();
@@ -331,66 +331,66 @@ TypeCategoryImpl::AnyMatches(ConstString
return false;
}
-TypeCategoryImpl::ValueNavigator::MapValueType
+TypeCategoryImpl::FormatContainer::MapValueType
TypeCategoryImpl::GetFormatForType (lldb::TypeNameSpecifierImplSP type_sp)
{
- ValueNavigator::MapValueType retval;
+ FormatContainer::MapValueType retval;
if (type_sp)
{
if (type_sp->IsRegex())
- m_regex_value_nav->GetExact(ConstString(type_sp->GetName()),retval);
+ m_regex_format_cont->GetExact(ConstString(type_sp->GetName()),retval);
else
- m_value_nav->GetExact(ConstString(type_sp->GetName()),retval);
+ m_format_cont->GetExact(ConstString(type_sp->GetName()),retval);
}
return retval;
}
-TypeCategoryImpl::SummaryNavigator::MapValueType
+TypeCategoryImpl::SummaryContainer::MapValueType
TypeCategoryImpl::GetSummaryForType (lldb::TypeNameSpecifierImplSP type_sp)
{
- SummaryNavigator::MapValueType retval;
+ SummaryContainer::MapValueType retval;
if (type_sp)
{
if (type_sp->IsRegex())
- m_regex_summary_nav->GetExact(ConstString(type_sp->GetName()),retval);
+ m_regex_summary_cont->GetExact(ConstString(type_sp->GetName()),retval);
else
- m_summary_nav->GetExact(ConstString(type_sp->GetName()),retval);
+ m_summary_cont->GetExact(ConstString(type_sp->GetName()),retval);
}
return retval;
}
-TypeCategoryImpl::FilterNavigator::MapValueType
+TypeCategoryImpl::FilterContainer::MapValueType
TypeCategoryImpl::GetFilterForType (lldb::TypeNameSpecifierImplSP type_sp)
{
- FilterNavigator::MapValueType retval;
+ FilterContainer::MapValueType retval;
if (type_sp)
{
if (type_sp->IsRegex())
- m_regex_filter_nav->GetExact(ConstString(type_sp->GetName()),retval);
+ m_regex_filter_cont->GetExact(ConstString(type_sp->GetName()),retval);
else
- m_filter_nav->GetExact(ConstString(type_sp->GetName()),retval);
+ m_filter_cont->GetExact(ConstString(type_sp->GetName()),retval);
}
return retval;
}
#ifndef LLDB_DISABLE_PYTHON
-TypeCategoryImpl::SynthNavigator::MapValueType
+TypeCategoryImpl::SynthContainer::MapValueType
TypeCategoryImpl::GetSyntheticForType (lldb::TypeNameSpecifierImplSP type_sp)
{
- SynthNavigator::MapValueType retval;
+ SynthContainer::MapValueType retval;
if (type_sp)
{
if (type_sp->IsRegex())
- m_regex_synth_nav->GetExact(ConstString(type_sp->GetName()),retval);
+ m_regex_synth_cont->GetExact(ConstString(type_sp->GetName()),retval);
else
- m_synth_nav->GetExact(ConstString(type_sp->GetName()),retval);
+ m_synth_cont->GetExact(ConstString(type_sp->GetName()),retval);
}
return retval;
@@ -400,74 +400,74 @@ TypeCategoryImpl::GetSyntheticForType (l
lldb::TypeNameSpecifierImplSP
TypeCategoryImpl::GetTypeNameSpecifierForSummaryAtIndex (size_t index)
{
- if (index < m_summary_nav->GetCount())
- return m_summary_nav->GetTypeNameSpecifierAtIndex(index);
+ if (index < m_summary_cont->GetCount())
+ return m_summary_cont->GetTypeNameSpecifierAtIndex(index);
else
- return m_regex_summary_nav->GetTypeNameSpecifierAtIndex(index-m_summary_nav->GetCount());
+ return m_regex_summary_cont->GetTypeNameSpecifierAtIndex(index-m_summary_cont->GetCount());
}
-TypeCategoryImpl::ValueNavigator::MapValueType
+TypeCategoryImpl::FormatContainer::MapValueType
TypeCategoryImpl::GetFormatAtIndex (size_t index)
{
- if (index < m_value_nav->GetCount())
- return m_value_nav->GetAtIndex(index);
+ if (index < m_format_cont->GetCount())
+ return m_format_cont->GetAtIndex(index);
else
- return m_regex_value_nav->GetAtIndex(index-m_value_nav->GetCount());
+ return m_regex_format_cont->GetAtIndex(index-m_format_cont->GetCount());
}
-TypeCategoryImpl::SummaryNavigator::MapValueType
+TypeCategoryImpl::SummaryContainer::MapValueType
TypeCategoryImpl::GetSummaryAtIndex (size_t index)
{
- if (index < m_summary_nav->GetCount())
- return m_summary_nav->GetAtIndex(index);
+ if (index < m_summary_cont->GetCount())
+ return m_summary_cont->GetAtIndex(index);
else
- return m_regex_summary_nav->GetAtIndex(index-m_summary_nav->GetCount());
+ return m_regex_summary_cont->GetAtIndex(index-m_summary_cont->GetCount());
}
-TypeCategoryImpl::FilterNavigator::MapValueType
+TypeCategoryImpl::FilterContainer::MapValueType
TypeCategoryImpl::GetFilterAtIndex (size_t index)
{
- if (index < m_filter_nav->GetCount())
- return m_filter_nav->GetAtIndex(index);
+ if (index < m_filter_cont->GetCount())
+ return m_filter_cont->GetAtIndex(index);
else
- return m_regex_filter_nav->GetAtIndex(index-m_filter_nav->GetCount());
+ return m_regex_filter_cont->GetAtIndex(index-m_filter_cont->GetCount());
}
lldb::TypeNameSpecifierImplSP
TypeCategoryImpl::GetTypeNameSpecifierForFormatAtIndex (size_t index)
{
- if (index < m_value_nav->GetCount())
- return m_value_nav->GetTypeNameSpecifierAtIndex(index);
+ if (index < m_format_cont->GetCount())
+ return m_format_cont->GetTypeNameSpecifierAtIndex(index);
else
- return m_regex_value_nav->GetTypeNameSpecifierAtIndex(index-m_value_nav->GetCount());
+ return m_regex_format_cont->GetTypeNameSpecifierAtIndex(index-m_format_cont->GetCount());
}
lldb::TypeNameSpecifierImplSP
TypeCategoryImpl::GetTypeNameSpecifierForFilterAtIndex (size_t index)
{
- if (index < m_filter_nav->GetCount())
- return m_filter_nav->GetTypeNameSpecifierAtIndex(index);
+ if (index < m_filter_cont->GetCount())
+ return m_filter_cont->GetTypeNameSpecifierAtIndex(index);
else
- return m_regex_filter_nav->GetTypeNameSpecifierAtIndex(index-m_filter_nav->GetCount());
+ return m_regex_filter_cont->GetTypeNameSpecifierAtIndex(index-m_filter_cont->GetCount());
}
#ifndef LLDB_DISABLE_PYTHON
-TypeCategoryImpl::SynthNavigator::MapValueType
+TypeCategoryImpl::SynthContainer::MapValueType
TypeCategoryImpl::GetSyntheticAtIndex (size_t index)
{
- if (index < m_synth_nav->GetCount())
- return m_synth_nav->GetAtIndex(index);
+ if (index < m_synth_cont->GetCount())
+ return m_synth_cont->GetAtIndex(index);
else
- return m_regex_synth_nav->GetAtIndex(index-m_synth_nav->GetCount());
+ return m_regex_synth_cont->GetAtIndex(index-m_synth_cont->GetCount());
}
lldb::TypeNameSpecifierImplSP
TypeCategoryImpl::GetTypeNameSpecifierForSyntheticAtIndex (size_t index)
{
- if (index < m_synth_nav->GetCount())
- return m_synth_nav->GetTypeNameSpecifierAtIndex(index);
+ if (index < m_synth_cont->GetCount())
+ return m_synth_cont->GetTypeNameSpecifierAtIndex(index);
else
- return m_regex_synth_nav->GetTypeNameSpecifierAtIndex(index - m_synth_nav->GetCount());
+ return m_regex_synth_cont->GetTypeNameSpecifierAtIndex(index - m_synth_cont->GetCount());
}
#endif
More information about the lldb-commits
mailing list