提交 73985154 编写于 作者: I isidor

debug: do not send breakpoints before the 'initialized' event

fixes #1702
上级 b0b8f17e
......@@ -774,7 +774,7 @@ export class DebugService extends ee.EventEmitter implements debug.IDebugService
}
private sendBreakpoints(modelUri: uri): Promise {
if (!this.session) {
if (!this.session || !this.session.readyForBreakpoints) {
return Promise.as(null);
}
......@@ -797,7 +797,7 @@ export class DebugService extends ee.EventEmitter implements debug.IDebugService
}
private sendExceptionBreakpoints(): Promise {
if (!this.session) {
if (!this.session || !this.session.readyForBreakpoints) {
return Promise.as(null);
}
......
......@@ -12,6 +12,7 @@ import debug = require('vs/workbench/parts/debug/common/debug');
export class V8Protocol extends ee.EventEmitter {
public emittedStopped: boolean;
public readyForBreakpoints: boolean;
protected flowEventsCount: number;
private static TWO_CRLF = '\r\n\r\n';
......@@ -26,6 +27,7 @@ export class V8Protocol extends ee.EventEmitter {
super();
this.flowEventsCount = 0;
this.emittedStopped = false;
this.readyForBreakpoints = false;
this.sequence = 1;
this.contentLength = -1;
this.pendingRequests = {};
......@@ -37,10 +39,14 @@ export class V8Protocol extends ee.EventEmitter {
if (eventType === debug.SessionEvents.STOPPED) {
this.emittedStopped = true;
}
if (eventType === debug.SessionEvents.INITIALIZED) {
this.readyForBreakpoints = true;
}
if (eventType === debug.SessionEvents.CONTINUED || eventType === debug.SessionEvents.STOPPED ||
eventType === debug.SessionEvents.DEBUGEE_TERMINATED || eventType === debug.SessionEvents.SERVER_EXIT) {
this.flowEventsCount++;
}
if (data) {
data.sessionId = this.getId();
} else {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册