From 0e33a0cd58ac7e7764943b5b478ea6812d890476 Mon Sep 17 00:00:00 2001 From: Pavel Labath Date: Tue, 12 Jun 2018 16:50:01 +0000 Subject: DebugNamesDWARFIndex: Implement DWARFDeclContext variant of GetTypes method This method is used to find complete definitions of a type when one parses a compile unit with only forward declaration available. Since it is only accessed from DWARFASTParserClang, it was not possible/easy to trigger this codepath from lldb-test. Therefore, I adapt add a debug-names variant to an existing dotest test to cover this scenario. llvm-svn: 334516 --- .../test/lang/c/forward/TestForwardDeclaration.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'lldb/packages/Python/lldbsuite') diff --git a/lldb/packages/Python/lldbsuite/test/lang/c/forward/TestForwardDeclaration.py b/lldb/packages/Python/lldbsuite/test/lang/c/forward/TestForwardDeclaration.py index c118ca95a0e..2537beb87df 100644 --- a/lldb/packages/Python/lldbsuite/test/lang/c/forward/TestForwardDeclaration.py +++ b/lldb/packages/Python/lldbsuite/test/lang/c/forward/TestForwardDeclaration.py @@ -7,6 +7,7 @@ import os import time import lldb from lldbsuite.test.lldbtest import * +from lldbsuite.test.decorators import * import lldbsuite.test.lldbutil as lldbutil @@ -14,9 +15,9 @@ class ForwardDeclarationTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) - def test_and_run_command(self): + def do_test(self, dictionary=None): """Display *bar_ptr when stopped on a function with forward declaration of struct bar.""" - self.build() + self.build(dictionary=dictionary) exe = self.getBuildArtifact("a.out") self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET) @@ -53,3 +54,15 @@ class ForwardDeclarationTestCase(TestBase): '(bar)', '(int) a = 1', '(int) b = 2']) + + def test(self): + self.do_test() + + @no_debug_info_test + @skipIfDarwin + @skipIf(compiler=no_match("clang")) + @skipIf(compiler_version=["<", "7.0"]) + def test_debug_names(self): + """Test that we are able to find complete types when using DWARF v5 + accelerator tables""" + self.do_test(dict(CFLAGS_EXTRAS="-mllvm -accel-tables=Dwarf")) -- cgit v1.2.3