-
Notifications
You must be signed in to change notification settings - Fork 30k
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
Fixes #3650: Support stop-all-threads mode debugging for multi-thread… #3990
Conversation
Hi @edumunoz, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution! TTYL, MSBOT; |
I changed my username on Github after linking my account with my corporate account. Hence it's asking for CLA. Anyway of re-triggering msftclas? I have already unlinked and re-linked my account again, so it shows the correct username on my corporate profile. |
@edumunoz, Thanks for signing the contribution license agreement so quickly! Actual humans will now validate the agreement and then evaluate the PR. |
From a debug protocol perspective I suggest to rename the @isidorn could you please review the PR from the front-end perspective. |
@edumunoz thanks for the PR. Concerns which I have regarding how model data is handled I will comment directly in the commits. |
I don't understand the change of this PR. Could someone please explain? |
@felixfbecker #3650 has more details |
Thanks for the feedback, @isidorn! I'll work through it and move the logic to @felixfbecker, we wanted to support multi-threading in the debug adapters in a more efficient way. |
5c1233e
to
3c10151
Compare
@isidorn, I updated the PR addressing your feedback, as well as adding some testing. For testing the existing debug adapters, on top of what is in brackets (which is the stuff that needs to be tested thoroughly), is there a standard list of stuff to test (e.g., list of stuff for breakpoints, list of stuff for step, etc.)? |
3c10151
to
8f26690
Compare
@edumunoz great! It looks much better now. I will add some comments directly in your commits. For testing, I would focus on the things in brackets, a smoke test of 'node' debugging with some focus on clicking in the call stack should do the trick. For 'go' and 'mono' focussing on threads makes most sense since changes here refactor how we deal with threads. Since the changes also touch the
I guess that you can already build your custom version of code. For testing 'mono' and 'go' you would need to install those extension in your custom built vscode, or just copy over those extensions to your userFolder.vscode-oss\extensions Here's a part of our smoke test that covers debugging, so doing something like this while focussing on the call stack would be best for 'node'. If you do not have access to out smoketest-express, taking any node app out there should do the trick. E.g https://github.com/bpasero/standup Debugging JavaScript
|
@isidorn For now we don't deal with multithreading, not sure if it's something we'll have to support. Thanks for the notification! cc @rkeithhill |
a44acce
to
29d3a19
Compare
* Indicates whether this thread is stopped. The callstack for stopped | ||
* threads can be retrieved from the debug adapter. | ||
*/ | ||
stopped: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stopped
doesn't necessarily need to be exposed. We could have two methods setRunning
and setStopped
that would set stopped
to false and true
, respectively.
I left it exposed so that the tests can check it. I'm fine removing stopped
from the interface and only have setters. Let me know what you think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having stopped
exposed like this is fine I think. It is a general property that other users of Thread
might be interested in the future. So I would leave it as it is.
@isidorn, thanks for your thorough review. In the end I went for exposing a non-promise based I left a couple of comments in 2 places to get your opinion. It would be great if you could give us the heads up today that the code looks good (bar very small changes), so we can spend more time testing the partner debug adapters thoroughly. Also, let me know if you'd like me to squash the commits after you review them. |
Ok, I'll review your newest changes today - and I will also comment on your older questions even though we decided to take the non-promise based Squashing the commits would be great! Edit: I went through the commits - and it looks really good to me! I left some comments in the code directly. Before testing make sure to merge with latest from master so we test the closest possible version to the one when we merge this PR in. On how to setup Go, Node, Mono in your built VSCode I quickly explained in my comment above, let me know if you have questions regarding this. |
@@ -134,18 +134,18 @@ export class DebugEditorModelManager implements IWorkbenchContribution { | |||
const result: editorcommon.IModelDeltaDecoration[] = []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like that there are not a lot of changes in this file now. Due to this we will not have to intensively test the UI changes in the editor (e.g. breakpoints).
@@ -7,6 +7,11 @@ import assert = require('assert'); | |||
import uri from 'vs/base/common/uri'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really happy for the tests.
f18af94
to
9d5f576
Compare
…ti-threaded programs Add a new flag to the StoppedEvent that will trigger the debug adapter to be queried for callstacks of the expanded threads in the callstack viewlet.
9d5f576
to
9af920e
Compare
@@ -624,11 +676,13 @@ export class Model extends ee.EventEmitter implements debug.IModel { | |||
|
|||
public sourceIsUnavailable(source: Source): void { | |||
Object.keys(this.threads).forEach(key => { | |||
this.threads[key].callStack.forEach(stackFrame => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For some reason I had missed updating this reference to callStack
.
Just pointing out what we have changed today that wasn't in yesterday's commit and you hadn't commented on.
@isidorn, I addressed your feedback from yesterday. For the existing debuggers, we tried that the behavior remains identical. Let us know if you need anything else from us. |
Looks good to me! Great work - merging! |
Fixes #3650: Support stop-all-threads mode debugging for multi-thread…
As discussed in #3650, this adds support for stop-all-threads mode by adding a flag to the StoppedEvent that the debug adapter sends. Here's the fix in action:
I tested this change with a basic multi-threaded program, and verified: