[Lldb-commits] [PATCH] D114461: [formatters] Capping size limitation avoidance for the libcxx and libcpp bitset data formatters.

Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Nov 23 14:04:34 PST 2021


This revision was automatically updated to reflect the committed changes.
Closed by commit rG193bf2e82052: [formatters] Capping size limitation avoidance for the libcxx and libcpp bitset… (authored by danilashtefan, committed by Walter Erquinigo <wallace at fb.com>).

Changed prior to commit:
  https://reviews.llvm.org/D114461?vs=389264&id=389316#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D114461/new/

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
@@ -81,12 +81,11 @@
   TargetSP target_sp = m_backend.GetTargetSP();
   if (!target_sp)
     return false;
-  size_t capping_size = target_sp->GetMaximumNumberOfChildrenToDisplay();
 
   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.389316.patch
Type: text/x-patch
Size: 2801 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20211123/63ee90ab/attachment.bin>


More information about the lldb-commits mailing list