diff --git a/src/vs/workbench/api/electron-browser/mainThreadDebugService.ts b/src/vs/workbench/api/electron-browser/mainThreadDebugService.ts index c5e3b642163..11014299ff5 100644 --- a/src/vs/workbench/api/electron-browser/mainThreadDebugService.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadDebugService.ts @@ -17,6 +17,7 @@ import { AbstractDebugAdapter } from 'vs/workbench/parts/debug/node/debugAdapter import * as paths from 'vs/base/common/paths'; import { IWorkspaceFolder } from 'vs/platform/workspace/common/workspace'; import { convertToVSCPaths, convertToDAPaths } from 'vs/workbench/parts/debug/common/debugUtils'; +import { deepClone } from 'vs/base/common/objects'; @extHostNamedCustomer(MainContext.MainThreadDebugService) @@ -298,7 +299,10 @@ class ExtensionHostDebugAdapter extends AbstractDebugAdapter { public sendMessage(message: DebugProtocol.ProtocolMessage): void { - convertToDAPaths(message, source => { + // since we modify Source.paths in the message in place, we need to make a copy of it (see #61129) + const msg = deepClone(message); + + convertToDAPaths(msg, source => { if (paths.isAbsolute(source.path)) { (source).path = uri.file(source.path); } else { @@ -306,7 +310,7 @@ class ExtensionHostDebugAdapter extends AbstractDebugAdapter { } }); - this._proxy.$sendDAMessage(this._handle, message); + this._proxy.$sendDAMessage(this._handle, msg); } public stopSession(): TPromise { diff --git a/src/vs/workbench/api/node/extHostDebugService.ts b/src/vs/workbench/api/node/extHostDebugService.ts index ba28777061f..46ee6e9e4aa 100644 --- a/src/vs/workbench/api/node/extHostDebugService.ts +++ b/src/vs/workbench/api/node/extHostDebugService.ts @@ -10,6 +10,7 @@ import { TPromise } from 'vs/base/common/winjs.base'; import { Event, Emitter } from 'vs/base/common/event'; import { asThenable } from 'vs/base/common/async'; import * as nls from 'vs/nls'; +import { deepClone } from 'vs/base/common/objects'; import { MainContext, MainThreadDebugServiceShape, ExtHostDebugServiceShape, DebugSessionUUID, IMainContext, IBreakpointsDeltaDto, ISourceMultiBreakpointDto, IFunctionBreakpointDto, IDebugSessionDto @@ -391,17 +392,21 @@ export class ExtHostDebugService implements ExtHostDebugServiceShape { da.onMessage(message => { + // since we modify Source.paths in the message in place, we need to make a copy of it (see #61129) + const msg = deepClone(message); + if (tracker) { - tracker.fromDebugAdapter(message); + tracker.fromDebugAdapter(msg); } // DA -> VS Code - convertToVSCPaths(message, source => { + convertToVSCPaths(msg, source => { if (paths.isAbsolute(source.path)) { (source).path = URI.file(source.path); } }); - mythis._debugServiceProxy.$acceptDAMessage(handle, message); + + mythis._debugServiceProxy.$acceptDAMessage(handle, msg); }); da.onError(err => { if (tracker) {