diff --git a/lldb/source/Commands/CommandObjectTarget.cpp b/lldb/source/Commands/CommandObjectTarget.cpp --- a/lldb/source/Commands/CommandObjectTarget.cpp +++ b/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(); } diff --git a/lldb/test/API/lang/cpp/type_lookup_duplicate/Makefile b/lldb/test/API/lang/cpp/type_lookup_duplicate/Makefile new file mode 100644 --- /dev/null +++ b/lldb/test/API/lang/cpp/type_lookup_duplicate/Makefile @@ -0,0 +1,2 @@ +CXX_SOURCES := main.cpp +include Makefile.rules diff --git a/lldb/test/API/lang/cpp/type_lookup_duplicate/TestCppTypeLookupDuplicate.py b/lldb/test/API/lang/cpp/type_lookup_duplicate/TestCppTypeLookupDuplicate.py new file mode 100644 --- /dev/null +++ b/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 ="]) diff --git a/lldb/test/API/lang/cpp/type_lookup_duplicate/main.cpp b/lldb/test/API/lang/cpp/type_lookup_duplicate/main.cpp new file mode 100644 --- /dev/null +++ b/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 +}