[Lldb-commits] [PATCH] D135827: [lldb] Print newline between found types

Arthur Eubanks via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Oct 17 14:24:41 PDT 2022


This revision was automatically updated to reflect the committed changes.
Closed by commit rG569be95a4089: [lldb] Print newline between found types (authored by aeubanks).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D135827

Files:
  lldb/source/Commands/CommandObjectTarget.cpp
  lldb/test/API/lang/cpp/type_lookup_duplicate/Makefile
  lldb/test/API/lang/cpp/type_lookup_duplicate/TestCppTypeLookupDuplicate.py
  lldb/test/API/lang/cpp/type_lookup_duplicate/main.cpp


Index: lldb/test/API/lang/cpp/type_lookup_duplicate/main.cpp
===================================================================
--- /dev/null
+++ lldb/test/API/lang/cpp/type_lookup_duplicate/main.cpp
@@ -0,0 +1,13 @@
+namespace a {
+struct Foo {};
+} // namespace a
+
+namespace b {
+struct Foo {};
+} // namespace b
+
+int main() {
+  a::Foo a;
+  b::Foo b;
+  return 0; // Set breakpoint here
+}
Index: lldb/test/API/lang/cpp/type_lookup_duplicate/TestCppTypeLookupDuplicate.py
===================================================================
--- /dev/null
+++ lldb/test/API/lang/cpp/type_lookup_duplicate/TestCppTypeLookupDuplicate.py
@@ -0,0 +1,16 @@
+"""
+Test that we properly print multiple types.
+"""
+
+import lldb
+import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import decorators
+
+class TestTypeLookupDuplicate(TestBase):
+
+    def test_namespace_only(self):
+        self.build()
+        lldbutil.run_to_source_breakpoint(self, "// Set breakpoint here", lldb.SBFileSpec("main.cpp"))
+
+        self.expect("image lookup -A -t Foo", DATA_TYPES_DISPLAYED_CORRECTLY, substrs=["2 matches found", "\nid =", "\nid ="])
Index: lldb/test/API/lang/cpp/type_lookup_duplicate/Makefile
===================================================================
--- /dev/null
+++ lldb/test/API/lang/cpp/type_lookup_duplicate/Makefile
@@ -0,0 +1,2 @@
+CXX_SOURCES := main.cpp
+include Makefile.rules
Index: lldb/source/Commands/CommandObjectTarget.cpp
===================================================================
--- lldb/source/Commands/CommandObjectTarget.cpp
+++ lldb/source/Commands/CommandObjectTarget.cpp
@@ -1663,8 +1663,8 @@
         typedef_type_sp = typedefed_type_sp;
         typedefed_type_sp = typedef_type_sp->GetTypedefType();
       }
+      strm.EOL();
     }
-    strm.EOL();
   }
   return type_list.GetSize();
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D135827.468322.patch
Type: text/x-patch
Size: 1896 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20221017/0bcac066/attachment.bin>


More information about the lldb-commits mailing list