[Lldb-commits] [lldb] [LLDB][Data Formatters] Calculate average and total time for summary providers within lldb (PR #102708)

Jacob Lalonde via lldb-commits lldb-commits at lists.llvm.org
Wed Aug 14 10:29:33 PDT 2024


================
@@ -615,7 +615,15 @@ bool ValueObject::GetSummaryAsCString(TypeSummaryImpl *summary_ptr,
       m_synthetic_value->UpdateValueIfNeeded(); // the summary might depend on
                                                 // the synthetic children being
                                                 // up-to-date (e.g. ${svar%#})
-    summary_ptr->FormatObject(this, destination, actual_options);
+
+    TargetSP target = GetExecutionContextRef().GetTargetSP();
+    if (target) {
+      /// Construct RAII types to time and collect data on summary creation.
+      SummaryStatistics::SummaryInvocation summary_inv =
+          target->GetSummaryStatisticsForProvider(*summary_ptr);
----------------
Jlalond wrote:

This actually does (humorously in my opinion) work

I didn't realize the intent was for the RAII object to update the cache, I actually agree that is better and frees us from needing std::map for any reference invalidation. I will modify.

https://github.com/llvm/llvm-project/pull/102708


More information about the lldb-commits mailing list