summaryrefslogtreecommitdiffstats
path: root/lldb/source/DataFormatters/CXXFormatterFunctions.cpp
diff options
context:
space:
mode:
authorEnrico Granata <egranata@apple.com>2013-02-08 01:55:46 +0000
committerEnrico Granata <egranata@apple.com>2013-02-08 01:55:46 +0000
commit5bfce363e12ef17c3dc87e19572db05a8c9fb653 (patch)
tree8f0362be707773463bf557e5cbb36d8e8a56c725 /lldb/source/DataFormatters/CXXFormatterFunctions.cpp
parent1bd53c367580c8c039c675bf9ac3a1406a8224e1 (diff)
downloadbcm5719-llvm-5bfce363e12ef17c3dc87e19572db05a8c9fb653.tar.gz
bcm5719-llvm-5bfce363e12ef17c3dc87e19572db05a8c9fb653.zip
<rdar://problem/12898191>
Added a summary for NSMutableAttributedString In the process, converted formatters for other NSString-based classes over to C++ code llvm-svn: 174693
Diffstat (limited to 'lldb/source/DataFormatters/CXXFormatterFunctions.cpp')
-rw-r--r--lldb/source/DataFormatters/CXXFormatterFunctions.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/lldb/source/DataFormatters/CXXFormatterFunctions.cpp b/lldb/source/DataFormatters/CXXFormatterFunctions.cpp
index 68605862ddd..dd49a9dd1cc 100644
--- a/lldb/source/DataFormatters/CXXFormatterFunctions.cpp
+++ b/lldb/source/DataFormatters/CXXFormatterFunctions.cpp
@@ -1013,6 +1013,37 @@ lldb_private::formatters::NSStringSummaryProvider (ValueObject& valobj, Stream&
}
bool
+lldb_private::formatters::NSAttributedStringSummaryProvider (ValueObject& valobj, Stream& stream)
+{
+ TargetSP target_sp(valobj.GetTargetSP());
+ if (!target_sp)
+ return false;
+ uint32_t addr_size = target_sp->GetArchitecture().GetAddressByteSize();
+ uint64_t pointee = valobj.GetValueAsUnsigned(0);
+ if (!pointee)
+ return false;
+ pointee += addr_size;
+ ClangASTType type(valobj.GetClangAST(),valobj.GetClangType());
+ ExecutionContext exe_ctx(target_sp,false);
+ ValueObjectSP child_ptr_sp(valobj.CreateValueObjectFromAddress("string_ptr", pointee, exe_ctx, type));
+ if (!child_ptr_sp)
+ return false;
+ DataExtractor data;
+ child_ptr_sp->GetData(data);
+ ValueObjectSP child_sp(child_ptr_sp->CreateValueObjectFromData("string_data", data, exe_ctx, type));
+ child_sp->GetValueAsUnsigned(0);
+ if (child_sp)
+ return NSStringSummaryProvider(*child_sp, stream);
+ return false;
+}
+
+bool
+lldb_private::formatters::NSMutableAttributedStringSummaryProvider (ValueObject& valobj, Stream& stream)
+{
+ return NSAttributedStringSummaryProvider(valobj, stream);
+}
+
+bool
lldb_private::formatters::RuntimeSpecificDescriptionSummaryProvider (ValueObject& valobj, Stream& stream)
{
stream.Printf("%s",valobj.GetObjectDescription());
OpenPOWER on IntegriCloud