Skip to content

DAP: when the selected thread continues alone, select the thread where the session stays suspended #2184

Done

Description

@lagergren

What happens

A thread other than the one where the session is suspended continues alone (a continued event with
allThreadsContinued: false). With #2181, the session stays suspended at the stopped thread, the Threads tab shows the
other thread as running, and that thread's stack in the Frames view says "Frames not available: the thread is running".

But if that other thread was the one selected in the Frames view, the selection stays on it:

  • Stale views: the current frame, the Variables view and the execution point stay on the frame of its stop.
  • Step and Resume act on the wrong thread. DAPDebugProcess takes the thread from DAPSuspendContext.getThreadId(),
    the thread of the active stack, so a step sends next for a thread that is running. Since feat: a DAP debug session shows the program running when the debug adapter says that it continued #2174 the client knows
    which thread stopped (DAPSuspendContext.getStoppedThreadId()), but stepping deliberately uses the selected stack.

Expected

When the selected thread continues alone while the session stays suspended at another thread:

  • the selection moves to the stopped thread's top frame;
  • the Variables view and the execution point follow it;
  • Step and Resume act on the stopped thread.

How it could be done

  • In the continued handling of DAPClient, after the views are rebuilt: if the session's current frame belongs to
    the thread that continued, call session.setCurrentStackFrame(stoppedStack, topFrame, true). This must run on the
    EDT, since the 2024.2 Frames view asserts it there. Also make the stopped thread's stack the context's active stack.
  • setCurrentStackFrame is public API, and reaches the frontend of 2026.3's split debugger.

Test

A session test like DAPThreadRunStateSessionTest (#2181):

  • main stops, the worker is selected, then the worker continues alone;
  • the current frame becomes main's top frame;
  • a step then sends next for main.

Related: #2176, #2181, #2174.

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
    67f9884
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