aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Commands/CommandObjectExpression.cpp
diff options
context:
space:
mode:
authorPavel Labath <pavel@labath.sk>2020-12-17 17:10:17 +0100
committerPavel Labath <pavel@labath.sk>2020-12-17 17:47:53 +0100
commit122a4ebde3f4394a84e9f93b9c7085f088be6dd7 (patch)
tree0cdf9c43e826c3e4d159e06b854520d837efe9ea /lldb/source/Commands/CommandObjectExpression.cpp
parentf50066292477fb26806336e5604615d0eddde399 (diff)
downloadllvm-122a4ebde3f4394a84e9f93b9c7085f088be6dd7.zip
llvm-122a4ebde3f4394a84e9f93b9c7085f088be6dd7.tar.gz
llvm-122a4ebde3f4394a84e9f93b9c7085f088be6dd7.tar.bz2
Revert "[lldb] Make CommandInterpreter's execution context the same as debugger's one."
This reverts commit a01b26fb51c710a3a8ef88cc83b0701461f5b9ab, because it breaks the "finish" command in some way -- the command does not terminate after it steps out, but continues running the target. The exact blast radius is not clear, but it at least affects the usage of the "finish" command in TestGuiBasicDebug.py. The error is *not* gui-related, as the same issue can be reproduced by running the same steps outside of the gui. There is some kind of a race going on, as the test fails only 20% of the time on the buildbot.
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();