summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core
diff options
context:
space:
mode:
authorEnrico Granata <granata.enrico@gmail.com>2012-01-31 17:01:51 +0000
committerEnrico Granata <granata.enrico@gmail.com>2012-01-31 17:01:51 +0000
commitbac45f610df116976a01ca7d84e4090e0537811b (patch)
tree9fd27370f9488c59135a5bc44f4c5d47e061d9fe /lldb/source/Core
parent27a59958bdfc24d58f32d45d6e1df75a08ee87ce (diff)
downloadbcm5719-llvm-bac45f610df116976a01ca7d84e4090e0537811b.tar.gz
bcm5719-llvm-bac45f610df116976a01ca7d84e4090e0537811b.zip
This commit provides a new default summary for Objective-C boolean variables, which shows YES or NO instead of the character value. A new category named objc is added to contain this summary provider. Any future Objective-C related formatters would probably fit here
llvm-svn: 149388
Diffstat (limited to 'lldb/source/Core')
-rw-r--r--lldb/source/Core/FormatManager.cpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/lldb/source/Core/FormatManager.cpp b/lldb/source/Core/FormatManager.cpp
index b1cc6e8a1f2..90762965d10 100644
--- a/lldb/source/Core/FormatManager.cpp
+++ b/lldb/source/Core/FormatManager.cpp
@@ -560,7 +560,8 @@ FormatManager::FormatManager() :
m_categories_map(this),
m_default_category_name(ConstString("default")),
m_system_category_name(ConstString("system")),
- m_gnu_cpp_category_name(ConstString("gnu-libstdc++"))
+ m_gnu_cpp_category_name(ConstString("gnu-libstdc++")),
+ m_objc_category_name(ConstString("objc"))
{
// add some default stuff
@@ -584,7 +585,6 @@ FormatManager::FormatManager() :
lldb::RegularExpressionSP any_size_char_arr(new RegularExpression("char \\[[0-9]+\\]"));
-
FormatCategory::SharedPointer sys_category_sp = GetCategory(m_system_category_name);
sys_category_sp->GetSummaryNavigator()->Add(ConstString("char *"), string_format);
@@ -633,9 +633,23 @@ FormatManager::FormatManager() :
false,
false,
"gnu_libstdcpp.StdListSynthProvider")));
+
+ lldb::SummaryFormatSP ObjC_BOOL_summary(new ScriptSummaryFormat(false,
+ false,
+ false,
+ true,
+ true,
+ false,
+ "objc.BOOL_SummaryProvider",
+ ""));
+ FormatCategory::SharedPointer objc_category_sp = GetCategory(m_objc_category_name);
+ objc_category_sp->GetSummaryNavigator()->Add(ConstString("BOOL"),
+ ObjC_BOOL_summary);
#endif
+
// DO NOT change the order of these calls, unless you WANT a change in the priority of these categories
EnableCategory(m_system_category_name);
+ EnableCategory(m_objc_category_name);
EnableCategory(m_gnu_cpp_category_name);
EnableCategory(m_default_category_name);
OpenPOWER on IntegriCloud