Author: enrico
Date: Wed May 25 15:38:33 2016
New Revision: 270752

URL: http://llvm.org/viewvc/llvm-project?rev=270752&view=rev
Log:
Fix an issue where LLDB would crash if one tried to 'frame variable' an 
unordered_map more than once in a stop due to the synthetic provider not 
properly caching the ValueObjects it was returning for the child elements

Fixes rdar://26470909


Modified:
    
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/TestDataFormatterUnordered.py
    lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxUnorderedMap.cpp

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/TestDataFormatterUnordered.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/TestDataFormatterUnordered.py?rev=270752&r1=270751&r2=270752&view=diff
==============================================================================
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/TestDataFormatterUnordered.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/TestDataFormatterUnordered.py
 Wed May 25 15:38:33 2016
@@ -73,4 +73,5 @@ class LibcxxUnorderedDataFormatterTestCa
 
     def look_for_content_and_continue(self, var_name, patterns):
         self.expect( ("frame variable %s" % var_name), patterns=patterns)
+        self.expect( ("frame variable %s" % var_name), patterns=patterns)
         self.runCmd("continue")

Modified: lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxUnorderedMap.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxUnorderedMap.cpp?rev=270752&r1=270751&r2=270752&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxUnorderedMap.cpp 
(original)
+++ lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxUnorderedMap.cpp Wed May 
25 15:38:33 2016
@@ -125,10 +125,13 @@ lldb_private::formatters::LibcxxStdUnord
         return lldb::ValueObjectSP();
     const bool thread_and_frame_only_if_stopped = true;
     ExecutionContext exe_ctx = 
val_hash.first->GetExecutionContextRef().Lock(thread_and_frame_only_if_stopped);
-    return val_hash.first->CreateValueObjectFromData(stream.GetData(),
-                                                     data,
-                                                     exe_ctx,
-                                                     
val_hash.first->GetCompilerType());
+    ValueObjectSP 
child_sp(val_hash.first->CreateValueObjectFromData(stream.GetData(),
+                                                                     data,
+                                                                     exe_ctx,
+                                                                     
val_hash.first->GetCompilerType()));
+    if (child_sp)
+        m_children.emplace(idx, child_sp);
+    return child_sp;
 }
 
 bool


_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to