[Lldb-commits] [PATCH] D111209: Don't push null ExecutionContext on CommandInterpreter exectx stack

Tatyana Krasnukha via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Oct 7 06:36:35 PDT 2021


tatyana-krasnukha added a comment.

Added inline comment



================
Comment at: lldb/source/Interpreter/CommandInterpreter.cpp:2842
 
-  OverrideExecutionContext(m_debugger.GetSelectedExecutionContext());
-  auto finalize = llvm::make_scope_exit([this]() {
-    RestoreExecutionContext();
+  ExecutionContext exe_ctx = m_debugger.GetSelectedExecutionContext();
+  bool pushed_exe_ctx = false;
----------------
The intention of overriding the context here with the currently selected one was to have the same context during `HandleCommand` and `GetProcessOutput`. However, this logic looks wrong to me now. `HandleCommand` may change the context and `GetProcessOutput` should use the new one. I think that you can safely remove this piece of code (untill `IOHandlerInputComplete` doesn't allow overriding execution context).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D111209/new/

https://reviews.llvm.org/D111209



More information about the lldb-commits mailing list