llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT--> @llvm/pr-subscribers-lldb Author: Ebuka Ezike (da-viper) <details> <summary>Changes</summary> test was failing because in some version of `libc++` there is an extra struct on the stored pair in map. And it did not use the synthetic child. https://github.com/llvm/llvm-project/blob/20dd053160f7d933037aacb69067ef4d77996ba1/lldb/source/Plugins/Language/CPlusPlus/LibCxxUnorderedMap.cpp#L370-L384 https://github.com/llvm/llvm-project/blob/c659a3be3bab9beb3b77343b2f50585e976b74a5/libcxx/include/__cxx03/unordered_map#L749-L757 --- Full diff: https://github.com/llvm/llvm-project/pull/156033.diff 1 Files Affected: - (modified) lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/unordered_map-iterator/TestDataFormatterStdUnorderedMap.py (+12-1) ``````````diff diff --git a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/unordered_map-iterator/TestDataFormatterStdUnorderedMap.py b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/unordered_map-iterator/TestDataFormatterStdUnorderedMap.py index d2382373f4810..95b0395ebc486 100644 --- a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/unordered_map-iterator/TestDataFormatterStdUnorderedMap.py +++ b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/unordered_map-iterator/TestDataFormatterStdUnorderedMap.py @@ -16,6 +16,12 @@ def check_ptr_or_ref(self, var_name: str): pair = var.GetChildAtIndex(0) self.assertTrue(pair) + # std::unordered_map previously stores the actual key/value pair + # in __hash_value_type::__cc_ (or previously __cc). + if pair.GetNumChildren() == 1: + pair = pair.GetChildAtIndex(0) + self.assertTrue(pair) + self.assertEqual(pair.GetChildAtIndex(0).summary, '"Hello"') self.assertEqual(pair.GetChildAtIndex(1).summary, '"World"') @@ -29,6 +35,12 @@ def check_ptr_ptr(self, var_name: str): pair = ptr.GetChildAtIndex(0) self.assertTrue(pair) + # std::unordered_map previously stores the actual key/value pair + # in __hash_value_type::__cc_ (or previously __cc). + if pair.GetNumChildren() == 1: + pair = pair.GetChildAtIndex(0) + self.assertTrue(pair) + self.assertEqual(pair.GetChildAtIndex(0).summary, '"Hello"') self.assertEqual(pair.GetChildAtIndex(1).summary, '"World"') @@ -113,7 +125,6 @@ def do_test_ptr(self): Test that pointers to std::unordered_map are formatted correctly. """ - self.build() (self.target, process, thread, bkpt) = lldbutil.run_to_source_breakpoint( self, "Stop here", lldb.SBFileSpec("main.cpp", False) ) `````````` </details> https://github.com/llvm/llvm-project/pull/156033 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits