summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process/Utility
diff options
context:
space:
mode:
authorPavel Labath <pavel@labath.sk>2019-05-07 15:27:35 +0000
committerPavel Labath <pavel@labath.sk>2019-05-07 15:27:35 +0000
commit95e72765c11fe22677e5922909520adbe7120e0b (patch)
tree1f4f1a85dea216e0a72c3db563d76be9b6208770 /lldb/source/Plugins/Process/Utility
parentdebb2b2a1e9dfbc0d42d51389e0a6b01a3a6d7ab (diff)
downloadbcm5719-llvm-95e72765c11fe22677e5922909520adbe7120e0b.tar.gz
bcm5719-llvm-95e72765c11fe22677e5922909520adbe7120e0b.zip
RegisterContextLLDB: Push CFA value on DWARF stack when evaluating register expressions
Summary: This behavior is specified in the Section 6.4.2.3 (Register Rule instructions) of the DWARF4 spec. We were not doing that, which meant that any register rule which was relying on the cfa value being there was not evaluated correctly (it was aborted due to "out of bounds" access). I'm not sure how come this wasn't noticed before, but I guess this has something to do with the fact that dwarf unwind expressions are not used very often, and when they are, the situation is so complicated that the CFA is of no use. I noticed this when I started emitting dwarf expressions for the unwind information present in breakpad symbol files. Reviewers: jasonmolenda, clayborg Subscribers: aprantl, lldb-commits Differential Revision: https://reviews.llvm.org/D61018 llvm-svn: 360158
Diffstat (limited to 'lldb/source/Plugins/Process/Utility')
-rw-r--r--lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp
index 69f4e38cc9e..ecda5556e60 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp
+++ b/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp
@@ -1513,9 +1513,11 @@ RegisterContextLLDB::SavedLocationForRegister(
DWARFExpression dwarfexpr(opcode_ctx, dwarfdata, nullptr, 0,
unwindplan_regloc.GetDWARFExpressionLength());
dwarfexpr.SetRegisterKind(unwindplan_registerkind);
+ Value cfa_val = Scalar(m_cfa);
+ cfa_val.SetValueType(Value::eValueTypeLoadAddress);
Value result;
Status error;
- if (dwarfexpr.Evaluate(&exe_ctx, this, 0, nullptr, nullptr, result,
+ if (dwarfexpr.Evaluate(&exe_ctx, this, 0, &cfa_val, nullptr, result,
&error)) {
addr_t val;
val = result.GetScalar().ULongLong();
OpenPOWER on IntegriCloud