clone DAP message before modifying it; fixes #61129

This commit is contained in:
Andre Weinand
2018-10-17 12:19:08 +02:00
parent d08e54002b
commit 1a348aa9f9
2 changed files with 14 additions and 5 deletions

View File

@@ -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)) {
(<any>source).path = URI.file(source.path);
}
});
mythis._debugServiceProxy.$acceptDAMessage(handle, message);
mythis._debugServiceProxy.$acceptDAMessage(handle, msg);
});
da.onError(err => {
if (tracker) {