summaryrefslogtreecommitdiffstats
path: root/lldb/lit/SymbolFile/NativePDB
diff options
context:
space:
mode:
authorAleksandr Urakov <aleksandr.urakov@jetbrains.com>2019-01-29 09:32:23 +0000
committerAleksandr Urakov <aleksandr.urakov@jetbrains.com>2019-01-29 09:32:23 +0000
commitee7c61f10eb68b72405c7783945395f89d20d8e5 (patch)
treea76f82ef2383bcd3fd8a57c0ce3877a861c1ca84 /lldb/lit/SymbolFile/NativePDB
parent015f97db8b34d48af22ac7f7f49df2a2635f677e (diff)
downloadbcm5719-llvm-ee7c61f10eb68b72405c7783945395f89d20d8e5.tar.gz
bcm5719-llvm-ee7c61f10eb68b72405c7783945395f89d20d8e5.zip
[NativePDB] Add basic support of methods recostruction in AST
Summary: This patch adds the basic support of methods reconstruction by native PDB plugin. It contains only most obvious changes (it processes LF_ONEMETHOD and LF_METHOD records), some things still remain unsolved: - mangled names retrieving; - support of template methods. Reviewers: zturner, labath, lemo, stella.stamenova Reviewed by: zturner Differential Revision: https://reviews.llvm.org/D56126 llvm-svn: 352464
Diffstat (limited to 'lldb/lit/SymbolFile/NativePDB')
-rw-r--r--lldb/lit/SymbolFile/NativePDB/Inputs/ast-methods.lldbinit5
-rw-r--r--lldb/lit/SymbolFile/NativePDB/ast-methods.cpp36
2 files changed, 41 insertions, 0 deletions
diff --git a/lldb/lit/SymbolFile/NativePDB/Inputs/ast-methods.lldbinit b/lldb/lit/SymbolFile/NativePDB/Inputs/ast-methods.lldbinit
new file mode 100644
index 00000000000..6d593589c4a
--- /dev/null
+++ b/lldb/lit/SymbolFile/NativePDB/Inputs/ast-methods.lldbinit
@@ -0,0 +1,5 @@
+target variable s
+
+target modules dump ast
+
+quit
diff --git a/lldb/lit/SymbolFile/NativePDB/ast-methods.cpp b/lldb/lit/SymbolFile/NativePDB/ast-methods.cpp
new file mode 100644
index 00000000000..6006c722cfb
--- /dev/null
+++ b/lldb/lit/SymbolFile/NativePDB/ast-methods.cpp
@@ -0,0 +1,36 @@
+// clang-format off
+// REQUIRES: lld
+
+// RUN: %build --compiler=clang-cl --nodefaultlib -o %t.exe -- %s
+// RUN: env LLDB_USE_NATIVE_PDB_READER=1 %lldb -f %t.exe -s \
+// RUN: %p/Inputs/ast-methods.lldbinit 2>&1 | FileCheck %s
+
+struct Struct {
+ void simple_method() {}
+
+ virtual void virtual_method() {}
+
+ static void static_method() {}
+
+ int overloaded_method() {}
+ int overloaded_method(char c) {}
+ int overloaded_method(char c, int i, ...) {}
+};
+
+Struct s;
+
+int main(int argc, char **argv) {
+ return 0;
+}
+
+// CHECK: TranslationUnitDecl
+// CHECK: |-CXXRecordDecl {{.*}} struct Struct definition
+// CHECK: | |-CXXMethodDecl {{.*}} simple_method 'void (){{.*}}'
+// CHECK: | |-CXXMethodDecl {{.*}} virtual_method 'void (){{.*}}' virtual
+// CHECK: | |-CXXMethodDecl {{.*}} static_method 'void ()' static
+// CHECK: | |-CXXMethodDecl {{.*}} overloaded_method 'int (){{.*}}'
+// CHECK: | |-CXXMethodDecl {{.*}} overloaded_method 'int (char){{.*}}'
+// CHECK: | | `-ParmVarDecl {{.*}} 'char'
+// CHECK: | `-CXXMethodDecl {{.*}} overloaded_method 'int (char, int, ...)'
+// CHECK: | |-ParmVarDecl {{.*}} 'char'
+// CHECK: | `-ParmVarDecl {{.*}} 'int'
OpenPOWER on IntegriCloud