[Lldb-commits] [lldb] 59e9160 - [lldb] UpdateFormatsIfNeeded should respect the dynamic value type (#93262)

via lldb-commits lldb-commits at lists.llvm.org
Wed Jun 5 11:08:39 PDT 2024


Author: Augusto Noronha
Date: 2024-06-05T11:08:36-07:00
New Revision: 59e9160ac8c906c5448c2094cd28cb5bc7678a3f

URL: https://github.com/llvm/llvm-project/commit/59e9160ac8c906c5448c2094cd28cb5bc7678a3f
DIFF: https://github.com/llvm/llvm-project/commit/59e9160ac8c906c5448c2094cd28cb5bc7678a3f.diff

LOG: [lldb] UpdateFormatsIfNeeded should respect the dynamic value type (#93262)

UpdateFormatsIfNeeded has hardcoded the call to GetFormat with no
dynamic values. GetFormat will try to find the synthetic children of the
ValueObject, and passing the wrong one can fail, which can be bad for
performance but should not be user visible. Fix the performace bug by
passing the dynamic value type of the ValueObject.

rdar://122506593

Added: 
    

Modified: 
    lldb/source/Core/ValueObject.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/source/Core/ValueObject.cpp b/lldb/source/Core/ValueObject.cpp
index 1443d9dfc3280..c5c434a941b34 100644
--- a/lldb/source/Core/ValueObject.cpp
+++ b/lldb/source/Core/ValueObject.cpp
@@ -216,7 +216,7 @@ bool ValueObject::UpdateFormatsIfNeeded() {
     m_last_format_mgr_revision = DataVisualization::GetCurrentRevision();
     any_change = true;
 
-    SetValueFormat(DataVisualization::GetFormat(*this, eNoDynamicValues));
+    SetValueFormat(DataVisualization::GetFormat(*this, GetDynamicValueType()));
     SetSummaryFormat(
         DataVisualization::GetSummaryFormat(*this, GetDynamicValueType()));
     SetSyntheticChildren(


        


More information about the lldb-commits mailing list