aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Interpreter/CommandInterpreter.cpp
diff options
context:
space:
mode:
authorDavid Spickett <david.spickett@linaro.org>2023-09-20 08:19:53 +0000
committerDavid Spickett <david.spickett@linaro.org>2023-09-20 08:19:53 +0000
commit1446e3cf7605f0988b914fac0a34d63045394ff3 (patch)
tree87608dee545b3166093cdf3b638c709d0ef301a1 /lldb/source/Interpreter/CommandInterpreter.cpp
parenta2046ca9afd575aeb458c6e5c9b720be3a35b857 (diff)
downloadllvm-1446e3cf7605f0988b914fac0a34d63045394ff3.zip
llvm-1446e3cf7605f0988b914fac0a34d63045394ff3.tar.gz
llvm-1446e3cf7605f0988b914fac0a34d63045394ff3.tar.bz2
Revert "Fix a bug with cancelling "attach -w" after you have run a process previously (#65822)"
This reverts commit 7265f792dc8e1157a3874aee5f8aed6d4d8236e7. The new test case is flaky on Linux AArch64 (https://lab.llvm.org/buildbot/#/builders/96) and more flaky on Windows on Arm (https://lab.llvm.org/buildbot/#/builders/219/builds/5735).
Diffstat (limited to 'lldb/source/Interpreter/CommandInterpreter.cpp')
-rw-r--r--lldb/source/Interpreter/CommandInterpreter.cpp33
1 files changed, 8 insertions, 25 deletions
diff --git a/lldb/source/Interpreter/CommandInterpreter.cpp b/lldb/source/Interpreter/CommandInterpreter.cpp
index 9f1f520..dcff53f 100644
--- a/lldb/source/Interpreter/CommandInterpreter.cpp
+++ b/lldb/source/Interpreter/CommandInterpreter.cpp
@@ -2471,7 +2471,7 @@ PlatformSP CommandInterpreter::GetPlatform(bool prefer_target_platform) {
return platform_sp;
}
-bool CommandInterpreter::DidProcessStopAbnormally() {
+bool CommandInterpreter::DidProcessStopAbnormally() const {
auto exe_ctx = GetExecutionContext();
TargetSP target_sp = exe_ctx.GetTargetSP();
if (!target_sp)
@@ -2976,22 +2976,10 @@ void CommandInterpreter::FindCommandsForApropos(llvm::StringRef search_word,
m_alias_dict);
}
-ExecutionContext CommandInterpreter::GetExecutionContext() {
- ExecutionContext exe_ctx;
- if (!m_overriden_exe_contexts.empty()) {
- // During the course of a command, the target may have replaced the process
- // coming in with another. I fix that here:
- exe_ctx = m_overriden_exe_contexts.top();
- // Don't use HasProcessScope, that returns false if there is a process but
- // it's no longer valid, which is one of the cases we want to catch here.
- if (exe_ctx.HasTargetScope() && exe_ctx.GetProcessPtr()) {
- ProcessSP actual_proc_sp = exe_ctx.GetTargetSP()->GetProcessSP();
- if (actual_proc_sp != exe_ctx.GetProcessSP())
- m_overriden_exe_contexts.top().SetContext(actual_proc_sp);
- }
- return m_overriden_exe_contexts.top();
- }
- return m_debugger.GetSelectedExecutionContext();
+ExecutionContext CommandInterpreter::GetExecutionContext() const {
+ return !m_overriden_exe_contexts.empty()
+ ? m_overriden_exe_contexts.top()
+ : m_debugger.GetSelectedExecutionContext();
}
void CommandInterpreter::OverrideExecutionContext(
@@ -3184,17 +3172,12 @@ void CommandInterpreter::IOHandlerInputComplete(IOHandler &io_handler,
}
bool CommandInterpreter::IOHandlerInterrupt(IOHandler &io_handler) {
- // InterruptCommand returns true if this is the first time
- // we initiate an interrupt for this command. So we give the
- // command a chance to handle the interrupt on the first
- // interrupt, but if that didn't do anything, a second
- // interrupt will do more work to halt the process/interpreter.
- if (InterruptCommand())
- return true;
-
ExecutionContext exe_ctx(GetExecutionContext());
Process *process = exe_ctx.GetProcessPtr();
+ if (InterruptCommand())
+ return true;
+
if (process) {
StateType state = process->GetState();
if (StateIsRunningState(state)) {