Skip to content

DAP: Terminate Thread in the context menu of the Frames view #2178

Done

Description

@lagergren

What

#2153 added "Terminate Thread" (DAP.TerminateThread) to the context menu of the DAP session's own Threads tab
(DAP.Threads.Popup), for #2113. #2113 also asked, as an optional part, for it in the context menu of IntelliJ's Frames
view (XDebugger.Frames.Tree.Popup). That menu exists in 2024.2 and in 2026.3. The action would terminate the thread
of the frame there. #2153 left this out.

Today

  • A frame doesn't know its thread. DAPExecutionStack has the thread ID, but the frames it creates don't:
    DAPStackFrame keeps only the client, the DAP StackFrame and the execution epoch. It has two public constructors,
    (client, stackFrame) and (client, stackFrame, executionEpoch).
  • The actions of that menu act on the session's current frame. OpenDisassemblyAction, which LSP4IJ already adds
    to XDebugger.Frames.Tree.Popup, takes the session from XDebugSession.DATA_KEY and works on its current frame. A
    thread action has to make sure it terminates the thread of the frame that was right-clicked. That is the current
    frame only if a right-click selects it, which needs a check on 2024.2 and in 2026.3's split debugger.

How it could be done

  • Give DAPStackFrame its thread ID through a new constructor, keeping the two existing ones. DAPExecutionStack
    passes it.
  • Add DAP.TerminateThread to XDebugger.Frames.Tree.Popup, or a small action that delegates to it. It is enabled
    for a DAPStackFrame whose debug adapter supports terminateThreads, and it terminates that frame's thread, as the
    Threads tab does.

Test

A session test like DAPTerminateThreadSessionTest: the action on a frame of the worker thread sends
terminateThreads with the worker's ID. It isn't offered for an adapter without supportsTerminateThreadsRequest.

Related: #2113, #2153, #2176.

Activity

  1. added this to the 0.30.2 milestone on Nov 24, 2026
  2. added
    enhancement
    dap
    on Nov 24, 2026
  3. added a commit that references this issue on Nov 25, 2026
    7b88e72
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    dapenhancement

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions