Author: Danil Stefaniuc Date: 2021-11-23T14:03:59-08:00 New Revision: 193bf2e820520dd4a2d5ed0e7d50ee45e8127071
URL: https://github.com/llvm/llvm-project/commit/193bf2e820520dd4a2d5ed0e7d50ee45e8127071 DIFF: https://github.com/llvm/llvm-project/commit/193bf2e820520dd4a2d5ed0e7d50ee45e8127071.diff LOG: [formatters] Capping size limitation avoidance for the libcxx and libcpp bitset data formatters. This diff is avoiding the size limitation introduced by the capping size for the libcxx and libcpp bitset data formatters. Reviewed By: wallace Differential Revision: https://reviews.llvm.org/D114461 Added: Modified: 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 Removed: ################################################################################ diff --git a/lldb/source/Plugins/Language/CPlusPlus/GenericBitset.cpp b/lldb/source/Plugins/Language/CPlusPlus/GenericBitset.cpp index fc8255983436..c8063915b178 100644 --- a/lldb/source/Plugins/Language/CPlusPlus/GenericBitset.cpp +++ b/lldb/source/Plugins/Language/CPlusPlus/GenericBitset.cpp @@ -81,12 +81,11 @@ bool GenericBitsetFrontEnd::Update() { 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) diff --git a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/bitset/TestDataFormatterGenericBitset.py b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/bitset/TestDataFormatterGenericBitset.py index 3d7ff340caab..94efbc5c7cf6 100644 --- a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/bitset/TestDataFormatterGenericBitset.py +++ b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/bitset/TestDataFormatterGenericBitset.py @@ -21,7 +21,7 @@ class GenericBitsetDataFormatterTestCase(TestBase): 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 @@ def do_test_value(self, stdlib_type): 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 @@ def do_test_ptr_and_ref(self, stdlib_type): 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) diff --git a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/bitset/main.cpp b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/bitset/main.cpp index c7be1c5c7133..52aea76a25dc 100644 --- a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/bitset/main.cpp +++ b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/bitset/main.cpp @@ -20,9 +20,12 @@ int main() { 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; } _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits