summaryrefslogtreecommitdiffstats
path: root/lldb/lit/SymbolFile/PDB
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2018-07-13 10:29:27 +0000
committerJonas Devlieghere <jonas@devlieghere.com>2018-07-13 10:29:27 +0000
commit924d560867f40b6ae22ef4dec7078d44d3d7c7e1 (patch)
tree9363e1fb13f2c510ec9259e0adc1468e6872bdc6 /lldb/lit/SymbolFile/PDB
parentd86aad699defc0be37ca25971df728a1ce8575ac (diff)
downloadbcm5719-llvm-924d560867f40b6ae22ef4dec7078d44d3d7c7e1.tar.gz
bcm5719-llvm-924d560867f40b6ae22ef4dec7078d44d3d7c7e1.zip
Convert a location information from PDB to a DWARF expression
The current version of SymbolFilePDB::ParseVariableForPDBData function always initializes variables with an empty location. This patch adds the converter of a location information from PDB to a DWARF expression, so it becomes possible to watch values of variables of primitive data types. At the moment the converter supports only Static, TLS, RegRel, Enregistered and Constant PDB location types, but it seems that it's enough for most cases. There are still some problems with retrieving values of variables (e.g. we can't watch variables of composite types), but they look not relevant to the conversion to DWARF. Patch by: Aleksandr Urakov Differential revision: https://reviews.llvm.org/D49018 llvm-svn: 336988
Diffstat (limited to 'lldb/lit/SymbolFile/PDB')
-rw-r--r--lldb/lit/SymbolFile/PDB/Inputs/VariablesLocationsTest.cpp15
-rw-r--r--lldb/lit/SymbolFile/PDB/Inputs/VariablesLocationsTest.script16
-rw-r--r--lldb/lit/SymbolFile/PDB/variables-locations.test14
3 files changed, 45 insertions, 0 deletions
diff --git a/lldb/lit/SymbolFile/PDB/Inputs/VariablesLocationsTest.cpp b/lldb/lit/SymbolFile/PDB/Inputs/VariablesLocationsTest.cpp
new file mode 100644
index 00000000000..54d54c0d56a
--- /dev/null
+++ b/lldb/lit/SymbolFile/PDB/Inputs/VariablesLocationsTest.cpp
@@ -0,0 +1,15 @@
+int g_var = 2222;
+
+void __fastcall foo(short arg_0, float arg_1) {
+ char loc_0 = 'x';
+ double loc_1 = 0.5678;
+}
+
+int main(int argc, char *argv[]) {
+ bool loc_0 = true;
+ int loc_1 = 3333;
+
+ foo(1111, 0.1234);
+
+ return 0;
+}
diff --git a/lldb/lit/SymbolFile/PDB/Inputs/VariablesLocationsTest.script b/lldb/lit/SymbolFile/PDB/Inputs/VariablesLocationsTest.script
new file mode 100644
index 00000000000..7058f29ae1c
--- /dev/null
+++ b/lldb/lit/SymbolFile/PDB/Inputs/VariablesLocationsTest.script
@@ -0,0 +1,16 @@
+breakpoint set --file VariablesLocationsTest.cpp --line 6
+
+run
+
+target variable g_var
+
+frame variable arg_0
+frame variable arg_1
+
+frame variable loc_0
+frame variable loc_1
+
+frame select 1
+
+frame variable loc_0
+frame variable loc_1
diff --git a/lldb/lit/SymbolFile/PDB/variables-locations.test b/lldb/lit/SymbolFile/PDB/variables-locations.test
new file mode 100644
index 00000000000..b70339fa23a
--- /dev/null
+++ b/lldb/lit/SymbolFile/PDB/variables-locations.test
@@ -0,0 +1,14 @@
+REQUIRES: windows
+RUN: clang-cl /Zi %S/Inputs/VariablesLocationsTest.cpp /o %t.exe
+RUN: %lldb -b -s %S/Inputs/VariablesLocationsTest.script -- %t.exe | FileCheck %s
+
+CHECK: g_var = 2222
+
+CHECK: arg_0 = 1111
+CHECK: arg_1 = 0.123
+
+CHECK: loc_0 = 'x'
+CHECK: loc_1 = 0.567
+
+CHECK: loc_0 = true
+CHECK: loc_1 = 3333
OpenPOWER on IntegriCloud