Skip to content

[lldb] Supporting interrupting a scripted command (e.g. python) #131944

Open
@ashgti

Description

@ashgti

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

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().

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions