This revision was automatically updated to reflect the committed changes. Closed by commit rG070a1d562b30: [lldb] Remove nothreadallow from SWIG's __str__ wrappers to work around a… (authored by teemperor). Herald added a project: LLDB. Herald added a subscriber: lldb-commits.
Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D88302/new/ https://reviews.llvm.org/D88302 Files: lldb/bindings/macros.swig lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/deque/Makefile lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/deque/TestDataFormatterLibcxxDeque.py lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/deque/main.cpp Index: lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/deque/main.cpp =================================================================== --- /dev/null +++ lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/deque/main.cpp @@ -0,0 +1,8 @@ +#include <deque> + +int main() { + std::deque<int> empty; + std::deque<int> deque_1 = {1}; + std::deque<int> deque_3 = {3, 1, 2}; + return empty.size() + deque_1.front() + deque_3.front(); // break here +} Index: lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/deque/TestDataFormatterLibcxxDeque.py =================================================================== --- /dev/null +++ lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/deque/TestDataFormatterLibcxxDeque.py @@ -0,0 +1,25 @@ +import lldb +from lldbsuite.test.decorators import * +from lldbsuite.test.lldbtest import * +from lldbsuite.test import lldbutil + + +class LibcxxDequeDataFormatterTestCase(TestBase): + + mydir = TestBase.compute_mydir(__file__) + + @add_test_categories(["libc++"]) + def test(self): + self.build() + lldbutil.run_to_source_breakpoint(self, "break here", + lldb.SBFileSpec("main.cpp")) + + self.expect_expr("empty", result_children=[]) + self.expect_expr("deque_1", result_children=[ + ValueCheck(name="[0]", value="1"), + ]) + self.expect_expr("deque_3", result_children=[ + ValueCheck(name="[0]", value="3"), + ValueCheck(name="[1]", value="1"), + ValueCheck(name="[2]", value="2") + ]) Index: lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/deque/Makefile =================================================================== --- /dev/null +++ lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/deque/Makefile @@ -0,0 +1,5 @@ +CXX_SOURCES := main.cpp + +USE_LIBCPP := 1 + +include Makefile.rules Index: lldb/bindings/macros.swig =================================================================== --- lldb/bindings/macros.swig +++ lldb/bindings/macros.swig @@ -1,6 +1,5 @@ %define STRING_EXTENSION_LEVEL(Class, Level) %extend { - %nothreadallow; std::string lldb:: ## Class ## ::__str__(){ lldb::SBStream stream; $self->GetDescription (stream, Level); @@ -11,13 +10,11 @@ } return std::string(desc, desc_len); } - %clearnothreadallow; } %enddef %define STRING_EXTENSION(Class) %extend { - %nothreadallow; std::string lldb:: ## Class ## ::__str__(){ lldb::SBStream stream; $self->GetDescription (stream); @@ -28,6 +25,5 @@ } return std::string(desc, desc_len); } - %clearnothreadallow; } %enddef
Index: lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/deque/main.cpp =================================================================== --- /dev/null +++ lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/deque/main.cpp @@ -0,0 +1,8 @@ +#include <deque> + +int main() { + std::deque<int> empty; + std::deque<int> deque_1 = {1}; + std::deque<int> deque_3 = {3, 1, 2}; + return empty.size() + deque_1.front() + deque_3.front(); // break here +} Index: lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/deque/TestDataFormatterLibcxxDeque.py =================================================================== --- /dev/null +++ lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/deque/TestDataFormatterLibcxxDeque.py @@ -0,0 +1,25 @@ +import lldb +from lldbsuite.test.decorators import * +from lldbsuite.test.lldbtest import * +from lldbsuite.test import lldbutil + + +class LibcxxDequeDataFormatterTestCase(TestBase): + + mydir = TestBase.compute_mydir(__file__) + + @add_test_categories(["libc++"]) + def test(self): + self.build() + lldbutil.run_to_source_breakpoint(self, "break here", + lldb.SBFileSpec("main.cpp")) + + self.expect_expr("empty", result_children=[]) + self.expect_expr("deque_1", result_children=[ + ValueCheck(name="[0]", value="1"), + ]) + self.expect_expr("deque_3", result_children=[ + ValueCheck(name="[0]", value="3"), + ValueCheck(name="[1]", value="1"), + ValueCheck(name="[2]", value="2") + ]) Index: lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/deque/Makefile =================================================================== --- /dev/null +++ lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/deque/Makefile @@ -0,0 +1,5 @@ +CXX_SOURCES := main.cpp + +USE_LIBCPP := 1 + +include Makefile.rules Index: lldb/bindings/macros.swig =================================================================== --- lldb/bindings/macros.swig +++ lldb/bindings/macros.swig @@ -1,6 +1,5 @@ %define STRING_EXTENSION_LEVEL(Class, Level) %extend { - %nothreadallow; std::string lldb:: ## Class ## ::__str__(){ lldb::SBStream stream; $self->GetDescription (stream, Level); @@ -11,13 +10,11 @@ } return std::string(desc, desc_len); } - %clearnothreadallow; } %enddef %define STRING_EXTENSION(Class) %extend { - %nothreadallow; std::string lldb:: ## Class ## ::__str__(){ lldb::SBStream stream; $self->GetDescription (stream); @@ -28,6 +25,5 @@ } return std::string(desc, desc_len); } - %clearnothreadallow; } %enddef
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits