aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Commands/CommandObjectExpression.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Commands/CommandObjectExpression.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectExpression.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/lldb/source/Commands/CommandObjectExpression.cpp b/lldb/source/Commands/CommandObjectExpression.cpp
index c7866f9..58eaa3f 100644
--- a/lldb/source/Commands/CommandObjectExpression.cpp
+++ b/lldb/source/Commands/CommandObjectExpression.cpp
@@ -292,12 +292,18 @@ void CommandObjectExpression::HandleCompletion(CompletionRequest &request) {
options.SetAutoApplyFixIts(false);
options.SetGenerateDebugInfo(false);
- ExecutionContext exe_ctx(m_interpreter.GetExecutionContext());
-
- // Get out before we start doing things that expect a valid frame pointer.
- if (exe_ctx.GetFramePtr() == nullptr)
+ // We need a valid execution context with a frame pointer for this
+ // completion, so if we don't have one we should try to make a valid
+ // execution context.
+ if (m_interpreter.GetExecutionContext().GetFramePtr() == nullptr)
+ m_interpreter.UpdateExecutionContext(nullptr);
+
+ // This didn't work, so let's get out before we start doing things that
+ // expect a valid frame pointer.
+ if (m_interpreter.GetExecutionContext().GetFramePtr() == nullptr)
return;
+ ExecutionContext exe_ctx(m_interpreter.GetExecutionContext());
Target *exe_target = exe_ctx.GetTargetPtr();
Target &target = exe_target ? *exe_target : GetDummyTarget();