From dce4a9aa5901788722f1a063c204e93dacbc8be7 Mon Sep 17 00:00:00 2001 From: Adrian Prantl Date: Thu, 4 Jan 2018 16:42:05 +0000 Subject: Look for external types in all clang modules imported by the current symbol file. This fixes a bug in -gmodules DWARF handling when debugging without a .dSYM bundle that was particularly noticable when debugging LLVM itself. Debugging without clang modules and DWO handling should be unaffected by this patch. llvm-svn: 321802 --- .../lldbsuite/test/lang/cpp/gmodules-templates/Makefile | 6 ++++++ .../test/lang/cpp/gmodules-templates/TestGModules.py | 4 ++++ .../Python/lldbsuite/test/lang/cpp/gmodules-templates/a.h | 7 +++++++ .../Python/lldbsuite/test/lang/cpp/gmodules-templates/b.h | 6 ++++++ .../lldbsuite/test/lang/cpp/gmodules-templates/main.cpp | 9 +++++++++ .../lldbsuite/test/lang/cpp/gmodules-templates/memory.h | 8 ++++++++ .../test/lang/cpp/gmodules-templates/module.modulemap | 11 +++++++++++ 7 files changed, 51 insertions(+) create mode 100644 lldb/packages/Python/lldbsuite/test/lang/cpp/gmodules-templates/Makefile create mode 100644 lldb/packages/Python/lldbsuite/test/lang/cpp/gmodules-templates/TestGModules.py create mode 100644 lldb/packages/Python/lldbsuite/test/lang/cpp/gmodules-templates/a.h create mode 100644 lldb/packages/Python/lldbsuite/test/lang/cpp/gmodules-templates/b.h create mode 100644 lldb/packages/Python/lldbsuite/test/lang/cpp/gmodules-templates/main.cpp create mode 100644 lldb/packages/Python/lldbsuite/test/lang/cpp/gmodules-templates/memory.h create mode 100644 lldb/packages/Python/lldbsuite/test/lang/cpp/gmodules-templates/module.modulemap (limited to 'lldb/packages/Python/lldbsuite') diff --git a/lldb/packages/Python/lldbsuite/test/lang/cpp/gmodules-templates/Makefile b/lldb/packages/Python/lldbsuite/test/lang/cpp/gmodules-templates/Makefile new file mode 100644 index 00000000000..0497d78fec3 --- /dev/null +++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/gmodules-templates/Makefile @@ -0,0 +1,6 @@ +LEVEL = ../../../make + +CXX_SOURCES = main.cpp +# CFLAGS_EXTRAS += $(MODULE_DEBUG_INFO_FLAGS) + +include $(LEVEL)/Makefile.rules diff --git a/lldb/packages/Python/lldbsuite/test/lang/cpp/gmodules-templates/TestGModules.py b/lldb/packages/Python/lldbsuite/test/lang/cpp/gmodules-templates/TestGModules.py new file mode 100644 index 00000000000..fef27dbdd80 --- /dev/null +++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/gmodules-templates/TestGModules.py @@ -0,0 +1,4 @@ +import lldbsuite.test.lldbinline as lldbinline +import lldbsuite.test.decorators + +lldbinline.MakeInlineTest(__file__, globals()) diff --git a/lldb/packages/Python/lldbsuite/test/lang/cpp/gmodules-templates/a.h b/lldb/packages/Python/lldbsuite/test/lang/cpp/gmodules-templates/a.h new file mode 100644 index 00000000000..7384f230801 --- /dev/null +++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/gmodules-templates/a.h @@ -0,0 +1,7 @@ +#include "memory.h" + +class MemoryBuffer { int buffer = 42; }; + +struct SrcBuffer { + my_std::unique_ptr Buffer; +}; diff --git a/lldb/packages/Python/lldbsuite/test/lang/cpp/gmodules-templates/b.h b/lldb/packages/Python/lldbsuite/test/lang/cpp/gmodules-templates/b.h new file mode 100644 index 00000000000..b777e8e3473 --- /dev/null +++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/gmodules-templates/b.h @@ -0,0 +1,6 @@ +#include "a.h" +#include "memory.h" + +class Module { + my_std::unique_ptr MBptr; +}; diff --git a/lldb/packages/Python/lldbsuite/test/lang/cpp/gmodules-templates/main.cpp b/lldb/packages/Python/lldbsuite/test/lang/cpp/gmodules-templates/main.cpp new file mode 100644 index 00000000000..df752616570 --- /dev/null +++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/gmodules-templates/main.cpp @@ -0,0 +1,9 @@ +#include "b.h" + +int main(int argc, const char * argv[]) +{ + Module m; + // Test that the type Module which contains a field that is a + // template instantiation can be fully resolved. + return 0; //% self.assertTrue(self.frame().FindVariable('m').GetChildAtIndex(0).GetChildAtIndex(0).GetChildAtIndex(0).GetName() == 'buffer', 'find template specializations in imported modules') +} diff --git a/lldb/packages/Python/lldbsuite/test/lang/cpp/gmodules-templates/memory.h b/lldb/packages/Python/lldbsuite/test/lang/cpp/gmodules-templates/memory.h new file mode 100644 index 00000000000..1d59dc0bbf0 --- /dev/null +++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/gmodules-templates/memory.h @@ -0,0 +1,8 @@ +#ifndef MEMORY_H +#define MEMORY_H +namespace my_std { + template class unique_ptr { + T t; + }; +} +#endif diff --git a/lldb/packages/Python/lldbsuite/test/lang/cpp/gmodules-templates/module.modulemap b/lldb/packages/Python/lldbsuite/test/lang/cpp/gmodules-templates/module.modulemap new file mode 100644 index 00000000000..2f05073a0b8 --- /dev/null +++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/gmodules-templates/module.modulemap @@ -0,0 +1,11 @@ +module A { + header "a.h" +} + +module B { + header "b.h" +} + +module std { + header "memory.h" +} -- cgit v1.2.3