summaryrefslogtreecommitdiffstats
path: root/lldb/source/Expression
diff options
context:
space:
mode:
authorVedant Kumar <vsk@apple.com>2019-09-14 19:43:16 -0700
committerVedant Kumar <vsk@apple.com>2019-11-22 11:50:22 -0800
commit4fdbc0728d4b8acb1921fc48301622e971fc3961 (patch)
tree74a32d9948b5c41de1b711455b2dc54f7b6e5570 /lldb/source/Expression
parent3f8a2af8f43faf6da15070108ceeacb9a5d2c42b (diff)
downloadbcm5719-llvm-4fdbc0728d4b8acb1921fc48301622e971fc3961.tar.gz
bcm5719-llvm-4fdbc0728d4b8acb1921fc48301622e971fc3961.zip
[DWARF] Handle call sites with indirect call targets
Split CallEdge into DirectCallEdge and IndirectCallEdge. Teach DWARFExpression how to evaluate entry values in cases where the current activation was created by an indirect call. rdar://57094085 Differential Revision: https://reviews.llvm.org/D70100
Diffstat (limited to 'lldb/source/Expression')
-rw-r--r--lldb/source/Expression/DWARFExpression.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/lldb/source/Expression/DWARFExpression.cpp b/lldb/source/Expression/DWARFExpression.cpp
index 79e155e7e8f..a063da0f4e4 100644
--- a/lldb/source/Expression/DWARFExpression.cpp
+++ b/lldb/source/Expression/DWARFExpression.cpp
@@ -830,6 +830,8 @@ static bool Evaluate_DW_OP_entry_value(std::vector<Value> &stack,
CallEdge *call_edge = nullptr;
ModuleList &modlist = target.GetImages();
+ ExecutionContext parent_exe_ctx = *exe_ctx;
+ parent_exe_ctx.SetFrameSP(parent_frame);
if (!parent_frame->IsArtificial()) {
// If the parent frame is not artificial, the current activation may be
// produced by an ambiguous tail call. In this case, refuse to proceed.
@@ -841,7 +843,7 @@ static bool Evaluate_DW_OP_entry_value(std::vector<Value> &stack,
return_pc, parent_func->GetName());
return false;
}
- Function *callee_func = call_edge->GetCallee(modlist);
+ Function *callee_func = call_edge->GetCallee(modlist, parent_exe_ctx);
if (callee_func != current_func) {
LLDB_LOG(log, "Evaluate_DW_OP_entry_value: ambiguous call sequence, "
"can't find real parent frame");
@@ -851,9 +853,9 @@ static bool Evaluate_DW_OP_entry_value(std::vector<Value> &stack,
// The StackFrameList solver machinery has deduced that an unambiguous tail
// call sequence that produced the current activation. The first edge in
// the parent that points to the current function must be valid.
- for (CallEdge &edge : parent_func->GetTailCallingEdges()) {
- if (edge.GetCallee(modlist) == current_func) {
- call_edge = &edge;
+ for (auto &edge : parent_func->GetTailCallingEdges()) {
+ if (edge->GetCallee(modlist, parent_exe_ctx) == current_func) {
+ call_edge = edge.get();
break;
}
}
@@ -907,8 +909,6 @@ static bool Evaluate_DW_OP_entry_value(std::vector<Value> &stack,
// TODO: Add support for DW_OP_push_object_address within a DW_OP_entry_value
// subexpresion whenever llvm does.
Value result;
- ExecutionContext parent_exe_ctx = *exe_ctx;
- parent_exe_ctx.SetFrameSP(parent_frame);
const DWARFExpression &param_expr = matched_param->LocationInCaller;
if (!param_expr.Evaluate(&parent_exe_ctx,
parent_frame->GetRegisterContext().get(),
OpenPOWER on IntegriCloud