[Lldb-commits] [PATCH] D114461: Draft PR for the bitset capping size limitation avoidance

Danil Stefaniuc via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Nov 23 11:02:02 PST 2021


danilashtefan created this revision.
danilashtefan requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D114461

Files:
  lldb/source/Plugins/Language/CPlusPlus/GenericBitset.cpp
  lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/bitset/TestDataFormatterGenericBitset.py
  lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/bitset/main.cpp


Index: lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/bitset/main.cpp
===================================================================
--- lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/bitset/main.cpp
+++ lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/bitset/main.cpp
@@ -20,9 +20,12 @@
   std::bitset<0> empty;
   std::bitset<13> small;
   fill(small);
-  std::bitset<70> large;
+  std::bitset<70> medium;
+  fill(medium);
+  std::bitset<1000> large;
   fill(large);
   by_ref_and_ptr(small, &small); // break here
+  by_ref_and_ptr(medium, &medium);
   by_ref_and_ptr(large, &large);
   return 0;
 }
Index: lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/bitset/TestDataFormatterGenericBitset.py
===================================================================
--- lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/bitset/TestDataFormatterGenericBitset.py
+++ lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/bitset/TestDataFormatterGenericBitset.py
@@ -21,7 +21,7 @@
 
     def setUp(self):
         TestBase.setUp(self)
-        primes = [1]*300
+        primes = [1]*1000
         primes[0] = primes[1] = 0
         for i in range(2, len(primes)):
             for j in range(2*i, len(primes), i):
@@ -58,7 +58,8 @@
 
         self.check("empty", 0, VALUE)
         self.check("small", 13, VALUE)
-        self.check("large", 70, VALUE)
+        self.check("medium", 70, VALUE)
+        self.check("large", 1000, VALUE)
 
     @add_test_categories(["libstdcxx"])
     def test_value_libstdcpp(self):
@@ -84,6 +85,11 @@
         self.check("ref", 70, REFERENCE)
         self.check("ptr", 70, POINTER)
 
+        lldbutil.continue_to_breakpoint(process, bkpt)
+
+        self.check("ref", 1000, REFERENCE)
+        self.check("ptr", 1000, POINTER)
+
     @add_test_categories(["libstdcxx"])
     def test_ptr_and_ref_libstdcpp(self):
         self.do_test_ptr_and_ref(USE_LIBSTDCPP)
Index: lldb/source/Plugins/Language/CPlusPlus/GenericBitset.cpp
===================================================================
--- lldb/source/Plugins/Language/CPlusPlus/GenericBitset.cpp
+++ lldb/source/Plugins/Language/CPlusPlus/GenericBitset.cpp
@@ -86,7 +86,7 @@
   size_t size = 0;
 
   if (auto arg = m_backend.GetCompilerType().GetIntegralTemplateArgument(0))
-    size = arg->value.getLimitedValue(capping_size);
+    size = arg->value.getLimitedValue();
 
   m_elements.assign(size, ValueObjectSP());
   m_first = m_backend.GetChildMemberWithName(GetDataContainerMemberName(), true)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D114461.389264.patch
Type: text/x-patch
Size: 2635 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20211123/f043c299/attachment-0001.bin>


More information about the lldb-commits mailing list