[Lldb-commits] [lldb] 877433a - Fix a48501150b9ef64fd61d24f8cef2645237facc44

Walter Erquinigo via lldb-commits lldb-commits at lists.llvm.org
Tue Nov 23 14:24:13 PST 2021


Author: Walter Erquinigo
Date: 2021-11-23T14:23:38-08:00
New Revision: 877433ad453cd1bd77497ec47828074b6e010edb

URL: https://github.com/llvm/llvm-project/commit/877433ad453cd1bd77497ec47828074b6e010edb
DIFF: https://github.com/llvm/llvm-project/commit/877433ad453cd1bd77497ec47828074b6e010edb.diff

LOG: Fix a48501150b9ef64fd61d24f8cef2645237facc44

Issue in https://lab.llvm.org/buildbot/#/builders/96/builds/14682.

Making the test deterministic.

Added: 
    

Modified: 
    lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/multimap/TestDataFormatterGenericMultiMap.py
    lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/multimap/main.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/multimap/TestDataFormatterGenericMultiMap.py b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/multimap/TestDataFormatterGenericMultiMap.py
index 84be87ae478e2..62cd06b421fe4 100644
--- a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/multimap/TestDataFormatterGenericMultiMap.py
+++ b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/multimap/TestDataFormatterGenericMultiMap.py
@@ -71,11 +71,8 @@ def cleanup():
 
         multimap = self.namespace + "::multimap"
 
-        self.expect('frame variable ii',
-                    substrs=[multimap, 'size=0',
-                             '{}'])
-
-        self.expect('frame variable si',
+        # We expect that in some malformed cases the map shows size 0
+        self.expect('frame variable corrupt_map',
                     substrs=[multimap, 'size=0',
                              '{}'])
 

diff  --git a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/multimap/main.cpp b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/multimap/main.cpp
index a30daa7a5bfe1..5daa6610a7afc 100644
--- a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/multimap/main.cpp
+++ b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/multimap/main.cpp
@@ -18,9 +18,12 @@ int thefoo_rw(int arg = 1)
 	return g_the_foo;
 }
 
-int main()  // Set break point at this line.
+int main()
 {
-    intint_map ii;
+    char buffer[sizeof(intint_map)] = {0};
+    intint_map &corrupt_map = *(intint_map *)buffer;
+
+    intint_map ii; // Set break point at this line.
 
     ii.emplace(0,0); // Set break point at this line.
     ii.emplace(1,1);


        


More information about the lldb-commits mailing list