@codingame/monaco-vscode-debug-service-override 4.0.0 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/debug.js +4 -4
- package/package.json +2 -2
- package/external/rollup-plugin-styles/dist/runtime/inject-css.js +0 -3
- package/external/tslib/tslib.es6.js +0 -11
- package/override/vs/platform/dialogs/common/dialogs.js +0 -10
- package/vscode/src/vs/platform/debug/common/extensionHostDebugIpc.js +0 -73
- package/vscode/src/vs/workbench/contrib/debug/browser/callStackView.js +0 -1026
- package/vscode/src/vs/workbench/contrib/debug/browser/debug.contribution.js +0 -1004
- package/vscode/src/vs/workbench/contrib/debug/browser/debugANSIHandling.js +0 -347
- package/vscode/src/vs/workbench/contrib/debug/browser/debugActionViewItems.js +0 -337
- package/vscode/src/vs/workbench/contrib/debug/browser/debugAdapterManager.js +0 -432
- package/vscode/src/vs/workbench/contrib/debug/browser/debugCommands.js +0 -1039
- package/vscode/src/vs/workbench/contrib/debug/browser/debugConfigurationManager.js +0 -649
- package/vscode/src/vs/workbench/contrib/debug/browser/debugConsoleQuickAccess.js +0 -64
- package/vscode/src/vs/workbench/contrib/debug/browser/debugEditorActions.js +0 -636
- package/vscode/src/vs/workbench/contrib/debug/browser/debugEditorContribution.js +0 -740
- package/vscode/src/vs/workbench/contrib/debug/browser/debugHover.js +0 -408
- package/vscode/src/vs/workbench/contrib/debug/browser/debugMemory.js +0 -206
- package/vscode/src/vs/workbench/contrib/debug/browser/debugProgress.js +0 -80
- package/vscode/src/vs/workbench/contrib/debug/browser/debugQuickAccess.js +0 -169
- package/vscode/src/vs/workbench/contrib/debug/browser/debugService.js +0 -1271
- package/vscode/src/vs/workbench/contrib/debug/browser/debugSession.js +0 -1330
- package/vscode/src/vs/workbench/contrib/debug/browser/debugSessionPicker.js +0 -115
- package/vscode/src/vs/workbench/contrib/debug/browser/debugStatus.js +0 -77
- package/vscode/src/vs/workbench/contrib/debug/browser/debugTaskRunner.js +0 -307
- package/vscode/src/vs/workbench/contrib/debug/browser/debugTitle.js +0 -31
- package/vscode/src/vs/workbench/contrib/debug/browser/debugToolBar.js +0 -387
- package/vscode/src/vs/workbench/contrib/debug/browser/debugViewlet.js +0 -267
- package/vscode/src/vs/workbench/contrib/debug/browser/disassemblyView.js +0 -817
- package/vscode/src/vs/workbench/contrib/debug/browser/exceptionWidget.js +0 -131
- package/vscode/src/vs/workbench/contrib/debug/browser/extensionHostDebugService.js +0 -142
- package/vscode/src/vs/workbench/contrib/debug/browser/linkDetector.js +0 -262
- package/vscode/src/vs/workbench/contrib/debug/browser/loadedScriptsView.js +0 -669
- package/vscode/src/vs/workbench/contrib/debug/browser/media/debug.contribution.css.js +0 -6
- package/vscode/src/vs/workbench/contrib/debug/browser/media/debugHover.css.js +0 -6
- package/vscode/src/vs/workbench/contrib/debug/browser/media/debugToolBar.css.js +0 -6
- package/vscode/src/vs/workbench/contrib/debug/browser/media/debugViewlet.css.js +0 -6
- package/vscode/src/vs/workbench/contrib/debug/browser/media/exceptionWidget.css.js +0 -6
- package/vscode/src/vs/workbench/contrib/debug/browser/media/repl.css.js +0 -6
- package/vscode/src/vs/workbench/contrib/debug/browser/rawDebugSession.js +0 -709
- package/vscode/src/vs/workbench/contrib/debug/browser/repl.js +0 -1002
- package/vscode/src/vs/workbench/contrib/debug/browser/replFilter.js +0 -48
- package/vscode/src/vs/workbench/contrib/debug/browser/replViewer.js +0 -352
- package/vscode/src/vs/workbench/contrib/debug/browser/statusbarColorProvider.js +0 -129
- package/vscode/src/vs/workbench/contrib/debug/browser/variablesView.js +0 -734
- package/vscode/src/vs/workbench/contrib/debug/browser/watchExpressionsView.js +0 -501
- package/vscode/src/vs/workbench/contrib/debug/browser/welcomeView.js +0 -162
- package/vscode/src/vs/workbench/contrib/debug/common/breakpoints.js +0 -21
- package/vscode/src/vs/workbench/contrib/debug/common/debugCompoundRoot.js +0 -17
- package/vscode/src/vs/workbench/contrib/debug/common/debugContentProvider.js +0 -110
- package/vscode/src/vs/workbench/contrib/debug/common/debugLifecycle.js +0 -62
- package/vscode/src/vs/workbench/contrib/debug/common/debugSchemas.js +0 -460
- package/vscode/src/vs/workbench/contrib/debug/common/debugStorage.js +0 -166
- package/vscode/src/vs/workbench/contrib/debug/common/debugTelemetry.js +0 -36
- package/vscode/src/vs/workbench/contrib/debug/common/debugViewModel.js +0 -150
- package/vscode/src/vs/workbench/contrib/debug/common/debugger.js +0 -289
- package/vscode/src/vs/workbench/contrib/debug/common/loadedScriptsPicker.js +0 -87
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariableCommands.js +0 -64
- package/vscode/src/vs/workbench/services/configurationResolver/browser/baseConfigurationResolverService.js +0 -311
- package/vscode/src/vs/workbench/services/configurationResolver/browser/configurationResolverService.js +0 -29
|
@@ -1,709 +0,0 @@
|
|
|
1
|
-
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
-
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
3
|
-
import { Emitter } from 'vscode/vscode/vs/base/common/event';
|
|
4
|
-
import { mixin } from 'vscode/vscode/vs/base/common/objects';
|
|
5
|
-
import { toAction } from 'vscode/vscode/vs/base/common/actions';
|
|
6
|
-
import { CancellationError, ErrorNoTelemetry } from 'vscode/vscode/vs/base/common/errors';
|
|
7
|
-
import { createErrorWithActions } from 'vscode/vscode/vs/base/common/errorMessage';
|
|
8
|
-
import { isUri, formatPII } from 'vscode/vscode/vs/workbench/contrib/debug/common/debugUtils';
|
|
9
|
-
import { IExtensionHostDebugService } from 'vscode/vscode/vs/platform/debug/common/extensionHostDebug';
|
|
10
|
-
import { URI } from 'vscode/vscode/vs/base/common/uri';
|
|
11
|
-
import { IOpenerService } from 'vscode/vscode/vs/platform/opener/common/opener';
|
|
12
|
-
import { dispose } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
13
|
-
import { Severity, INotificationService } from 'vscode/vscode/vs/platform/notification/common/notification';
|
|
14
|
-
import '../../../../../../../override/vs/platform/dialogs/common/dialogs.js';
|
|
15
|
-
import { Schemas } from 'vscode/vscode/vs/base/common/network';
|
|
16
|
-
import { IDialogService } from 'vscode/vscode/vs/platform/dialogs/common/dialogs';
|
|
17
|
-
|
|
18
|
-
let RawDebugSession = class RawDebugSession {
|
|
19
|
-
constructor(debugAdapter, dbgr, sessionId, name, extensionHostDebugService, openerService, notificationService, dialogSerivce) {
|
|
20
|
-
this.dbgr = dbgr;
|
|
21
|
-
this.sessionId = sessionId;
|
|
22
|
-
this.name = name;
|
|
23
|
-
this.extensionHostDebugService = extensionHostDebugService;
|
|
24
|
-
this.openerService = openerService;
|
|
25
|
-
this.notificationService = notificationService;
|
|
26
|
-
this.dialogSerivce = dialogSerivce;
|
|
27
|
-
this.allThreadsContinued = true;
|
|
28
|
-
this._readyForBreakpoints = false;
|
|
29
|
-
this.debugAdapterStopped = false;
|
|
30
|
-
this.inShutdown = false;
|
|
31
|
-
this.terminated = false;
|
|
32
|
-
this.firedAdapterExitEvent = false;
|
|
33
|
-
this.startTime = 0;
|
|
34
|
-
this.didReceiveStoppedEvent = false;
|
|
35
|
-
this._onDidInitialize = ( new Emitter());
|
|
36
|
-
this._onDidStop = ( new Emitter());
|
|
37
|
-
this._onDidContinued = ( new Emitter());
|
|
38
|
-
this._onDidTerminateDebugee = ( new Emitter());
|
|
39
|
-
this._onDidExitDebugee = ( new Emitter());
|
|
40
|
-
this._onDidThread = ( new Emitter());
|
|
41
|
-
this._onDidOutput = ( new Emitter());
|
|
42
|
-
this._onDidBreakpoint = ( new Emitter());
|
|
43
|
-
this._onDidLoadedSource = ( new Emitter());
|
|
44
|
-
this._onDidProgressStart = ( new Emitter());
|
|
45
|
-
this._onDidProgressUpdate = ( new Emitter());
|
|
46
|
-
this._onDidProgressEnd = ( new Emitter());
|
|
47
|
-
this._onDidInvalidated = ( new Emitter());
|
|
48
|
-
this._onDidInvalidateMemory = ( new Emitter());
|
|
49
|
-
this._onDidCustomEvent = ( new Emitter());
|
|
50
|
-
this._onDidEvent = ( new Emitter());
|
|
51
|
-
this._onDidExitAdapter = ( new Emitter());
|
|
52
|
-
this.stoppedSinceLastStep = false;
|
|
53
|
-
this.toDispose = [];
|
|
54
|
-
this.debugAdapter = debugAdapter;
|
|
55
|
-
this._capabilities = Object.create(null);
|
|
56
|
-
this.toDispose.push(this.debugAdapter.onError(err => {
|
|
57
|
-
this.shutdown(err);
|
|
58
|
-
}));
|
|
59
|
-
this.toDispose.push(this.debugAdapter.onExit(code => {
|
|
60
|
-
if (code !== 0) {
|
|
61
|
-
this.shutdown(( new Error(`exit code: ${code}`)));
|
|
62
|
-
}
|
|
63
|
-
else {
|
|
64
|
-
this.shutdown();
|
|
65
|
-
}
|
|
66
|
-
}));
|
|
67
|
-
this.debugAdapter.onEvent(event => {
|
|
68
|
-
switch (event.event) {
|
|
69
|
-
case 'initialized':
|
|
70
|
-
this._readyForBreakpoints = true;
|
|
71
|
-
this._onDidInitialize.fire(event);
|
|
72
|
-
break;
|
|
73
|
-
case 'loadedSource':
|
|
74
|
-
this._onDidLoadedSource.fire(event);
|
|
75
|
-
break;
|
|
76
|
-
case 'capabilities':
|
|
77
|
-
if (event.body) {
|
|
78
|
-
const capabilities = event.body.capabilities;
|
|
79
|
-
this.mergeCapabilities(capabilities);
|
|
80
|
-
}
|
|
81
|
-
break;
|
|
82
|
-
case 'stopped':
|
|
83
|
-
this.didReceiveStoppedEvent = true;
|
|
84
|
-
this.stoppedSinceLastStep = true;
|
|
85
|
-
this._onDidStop.fire(event);
|
|
86
|
-
break;
|
|
87
|
-
case 'continued':
|
|
88
|
-
this.allThreadsContinued = event.body.allThreadsContinued === false ? false : true;
|
|
89
|
-
this._onDidContinued.fire(event);
|
|
90
|
-
break;
|
|
91
|
-
case 'thread':
|
|
92
|
-
this._onDidThread.fire(event);
|
|
93
|
-
break;
|
|
94
|
-
case 'output':
|
|
95
|
-
this._onDidOutput.fire(event);
|
|
96
|
-
break;
|
|
97
|
-
case 'breakpoint':
|
|
98
|
-
this._onDidBreakpoint.fire(event);
|
|
99
|
-
break;
|
|
100
|
-
case 'terminated':
|
|
101
|
-
this._onDidTerminateDebugee.fire(event);
|
|
102
|
-
break;
|
|
103
|
-
case 'exited':
|
|
104
|
-
this._onDidExitDebugee.fire(event);
|
|
105
|
-
break;
|
|
106
|
-
case 'progressStart':
|
|
107
|
-
this._onDidProgressStart.fire(event);
|
|
108
|
-
break;
|
|
109
|
-
case 'progressUpdate':
|
|
110
|
-
this._onDidProgressUpdate.fire(event);
|
|
111
|
-
break;
|
|
112
|
-
case 'progressEnd':
|
|
113
|
-
this._onDidProgressEnd.fire(event);
|
|
114
|
-
break;
|
|
115
|
-
case 'invalidated':
|
|
116
|
-
this._onDidInvalidated.fire(event);
|
|
117
|
-
break;
|
|
118
|
-
case 'memory':
|
|
119
|
-
this._onDidInvalidateMemory.fire(event);
|
|
120
|
-
break;
|
|
121
|
-
case 'process':
|
|
122
|
-
break;
|
|
123
|
-
case 'module':
|
|
124
|
-
break;
|
|
125
|
-
default:
|
|
126
|
-
this._onDidCustomEvent.fire(event);
|
|
127
|
-
break;
|
|
128
|
-
}
|
|
129
|
-
this._onDidEvent.fire(event);
|
|
130
|
-
});
|
|
131
|
-
this.debugAdapter.onRequest(request => this.dispatchRequest(request));
|
|
132
|
-
}
|
|
133
|
-
get isInShutdown() {
|
|
134
|
-
return this.inShutdown;
|
|
135
|
-
}
|
|
136
|
-
get onDidExitAdapter() {
|
|
137
|
-
return this._onDidExitAdapter.event;
|
|
138
|
-
}
|
|
139
|
-
get capabilities() {
|
|
140
|
-
return this._capabilities;
|
|
141
|
-
}
|
|
142
|
-
get readyForBreakpoints() {
|
|
143
|
-
return this._readyForBreakpoints;
|
|
144
|
-
}
|
|
145
|
-
get onDidInitialize() {
|
|
146
|
-
return this._onDidInitialize.event;
|
|
147
|
-
}
|
|
148
|
-
get onDidStop() {
|
|
149
|
-
return this._onDidStop.event;
|
|
150
|
-
}
|
|
151
|
-
get onDidContinued() {
|
|
152
|
-
return this._onDidContinued.event;
|
|
153
|
-
}
|
|
154
|
-
get onDidTerminateDebugee() {
|
|
155
|
-
return this._onDidTerminateDebugee.event;
|
|
156
|
-
}
|
|
157
|
-
get onDidExitDebugee() {
|
|
158
|
-
return this._onDidExitDebugee.event;
|
|
159
|
-
}
|
|
160
|
-
get onDidThread() {
|
|
161
|
-
return this._onDidThread.event;
|
|
162
|
-
}
|
|
163
|
-
get onDidOutput() {
|
|
164
|
-
return this._onDidOutput.event;
|
|
165
|
-
}
|
|
166
|
-
get onDidBreakpoint() {
|
|
167
|
-
return this._onDidBreakpoint.event;
|
|
168
|
-
}
|
|
169
|
-
get onDidLoadedSource() {
|
|
170
|
-
return this._onDidLoadedSource.event;
|
|
171
|
-
}
|
|
172
|
-
get onDidCustomEvent() {
|
|
173
|
-
return this._onDidCustomEvent.event;
|
|
174
|
-
}
|
|
175
|
-
get onDidProgressStart() {
|
|
176
|
-
return this._onDidProgressStart.event;
|
|
177
|
-
}
|
|
178
|
-
get onDidProgressUpdate() {
|
|
179
|
-
return this._onDidProgressUpdate.event;
|
|
180
|
-
}
|
|
181
|
-
get onDidProgressEnd() {
|
|
182
|
-
return this._onDidProgressEnd.event;
|
|
183
|
-
}
|
|
184
|
-
get onDidInvalidated() {
|
|
185
|
-
return this._onDidInvalidated.event;
|
|
186
|
-
}
|
|
187
|
-
get onDidInvalidateMemory() {
|
|
188
|
-
return this._onDidInvalidateMemory.event;
|
|
189
|
-
}
|
|
190
|
-
get onDidEvent() {
|
|
191
|
-
return this._onDidEvent.event;
|
|
192
|
-
}
|
|
193
|
-
async start() {
|
|
194
|
-
if (!this.debugAdapter) {
|
|
195
|
-
return Promise.reject(( new Error(( localizeWithPath(
|
|
196
|
-
'vs/workbench/contrib/debug/browser/rawDebugSession',
|
|
197
|
-
'noDebugAdapterStart',
|
|
198
|
-
"No debug adapter, can not start debug session."
|
|
199
|
-
)))));
|
|
200
|
-
}
|
|
201
|
-
await this.debugAdapter.startSession();
|
|
202
|
-
this.startTime = ( new Date()).getTime();
|
|
203
|
-
}
|
|
204
|
-
async initialize(args) {
|
|
205
|
-
const response = await this.send('initialize', args, undefined, undefined, false);
|
|
206
|
-
if (response) {
|
|
207
|
-
this.mergeCapabilities(response.body);
|
|
208
|
-
}
|
|
209
|
-
return response;
|
|
210
|
-
}
|
|
211
|
-
disconnect(args) {
|
|
212
|
-
const terminateDebuggee = this.capabilities.supportTerminateDebuggee ? args.terminateDebuggee : undefined;
|
|
213
|
-
const suspendDebuggee = this.capabilities.supportTerminateDebuggee && this.capabilities.supportSuspendDebuggee ? args.suspendDebuggee : undefined;
|
|
214
|
-
return this.shutdown(undefined, args.restart, terminateDebuggee, suspendDebuggee);
|
|
215
|
-
}
|
|
216
|
-
async launchOrAttach(config) {
|
|
217
|
-
const response = await this.send(config.request, config, undefined, undefined, false);
|
|
218
|
-
if (response) {
|
|
219
|
-
this.mergeCapabilities(response.body);
|
|
220
|
-
}
|
|
221
|
-
return response;
|
|
222
|
-
}
|
|
223
|
-
terminate(restart = false) {
|
|
224
|
-
if (this.capabilities.supportsTerminateRequest) {
|
|
225
|
-
if (!this.terminated) {
|
|
226
|
-
this.terminated = true;
|
|
227
|
-
return this.send('terminate', { restart }, undefined);
|
|
228
|
-
}
|
|
229
|
-
return this.disconnect({ terminateDebuggee: true, restart });
|
|
230
|
-
}
|
|
231
|
-
return Promise.reject(( new Error('terminated not supported')));
|
|
232
|
-
}
|
|
233
|
-
restart(args) {
|
|
234
|
-
if (this.capabilities.supportsRestartRequest) {
|
|
235
|
-
return this.send('restart', args);
|
|
236
|
-
}
|
|
237
|
-
return Promise.reject(( new Error('restart not supported')));
|
|
238
|
-
}
|
|
239
|
-
async next(args) {
|
|
240
|
-
this.stoppedSinceLastStep = false;
|
|
241
|
-
const response = await this.send('next', args);
|
|
242
|
-
if (!this.stoppedSinceLastStep) {
|
|
243
|
-
this.fireSimulatedContinuedEvent(args.threadId);
|
|
244
|
-
}
|
|
245
|
-
return response;
|
|
246
|
-
}
|
|
247
|
-
async stepIn(args) {
|
|
248
|
-
this.stoppedSinceLastStep = false;
|
|
249
|
-
const response = await this.send('stepIn', args);
|
|
250
|
-
if (!this.stoppedSinceLastStep) {
|
|
251
|
-
this.fireSimulatedContinuedEvent(args.threadId);
|
|
252
|
-
}
|
|
253
|
-
return response;
|
|
254
|
-
}
|
|
255
|
-
async stepOut(args) {
|
|
256
|
-
this.stoppedSinceLastStep = false;
|
|
257
|
-
const response = await this.send('stepOut', args);
|
|
258
|
-
if (!this.stoppedSinceLastStep) {
|
|
259
|
-
this.fireSimulatedContinuedEvent(args.threadId);
|
|
260
|
-
}
|
|
261
|
-
return response;
|
|
262
|
-
}
|
|
263
|
-
async continue(args) {
|
|
264
|
-
this.stoppedSinceLastStep = false;
|
|
265
|
-
const response = await this.send('continue', args);
|
|
266
|
-
if (response && response.body && response.body.allThreadsContinued !== undefined) {
|
|
267
|
-
this.allThreadsContinued = response.body.allThreadsContinued;
|
|
268
|
-
}
|
|
269
|
-
if (!this.stoppedSinceLastStep) {
|
|
270
|
-
this.fireSimulatedContinuedEvent(args.threadId, this.allThreadsContinued);
|
|
271
|
-
}
|
|
272
|
-
return response;
|
|
273
|
-
}
|
|
274
|
-
pause(args) {
|
|
275
|
-
return this.send('pause', args);
|
|
276
|
-
}
|
|
277
|
-
terminateThreads(args) {
|
|
278
|
-
if (this.capabilities.supportsTerminateThreadsRequest) {
|
|
279
|
-
return this.send('terminateThreads', args);
|
|
280
|
-
}
|
|
281
|
-
return Promise.reject(( new Error('terminateThreads not supported')));
|
|
282
|
-
}
|
|
283
|
-
setVariable(args) {
|
|
284
|
-
if (this.capabilities.supportsSetVariable) {
|
|
285
|
-
return this.send('setVariable', args);
|
|
286
|
-
}
|
|
287
|
-
return Promise.reject(( new Error('setVariable not supported')));
|
|
288
|
-
}
|
|
289
|
-
setExpression(args) {
|
|
290
|
-
if (this.capabilities.supportsSetExpression) {
|
|
291
|
-
return this.send('setExpression', args);
|
|
292
|
-
}
|
|
293
|
-
return Promise.reject(( new Error('setExpression not supported')));
|
|
294
|
-
}
|
|
295
|
-
async restartFrame(args, threadId) {
|
|
296
|
-
if (this.capabilities.supportsRestartFrame) {
|
|
297
|
-
this.stoppedSinceLastStep = false;
|
|
298
|
-
const response = await this.send('restartFrame', args);
|
|
299
|
-
if (!this.stoppedSinceLastStep) {
|
|
300
|
-
this.fireSimulatedContinuedEvent(threadId);
|
|
301
|
-
}
|
|
302
|
-
return response;
|
|
303
|
-
}
|
|
304
|
-
return Promise.reject(( new Error('restartFrame not supported')));
|
|
305
|
-
}
|
|
306
|
-
stepInTargets(args) {
|
|
307
|
-
if (this.capabilities.supportsStepInTargetsRequest) {
|
|
308
|
-
return this.send('stepInTargets', args);
|
|
309
|
-
}
|
|
310
|
-
return Promise.reject(( new Error('stepInTargets not supported')));
|
|
311
|
-
}
|
|
312
|
-
completions(args, token) {
|
|
313
|
-
if (this.capabilities.supportsCompletionsRequest) {
|
|
314
|
-
return this.send('completions', args, token);
|
|
315
|
-
}
|
|
316
|
-
return Promise.reject(( new Error('completions not supported')));
|
|
317
|
-
}
|
|
318
|
-
setBreakpoints(args) {
|
|
319
|
-
return this.send('setBreakpoints', args);
|
|
320
|
-
}
|
|
321
|
-
setFunctionBreakpoints(args) {
|
|
322
|
-
if (this.capabilities.supportsFunctionBreakpoints) {
|
|
323
|
-
return this.send('setFunctionBreakpoints', args);
|
|
324
|
-
}
|
|
325
|
-
return Promise.reject(( new Error('setFunctionBreakpoints not supported')));
|
|
326
|
-
}
|
|
327
|
-
dataBreakpointInfo(args) {
|
|
328
|
-
if (this.capabilities.supportsDataBreakpoints) {
|
|
329
|
-
return this.send('dataBreakpointInfo', args);
|
|
330
|
-
}
|
|
331
|
-
return Promise.reject(( new Error('dataBreakpointInfo not supported')));
|
|
332
|
-
}
|
|
333
|
-
setDataBreakpoints(args) {
|
|
334
|
-
if (this.capabilities.supportsDataBreakpoints) {
|
|
335
|
-
return this.send('setDataBreakpoints', args);
|
|
336
|
-
}
|
|
337
|
-
return Promise.reject(( new Error('setDataBreakpoints not supported')));
|
|
338
|
-
}
|
|
339
|
-
setExceptionBreakpoints(args) {
|
|
340
|
-
return this.send('setExceptionBreakpoints', args);
|
|
341
|
-
}
|
|
342
|
-
breakpointLocations(args) {
|
|
343
|
-
if (this.capabilities.supportsBreakpointLocationsRequest) {
|
|
344
|
-
return this.send('breakpointLocations', args);
|
|
345
|
-
}
|
|
346
|
-
return Promise.reject(( new Error('breakpointLocations is not supported')));
|
|
347
|
-
}
|
|
348
|
-
configurationDone() {
|
|
349
|
-
if (this.capabilities.supportsConfigurationDoneRequest) {
|
|
350
|
-
return this.send('configurationDone', null);
|
|
351
|
-
}
|
|
352
|
-
return Promise.reject(( new Error('configurationDone not supported')));
|
|
353
|
-
}
|
|
354
|
-
stackTrace(args, token) {
|
|
355
|
-
return this.send('stackTrace', args, token);
|
|
356
|
-
}
|
|
357
|
-
exceptionInfo(args) {
|
|
358
|
-
if (this.capabilities.supportsExceptionInfoRequest) {
|
|
359
|
-
return this.send('exceptionInfo', args);
|
|
360
|
-
}
|
|
361
|
-
return Promise.reject(( new Error('exceptionInfo not supported')));
|
|
362
|
-
}
|
|
363
|
-
scopes(args, token) {
|
|
364
|
-
return this.send('scopes', args, token);
|
|
365
|
-
}
|
|
366
|
-
variables(args, token) {
|
|
367
|
-
return this.send('variables', args, token);
|
|
368
|
-
}
|
|
369
|
-
source(args) {
|
|
370
|
-
return this.send('source', args);
|
|
371
|
-
}
|
|
372
|
-
loadedSources(args) {
|
|
373
|
-
if (this.capabilities.supportsLoadedSourcesRequest) {
|
|
374
|
-
return this.send('loadedSources', args);
|
|
375
|
-
}
|
|
376
|
-
return Promise.reject(( new Error('loadedSources not supported')));
|
|
377
|
-
}
|
|
378
|
-
threads() {
|
|
379
|
-
return this.send('threads', null);
|
|
380
|
-
}
|
|
381
|
-
evaluate(args) {
|
|
382
|
-
return this.send('evaluate', args);
|
|
383
|
-
}
|
|
384
|
-
async stepBack(args) {
|
|
385
|
-
if (this.capabilities.supportsStepBack) {
|
|
386
|
-
this.stoppedSinceLastStep = false;
|
|
387
|
-
const response = await this.send('stepBack', args);
|
|
388
|
-
if (!this.stoppedSinceLastStep) {
|
|
389
|
-
this.fireSimulatedContinuedEvent(args.threadId);
|
|
390
|
-
}
|
|
391
|
-
return response;
|
|
392
|
-
}
|
|
393
|
-
return Promise.reject(( new Error('stepBack not supported')));
|
|
394
|
-
}
|
|
395
|
-
async reverseContinue(args) {
|
|
396
|
-
if (this.capabilities.supportsStepBack) {
|
|
397
|
-
this.stoppedSinceLastStep = false;
|
|
398
|
-
const response = await this.send('reverseContinue', args);
|
|
399
|
-
if (!this.stoppedSinceLastStep) {
|
|
400
|
-
this.fireSimulatedContinuedEvent(args.threadId);
|
|
401
|
-
}
|
|
402
|
-
return response;
|
|
403
|
-
}
|
|
404
|
-
return Promise.reject(( new Error('reverseContinue not supported')));
|
|
405
|
-
}
|
|
406
|
-
gotoTargets(args) {
|
|
407
|
-
if (this.capabilities.supportsGotoTargetsRequest) {
|
|
408
|
-
return this.send('gotoTargets', args);
|
|
409
|
-
}
|
|
410
|
-
return Promise.reject(( new Error('gotoTargets is not supported')));
|
|
411
|
-
}
|
|
412
|
-
async goto(args) {
|
|
413
|
-
if (this.capabilities.supportsGotoTargetsRequest) {
|
|
414
|
-
this.stoppedSinceLastStep = false;
|
|
415
|
-
const response = await this.send('goto', args);
|
|
416
|
-
if (!this.stoppedSinceLastStep) {
|
|
417
|
-
this.fireSimulatedContinuedEvent(args.threadId);
|
|
418
|
-
}
|
|
419
|
-
return response;
|
|
420
|
-
}
|
|
421
|
-
return Promise.reject(( new Error('goto is not supported')));
|
|
422
|
-
}
|
|
423
|
-
async setInstructionBreakpoints(args) {
|
|
424
|
-
if (this.capabilities.supportsInstructionBreakpoints) {
|
|
425
|
-
return await this.send('setInstructionBreakpoints', args);
|
|
426
|
-
}
|
|
427
|
-
return Promise.reject(( new Error('setInstructionBreakpoints is not supported')));
|
|
428
|
-
}
|
|
429
|
-
async disassemble(args) {
|
|
430
|
-
if (this.capabilities.supportsDisassembleRequest) {
|
|
431
|
-
return await this.send('disassemble', args);
|
|
432
|
-
}
|
|
433
|
-
return Promise.reject(( new Error('disassemble is not supported')));
|
|
434
|
-
}
|
|
435
|
-
async readMemory(args) {
|
|
436
|
-
if (this.capabilities.supportsReadMemoryRequest) {
|
|
437
|
-
return await this.send('readMemory', args);
|
|
438
|
-
}
|
|
439
|
-
return Promise.reject(( new Error('readMemory is not supported')));
|
|
440
|
-
}
|
|
441
|
-
async writeMemory(args) {
|
|
442
|
-
if (this.capabilities.supportsWriteMemoryRequest) {
|
|
443
|
-
return await this.send('writeMemory', args);
|
|
444
|
-
}
|
|
445
|
-
return Promise.reject(( new Error('writeMemory is not supported')));
|
|
446
|
-
}
|
|
447
|
-
cancel(args) {
|
|
448
|
-
return this.send('cancel', args);
|
|
449
|
-
}
|
|
450
|
-
custom(request, args) {
|
|
451
|
-
return this.send(request, args);
|
|
452
|
-
}
|
|
453
|
-
async shutdown(error, restart = false, terminateDebuggee = undefined, suspendDebuggee = undefined) {
|
|
454
|
-
if (!this.inShutdown) {
|
|
455
|
-
this.inShutdown = true;
|
|
456
|
-
if (this.debugAdapter) {
|
|
457
|
-
try {
|
|
458
|
-
const args = { restart };
|
|
459
|
-
if (typeof terminateDebuggee === 'boolean') {
|
|
460
|
-
args.terminateDebuggee = terminateDebuggee;
|
|
461
|
-
}
|
|
462
|
-
if (typeof suspendDebuggee === 'boolean') {
|
|
463
|
-
args.suspendDebuggee = suspendDebuggee;
|
|
464
|
-
}
|
|
465
|
-
await this.send('disconnect', args, undefined, error ? 200 : 2000);
|
|
466
|
-
}
|
|
467
|
-
catch (e) {
|
|
468
|
-
}
|
|
469
|
-
finally {
|
|
470
|
-
await this.stopAdapter(error);
|
|
471
|
-
}
|
|
472
|
-
}
|
|
473
|
-
else {
|
|
474
|
-
return this.stopAdapter(error);
|
|
475
|
-
}
|
|
476
|
-
}
|
|
477
|
-
}
|
|
478
|
-
async stopAdapter(error) {
|
|
479
|
-
try {
|
|
480
|
-
if (this.debugAdapter) {
|
|
481
|
-
const da = this.debugAdapter;
|
|
482
|
-
this.debugAdapter = null;
|
|
483
|
-
await da.stopSession();
|
|
484
|
-
this.debugAdapterStopped = true;
|
|
485
|
-
}
|
|
486
|
-
}
|
|
487
|
-
finally {
|
|
488
|
-
this.fireAdapterExitEvent(error);
|
|
489
|
-
}
|
|
490
|
-
}
|
|
491
|
-
fireAdapterExitEvent(error) {
|
|
492
|
-
if (!this.firedAdapterExitEvent) {
|
|
493
|
-
this.firedAdapterExitEvent = true;
|
|
494
|
-
const e = {
|
|
495
|
-
emittedStopped: this.didReceiveStoppedEvent,
|
|
496
|
-
sessionLengthInSeconds: (( new Date()).getTime() - this.startTime) / 1000
|
|
497
|
-
};
|
|
498
|
-
if (error && !this.debugAdapterStopped) {
|
|
499
|
-
e.error = error;
|
|
500
|
-
}
|
|
501
|
-
this._onDidExitAdapter.fire(e);
|
|
502
|
-
}
|
|
503
|
-
}
|
|
504
|
-
async dispatchRequest(request) {
|
|
505
|
-
const response = {
|
|
506
|
-
type: 'response',
|
|
507
|
-
seq: 0,
|
|
508
|
-
command: request.command,
|
|
509
|
-
request_seq: request.seq,
|
|
510
|
-
success: true
|
|
511
|
-
};
|
|
512
|
-
const safeSendResponse = (response) => this.debugAdapter && this.debugAdapter.sendResponse(response);
|
|
513
|
-
if (request.command === 'launchVSCode') {
|
|
514
|
-
try {
|
|
515
|
-
let result = await this.launchVsCode(request.arguments);
|
|
516
|
-
if (!result.success) {
|
|
517
|
-
const { confirmed } = await this.dialogSerivce.confirm({
|
|
518
|
-
type: Severity.Warning,
|
|
519
|
-
message: ( localizeWithPath(
|
|
520
|
-
'vs/workbench/contrib/debug/browser/rawDebugSession',
|
|
521
|
-
'canNotStart',
|
|
522
|
-
"The debugger needs to open a new tab or window for the debuggee but the browser prevented this. You must give permission to continue."
|
|
523
|
-
)),
|
|
524
|
-
primaryButton: ( localizeWithPath(
|
|
525
|
-
'vs/workbench/contrib/debug/browser/rawDebugSession',
|
|
526
|
-
{ key: 'continue', comment: ['&& denotes a mnemonic'] },
|
|
527
|
-
"&&Continue"
|
|
528
|
-
))
|
|
529
|
-
});
|
|
530
|
-
if (confirmed) {
|
|
531
|
-
result = await this.launchVsCode(request.arguments);
|
|
532
|
-
}
|
|
533
|
-
else {
|
|
534
|
-
response.success = false;
|
|
535
|
-
safeSendResponse(response);
|
|
536
|
-
await this.shutdown();
|
|
537
|
-
}
|
|
538
|
-
}
|
|
539
|
-
response.body = {
|
|
540
|
-
rendererDebugPort: result.rendererDebugPort,
|
|
541
|
-
};
|
|
542
|
-
safeSendResponse(response);
|
|
543
|
-
}
|
|
544
|
-
catch (err) {
|
|
545
|
-
response.success = false;
|
|
546
|
-
response.message = err.message;
|
|
547
|
-
safeSendResponse(response);
|
|
548
|
-
}
|
|
549
|
-
}
|
|
550
|
-
else if (request.command === 'runInTerminal') {
|
|
551
|
-
try {
|
|
552
|
-
const shellProcessId = await this.dbgr.runInTerminal(request.arguments, this.sessionId);
|
|
553
|
-
const resp = response;
|
|
554
|
-
resp.body = {};
|
|
555
|
-
if (typeof shellProcessId === 'number') {
|
|
556
|
-
resp.body.shellProcessId = shellProcessId;
|
|
557
|
-
}
|
|
558
|
-
safeSendResponse(resp);
|
|
559
|
-
}
|
|
560
|
-
catch (err) {
|
|
561
|
-
response.success = false;
|
|
562
|
-
response.message = err.message;
|
|
563
|
-
safeSendResponse(response);
|
|
564
|
-
}
|
|
565
|
-
}
|
|
566
|
-
else if (request.command === 'startDebugging') {
|
|
567
|
-
try {
|
|
568
|
-
const args = request.arguments;
|
|
569
|
-
const config = {
|
|
570
|
-
...args.configuration,
|
|
571
|
-
...{
|
|
572
|
-
request: args.request,
|
|
573
|
-
type: this.dbgr.type,
|
|
574
|
-
name: args.configuration.name || this.name
|
|
575
|
-
}
|
|
576
|
-
};
|
|
577
|
-
const success = await this.dbgr.startDebugging(config, this.sessionId);
|
|
578
|
-
if (success) {
|
|
579
|
-
safeSendResponse(response);
|
|
580
|
-
}
|
|
581
|
-
else {
|
|
582
|
-
response.success = false;
|
|
583
|
-
response.message = 'Failed to start debugging';
|
|
584
|
-
safeSendResponse(response);
|
|
585
|
-
}
|
|
586
|
-
}
|
|
587
|
-
catch (err) {
|
|
588
|
-
response.success = false;
|
|
589
|
-
response.message = err.message;
|
|
590
|
-
safeSendResponse(response);
|
|
591
|
-
}
|
|
592
|
-
}
|
|
593
|
-
else {
|
|
594
|
-
response.success = false;
|
|
595
|
-
response.message = `unknown request '${request.command}'`;
|
|
596
|
-
safeSendResponse(response);
|
|
597
|
-
}
|
|
598
|
-
}
|
|
599
|
-
launchVsCode(vscodeArgs) {
|
|
600
|
-
const args = [];
|
|
601
|
-
for (const arg of vscodeArgs.args) {
|
|
602
|
-
const a2 = (arg.prefix || '') + (arg.path || '');
|
|
603
|
-
const match = /^--(.+)=(.+)$/.exec(a2);
|
|
604
|
-
if (match && match.length === 3) {
|
|
605
|
-
const key = match[1];
|
|
606
|
-
let value = match[2];
|
|
607
|
-
if ((key === 'file-uri' || key === 'folder-uri') && !isUri(arg.path)) {
|
|
608
|
-
value = isUri(value) ? value : ( URI.file(value).toString());
|
|
609
|
-
}
|
|
610
|
-
args.push(`--${key}=${value}`);
|
|
611
|
-
}
|
|
612
|
-
else {
|
|
613
|
-
args.push(a2);
|
|
614
|
-
}
|
|
615
|
-
}
|
|
616
|
-
if (vscodeArgs.env) {
|
|
617
|
-
args.push(`--extensionEnvironment=${JSON.stringify(vscodeArgs.env)}`);
|
|
618
|
-
}
|
|
619
|
-
return this.extensionHostDebugService.openExtensionDevelopmentHostWindow(args, !!vscodeArgs.debugRenderer);
|
|
620
|
-
}
|
|
621
|
-
send(command, args, token, timeout, showErrors = true) {
|
|
622
|
-
return ( new Promise((completeDispatch, errorDispatch) => {
|
|
623
|
-
if (!this.debugAdapter) {
|
|
624
|
-
if (this.inShutdown) {
|
|
625
|
-
completeDispatch(undefined);
|
|
626
|
-
}
|
|
627
|
-
else {
|
|
628
|
-
errorDispatch(( new Error(( localizeWithPath(
|
|
629
|
-
'vs/workbench/contrib/debug/browser/rawDebugSession',
|
|
630
|
-
'noDebugAdapter',
|
|
631
|
-
"No debugger available found. Can not send '{0}'.",
|
|
632
|
-
command
|
|
633
|
-
)))));
|
|
634
|
-
}
|
|
635
|
-
return;
|
|
636
|
-
}
|
|
637
|
-
let cancelationListener;
|
|
638
|
-
const requestId = this.debugAdapter.sendRequest(command, args, (response) => {
|
|
639
|
-
cancelationListener?.dispose();
|
|
640
|
-
if (response.success) {
|
|
641
|
-
completeDispatch(response);
|
|
642
|
-
}
|
|
643
|
-
else {
|
|
644
|
-
errorDispatch(response);
|
|
645
|
-
}
|
|
646
|
-
}, timeout);
|
|
647
|
-
if (token) {
|
|
648
|
-
cancelationListener = token.onCancellationRequested(() => {
|
|
649
|
-
cancelationListener.dispose();
|
|
650
|
-
if (this.capabilities.supportsCancelRequest) {
|
|
651
|
-
this.cancel({ requestId });
|
|
652
|
-
}
|
|
653
|
-
});
|
|
654
|
-
}
|
|
655
|
-
})).then(undefined, err => Promise.reject(this.handleErrorResponse(err, showErrors)));
|
|
656
|
-
}
|
|
657
|
-
handleErrorResponse(errorResponse, showErrors) {
|
|
658
|
-
if (errorResponse.command === 'canceled' && errorResponse.message === 'canceled') {
|
|
659
|
-
return new CancellationError();
|
|
660
|
-
}
|
|
661
|
-
const error = errorResponse?.body?.error;
|
|
662
|
-
const errorMessage = errorResponse?.message || '';
|
|
663
|
-
const userMessage = error ? formatPII(error.format, false, error.variables) : errorMessage;
|
|
664
|
-
const url = error?.url;
|
|
665
|
-
if (error && url) {
|
|
666
|
-
const label = error.urlLabel ? error.urlLabel : ( localizeWithPath(
|
|
667
|
-
'vs/workbench/contrib/debug/browser/rawDebugSession',
|
|
668
|
-
'moreInfo',
|
|
669
|
-
"More Info"
|
|
670
|
-
));
|
|
671
|
-
const uri = ( URI.parse(url));
|
|
672
|
-
const actionId = uri.scheme === Schemas.command ? 'debug.moreInfo.command' : 'debug.moreInfo';
|
|
673
|
-
return createErrorWithActions(userMessage, [toAction({ id: actionId, label, run: () => this.openerService.open(uri, { allowCommands: true }) })]);
|
|
674
|
-
}
|
|
675
|
-
if (showErrors && error && error.format && error.showUser) {
|
|
676
|
-
this.notificationService.error(userMessage);
|
|
677
|
-
}
|
|
678
|
-
const result = new ErrorNoTelemetry(userMessage);
|
|
679
|
-
result.showUser = error?.showUser;
|
|
680
|
-
return result;
|
|
681
|
-
}
|
|
682
|
-
mergeCapabilities(capabilities) {
|
|
683
|
-
if (capabilities) {
|
|
684
|
-
this._capabilities = mixin(this._capabilities, capabilities);
|
|
685
|
-
}
|
|
686
|
-
}
|
|
687
|
-
fireSimulatedContinuedEvent(threadId, allThreadsContinued = false) {
|
|
688
|
-
this._onDidContinued.fire({
|
|
689
|
-
type: 'event',
|
|
690
|
-
event: 'continued',
|
|
691
|
-
body: {
|
|
692
|
-
threadId,
|
|
693
|
-
allThreadsContinued
|
|
694
|
-
},
|
|
695
|
-
seq: undefined
|
|
696
|
-
});
|
|
697
|
-
}
|
|
698
|
-
dispose() {
|
|
699
|
-
dispose(this.toDispose);
|
|
700
|
-
}
|
|
701
|
-
};
|
|
702
|
-
RawDebugSession = ( __decorate([
|
|
703
|
-
( __param(4, IExtensionHostDebugService)),
|
|
704
|
-
( __param(5, IOpenerService)),
|
|
705
|
-
( __param(6, INotificationService)),
|
|
706
|
-
( __param(7, IDialogService))
|
|
707
|
-
], RawDebugSession));
|
|
708
|
-
|
|
709
|
-
export { RawDebugSession };
|