-
Notifications
You must be signed in to change notification settings - Fork 79
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
How can a debug adapter know if VS Code has finished sending all breakpoints? #4
Comments
So I found this in the Go adapter protected setExceptionBreakPointsRequest(response: DebugProtocol.SetExceptionBreakpointsResponse, args: DebugProtocol.SetExceptionBreakpointsArguments): void {
console.log("ExceptionBreakPointsRequest");
// Wow - this is subtle - it appears that this event will always get
// sent during intiail breakpoint initialization even if there are not
// user breakpoints - so we use this as the indicator to signal
// that breakpoints have been set and we can continue
this.signalInitialBreakpointsSet();
this.sendResponse(response);
console.log("ExceptionBreakPointsResponse");
} is this the right approach? |
FWIW - the implementation in the Go debug adapter is based on https://github.com/Microsoft/vscode-node-debug/blob/master/src/node/nodeDebug.ts#L1117, which triggers the completion of the the debug session initialization during the It's certainly subtle that this would be the (only?) way to be sure you are ready to complete the initialization of the debug session. |
@felixfbecker @lukehoban atm the only (correct) way to know that all persisted breakpoints have been sent to the debug adapter is to wait for the next non- The reason why there is currently no better way to do this, is that the mono debug adapter and the gdb debug adapter both request the breakpoints before a I propose that we add a new request that indicates the end of the "initialize" phase. |
@weinand I also think there should be a seperate request. So, for my debug adapter that is derived from the node DebugSession class, is there any event that gets fired for all requests, that I can bind to, so I can check if it's the first non-breakpoint request? I dont want to add that check to every single one of my request methods. Should I overwrite dispatchRequest with that check and a call to super? And just curious, how can a debugadapter run before there is a launch request?! |
@felixfbecker, @lukehoban I'm going to add a new request Any objections or suggestions for a better name? |
@weinand I think it's great 👍 Just to clarify, the sequence is
But it would never get sent after a normal |
@felixfbecker yes, your sequence is correct and since ConfigurationDoneRequest is a reaction to the InitializedEvent (and not the SetBreakpointsRequest), it will not be sent after a 'normal' SetBreakpointRequest. |
👍 |
before this can be used, VS Code has to adapt first. I've created microsoft/vscode#1828 for tracking this. |
microsoft/vscode#1828 is fixed. However, since old debug adapters are not implementing the new ConfigurationDoneRequest, they now produce an error on the dev tools console. This error is not visible to the user but is annoying anyway. We should use feature #9 to only send the ConfigurationDoneRequest for debug-adapters that support it. |
setBreakpointsRequest
gets called for every source file that has break points. I have to register them to the debugger engine and then issue a run command to the debugger engine. But ifsetBreakpointsRequest
is called multiple times, how can I ever know if that was it or if there are still more break points in more source files coming? How can I know when to tell the debugger engine to actually run the program?The text was updated successfully, but these errors were encountered: