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

Debug: continue action is broken when target app has multiple threads #6304

Closed
caslan opened this issue May 12, 2016 · 11 comments
Closed

Debug: continue action is broken when target app has multiple threads #6304

caslan opened this issue May 12, 2016 · 11 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug candidate Issue identified as probable candidate for fixing in the next release debug Debug viewlet, configurations, breakpoints, adapter issues important Issue identified as high-priority verified Verification succeeded

Comments

@caslan
Copy link

caslan commented May 12, 2016

We are seeing this issue with CppTools extension and CSharp extension with VS Code 1.1.0 (stable). It doesn't repro in VS Code 1.0.0.

One repro involving CSharp extension is:
Install VS Code 1.1.0
Install .NET CLI tools and CSharp extension per instructions here: https://github.com/gregg-miskelly/omnisharp-vscode/blob/daily-build-docs/debugger.md
Extract the attached project, do a "dotnet restore" on it
clisample.zip
Open the project folder in VS Code, put a bp in line 22
Start debugging
Hit the bp in line 22 multiple times until you have 2 threads running in the app
Remove the bp
Hit continue

The app continues but the VS Code UI thinks it is still in break mode.

@isidorn
Copy link
Contributor

isidorn commented May 12, 2016

The continue request from vscode always sends the threadID of the thread that should be continued.
Previously in vscode there was an issue that VSCode would react as if the continue continued all the threads. This has been fixed and due to this you are probably seeing this behavior. More details can be found here #1703 and here #5644 I pinged your team members in the issue so you are aware of the change.

So upon continue the debug adapter should only continue that specific thread, not all threads.
If this is not possible then we need to introduce some sort of capability that the debug adapter can specify to vscode that continue should always continue all the threads. @weinand and me are looking into this.

@isidorn isidorn added the debug Debug viewlet, configurations, breakpoints, adapter issues label May 12, 2016
@isidorn isidorn self-assigned this May 12, 2016
@MattGertz
Copy link

So, the 90% user scenario (I guess) is that all threads should continue. Can we revert to that behavior until a mechanism to support single vs. all is put into place & supported?

@delmyers
Copy link

I added this additional comment in #5643:

@isidorn, @jacdavis I think that the understanding of how Visual Studio works here is incorrect. The converse of your statement is actually the case. VS does not support pause/continue one. That is, VS is pause/continue all by default, and the AD7 based debuggers are all this way. For the C# debugger and C++ debugger, I think the request is really that the debugger makes the determination about how it will pause/continue debugging.

@edumunoz tested the original change, and didn't find an issue. Possibly, we missed this specific case, or it is harder to repro in C++ than it is in C#.

@MattGertz
Copy link

(Note -- I've looped.NET Core War as a potential release blocker; we haven't assessed yet.)

@jacdavis
Copy link

jacdavis commented May 12, 2016

Repost from the other thread.
All Visual Studio debuggers (and any debugger on windows using the win32 debug api) use the Stop All model. That is the native debuggers (visual studio, windbg) and the Clr debugger. That is, when a break event occurs, all threads are stopped by the OS before the debugger ever sees the event. A continue continues all threads in the process.

The only way to get into stop one mode on windows is for a user, to go to the threads window in break mode and pause the one thread they want stopped in break mode and then continue. While it would be nice to support a stop one model, it is not something we have ever received feedback from users as necessary. Doing this automatically would introduces huge changes in the way our debuggers would work since new debug events can now arrive while we're in break mode. This is especially heinous when we are performing function evaluations implicitly like we do in managed code.

What vsdiag wants is this: if the stopping event has all threads stopped set to true, continue all threads on continue. That is the behavior we implemented when we added the new flag to the stopped event that all threads are stopped.

@MattGertz
Copy link

Confirmed that this is a blocker for .NET Core scenarios & we will need a quick resolution, please.

@delmyers
Copy link

@jacdavis Just making a clarification, you said:

All Visual Studio debuggers (and any debugger on windows using the win32 debug api) use the Stop One

I think you meant:

All Visual Studio debuggers (and any debugger on windows using the win32 debug api) use the Stop All

@jacdavis
Copy link

Yes, I edited the text in both threads.

@weinand weinand added bug Issue identified by VS Code Team member as probable bug important Issue identified as high-priority candidate Issue identified as probable candidate for fixing in the next release labels May 12, 2016
@isidorn
Copy link
Contributor

isidorn commented May 12, 2016

We have changed the behavior such that the stop one / continue one is a special case for php. This is a temporary workaround, in the future we plan to let adapters specify what model they support.

I have triggered VSCode alpha builds and they should be out of the oven in around 20mins, please verify this fix solves the issue described.

Thanks

@hbenl
Copy link

hbenl commented May 16, 2016

The stop/continue all model breaks the debug adapter for Firefox - I need the stop/continue one model to support debugging WebWorkers. Could you please enable the stop/continue one model for the 'firefox' debug type or, even better, add a way for the debug adapter to specify which model it needs.

@egamma
Copy link
Member

egamma commented May 16, 2016

@hbenl issue extracted into #6400

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 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 candidate Issue identified as probable candidate for fixing in the next release debug Debug viewlet, configurations, breakpoints, adapter issues important Issue identified as high-priority verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

8 participants