From 20dbb29a1a94c60b556f8880ab841b150e83ab25 Mon Sep 17 00:00:00 2001 From: Med Ismail Bennani Date: Mon, 6 Mar 2023 13:17:43 -0800 Subject: Revert "[lldb] Move ScriptedProcess private state update to implementation" This reverts commit 3c33d72e7fa83beb8a9b39fb3b8ecf4ee00c697d. --- .../Python/ScriptedProcessPythonInterface.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/ScriptedProcessPythonInterface.cpp') diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptedProcessPythonInterface.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptedProcessPythonInterface.cpp index 0c6f308..cffa3bd 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptedProcessPythonInterface.cpp +++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptedProcessPythonInterface.cpp @@ -80,8 +80,21 @@ Status ScriptedProcessPythonInterface::Launch() { } Status ScriptedProcessPythonInterface::Resume() { - // When calling ScriptedProcess.Resume from lldb we should always stop. - return GetStatusFromMethod("resume", /*should_stop=*/true); + return GetStatusFromMethod("resume"); +} + +bool ScriptedProcessPythonInterface::ShouldStop() { + Status error; + StructuredData::ObjectSP obj = Dispatch("is_alive", error); + + if (!CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, obj, error)) + return {}; + + return obj->GetBooleanValue(); +} + +Status ScriptedProcessPythonInterface::Stop() { + return GetStatusFromMethod("stop"); } std::optional -- cgit v1.1