[Lldb-commits] [lldb] r332831 - Add some apple-tables lookup tests
Pavel Labath via lldb-commits
lldb-commits at lists.llvm.org
Mon May 21 02:27:17 PDT 2018
Author: labath
Date: Mon May 21 02:27:16 2018
New Revision: 332831
URL: http://llvm.org/viewvc/llvm-project?rev=332831&view=rev
Log:
Add some apple-tables lookup tests
Summary:
Now that we are able to parse MachO files everywhere, we can write some
cross-platform tests for handling of apple accelerator tables. This
reruns the same lookup tests we have for manual indexes on MachO files
which will use the accelerator tables instead. This makes sure we return
the same results regardless of the method we used to access the debug
info.
The tests confirm we return the same results for looking up types,
namespaces and variables, but have found an inconsistency in the
treatment of function lookup. In the function case we mis-classify the
method "foo" declared in the local struct sbar (inside function ffbar).
We classify it as a function whereas it really is a method. Preliminary
analysis suggests this is because
DWARFASTParserClang::GetClangDeclContextForDIE returns null when given
the local "struct sbar" DIE. This causes us to get the wrong
CompilerDeclContext when we ask for the context of the inner foo, which
means CompilerDeclContext::ISStructUnionOrClass returns false.
Until this is fixed, I do not include the darwin versions of the "base"
and "method" function lookup tests.
Reviewers: JDevlieghere, clayborg
Subscribers: aprantl, ilya-biryukov, ioeric, lldb-commits
Differential Revision: https://reviews.llvm.org/D47064
Modified:
lldb/trunk/lit/SymbolFile/DWARF/find-basic-function.cpp
lldb/trunk/lit/SymbolFile/DWARF/find-basic-namespace.cpp
lldb/trunk/lit/SymbolFile/DWARF/find-basic-type.cpp
lldb/trunk/lit/SymbolFile/DWARF/find-basic-variable.cpp
Modified: lldb/trunk/lit/SymbolFile/DWARF/find-basic-function.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/DWARF/find-basic-function.cpp?rev=332831&r1=332830&r2=332831&view=diff
==============================================================================
--- lldb/trunk/lit/SymbolFile/DWARF/find-basic-function.cpp (original)
+++ lldb/trunk/lit/SymbolFile/DWARF/find-basic-function.cpp Mon May 21 02:27:16 2018
@@ -14,6 +14,16 @@
// RUN: FileCheck --check-prefix=CONTEXT %s
// RUN: lldb-test symbols --name=not_there --find=function %t | \
// RUN: FileCheck --check-prefix=EMPTY %s
+//
+// RUN: clang %s -g -c -o %t --target=x86_64-apple-macosx
+// RUN: lldb-test symbols --name=foo --find=function --function-flags=full %t | \
+// RUN: FileCheck --check-prefix=FULL %s
+// RUN: lldb-test symbols --name=_Z3fooi --find=function --function-flags=full %t | \
+// RUN: FileCheck --check-prefix=FULL-MANGLED %s
+// RUN: lldb-test symbols --name=foo --context=context --find=function --function-flags=base %t | \
+// RUN: FileCheck --check-prefix=CONTEXT %s
+// RUN: lldb-test symbols --name=not_there --find=function %t | \
+// RUN: FileCheck --check-prefix=EMPTY %s
// BASE: Found 4 functions:
// BASE-DAG: name = "foo()", mangled = "_Z3foov"
Modified: lldb/trunk/lit/SymbolFile/DWARF/find-basic-namespace.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/DWARF/find-basic-namespace.cpp?rev=332831&r1=332830&r2=332831&view=diff
==============================================================================
--- lldb/trunk/lit/SymbolFile/DWARF/find-basic-namespace.cpp (original)
+++ lldb/trunk/lit/SymbolFile/DWARF/find-basic-namespace.cpp Mon May 21 02:27:16 2018
@@ -8,6 +8,14 @@
// RUN: FileCheck --check-prefix=CONTEXT %s
// RUN: lldb-test symbols --name=not_there --find=namespace %t | \
// RUN: FileCheck --check-prefix=EMPTY %s
+//
+// RUN: clang %s -g -c -o %t --target=x86_64-apple-macosx
+// RUN: lldb-test symbols --name=foo --find=namespace %t | \
+// RUN: FileCheck --check-prefix=FOO %s
+// RUN: lldb-test symbols --name=foo --find=namespace --context=context %t | \
+// RUN: FileCheck --check-prefix=CONTEXT %s
+// RUN: lldb-test symbols --name=not_there --find=namespace %t | \
+// RUN: FileCheck --check-prefix=EMPTY %s
// FOO: Found namespace: foo
Modified: lldb/trunk/lit/SymbolFile/DWARF/find-basic-type.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/DWARF/find-basic-type.cpp?rev=332831&r1=332830&r2=332831&view=diff
==============================================================================
--- lldb/trunk/lit/SymbolFile/DWARF/find-basic-type.cpp (original)
+++ lldb/trunk/lit/SymbolFile/DWARF/find-basic-type.cpp Mon May 21 02:27:16 2018
@@ -8,6 +8,14 @@
// RUN: FileCheck --check-prefix=CONTEXT %s
// RUN: lldb-test symbols --name=not_there --find=type %t | \
// RUN: FileCheck --check-prefix=EMPTY %s
+//
+// RUN: clang %s -g -c -o %t --target=x86_64-apple-macosx
+// RUN: lldb-test symbols --name=foo --find=type %t | \
+// RUN: FileCheck --check-prefix=NAME %s
+// RUN: lldb-test symbols --name=foo --context=context --find=type %t | \
+// RUN: FileCheck --check-prefix=CONTEXT %s
+// RUN: lldb-test symbols --name=not_there --find=type %t | \
+// RUN: FileCheck --check-prefix=EMPTY %s
// EMPTY: Found 0 types:
// NAME: Found 4 types:
Modified: lldb/trunk/lit/SymbolFile/DWARF/find-basic-variable.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/DWARF/find-basic-variable.cpp?rev=332831&r1=332830&r2=332831&view=diff
==============================================================================
--- lldb/trunk/lit/SymbolFile/DWARF/find-basic-variable.cpp (original)
+++ lldb/trunk/lit/SymbolFile/DWARF/find-basic-variable.cpp Mon May 21 02:27:16 2018
@@ -10,6 +10,16 @@
// RUN: FileCheck --check-prefix=REGEX %s
// RUN: lldb-test symbols --name=not_there --find=variable %t | \
// RUN: FileCheck --check-prefix=EMPTY %s
+//
+// RUN: clang %s -g -c -o %t --target=x86_64-apple-macosx
+// RUN: lldb-test symbols --name=foo --find=variable --context=context %t | \
+// RUN: FileCheck --check-prefix=CONTEXT %s
+// RUN: lldb-test symbols --name=foo --find=variable %t | \
+// RUN: FileCheck --check-prefix=NAME %s
+// RUN: lldb-test symbols --regex --name=foo --find=variable %t | \
+// RUN: FileCheck --check-prefix=REGEX %s
+// RUN: lldb-test symbols --name=not_there --find=variable %t | \
+// RUN: FileCheck --check-prefix=EMPTY %s
// EMPTY: Found 0 variables:
// NAME: Found 4 variables:
More information about the lldb-commits
mailing list