Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lahodaj
Copy link
Contributor

@lahodaj lahodaj commented Feb 11, 2025

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 [ci] enable VSCode Extension tests 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
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 [ci] enable VSCode Extension tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant