[Lldb-commits] [PATCH] D13657: [lldb] char summary provider

Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Oct 22 17:05:09 PDT 2015


This revision was automatically updated to reflect the committed changes.
Closed by commit rL251080: Summary provider for char. (authored by dperchik).

Changed prior to commit:
  http://reviews.llvm.org/D13657?vs=37487&id=38187#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D13657

Files:
  lldb/trunk/include/lldb/API/SBTypeSummary.h
  lldb/trunk/source/API/SBTypeSummary.cpp

Index: lldb/trunk/source/API/SBTypeSummary.cpp
===================================================================
--- lldb/trunk/source/API/SBTypeSummary.cpp
+++ lldb/trunk/source/API/SBTypeSummary.cpp
@@ -146,6 +146,25 @@
     return SBTypeSummary(TypeSummaryImplSP(new ScriptSummaryFormat(options, "", data)));
 }
 
+SBTypeSummary
+SBTypeSummary::CreateWithCallback (FormatCallback cb, uint32_t options)
+{
+    return SBTypeSummary(
+               TypeSummaryImplSP(
+                   cb ? new CXXFunctionSummaryFormat(options,
+                       [cb] (ValueObject& valobj, Stream& stm, const TypeSummaryOptions& opt) -> bool {
+                            BStream stream;
+                            if (!cb(SBValue(valobj.GetSP()), SBTypeSummaryOptions(&opt), stream))
+                                return false;
+                            stm.Write(stream.GetData(), stream.GetSize());
+                            return true;
+                       },
+                       "SBTypeSummary formatter callback"
+                   ) : nullptr
+                )
+            );
+}
+
 SBTypeSummary::SBTypeSummary (const lldb::SBTypeSummary &rhs) :
 m_opaque_sp(rhs.m_opaque_sp)
 {
Index: lldb/trunk/include/lldb/API/SBTypeSummary.h
===================================================================
--- lldb/trunk/include/lldb/API/SBTypeSummary.h
+++ lldb/trunk/include/lldb/API/SBTypeSummary.h
@@ -69,6 +69,9 @@
     public:
         
         SBTypeSummary();
+
+        // Native function summary formatter callback
+        typedef bool (*FormatCallback) (SBValue, SBTypeSummaryOptions, SBStream&);
         
         static SBTypeSummary
         CreateWithSummaryString (const char* data,
@@ -81,6 +84,10 @@
         static SBTypeSummary
         CreateWithScriptCode (const char* data,
                               uint32_t options = 0); // see lldb::eTypeOption values
+
+        static SBTypeSummary
+        CreateWithCallback (FormatCallback cb, 
+                            uint32_t options = 0);
         
         SBTypeSummary (const lldb::SBTypeSummary &rhs);
         


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D13657.38187.patch
Type: text/x-patch
Size: 2114 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20151023/a964506a/attachment.bin>


More information about the lldb-commits mailing list