[Lldb-commits] [lldb] r200984 - rdar://15648942

Enrico Granata egranata at apple.com
Fri Feb 7 11:21:09 PST 2014


Author: enrico
Date: Fri Feb  7 13:21:09 2014
New Revision: 200984

URL: http://llvm.org/viewvc/llvm-project?rev=200984&view=rev
Log:
rdar://15648942

Provide a filter for libc++ std::atomic<T>
This just hides some implementation clutter and promotes the actual content to only child status


Modified:
    lldb/trunk/source/DataFormatters/FormatManager.cpp

Modified: lldb/trunk/source/DataFormatters/FormatManager.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/FormatManager.cpp?rev=200984&r1=200983&r2=200984&view=diff
==============================================================================
--- lldb/trunk/source/DataFormatters/FormatManager.cpp (original)
+++ lldb/trunk/source/DataFormatters/FormatManager.cpp Fri Feb  7 13:21:09 2014
@@ -821,6 +821,24 @@ static void AddCXXSynthetic  (TypeCatego
 }
 #endif
 
+#ifndef LLDB_DISABLE_PYTHON
+static void AddFilter  (TypeCategoryImpl::SharedPointer category_sp,
+                        std::vector<std::string> children,
+                        const char* description,
+                        ConstString type_name,
+                        ScriptedSyntheticChildren::Flags flags,
+                        bool regex = false)
+{
+    TypeFilterImplSP filter_sp(new TypeFilterImpl(flags));
+    for (auto child : children)
+        filter_sp->AddExpressionPath(child);
+    if (regex)
+        category_sp->GetRegexTypeFiltersContainer()->Add(RegularExpressionSP(new RegularExpression(type_name.AsCString())), filter_sp);
+    else
+        category_sp->GetTypeFiltersContainer()->Add(type_name,filter_sp);
+}
+#endif
+
 void
 FormatManager::LoadLibStdcppFormatters()
 {
@@ -971,6 +989,7 @@ FormatManager::LoadLibcxxFormatters()
     
     AddCXXSynthetic(libcxx_category_sp, lldb_private::formatters::LibCxxMapIteratorSyntheticFrontEndCreator, "std::map iterator synthetic children", ConstString("^std::__1::__map_iterator<.+>$"), stl_synth_flags, true);
     
+    AddFilter(libcxx_category_sp, {"__a_"}, "libc++ std::atomic filter", ConstString("^std::__1::atomic<.*>$"), stl_synth_flags, true);
 #endif
 }
 





More information about the lldb-commits mailing list