diff options
author | Aleksandr Urakov <aleksandr.urakov@jetbrains.com> | 2019-02-01 10:01:18 +0000 |
---|---|---|
committer | Aleksandr Urakov <aleksandr.urakov@jetbrains.com> | 2019-02-01 10:01:18 +0000 |
commit | 758657e56550c0681260bb61b0a2bddb4a5c2e6d (patch) | |
tree | cd529a2f27ed73e5871fc04afa541f0a97959ade /lldb/lit/SymbolFile/PDB | |
parent | bac11518cd44f85cea38e5be116388cd254de9eb (diff) | |
download | bcm5719-llvm-758657e56550c0681260bb61b0a2bddb4a5c2e6d.tar.gz bcm5719-llvm-758657e56550c0681260bb61b0a2bddb4a5c2e6d.zip |
[PDB] Fix location retrieval for function local variables and arguments that are
stored relative to VFRAME
Summary:
This patch makes LLDB able to retrieve proper values for function arguments and
local variables stored in PDB relative to VFRAME register.
Patch contains retrieval of corresponding FPO table entries from PDB and a
generic translator from FPO programs to DWARF expressions to get correct VFRAME
value.
Patch also improves variables-locations.test and makes this test passable on
x86.
Patch By: leonid.mashinsky
Reviewers: zturner, asmith, stella.stamenova, aleksandr.urakov
Reviewed By: zturner
Subscribers: arphaman, labath, mgorny, aprantl, JDevlieghere, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D55122
llvm-svn: 352845
Diffstat (limited to 'lldb/lit/SymbolFile/PDB')
3 files changed, 26 insertions, 0 deletions
diff --git a/lldb/lit/SymbolFile/PDB/Inputs/VariablesLocationsTest.cpp b/lldb/lit/SymbolFile/PDB/Inputs/VariablesLocationsTest.cpp index 54d54c0d56a..7b7180a3ec4 100644 --- a/lldb/lit/SymbolFile/PDB/Inputs/VariablesLocationsTest.cpp +++ b/lldb/lit/SymbolFile/PDB/Inputs/VariablesLocationsTest.cpp @@ -5,11 +5,22 @@ void __fastcall foo(short arg_0, float arg_1) { double loc_1 = 0.5678; } +__declspec(align(128)) struct S { + int a = 1234; +}; + +void bar(int arg_0) { + S loc_0; + int loc_1 = 5678; +} + + int main(int argc, char *argv[]) { bool loc_0 = true; int loc_1 = 3333; foo(1111, 0.1234); + bar(22); return 0; } diff --git a/lldb/lit/SymbolFile/PDB/Inputs/VariablesLocationsTest.script b/lldb/lit/SymbolFile/PDB/Inputs/VariablesLocationsTest.script index 7058f29ae1c..7dd90352cce 100644 --- a/lldb/lit/SymbolFile/PDB/Inputs/VariablesLocationsTest.script +++ b/lldb/lit/SymbolFile/PDB/Inputs/VariablesLocationsTest.script @@ -1,4 +1,5 @@ breakpoint set --file VariablesLocationsTest.cpp --line 6 +breakpoint set --file VariablesLocationsTest.cpp --line 15 run @@ -14,3 +15,11 @@ frame select 1 frame variable loc_0 frame variable loc_1 + +continue + +frame variable arg_0 + +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 index 7696dc92cee..b5bfc6fe81a 100644 --- a/lldb/lit/SymbolFile/PDB/variables-locations.test +++ b/lldb/lit/SymbolFile/PDB/variables-locations.test @@ -1,5 +1,6 @@ REQUIRES: system-windows, lld RUN: %build --compiler=clang-cl --output=%t.exe %S/Inputs/VariablesLocationsTest.cpp +RUN: env LLDB_USE_NATIVE_PDB_READER=0 %lldb -b -s %S/Inputs/VariablesLocationsTest.script -- %t.exe | FileCheck %s RUN: env LLDB_USE_NATIVE_PDB_READER=1 %lldb -b -s %S/Inputs/VariablesLocationsTest.script -- %t.exe | FileCheck %s CHECK: g_var = 2222 @@ -12,3 +13,8 @@ CHECK: loc_1 = 0.567 CHECK: loc_0 = true CHECK: loc_1 = 3333 + +CHECK: arg_0 = 22 + +CHECK: loc_0 = (a = 1234) +CHECK: loc_1 = 5678 |