@@ -716,48 +716,6 @@ lldb_private::formatters::NSDataSummaryProvider (ValueObject& valobj, Stream& st
716
716
return true ;
717
717
}
718
718
719
- static bool
720
- ReadAsciiBufferAndDumpToStream (lldb::addr_t location,
721
- lldb::ProcessSP& process_sp,
722
- Stream& dest,
723
- uint32_t size = 0 ,
724
- Error* error = NULL ,
725
- size_t *data_read = NULL ,
726
- char prefix_token = ' @' ,
727
- char quote = ' "' )
728
- {
729
- Error my_error;
730
- size_t my_data_read;
731
- if (!process_sp || location == 0 )
732
- return false ;
733
-
734
- if (!size)
735
- size = process_sp->GetTarget ().GetMaximumSizeOfStringSummary ();
736
- else
737
- size = std::min (size,process_sp->GetTarget ().GetMaximumSizeOfStringSummary ());
738
-
739
- lldb::DataBufferSP buffer_sp (new DataBufferHeap (size,0 ));
740
-
741
- my_data_read = process_sp->ReadCStringFromMemory (location, (char *)buffer_sp->GetBytes (), size, my_error);
742
-
743
- if (error)
744
- *error = my_error;
745
- if (data_read)
746
- *data_read = my_data_read;
747
-
748
- if (my_error.Fail ())
749
- return false ;
750
-
751
- dest.Printf (" %c%c" ,prefix_token,quote);
752
-
753
- if (my_data_read)
754
- dest.Printf (" %s" ,(char *)buffer_sp->GetBytes ());
755
-
756
- dest.Printf (" %c" ,quote);
757
-
758
- return true ;
759
- }
760
-
761
719
bool
762
720
lldb_private::formatters::NSTaggedString_SummaryProvider (ObjCLanguageRuntime::ClassDescriptorSP descriptor, Stream& stream)
763
721
{
@@ -956,7 +914,16 @@ lldb_private::formatters::NSStringSummaryProvider (ValueObject& valobj, Stream&
956
914
else if (is_inline && has_explicit_length && !is_unicode && !is_path_store && !is_mutable)
957
915
{
958
916
uint64_t location = 3 * ptr_size + valobj_addr;
959
- return ReadAsciiBufferAndDumpToStream (location,process_sp,stream,explicit_length);
917
+
918
+ ReadStringAndDumpToStreamOptions options (valobj);
919
+ options.SetLocation (location);
920
+ options.SetProcessSP (process_sp);
921
+ options.SetStream (&stream);
922
+ options.SetPrefixToken (' @' );
923
+ options.SetQuote (' "' );
924
+ options.SetSourceSize (explicit_length);
925
+ options.SetIgnoreMaxLength (summary_options.GetCapping () == TypeSummaryCapping::eTypeSummaryUncapped);
926
+ return ReadStringAndDumpToStream<StringElementType::ASCII> (options);
960
927
}
961
928
else if (is_unicode)
962
929
{
0 commit comments