diff --git a/src/vs/workbench/parts/debug/common/debug.ts b/src/vs/workbench/parts/debug/common/debug.ts index de3f75121506441ad7e016d11c3d5923250774eb..c81a373bec4261153b68b77e709963f9f59abdd3 100644 --- a/src/vs/workbench/parts/debug/common/debug.ts +++ b/src/vs/workbench/parts/debug/common/debug.ts @@ -82,11 +82,13 @@ export interface IBreakpoint extends IEnablement { desiredLineNumber: number; condition: string; verified: boolean; + idFromAdapter: number; } export interface IFunctionBreakpoint extends IEnablement { name: string; verified: boolean; + idFromAdapter: number; } export interface IExceptionBreakpoint extends IEnablement { diff --git a/src/vs/workbench/parts/debug/common/debugModel.ts b/src/vs/workbench/parts/debug/common/debugModel.ts index 76c03079962b3b597bd81079ca4fa6b8ccb826b4..baf62f2c001101c897434f0b2980320ea9a4f6a0 100644 --- a/src/vs/workbench/parts/debug/common/debugModel.ts +++ b/src/vs/workbench/parts/debug/common/debugModel.ts @@ -282,6 +282,7 @@ export class Breakpoint implements debug.IBreakpoint { public lineNumber: number; public verified: boolean; + public idFromAdapter: number; private id: string; constructor(public source: Source, public desiredLineNumber: number, public enabled: boolean, public condition: string) { @@ -302,6 +303,7 @@ export class FunctionBreakpoint implements debug.IFunctionBreakpoint { private id: string; public verified: boolean; + public idFromAdapter: number; constructor(public name: string, public enabled: boolean) { this.verified = false; @@ -412,6 +414,7 @@ export class Model extends ee.EventEmitter implements debug.IModel { if (bpData) { bp.lineNumber = bpData.line; bp.verified = bpData.verified; + bp.idFromAdapter = bpData.id; } }); this.emit(debug.ModelEvents.BREAKPOINTS_UPDATED); @@ -447,12 +450,13 @@ export class Model extends ee.EventEmitter implements debug.IModel { this.emit(debug.ModelEvents.BREAKPOINTS_UPDATED); } - public updateFunctionBreakpoints(data: { [id: string]: { name?: string, verified?: boolean } }): void { + public updateFunctionBreakpoints(data: { [id: string]: { name?: string, verified?: boolean; id?: number } }): void { this.functionBreakpoints.forEach(fbp => { const fbpData = data[fbp.getId()]; if (fbpData) { fbp.name = fbpData.name || fbp.name; fbp.verified = fbpData.verified; + fbp.idFromAdapter = fbpData.id; } }); diff --git a/src/vs/workbench/parts/debug/electron-browser/debugService.ts b/src/vs/workbench/parts/debug/electron-browser/debugService.ts index ab5b55da2159db01e04dac87d87e81f85c46c3a8..852be2d75ceb19ce0295e72f4a716ef0f28ad05a 100644 --- a/src/vs/workbench/parts/debug/electron-browser/debugService.ts +++ b/src/vs/workbench/parts/debug/electron-browser/debugService.ts @@ -291,11 +291,11 @@ export class DebugService extends ee.EventEmitter implements debug.IDebugService this.toDispose.push(this.session.addListener2(debug.SessionEvents.BREAKPOINT, (event: DebugProtocol.BreakpointEvent) => { const id = event.body && event.body.breakpoint ? event.body.breakpoint.id : undefined; - const breakpoint = this.model.getBreakpoints().filter(bp => bp.getId() === id).pop(); + const breakpoint = this.model.getBreakpoints().filter(bp => bp.idFromAdapter === id).pop(); if (breakpoint) { this.model.updateBreakpoints({ [breakpoint.getId()]: event.body.breakpoint }); } else { - const functionBreakpoint = this.model.getFunctionBreakpoints().filter(bp => bp.getId() === id).pop(); + const functionBreakpoint = this.model.getFunctionBreakpoints().filter(bp => bp.idFromAdapter === id).pop(); if (functionBreakpoint) { this.model.updateFunctionBreakpoints({ [functionBreakpoint.getId()]: event.body.breakpoint }); }