Skip to content

Ensure the thread suspended event is fired even if the thread was suspended when its NB model was being created. - #8232

Open
lahodaj wants to merge 1 commit into
apache:masterfrom
lahodaj:send-events-on-initially-suspended-thread
Open

lahodaj wants to merge 1 commit into
apache:masterfrom
lahodaj:send-events-on-initially-suspended-thread

Conversation

@lahodaj

@lahodaj lahodaj commented Feb 11, 2025

Copy link
Copy Markdown
Contributor

Using the VS Code extension and running this code under debugger:

package test.threading;

public class ThreadingTest {

    public static void main(String[] args) {
        Thread.ofPlatform().start(() -> {
            System.err.println(); //breakpoint here
        });
    }
}

(having the line breakpoint on the marked line). The debugger does not properly stop at the breakpoint.

What I think is happening is that when the JPDAThreadImpl is created, it is already suspended inside the debuggee. As a consequence, the event that the thread was suspended does not go through, and the "UI" part of the debugger is not notified the thread was suspended.

The proposal here is to send the "thread suspended" event the first time the thread stops on a breakpoint, if it was created as already-suspended.

@lahodaj lahodaj added Java [ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form) LSP [ci] enable Language Server Protocol tests VSCode Extension debugger labels Feb 11, 2025
@lahodaj lahodaj added this to the NB26 milestone Feb 11, 2025
@lahodaj
lahodaj requested a review from entlicher February 11, 2025 17:28
@neilcsmith-net neilcsmith-net modified the milestones: NB26, NB27 Apr 16, 2025
@neilcsmith-net neilcsmith-net removed this from the NB27 milestone Jul 18, 2025
@neilcsmith-net
neilcsmith-net marked this pull request as draft July 18, 2025 14:11
@neilcsmith-net

Copy link
Copy Markdown
Member

Removing milestone as it has conflicts and has bumped through a couple of milestones. Please retarget or close as necessary.

@lahodaj
lahodaj force-pushed the send-events-on-initially-suspended-thread branch from 138b24c to 23388b4 Compare October 20, 2026 05:59
@lahodaj
lahodaj requested a review from jtulach October 20, 2026 05:59
@lahodaj lahodaj added this to the NB33 milestone Oct 20, 2026
@lahodaj
lahodaj marked this pull request as ready for review October 20, 2026 06:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

debugger Java [ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form) LSP [ci] enable Language Server Protocol tests VSCode Extension

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants