-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Description
While looking into how we can support interrupting a command in lldb-dap I noticed that I think we cannot interrupt a script command from the SB API.
Looking at the ScriptInterpreterPythonImpl::Interrupt() function that tries to interrupt running python
llvm-project/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h
Line 37 in 9ed772c
| bool Interrupt() override; |
This is only ever triggered from
| if (script_interpreter->Interrupt()) |
Which is only triggered ever called from the IOHandlerEditline or IOHandlerCursesGUI.
I noticed this while implementing tests for the lldb-dap cancel request and using an evaluate request with a command like:
script import time; time.sleep(10); print("Done")
Would always sleep for 10 seconds, even if I triggered SBDebugger::RequestInterrupt() or SBCommandInterpreter::InterruptCommand().