diff options
author | Enrico Granata <egranata@apple.com> | 2013-10-08 20:59:02 +0000 |
---|---|---|
committer | Enrico Granata <egranata@apple.com> | 2013-10-08 20:59:02 +0000 |
commit | 4cc21772f382398b459a39e14f7f514441f6474e (patch) | |
tree | e74154d5c049cfe50657e2f20d6a6baf38236a2c /lldb/source/DataFormatters/FormatManager.cpp | |
parent | 0babda4b9c0cf7eea3b6068cf035d8a630f94ec7 (diff) | |
download | bcm5719-llvm-4cc21772f382398b459a39e14f7f514441f6474e.tar.gz bcm5719-llvm-4cc21772f382398b459a39e14f7f514441f6474e.zip |
<rdar://problem/12632394>
Add a format for FourCharCode
This is now safe to do thanks to the "formats in categories" feature
llvm-svn: 192233
Diffstat (limited to 'lldb/source/DataFormatters/FormatManager.cpp')
-rw-r--r-- | lldb/source/DataFormatters/FormatManager.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/lldb/source/DataFormatters/FormatManager.cpp b/lldb/source/DataFormatters/FormatManager.cpp index b67cfb26c0a..e8bc54f5aae 100644 --- a/lldb/source/DataFormatters/FormatManager.cpp +++ b/lldb/source/DataFormatters/FormatManager.cpp @@ -563,6 +563,22 @@ FormatManager::FormatManager() : } static void +AddFormat (TypeCategoryImpl::SharedPointer category_sp, + lldb::Format format, + ConstString type_name, + TypeFormatImpl::Flags flags, + bool regex = false) +{ + lldb::TypeFormatImplSP format_sp(new TypeFormatImpl(format, flags)); + + if (regex) + category_sp->GetRegexValueNavigator()->Add(RegularExpressionSP(new RegularExpression(type_name.AsCString())),format_sp); + else + category_sp->GetValueNavigator()->Add(type_name, format_sp); +} + + +static void AddStringSummary(TypeCategoryImpl::SharedPointer category_sp, const char* string, ConstString type_name, @@ -854,6 +870,11 @@ FormatManager::LoadSystemFormatters() AddCXXSummary(sys_category_sp, lldb_private::formatters::Char16SummaryProvider, "unichar summary provider", ConstString("unichar"), widechar_flags); + TypeFormatImpl::Flags fourchar_flags; + fourchar_flags.SetCascades(true).SetSkipPointers(true).SetSkipReferences(true); + + AddFormat(sys_category_sp, lldb::eFormatOSType, ConstString("FourCharCode"), fourchar_flags); + #endif } |