[Lldb-commits] [PATCH] D85141: [lldb] Enable std::pair in CxxModuleHandler

Raphael Isemann via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Sep 9 01:50:37 PDT 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rGb85222520f86: [lldb] Enable std::pair in CxxModuleHandler (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/D85141/new/

https://reviews.llvm.org/D85141

Files:
  lldb/source/Plugins/ExpressionParser/Clang/CxxModuleHandler.cpp
  lldb/test/API/commands/expression/import-std-module/pair/Makefile
  lldb/test/API/commands/expression/import-std-module/pair/TestPairFromStdModule.py
  lldb/test/API/commands/expression/import-std-module/pair/main.cpp


Index: lldb/test/API/commands/expression/import-std-module/pair/main.cpp
===================================================================
--- /dev/null
+++ lldb/test/API/commands/expression/import-std-module/pair/main.cpp
@@ -0,0 +1,6 @@
+#include <utility>
+
+int main(int argc, char **argv) {
+  std::pair<int, int> pair_int(1234, 5678);
+  return 0; // Set break point at this line.
+}
Index: lldb/test/API/commands/expression/import-std-module/pair/TestPairFromStdModule.py
===================================================================
--- /dev/null
+++ lldb/test/API/commands/expression/import-std-module/pair/TestPairFromStdModule.py
@@ -0,0 +1,25 @@
+"""
+Test basic std::pair functionality.
+"""
+
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+class TestCase(TestBase):
+
+    mydir = TestBase.compute_mydir(__file__)
+
+    @add_test_categories(["libc++"])
+    @skipIf(compiler=no_match("clang"))
+    def test(self):
+        self.build()
+
+        lldbutil.run_to_source_breakpoint(self,
+            "// Set break point at this line.", lldb.SBFileSpec("main.cpp"))
+
+        self.runCmd("settings set target.import-std-module true")
+
+        self.expect_expr("pair_int.first", result_type="int", result_value="1234")
+        self.expect_expr("pair_int.second", result_type="int", result_value="5678")
+        self.expect("expr pair_int", substrs=['first = 1234, second = 5678'])
\ No newline at end of file
Index: lldb/test/API/commands/expression/import-std-module/pair/Makefile
===================================================================
--- /dev/null
+++ lldb/test/API/commands/expression/import-std-module/pair/Makefile
@@ -0,0 +1,3 @@
+USE_LIBCPP := 1
+CXX_SOURCES := main.cpp
+include Makefile.rules
Index: lldb/source/Plugins/ExpressionParser/Clang/CxxModuleHandler.cpp
===================================================================
--- lldb/source/Plugins/ExpressionParser/Clang/CxxModuleHandler.cpp
+++ lldb/source/Plugins/ExpressionParser/Clang/CxxModuleHandler.cpp
@@ -34,6 +34,7 @@
       "weak_ptr",
       // utility
       "allocator",
+      "pair",
   };
   m_supported_templates.insert(supported_names.begin(), supported_names.end());
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D85141.290669.patch
Type: text/x-patch
Size: 2271 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20200909/dac39273/attachment-0001.bin>


More information about the lldb-commits mailing list