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

allThreadsContinued not respected #33839

Closed
weinand opened this issue Sep 5, 2017 · 7 comments
Closed

allThreadsContinued not respected #33839

weinand opened this issue Sep 5, 2017 · 7 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug debug Debug viewlet, configurations, breakpoints, adapter issues verified Verification succeeded

Comments

@weinand
Copy link
Contributor

weinand commented Sep 5, 2017

From @DatGuyJonathan on August 31, 2017 22:0

I'm working on a debugger extension that supports multiple stopped threads. When the user clicks 'continue', the debug adapter (DA) handles continueRequest with the backend and responds to VS Code with allThreadsContinued = false. The backend will eventually notify DA that the thread has finished, so DA sends a ThreadEvent with reason 'exited' to VS Code.

If I have multiple stopped threads and perform 'continue' on one of them, VS Code removes all the threads from the call stack view. My workaround is to send a stopped event to VS Code for every thread that the DA knows about, but that seems expensive because the DA will have to handle stackTraceRequest for threads that haven't changed.

Is that workaround the expected behavior from DA?

Here are the versions I'm working with:
VS Code: 1.15.0
vscode-debugadapter & vscode-debugprotocol: 1.22.0

Copied from original issue: microsoft/vscode-debugadapter-node#130

@weinand
Copy link
Contributor Author

weinand commented Sep 5, 2017

I will move this to VS Code, since the issue is about a client implementation problem.

@vscodebot vscodebot bot added the debug Debug viewlet, configurations, breakpoints, adapter issues label Sep 5, 2017
@isidorn
Copy link
Contributor

isidorn commented Sep 6, 2017

The ThreadEvent with reason exited will only remove one thread which can be seen here

@DatGuyJonathan I believe the only issue you are seeing is that the continue event continues all threads. This is expected default behavior, in order to only continue one thread please send a ContinuedEvent with allThreadsContinued = false

Closing this as designed. Let me know if things still do not work for you and I will reopen. Also be sure to try with latest vscode insiders. Thanks

@isidorn isidorn closed this as completed Sep 6, 2017
@isidorn isidorn added the *as-designed Described behavior is as designed label Sep 6, 2017
@DatGuyJonathan
Copy link

Thanks for the prompt response @isidorn . I use allThreadsContinued: false as seen here. It is not in a ContinuedEvent, but rather in the response of continueRequest because the protocol says ContinuedEvent is not required. I can still repro the issue if I send a ContinuedEvent and also with the latest vscode-insiders.

@isidorn isidorn reopened this Sep 8, 2017
@isidorn isidorn removed the *as-designed Described behavior is as designed label Sep 8, 2017
@isidorn isidorn changed the title ThreadEvent with reason 'exited' removes all threads allThreadsContinued not respected Sep 8, 2017
@isidorn
Copy link
Contributor

isidorn commented Sep 8, 2017

@DatGuyJonathan ok in that case we have two options

  1. You give me the steps how to setup your debugger on my mac machine
  2. You run vscode out of source as specified here you add your extension to the out of source setup and place a breakpoint in these locations and let me know what you find out
    https://github.com/Microsoft/vscode/blob/master/src/vs/workbench/parts/debug/electron-browser/debugService.ts#L314
    https://github.com/Microsoft/vscode/blob/master/src/vs/workbench/parts/debug/electron-browser/rawDebugSession.ts#L204
    https://github.com/Microsoft/vscode/blob/master/src/vs/workbench/parts/debug/electron-browser/rawDebugSession.ts#L271

@isidorn isidorn added the info-needed Issue requires more information from poster label Sep 8, 2017
@DatGuyJonathan
Copy link

@isidorn , I was using zero-based thread IDs which made clearThreads() in debugModel.ts remove all threads when I continue or thread-exit the first stopped thread.
https://github.com/Microsoft/vscode/blob/master/src/vs/workbench/parts/debug/common/debugModel.ts#L616

I can fix this on my side to use one-based ID. Maybe that if-statement should be updated as well :)

@isidorn
Copy link
Contributor

isidorn commented Sep 12, 2017

@DatGuyJonathan that if statement should be updated :)

@isidorn isidorn added bug Issue identified by VS Code Team member as probable bug and removed info-needed Issue requires more information from poster labels Sep 12, 2017
@isidorn isidorn added this to the September 2017 milestone Sep 12, 2017
@weinand weinand added the verified Verification succeeded label Sep 29, 2017
@weinand
Copy link
Contributor Author

weinand commented Sep 29, 2017

Verified by code inspection.

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug debug Debug viewlet, configurations, breakpoints, adapter issues verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

3 participants