summaryrefslogtreecommitdiffstats
path: root/lldb/source/DataFormatters
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/DataFormatters')
-rw-r--r--lldb/source/DataFormatters/DataVisualization.cpp12
-rw-r--r--lldb/source/DataFormatters/TypeCategory.cpp4
-rw-r--r--lldb/source/DataFormatters/TypeCategoryMap.cpp25
3 files changed, 39 insertions, 2 deletions
diff --git a/lldb/source/DataFormatters/DataVisualization.cpp b/lldb/source/DataFormatters/DataVisualization.cpp
index 8799c59103e..7ef0be50efe 100644
--- a/lldb/source/DataFormatters/DataVisualization.cpp
+++ b/lldb/source/DataFormatters/DataVisualization.cpp
@@ -196,6 +196,18 @@ DataVisualization::Categories::Disable (const lldb::TypeCategoryImplSP& category
}
void
+DataVisualization::Categories::EnableStar ()
+{
+ GetFormatManager().EnableAllCategories ();
+}
+
+void
+DataVisualization::Categories::DisableStar ()
+{
+ GetFormatManager().DisableAllCategories();
+}
+
+void
DataVisualization::Categories::LoopThrough (FormatManager::CategoryCallback callback, void* callback_baton)
{
GetFormatManager().LoopThroughCategories(callback, callback_baton);
diff --git a/lldb/source/DataFormatters/TypeCategory.cpp b/lldb/source/DataFormatters/TypeCategory.cpp
index d3291aa5545..3df6884fe67 100644
--- a/lldb/source/DataFormatters/TypeCategory.cpp
+++ b/lldb/source/DataFormatters/TypeCategory.cpp
@@ -564,8 +564,8 @@ void
TypeCategoryImpl::Enable (bool value, uint32_t position)
{
Mutex::Locker locker(m_mutex);
- m_enabled = value;
- m_enabled_position = position;
+ if ( (m_enabled = value) )
+ m_enabled_position = position;
if (m_change_listener)
m_change_listener->Changed();
}
diff --git a/lldb/source/DataFormatters/TypeCategoryMap.cpp b/lldb/source/DataFormatters/TypeCategoryMap.cpp
index 45444327882..c5f22b06628 100644
--- a/lldb/source/DataFormatters/TypeCategoryMap.cpp
+++ b/lldb/source/DataFormatters/TypeCategoryMap.cpp
@@ -120,6 +120,31 @@ TypeCategoryMap::Disable (ValueSP category)
}
void
+TypeCategoryMap::EnableAllCategories ()
+{
+ Mutex::Locker locker(m_map_mutex);
+ std::vector<ValueSP> sorted_categories(m_map.size(), ValueSP());
+ MapType::iterator iter = m_map.begin(), end = m_map.end();
+ for (; iter != end; ++iter)
+ sorted_categories.at(iter->second->GetLastEnabledPosition()) = iter->second;
+ decltype(sorted_categories)::iterator viter = sorted_categories.begin(), vend = sorted_categories.end();
+ for (; viter != vend; viter++)
+ Enable(*viter, Last);
+}
+
+void
+TypeCategoryMap::DisableAllCategories ()
+{
+ Mutex::Locker locker(m_map_mutex);
+ Position p = First;
+ for (; false == m_active_categories.empty(); p++)
+ {
+ m_active_categories.front()->SetEnabledPosition(p);
+ Disable(m_active_categories.front());
+ }
+}
+
+void
TypeCategoryMap::Clear ()
{
Mutex::Locker locker(m_map_mutex);
OpenPOWER on IntegriCloud