Repository navigation
Description
What
The continued event tells the client that the program resumed without a client request that implied it. Its body has threadId and allThreadsContinued. When allThreadsContinued is omitted or true, all threads resumed. There is no capability flag.
Why
When the program resumes on its own, the IDE must stop showing it as paused. Adapters that send this event (source read on default branches, 2026-11-22):
- GDB native DAP: sends it only for resumes that no DAP request caused (
gdb/python/lib/gdb/dap/events.py:133-177). An example iscontinueornexttyped as a CLI command in the Debug console. LSP4IJ sends console lines asevaluatewith contextrepl. - vscode-js-debug: sends it on every CDP
Debugger.resumed, whatever resumed the target, withallThreadsContinued: false(src/adapter/threads.ts:775,:1951-1956). It also sends it when it refreshes a stack (:934). - debugpy (pydevd): sends it when a thread resumes after a suspend (
pydevd.py:2395,:2451). - CodeLLDB: sends it on every change of the process to running or stepping (
src/codelldb/src/debug_session.rs:1463,:1500-1504). - lldb-dap: the same (
lldb/tools/lldb-dap/EventHelper.cpp:361-379,:458-461). - Delve: sends it before the response to next, stepIn, stepOut and stepBack (
service/dap/server.go:2500-2510). - netcoredbg: sends it on Step and Continue.
- java-debug: sends it for its custom continueAll and continueOthers requests, for terminate, restartFrame and hot code replace.
- Not sent: rdbg, MIEngine.
Most of these follow a request from the IDE, when IntelliJ already shows the session as running. The ones that matter are the resumes nobody in the IDE asked for.
Today
DAPClient doesn't override continued, and LSP4J's default method does nothing. When the program resumes on its own, the session stays suspended:
- Frames and Variables show the old stop.
- Resume and the step actions stay enabled, and Pause stays disabled.
- A step sends
nextfor a thread that is running.
At the next stop, getSuspendContext reuses the old DAPSuspendContext and adds every thread to it again: addToExecutionStack appends. The thread list can then show each thread twice. This is from reading the code; I did not reproduce it.
How it could be done
-
Override
continued(ContinuedEventArguments)inDAPClient. -
Call
getSession().sessionResumed()when all of these hold:- the session is suspended;
- its suspend context is a
DAPSuspendContextof this client; allThreadsContinuedis notfalse, orthreadIdis the context's thread.
Child sessions started with
startDebuggingget their own events. A worker'scontinuedmust not resume a session suspended in the page's session. -
When
allThreadsContinuedisfalsefor another thread, keep the session suspended. Refresh the Threads panel (getThreads(true)) and show that thread as running. -
XDebugSession.sessionResumed()is public in both 2024.2 and 2026.3, and not internal. In both versionsXDebugSessionImpl.sessionResumed()only callsdoResume()(bytecode checked).doResume():- clears the paused data and fires
beforeSessionResumeandsessionResumed; - does not call
XDebugProcess.resume(), so nocontinueis sent; - returns at once when the session isn't paused. So the many
continuedevents that follow a step or a Resume from the IDE do nothing.
- clears the paused data and fires
-
LSP4IJ already calls
sessionResumed()from the LSP4J thread, inDAPDropFrameHandler.restartFrame. -
Race:
stoppedis handled asynchronously: threads, then stackTrace, thensuspend()throughthenAcceptAsync(DAPClient.java:586). Acontinuedthat arrives meanwhile would be undone by the latepositionReached. The fix:- keep a per-client counter that
continuedincrements; stoppedcaptures it;suspend()skipspositionReachedandbreakpointReachedif the counter changed.
js-debug's continued-then-stopped refresh produces exactly this order.
- keep a per-client counter that
-
Threading: events arrive on LSP4J's reader thread. No read action is needed.
-
Compatibility: adapters that never send
continuedbehave as today. Behaviour change: the views clear when the adapter says the program runs.ContinueResponse.allThreadsContinuedstays out of scope. -
For reference, VS Code clears the call stack of that thread, or of all threads (
debugSession.ts:1136-1160). -
Docs: mark Continued as supported in
docs/dap/DAPSupport.md.
Test
-
Unit test: use JUnit 5 with
java.lang.reflect.Proxyfakes ofXDebugSession, asDAPClientInvalidatedTestandDAPDropFrameHandlerTestdo. Extract the decision into a static helper and check that it resumes for:- all threads;
- the context's thread with
allThreadsContinued: false.
Check that it does not resume for:
- another thread;
- another client;
- a session that is not suspended.
-
Session test: use
HeavyPlatformTestCaselikeDAPStepOnlyCurrentThreadSessionTest: an in-processIDebugProtocolServerbehindDSPLauncher.createServerLauncheron a loopback socket, and aDAPRunConfigurationin ATTACH mode.- After the first stop, the server calls
client.continued(...); wait until!session.isSuspended(). - On the next stop, assert one execution stack per thread.
- For the race, the server sends
stoppedandcontinuedback to back. The session must end up not suspended.
- After the first stop, the server calls
Effort and risk
Small. Low risk with the counter. Open questions:
- Should the Threads panel show a running state per thread?
- Should
ContinueResponse.allThreadsContinued: falsebe handled as well?
Activity
fix: a stop while suspended lists each thread once, and only the thre…
feat: a DAP debug session shows the program running when the debug ad…
fix: a DAP stop from which the program continued before the session s…
test: a DAP session resumes on the 'continued' event, and a stop whic…
lagergren commentedon Nov 24, 2026
#2174 implements this issue, except for one part, deferred for later: showing a thread that continued alone (
allThreadsContinued: false) as running in the Threads tab. With #2174, such an event for another thread than the stopped one leaves the session suspended and asks for the threads again, but the Threads tab doesn't track whether a thread runs at all: a row shows the reason of the thread's lastthreadevent, and nothing changes it at a stop or a resume. #2176 tracks it, with the Frames view of such a thread.feat: a DAP debug session shows the program running when the debug ad…
fix: a DAP stop from which the program continued before the session s…
test: a DAP session resumes on the 'continued' event, and a stop whic…