@codingame/monaco-vscode-debug-service-override 24.2.0 → 25.0.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/package.json +2 -2
- package/vscode/src/vs/workbench/contrib/debug/browser/callStackView.js +16 -16
- package/vscode/src/vs/workbench/contrib/debug/browser/debug.contribution.js +121 -112
- package/vscode/src/vs/workbench/contrib/debug/browser/debugAdapterManager.js +12 -12
- package/vscode/src/vs/workbench/contrib/debug/browser/debugChatIntegration.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/debug/browser/debugChatIntegration.js +14 -14
- package/vscode/src/vs/workbench/contrib/debug/browser/debugConfigurationManager.js +5 -5
- package/vscode/src/vs/workbench/contrib/debug/browser/debugConsoleQuickAccess.js +1 -1
- package/vscode/src/vs/workbench/contrib/debug/browser/debugEditorActions.js +25 -25
- package/vscode/src/vs/workbench/contrib/debug/browser/debugQuickAccess.js +9 -9
- package/vscode/src/vs/workbench/contrib/debug/browser/debugService.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/debug/browser/debugService.js +26 -22
- package/vscode/src/vs/workbench/contrib/debug/browser/debugSession.js +69 -59
- package/vscode/src/vs/workbench/contrib/debug/browser/debugStatus.js +3 -3
- package/vscode/src/vs/workbench/contrib/debug/browser/debugTaskRunner.js +17 -17
- package/vscode/src/vs/workbench/contrib/debug/browser/debugToolBar.js +3 -3
- package/vscode/src/vs/workbench/contrib/debug/browser/debugViewlet.js +5 -5
- package/vscode/src/vs/workbench/contrib/debug/browser/disassemblyView.js +7 -7
- package/vscode/src/vs/workbench/contrib/debug/browser/loadedScriptsView.js +7 -7
- package/vscode/src/vs/workbench/contrib/debug/browser/media/debugViewlet.css +13 -13
- package/vscode/src/vs/workbench/contrib/debug/browser/rawDebugSession.js +5 -5
- package/vscode/src/vs/workbench/contrib/debug/browser/replAccessibilityHelp.js +8 -8
- package/vscode/src/vs/workbench/contrib/debug/browser/runAndDebugAccessibilityHelp.js +16 -16
- package/vscode/src/vs/workbench/contrib/debug/browser/statusbarColorProvider.js +4 -4
- package/vscode/src/vs/workbench/contrib/debug/browser/watchExpressionsView.js +10 -10
- package/vscode/src/vs/workbench/contrib/debug/browser/welcomeView.js +6 -6
- package/vscode/src/vs/workbench/contrib/debug/common/debugContentProvider.js +3 -3
- package/vscode/src/vs/workbench/contrib/debug/common/debugLifecycle.js +3 -3
- package/vscode/src/vs/workbench/contrib/debug/common/debugSchemas.js +44 -44
- package/vscode/src/vs/workbench/contrib/debug/common/debugger.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/debug/common/debugger.js +17 -14
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariableCommands.js +2 -2
|
@@ -142,7 +142,7 @@ let DebugService = class DebugService {
|
|
|
142
142
|
if (numberOfSessions > 0) {
|
|
143
143
|
const viewContainer = this.viewDescriptorService.getViewContainerByViewId(CALLSTACK_VIEW_ID);
|
|
144
144
|
if (viewContainer) {
|
|
145
|
-
this.activity = this.activityService.showViewContainerActivity(viewContainer.id, { badge: ( new NumberBadge(numberOfSessions, n => n === 1 ? ( localize(
|
|
145
|
+
this.activity = this.activityService.showViewContainerActivity(viewContainer.id, { badge: ( new NumberBadge(numberOfSessions, n => n === 1 ? ( localize(6875, "1 active session")) : ( localize(6876, "{0} active sessions", n)))) });
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
148
|
}));
|
|
@@ -164,7 +164,7 @@ let DebugService = class DebugService {
|
|
|
164
164
|
}
|
|
165
165
|
}));
|
|
166
166
|
this.disposables.add(extensionService.onWillStop(evt => {
|
|
167
|
-
evt.veto(this.model.getSessions().length > 0, ( localize(
|
|
167
|
+
evt.veto(this.model.getSessions().length > 0, ( localize(6877, 'A debug session is still running that would terminate.')));
|
|
168
168
|
}));
|
|
169
169
|
this.initContextKeys(contextKeyService);
|
|
170
170
|
}
|
|
@@ -273,8 +273,8 @@ let DebugService = class DebugService {
|
|
|
273
273
|
}
|
|
274
274
|
}
|
|
275
275
|
async startDebugging(launch, configOrName, options, saveBeforeStart = !options?.parentSession) {
|
|
276
|
-
const message = options && options.noDebug ? ( localize(
|
|
277
|
-
|
|
276
|
+
const message = options && options.noDebug ? ( localize(6878, "Running executes build tasks and program code from your workspace.")) : ( localize(
|
|
277
|
+
6879,
|
|
278
278
|
"Debugging executes build tasks and program code from your workspace."
|
|
279
279
|
));
|
|
280
280
|
const trust = await this.workspaceTrustRequestService.requestWorkspaceTrust({ message });
|
|
@@ -305,7 +305,7 @@ let DebugService = class DebugService {
|
|
|
305
305
|
if (compound) {
|
|
306
306
|
if (!compound.configurations) {
|
|
307
307
|
throw ( new Error(( localize(
|
|
308
|
-
|
|
308
|
+
6880,
|
|
309
309
|
"Compound must have \"configurations\" attribute set in order to start multiple configurations."
|
|
310
310
|
))));
|
|
311
311
|
}
|
|
@@ -334,9 +334,9 @@ let DebugService = class DebugService {
|
|
|
334
334
|
launchForName = launch;
|
|
335
335
|
}
|
|
336
336
|
else {
|
|
337
|
-
throw ( new Error(launchesContainingName.length === 0 ? ( localize(
|
|
337
|
+
throw ( new Error(launchesContainingName.length === 0 ? ( localize(6881, "Could not find launch configuration '{0}' in the workspace.", name))
|
|
338
338
|
: ( localize(
|
|
339
|
-
|
|
339
|
+
6882,
|
|
340
340
|
"There are multiple launch configurations '{0}' in the workspace. Use folder name to qualify the configuration.",
|
|
341
341
|
name
|
|
342
342
|
))));
|
|
@@ -349,7 +349,7 @@ let DebugService = class DebugService {
|
|
|
349
349
|
}
|
|
350
350
|
else {
|
|
351
351
|
throw ( new Error(( localize(
|
|
352
|
-
|
|
352
|
+
6883,
|
|
353
353
|
"Can not find folder with name '{0}' for configuration '{1}' in compound '{2}'.",
|
|
354
354
|
configData.folder,
|
|
355
355
|
configData.name,
|
|
@@ -365,11 +365,11 @@ let DebugService = class DebugService {
|
|
|
365
365
|
}
|
|
366
366
|
if (configOrName && !config) {
|
|
367
367
|
const message = !!launch ? ( localize(
|
|
368
|
-
|
|
368
|
+
6884,
|
|
369
369
|
"Configuration '{0}' is missing in 'launch.json'.",
|
|
370
370
|
typeof configOrName === 'string' ? configOrName : configOrName.name
|
|
371
371
|
)) :
|
|
372
|
-
( localize(
|
|
372
|
+
( localize(6885, "'launch.json' does not exist for passed workspace folder."));
|
|
373
373
|
throw ( new Error(message));
|
|
374
374
|
}
|
|
375
375
|
const result = await this.createSession(launch, config, options);
|
|
@@ -473,25 +473,25 @@ let DebugService = class DebugService {
|
|
|
473
473
|
let message;
|
|
474
474
|
if (configByProviders.request !== 'attach' && configByProviders.request !== 'launch') {
|
|
475
475
|
message = configByProviders.request ? ( localize(
|
|
476
|
-
|
|
476
|
+
6886,
|
|
477
477
|
"Attribute '{0}' has an unsupported value '{1}' in the chosen debug configuration.",
|
|
478
478
|
'request',
|
|
479
479
|
configByProviders.request
|
|
480
480
|
))
|
|
481
481
|
: ( localize(
|
|
482
|
-
|
|
482
|
+
6887,
|
|
483
483
|
"Attribute '{0}' is missing from the chosen debug configuration.",
|
|
484
484
|
'request'
|
|
485
485
|
));
|
|
486
486
|
}
|
|
487
487
|
else {
|
|
488
|
-
message = resolvedConfig.type ? ( localize(
|
|
489
|
-
( localize(
|
|
488
|
+
message = resolvedConfig.type ? ( localize(6888, "Configured debug type '{0}' is not supported.", resolvedConfig.type)) :
|
|
489
|
+
( localize(6889, "Missing property 'type' for the chosen launch configuration."));
|
|
490
490
|
}
|
|
491
491
|
const actionList = [];
|
|
492
492
|
actionList.push(toAction({
|
|
493
493
|
id: 'installAdditionalDebuggers',
|
|
494
|
-
label: ( localize(
|
|
494
|
+
label: ( localize(6890, "Install {0} Extension", resolvedConfig.type)),
|
|
495
495
|
enabled: true,
|
|
496
496
|
run: async () => this.commandService.executeCommand('debug.installAdditionalDebuggers', resolvedConfig?.type)
|
|
497
497
|
}));
|
|
@@ -515,7 +515,7 @@ let DebugService = class DebugService {
|
|
|
515
515
|
}
|
|
516
516
|
else if (this.contextService.getWorkbenchState() === WorkbenchState.EMPTY) {
|
|
517
517
|
await this.showError(( localize(
|
|
518
|
-
|
|
518
|
+
6891,
|
|
519
519
|
"The active file can not be debugged. Make sure it is saved and that you have a debug extension installed for that file type."
|
|
520
520
|
)));
|
|
521
521
|
}
|
|
@@ -583,7 +583,7 @@ let DebugService = class DebugService {
|
|
|
583
583
|
async confirmConcurrentSession(sessionLabel) {
|
|
584
584
|
const result = await this.dialogService.confirm({
|
|
585
585
|
message: ( localize(
|
|
586
|
-
|
|
586
|
+
6892,
|
|
587
587
|
"'{0}' is already running. Do you want to start another instance?",
|
|
588
588
|
sessionLabel
|
|
589
589
|
))
|
|
@@ -634,7 +634,7 @@ let DebugService = class DebugService {
|
|
|
634
634
|
if (adapterExitEvent) {
|
|
635
635
|
if (adapterExitEvent.error) {
|
|
636
636
|
this.notificationService.error(( localize(
|
|
637
|
-
|
|
637
|
+
6893,
|
|
638
638
|
"Debug adapter process has terminated unexpectedly ({0})",
|
|
639
639
|
adapterExitEvent.error.message || ( adapterExitEvent.error.toString())
|
|
640
640
|
)));
|
|
@@ -874,7 +874,7 @@ let DebugService = class DebugService {
|
|
|
874
874
|
if (lineNumber >= 1 && lineNumber <= model.getLineCount()) {
|
|
875
875
|
const lineContent = control.getModel().getLineContent(lineNumber);
|
|
876
876
|
alert(( localize(
|
|
877
|
-
|
|
877
|
+
6894,
|
|
878
878
|
"{0}, debugging paused {1}, {2}:{3}",
|
|
879
879
|
lineContent,
|
|
880
880
|
thread && thread.stoppedDetails ? `, reason ${thread.stoppedDetails.reason}` : '',
|
|
@@ -947,7 +947,7 @@ let DebugService = class DebugService {
|
|
|
947
947
|
async addBreakpoints(uri, rawBreakpoints, ariaAnnounce = true) {
|
|
948
948
|
const breakpoints = this.model.addBreakpoints(uri, rawBreakpoints);
|
|
949
949
|
if (ariaAnnounce) {
|
|
950
|
-
breakpoints.forEach(bp => status(( localize(
|
|
950
|
+
breakpoints.forEach(bp => status(( localize(6895, "Added breakpoint, line {0}, file {1}", bp.lineNumber, uri.fsPath))));
|
|
951
951
|
}
|
|
952
952
|
this.debugStorage.storeBreakpoints(this.model);
|
|
953
953
|
await this.sendBreakpoints(uri);
|
|
@@ -967,9 +967,13 @@ let DebugService = class DebugService {
|
|
|
967
967
|
}
|
|
968
968
|
async removeBreakpoints(id) {
|
|
969
969
|
const breakpoints = this.model.getBreakpoints();
|
|
970
|
-
const toRemove =
|
|
970
|
+
const toRemove = id === undefined
|
|
971
|
+
? breakpoints
|
|
972
|
+
: id instanceof Array
|
|
973
|
+
? breakpoints.filter(bp => id.includes(bp.getId()))
|
|
974
|
+
: breakpoints.filter(bp => bp.getId() === id);
|
|
971
975
|
toRemove.forEach(bp => status(( localize(
|
|
972
|
-
|
|
976
|
+
6896,
|
|
973
977
|
"Removed breakpoint, line {0}, file {1}",
|
|
974
978
|
bp.lineNumber,
|
|
975
979
|
bp.uri.fsPath
|
|
@@ -9,6 +9,7 @@ import { CancellationTokenSource } from '@codingame/monaco-vscode-api/vscode/vs/
|
|
|
9
9
|
import { canceled } from '@codingame/monaco-vscode-api/vscode/vs/base/common/errors';
|
|
10
10
|
import { Emitter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
11
11
|
import { normalizeDriveLetter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/labels';
|
|
12
|
+
import { Lazy } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lazy';
|
|
12
13
|
import { DisposableStore, MutableDisposable, dispose, Disposable, DisposableMap } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
13
14
|
import { mixin } from '@codingame/monaco-vscode-api/vscode/vs/base/common/objects';
|
|
14
15
|
import { language } from '@codingame/monaco-vscode-api/vscode/vs/base/common/platform';
|
|
@@ -73,6 +74,13 @@ let DebugSession = class DebugSession {
|
|
|
73
74
|
this.cancellationMap = ( new Map());
|
|
74
75
|
this.rawListeners = ( new DisposableStore());
|
|
75
76
|
this.globalDisposables = ( new DisposableStore());
|
|
77
|
+
this.fetchThreadsScheduler = ( new Lazy(() => {
|
|
78
|
+
const inst = ( new RunOnceScheduler(() => {
|
|
79
|
+
this.fetchThreads();
|
|
80
|
+
}, 100));
|
|
81
|
+
this.rawListeners.add(inst);
|
|
82
|
+
return inst;
|
|
83
|
+
}));
|
|
76
84
|
this.stoppedDetails = [];
|
|
77
85
|
this.statusQueue = this.rawListeners.add(( new ThreadStatusScheduler()));
|
|
78
86
|
this._onDidChangeState = ( new Emitter());
|
|
@@ -291,7 +299,7 @@ let DebugSession = class DebugSession {
|
|
|
291
299
|
}
|
|
292
300
|
async launchOrAttach(config) {
|
|
293
301
|
if (!this.raw) {
|
|
294
|
-
throw ( new Error(( localize(
|
|
302
|
+
throw ( new Error(( localize(6897, "No debugger available, can not send '{0}'", 'launch or attach'))));
|
|
295
303
|
}
|
|
296
304
|
if (this.parentSession && this.parentSession.state === State.Inactive) {
|
|
297
305
|
throw canceled();
|
|
@@ -351,7 +359,7 @@ let DebugSession = class DebugSession {
|
|
|
351
359
|
}
|
|
352
360
|
async restart() {
|
|
353
361
|
if (!this.raw) {
|
|
354
|
-
throw ( new Error(( localize(
|
|
362
|
+
throw ( new Error(( localize(6897, "No debugger available, can not send '{0}'", 'restart'))));
|
|
355
363
|
}
|
|
356
364
|
this.cancelAllRequests();
|
|
357
365
|
if (this._options.lifecycleManagedByParent && this.parentSession) {
|
|
@@ -363,7 +371,7 @@ let DebugSession = class DebugSession {
|
|
|
363
371
|
}
|
|
364
372
|
async sendBreakpoints(modelUri, breakpointsToSend, sourceModified) {
|
|
365
373
|
if (!this.raw) {
|
|
366
|
-
throw ( new Error(( localize(
|
|
374
|
+
throw ( new Error(( localize(6897, "No debugger available, can not send '{0}'", 'breakpoints'))));
|
|
367
375
|
}
|
|
368
376
|
if (!this.raw.readyForBreakpoints) {
|
|
369
377
|
return Promise.resolve(undefined);
|
|
@@ -391,7 +399,7 @@ let DebugSession = class DebugSession {
|
|
|
391
399
|
}
|
|
392
400
|
async sendFunctionBreakpoints(fbpts) {
|
|
393
401
|
if (!this.raw) {
|
|
394
|
-
throw ( new Error(( localize(
|
|
402
|
+
throw ( new Error(( localize(6897, "No debugger available, can not send '{0}'", 'function breakpoints'))));
|
|
395
403
|
}
|
|
396
404
|
if (this.raw.readyForBreakpoints) {
|
|
397
405
|
const response = await this.raw.setFunctionBreakpoints({ breakpoints: ( fbpts.map(bp => bp.toDAP())) });
|
|
@@ -406,7 +414,7 @@ let DebugSession = class DebugSession {
|
|
|
406
414
|
}
|
|
407
415
|
async sendExceptionBreakpoints(exbpts) {
|
|
408
416
|
if (!this.raw) {
|
|
409
|
-
throw ( new Error(( localize(
|
|
417
|
+
throw ( new Error(( localize(6897, "No debugger available, can not send '{0}'", 'exception breakpoints'))));
|
|
410
418
|
}
|
|
411
419
|
if (this.raw.readyForBreakpoints) {
|
|
412
420
|
const args = this.capabilities.supportsExceptionFilterOptions ? {
|
|
@@ -430,7 +438,7 @@ let DebugSession = class DebugSession {
|
|
|
430
438
|
}
|
|
431
439
|
dataBytesBreakpointInfo(address, bytes) {
|
|
432
440
|
if (this.raw?.capabilities.supportsDataBreakpointBytes === false) {
|
|
433
|
-
throw ( new Error(( localize(
|
|
441
|
+
throw ( new Error(( localize(6898, "Session does not support breakpoints with bytes"))));
|
|
434
442
|
}
|
|
435
443
|
return this._dataBreakpointInfo({ name: address, bytes, asAddress: true });
|
|
436
444
|
}
|
|
@@ -439,17 +447,17 @@ let DebugSession = class DebugSession {
|
|
|
439
447
|
}
|
|
440
448
|
async _dataBreakpointInfo(args) {
|
|
441
449
|
if (!this.raw) {
|
|
442
|
-
throw ( new Error(( localize(
|
|
450
|
+
throw ( new Error(( localize(6897, "No debugger available, can not send '{0}'", 'data breakpoints info'))));
|
|
443
451
|
}
|
|
444
452
|
if (!this.raw.readyForBreakpoints) {
|
|
445
|
-
throw ( new Error(( localize(
|
|
453
|
+
throw ( new Error(( localize(6899, "Session is not ready for breakpoints"))));
|
|
446
454
|
}
|
|
447
455
|
const response = await this.raw.dataBreakpointInfo(args);
|
|
448
456
|
return response?.body;
|
|
449
457
|
}
|
|
450
458
|
async sendDataBreakpoints(dataBreakpoints) {
|
|
451
459
|
if (!this.raw) {
|
|
452
|
-
throw ( new Error(( localize(
|
|
460
|
+
throw ( new Error(( localize(6897, "No debugger available, can not send '{0}'", 'data breakpoints'))));
|
|
453
461
|
}
|
|
454
462
|
if (this.raw.readyForBreakpoints) {
|
|
455
463
|
const converted = await Promise.all(( dataBreakpoints.map(async (bp) => {
|
|
@@ -480,7 +488,7 @@ let DebugSession = class DebugSession {
|
|
|
480
488
|
async sendInstructionBreakpoints(instructionBreakpoints) {
|
|
481
489
|
if (!this.raw) {
|
|
482
490
|
throw ( new Error(( localize(
|
|
483
|
-
|
|
491
|
+
6897,
|
|
484
492
|
"No debugger available, can not send '{0}'",
|
|
485
493
|
'instruction breakpoints'
|
|
486
494
|
))));
|
|
@@ -498,7 +506,7 @@ let DebugSession = class DebugSession {
|
|
|
498
506
|
}
|
|
499
507
|
async breakpointsLocations(uri, lineNumber) {
|
|
500
508
|
if (!this.raw) {
|
|
501
|
-
throw ( new Error(( localize(
|
|
509
|
+
throw ( new Error(( localize(6897, "No debugger available, can not send '{0}'", 'breakpoints locations'))));
|
|
502
510
|
}
|
|
503
511
|
const source = this.getRawSource(uri);
|
|
504
512
|
const response = await this.raw.breakpointLocations({ source, line: lineNumber });
|
|
@@ -513,20 +521,20 @@ let DebugSession = class DebugSession {
|
|
|
513
521
|
}
|
|
514
522
|
customRequest(request, args) {
|
|
515
523
|
if (!this.raw) {
|
|
516
|
-
throw ( new Error(( localize(
|
|
524
|
+
throw ( new Error(( localize(6897, "No debugger available, can not send '{0}'", request))));
|
|
517
525
|
}
|
|
518
526
|
return this.raw.custom(request, args);
|
|
519
527
|
}
|
|
520
528
|
stackTrace(threadId, startFrame, levels, token) {
|
|
521
529
|
if (!this.raw) {
|
|
522
|
-
throw ( new Error(( localize(
|
|
530
|
+
throw ( new Error(( localize(6897, "No debugger available, can not send '{0}'", 'stackTrace'))));
|
|
523
531
|
}
|
|
524
532
|
const sessionToken = this.getNewCancellationToken(threadId, token);
|
|
525
533
|
return this.raw.stackTrace({ threadId, startFrame, levels }, sessionToken);
|
|
526
534
|
}
|
|
527
535
|
async exceptionInfo(threadId) {
|
|
528
536
|
if (!this.raw) {
|
|
529
|
-
throw ( new Error(( localize(
|
|
537
|
+
throw ( new Error(( localize(6897, "No debugger available, can not send '{0}'", 'exceptionInfo'))));
|
|
530
538
|
}
|
|
531
539
|
const response = await this.raw.exceptionInfo({ threadId });
|
|
532
540
|
if (response) {
|
|
@@ -541,28 +549,28 @@ let DebugSession = class DebugSession {
|
|
|
541
549
|
}
|
|
542
550
|
scopes(frameId, threadId) {
|
|
543
551
|
if (!this.raw) {
|
|
544
|
-
throw ( new Error(( localize(
|
|
552
|
+
throw ( new Error(( localize(6897, "No debugger available, can not send '{0}'", 'scopes'))));
|
|
545
553
|
}
|
|
546
554
|
const token = this.getNewCancellationToken(threadId);
|
|
547
555
|
return this.raw.scopes({ frameId }, token);
|
|
548
556
|
}
|
|
549
557
|
variables(variablesReference, threadId, filter, start, count) {
|
|
550
558
|
if (!this.raw) {
|
|
551
|
-
throw ( new Error(( localize(
|
|
559
|
+
throw ( new Error(( localize(6897, "No debugger available, can not send '{0}'", 'variables'))));
|
|
552
560
|
}
|
|
553
561
|
const token = threadId ? this.getNewCancellationToken(threadId) : undefined;
|
|
554
562
|
return this.raw.variables({ variablesReference, filter, start, count }, token);
|
|
555
563
|
}
|
|
556
564
|
evaluate(expression, frameId, context, location) {
|
|
557
565
|
if (!this.raw) {
|
|
558
|
-
throw ( new Error(( localize(
|
|
566
|
+
throw ( new Error(( localize(6897, "No debugger available, can not send '{0}'", 'evaluate'))));
|
|
559
567
|
}
|
|
560
568
|
return this.raw.evaluate({ expression, frameId, context, line: location?.line, column: location?.column, source: location?.source });
|
|
561
569
|
}
|
|
562
570
|
async restartFrame(frameId, threadId) {
|
|
563
571
|
await this.waitForTriggeredBreakpoints();
|
|
564
572
|
if (!this.raw) {
|
|
565
|
-
throw ( new Error(( localize(
|
|
573
|
+
throw ( new Error(( localize(6897, "No debugger available, can not send '{0}'", 'restartFrame'))));
|
|
566
574
|
}
|
|
567
575
|
await this.raw.restartFrame({ frameId }, threadId);
|
|
568
576
|
}
|
|
@@ -575,7 +583,7 @@ let DebugSession = class DebugSession {
|
|
|
575
583
|
async next(threadId, granularity) {
|
|
576
584
|
await this.waitForTriggeredBreakpoints();
|
|
577
585
|
if (!this.raw) {
|
|
578
|
-
throw ( new Error(( localize(
|
|
586
|
+
throw ( new Error(( localize(6897, "No debugger available, can not send '{0}'", 'next'))));
|
|
579
587
|
}
|
|
580
588
|
this.setLastSteppingGranularity(threadId, granularity);
|
|
581
589
|
await this.raw.next({ threadId, granularity });
|
|
@@ -583,7 +591,7 @@ let DebugSession = class DebugSession {
|
|
|
583
591
|
async stepIn(threadId, targetId, granularity) {
|
|
584
592
|
await this.waitForTriggeredBreakpoints();
|
|
585
593
|
if (!this.raw) {
|
|
586
|
-
throw ( new Error(( localize(
|
|
594
|
+
throw ( new Error(( localize(6897, "No debugger available, can not send '{0}'", 'stepIn'))));
|
|
587
595
|
}
|
|
588
596
|
this.setLastSteppingGranularity(threadId, granularity);
|
|
589
597
|
await this.raw.stepIn({ threadId, targetId, granularity });
|
|
@@ -591,7 +599,7 @@ let DebugSession = class DebugSession {
|
|
|
591
599
|
async stepOut(threadId, granularity) {
|
|
592
600
|
await this.waitForTriggeredBreakpoints();
|
|
593
601
|
if (!this.raw) {
|
|
594
|
-
throw ( new Error(( localize(
|
|
602
|
+
throw ( new Error(( localize(6897, "No debugger available, can not send '{0}'", 'stepOut'))));
|
|
595
603
|
}
|
|
596
604
|
this.setLastSteppingGranularity(threadId, granularity);
|
|
597
605
|
await this.raw.stepOut({ threadId, granularity });
|
|
@@ -599,7 +607,7 @@ let DebugSession = class DebugSession {
|
|
|
599
607
|
async stepBack(threadId, granularity) {
|
|
600
608
|
await this.waitForTriggeredBreakpoints();
|
|
601
609
|
if (!this.raw) {
|
|
602
|
-
throw ( new Error(( localize(
|
|
610
|
+
throw ( new Error(( localize(6897, "No debugger available, can not send '{0}'", 'stepBack'))));
|
|
603
611
|
}
|
|
604
612
|
this.setLastSteppingGranularity(threadId, granularity);
|
|
605
613
|
await this.raw.stepBack({ threadId, granularity });
|
|
@@ -607,56 +615,56 @@ let DebugSession = class DebugSession {
|
|
|
607
615
|
async continue(threadId) {
|
|
608
616
|
await this.waitForTriggeredBreakpoints();
|
|
609
617
|
if (!this.raw) {
|
|
610
|
-
throw ( new Error(( localize(
|
|
618
|
+
throw ( new Error(( localize(6897, "No debugger available, can not send '{0}'", 'continue'))));
|
|
611
619
|
}
|
|
612
620
|
await this.raw.continue({ threadId });
|
|
613
621
|
}
|
|
614
622
|
async reverseContinue(threadId) {
|
|
615
623
|
await this.waitForTriggeredBreakpoints();
|
|
616
624
|
if (!this.raw) {
|
|
617
|
-
throw ( new Error(( localize(
|
|
625
|
+
throw ( new Error(( localize(6897, "No debugger available, can not send '{0}'", 'reverse continue'))));
|
|
618
626
|
}
|
|
619
627
|
await this.raw.reverseContinue({ threadId });
|
|
620
628
|
}
|
|
621
629
|
async pause(threadId) {
|
|
622
630
|
if (!this.raw) {
|
|
623
|
-
throw ( new Error(( localize(
|
|
631
|
+
throw ( new Error(( localize(6897, "No debugger available, can not send '{0}'", 'pause'))));
|
|
624
632
|
}
|
|
625
633
|
await this.raw.pause({ threadId });
|
|
626
634
|
}
|
|
627
635
|
async terminateThreads(threadIds) {
|
|
628
636
|
if (!this.raw) {
|
|
629
|
-
throw ( new Error(( localize(
|
|
637
|
+
throw ( new Error(( localize(6897, "No debugger available, can not send '{0}'", 'terminateThreads'))));
|
|
630
638
|
}
|
|
631
639
|
await this.raw.terminateThreads({ threadIds });
|
|
632
640
|
}
|
|
633
641
|
setVariable(variablesReference, name, value) {
|
|
634
642
|
if (!this.raw) {
|
|
635
|
-
throw ( new Error(( localize(
|
|
643
|
+
throw ( new Error(( localize(6897, "No debugger available, can not send '{0}'", 'setVariable'))));
|
|
636
644
|
}
|
|
637
645
|
return this.raw.setVariable({ variablesReference, name, value });
|
|
638
646
|
}
|
|
639
647
|
setExpression(frameId, expression, value) {
|
|
640
648
|
if (!this.raw) {
|
|
641
|
-
throw ( new Error(( localize(
|
|
649
|
+
throw ( new Error(( localize(6897, "No debugger available, can not send '{0}'", 'setExpression'))));
|
|
642
650
|
}
|
|
643
651
|
return this.raw.setExpression({ expression, value, frameId });
|
|
644
652
|
}
|
|
645
653
|
gotoTargets(source, line, column) {
|
|
646
654
|
if (!this.raw) {
|
|
647
|
-
throw ( new Error(( localize(
|
|
655
|
+
throw ( new Error(( localize(6897, "No debugger available, can not send '{0}'", 'gotoTargets'))));
|
|
648
656
|
}
|
|
649
657
|
return this.raw.gotoTargets({ source, line, column });
|
|
650
658
|
}
|
|
651
659
|
goto(threadId, targetId) {
|
|
652
660
|
if (!this.raw) {
|
|
653
|
-
throw ( new Error(( localize(
|
|
661
|
+
throw ( new Error(( localize(6897, "No debugger available, can not send '{0}'", 'goto'))));
|
|
654
662
|
}
|
|
655
663
|
return this.raw.goto({ threadId, targetId });
|
|
656
664
|
}
|
|
657
665
|
loadSource(resource) {
|
|
658
666
|
if (!this.raw) {
|
|
659
|
-
return Promise.reject(( new Error(( localize(
|
|
667
|
+
return Promise.reject(( new Error(( localize(6897, "No debugger available, can not send '{0}'", 'loadSource')))));
|
|
660
668
|
}
|
|
661
669
|
const source = this.getSourceForUri(resource);
|
|
662
670
|
let rawSource;
|
|
@@ -671,7 +679,7 @@ let DebugSession = class DebugSession {
|
|
|
671
679
|
}
|
|
672
680
|
async getLoadedSources() {
|
|
673
681
|
if (!this.raw) {
|
|
674
|
-
return Promise.reject(( new Error(( localize(
|
|
682
|
+
return Promise.reject(( new Error(( localize(6897, "No debugger available, can not send '{0}'", 'getLoadedSources')))));
|
|
675
683
|
}
|
|
676
684
|
const response = await this.raw.loadedSources({});
|
|
677
685
|
if (response?.body && response.body.sources) {
|
|
@@ -683,7 +691,7 @@ let DebugSession = class DebugSession {
|
|
|
683
691
|
}
|
|
684
692
|
async completions(frameId, threadId, text, position, token) {
|
|
685
693
|
if (!this.raw) {
|
|
686
|
-
return Promise.reject(( new Error(( localize(
|
|
694
|
+
return Promise.reject(( new Error(( localize(6897, "No debugger available, can not send '{0}'", 'completions')))));
|
|
687
695
|
}
|
|
688
696
|
const sessionCancelationToken = this.getNewCancellationToken(threadId, token);
|
|
689
697
|
return this.raw.completions({
|
|
@@ -695,43 +703,43 @@ let DebugSession = class DebugSession {
|
|
|
695
703
|
}
|
|
696
704
|
async stepInTargets(frameId) {
|
|
697
705
|
if (!this.raw) {
|
|
698
|
-
return Promise.reject(( new Error(( localize(
|
|
706
|
+
return Promise.reject(( new Error(( localize(6897, "No debugger available, can not send '{0}'", 'stepInTargets')))));
|
|
699
707
|
}
|
|
700
708
|
const response = await this.raw.stepInTargets({ frameId });
|
|
701
709
|
return response?.body.targets;
|
|
702
710
|
}
|
|
703
711
|
async cancel(progressId) {
|
|
704
712
|
if (!this.raw) {
|
|
705
|
-
return Promise.reject(( new Error(( localize(
|
|
713
|
+
return Promise.reject(( new Error(( localize(6897, "No debugger available, can not send '{0}'", 'cancel')))));
|
|
706
714
|
}
|
|
707
715
|
return this.raw.cancel({ progressId });
|
|
708
716
|
}
|
|
709
717
|
async disassemble(memoryReference, offset, instructionOffset, instructionCount) {
|
|
710
718
|
if (!this.raw) {
|
|
711
|
-
return Promise.reject(( new Error(( localize(
|
|
719
|
+
return Promise.reject(( new Error(( localize(6897, "No debugger available, can not send '{0}'", 'disassemble')))));
|
|
712
720
|
}
|
|
713
721
|
const response = await this.raw.disassemble({ memoryReference, offset, instructionOffset, instructionCount, resolveSymbols: true });
|
|
714
722
|
return response?.body?.instructions;
|
|
715
723
|
}
|
|
716
724
|
readMemory(memoryReference, offset, count) {
|
|
717
725
|
if (!this.raw) {
|
|
718
|
-
return Promise.reject(( new Error(( localize(
|
|
726
|
+
return Promise.reject(( new Error(( localize(6897, "No debugger available, can not send '{0}'", 'readMemory')))));
|
|
719
727
|
}
|
|
720
728
|
return this.raw.readMemory({ count, memoryReference, offset });
|
|
721
729
|
}
|
|
722
730
|
writeMemory(memoryReference, offset, data, allowPartial) {
|
|
723
731
|
if (!this.raw) {
|
|
724
|
-
return Promise.reject(( new Error(( localize(
|
|
732
|
+
return Promise.reject(( new Error(( localize(6897, "No debugger available, can not send '{0}'", 'disassemble')))));
|
|
725
733
|
}
|
|
726
734
|
return this.raw.writeMemory({ memoryReference, offset, allowPartial, data });
|
|
727
735
|
}
|
|
728
736
|
async resolveLocationReference(locationReference) {
|
|
729
737
|
if (!this.raw) {
|
|
730
|
-
throw ( new Error(( localize(
|
|
738
|
+
throw ( new Error(( localize(6897, "No debugger available, can not send '{0}'", 'locations'))));
|
|
731
739
|
}
|
|
732
740
|
const location = await this.raw.locations({ locationReference });
|
|
733
741
|
if (!location?.body) {
|
|
734
|
-
throw ( new Error(( localize(
|
|
742
|
+
throw ( new Error(( localize(6897, "No debugger available, can not send '{0}'", 'locations'))));
|
|
735
743
|
}
|
|
736
744
|
const source = this.getSource(location.body.source);
|
|
737
745
|
return { column: 1, ...location.body, source };
|
|
@@ -843,8 +851,8 @@ let DebugSession = class DebugSession {
|
|
|
843
851
|
}
|
|
844
852
|
this.rawListeners.add(this.raw.onDidInitialize(async () => {
|
|
845
853
|
status(this.configuration.noDebug
|
|
846
|
-
? ( localize(
|
|
847
|
-
: ( localize(
|
|
854
|
+
? ( localize(6900, "Started running without debugging."))
|
|
855
|
+
: ( localize(6901, "Debugging started.")));
|
|
848
856
|
const sendConfigurationDone = async () => {
|
|
849
857
|
if (this.raw && this.raw.capabilities.supportsConfigurationDoneRequest) {
|
|
850
858
|
try {
|
|
@@ -870,14 +878,8 @@ let DebugSession = class DebugSession {
|
|
|
870
878
|
this.rawListeners.add(this.raw.onDidThread(event => {
|
|
871
879
|
statusQueue.cancel([event.body.threadId]);
|
|
872
880
|
if (event.body.reason === 'started') {
|
|
873
|
-
if (!this.fetchThreadsScheduler) {
|
|
874
|
-
this.fetchThreadsScheduler
|
|
875
|
-
this.fetchThreads();
|
|
876
|
-
}, 100));
|
|
877
|
-
this.rawListeners.add(this.fetchThreadsScheduler);
|
|
878
|
-
}
|
|
879
|
-
if (!this.fetchThreadsScheduler.isScheduled()) {
|
|
880
|
-
this.fetchThreadsScheduler.schedule();
|
|
881
|
+
if (!this.fetchThreadsScheduler.value.isScheduled()) {
|
|
882
|
+
this.fetchThreadsScheduler.value.schedule();
|
|
881
883
|
}
|
|
882
884
|
}
|
|
883
885
|
else if (event.body.reason === 'exited') {
|
|
@@ -891,7 +893,7 @@ let DebugSession = class DebugSession {
|
|
|
891
893
|
}
|
|
892
894
|
}));
|
|
893
895
|
this.rawListeners.add(this.raw.onDidTerminateDebugee(async (event) => {
|
|
894
|
-
status(( localize(
|
|
896
|
+
status(( localize(6902, "Debugging stopped.")));
|
|
895
897
|
if (event.body && event.body.restart) {
|
|
896
898
|
await this.debugService.restartSession(this, event.body.restart);
|
|
897
899
|
}
|
|
@@ -908,12 +910,12 @@ let DebugSession = class DebugSession {
|
|
|
908
910
|
affectedThreads = [event.body.threadId];
|
|
909
911
|
}
|
|
910
912
|
else {
|
|
911
|
-
this.fetchThreadsScheduler?.cancel();
|
|
913
|
+
this.fetchThreadsScheduler.rawValue?.cancel();
|
|
912
914
|
affectedThreads = this.fetchThreads().then(() => [event.body.threadId]);
|
|
913
915
|
}
|
|
914
916
|
}
|
|
915
|
-
else if (this.fetchThreadsScheduler
|
|
916
|
-
this.fetchThreadsScheduler.cancel();
|
|
917
|
+
else if (this.fetchThreadsScheduler.value.isScheduled()) {
|
|
918
|
+
this.fetchThreadsScheduler.value.cancel();
|
|
917
919
|
affectedThreads = this.fetchThreads().then(() => this.threadIds);
|
|
918
920
|
}
|
|
919
921
|
else {
|
|
@@ -1069,9 +1071,14 @@ let DebugSession = class DebugSession {
|
|
|
1069
1071
|
if (areas.includes('threads') || areas.includes('stacks') || areas.includes('all')) {
|
|
1070
1072
|
this.cancelAllRequests();
|
|
1071
1073
|
this.model.clearThreads(this.getId(), true);
|
|
1072
|
-
const details = this.stoppedDetails;
|
|
1073
|
-
this.stoppedDetails.length =
|
|
1074
|
-
|
|
1074
|
+
const details = this.stoppedDetails.slice();
|
|
1075
|
+
this.stoppedDetails.length = 0;
|
|
1076
|
+
if (details.length) {
|
|
1077
|
+
await Promise.all(( details.map(d => this.handleStop(d))));
|
|
1078
|
+
}
|
|
1079
|
+
else if (!this.fetchThreadsScheduler.value.isScheduled()) {
|
|
1080
|
+
this.fetchThreadsScheduler.value.schedule();
|
|
1081
|
+
}
|
|
1075
1082
|
}
|
|
1076
1083
|
const viewModel = this.debugService.getViewModel();
|
|
1077
1084
|
if (viewModel.focusedSession === this) {
|
|
@@ -1188,17 +1195,20 @@ let DebugSession = class DebugSession {
|
|
|
1188
1195
|
this.raw.dispose();
|
|
1189
1196
|
this.raw = undefined;
|
|
1190
1197
|
}
|
|
1191
|
-
this.fetchThreadsScheduler?.dispose();
|
|
1192
|
-
this.fetchThreadsScheduler = undefined;
|
|
1193
1198
|
this.passFocusScheduler.cancel();
|
|
1194
1199
|
this.passFocusScheduler.dispose();
|
|
1195
1200
|
this.model.clearThreads(this.getId(), true);
|
|
1201
|
+
this.sources.clear();
|
|
1202
|
+
this.threads.clear();
|
|
1203
|
+
this.threadIds = [];
|
|
1204
|
+
this.stoppedDetails = [];
|
|
1196
1205
|
this._onDidChangeState.fire();
|
|
1197
1206
|
}
|
|
1198
1207
|
dispose() {
|
|
1199
1208
|
this.cancelAllRequests();
|
|
1200
1209
|
this.rawListeners.dispose();
|
|
1201
1210
|
this.globalDisposables.dispose();
|
|
1211
|
+
this._waitToResume = undefined;
|
|
1202
1212
|
}
|
|
1203
1213
|
getSourceForUri(uri) {
|
|
1204
1214
|
return this.sources.get(( this.uriIdentityService.asCanonicalUri(uri).toString()));
|
|
@@ -50,10 +50,10 @@ let DebugStatusContribution = class DebugStatusContribution {
|
|
|
50
50
|
text = (manager.getLaunches().length > 1 ? `${name} (${manager.selectedConfiguration.launch.name})` : name);
|
|
51
51
|
}
|
|
52
52
|
return {
|
|
53
|
-
name: ( localize(
|
|
53
|
+
name: ( localize(6906, "Debug")),
|
|
54
54
|
text: '$(debug-alt-small) ' + text,
|
|
55
|
-
ariaLabel: ( localize(
|
|
56
|
-
tooltip: ( localize(
|
|
55
|
+
ariaLabel: ( localize(6907, "Debug: {0}", text)),
|
|
56
|
+
tooltip: ( localize(6908, "Select and Start Debug Configuration")),
|
|
57
57
|
command: 'workbench.action.debug.selectandstart'
|
|
58
58
|
};
|
|
59
59
|
}
|