@codingame/monaco-vscode-debug-service-override 1.83.1 → 1.83.2
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/breakpointEditorContribution.js +98 -155
- package/vscode/src/vs/workbench/contrib/debug/browser/disassemblyView.js +46 -50
- package/vscode/src/vs/workbench/contrib/debug/browser/welcomeView.js +21 -35
- package/vscode/src/vs/workbench/contrib/debug/common/debugModel.js +102 -145
|
@@ -43,7 +43,7 @@ const disassemblyNotAvailable = {
|
|
|
43
43
|
address: 0n,
|
|
44
44
|
instruction: {
|
|
45
45
|
address: '-1',
|
|
46
|
-
instruction: (
|
|
46
|
+
instruction: ( localize('instructionNotAvailable', "Disassembly not available."))
|
|
47
47
|
},
|
|
48
48
|
};
|
|
49
49
|
let DisassemblyView = class DisassemblyView extends EditorPane {
|
|
@@ -57,9 +57,9 @@ let DisassemblyView = class DisassemblyView extends EditorPane {
|
|
|
57
57
|
this._instructionBpList = [];
|
|
58
58
|
this._enableSourceCodeRender = true;
|
|
59
59
|
this._loadingLock = false;
|
|
60
|
-
this._referenceToMemoryAddress = (
|
|
60
|
+
this._referenceToMemoryAddress = ( new Map());
|
|
61
61
|
this._disassembledInstructions = undefined;
|
|
62
|
-
this._onDidChangeStackFrame = this._register((
|
|
62
|
+
this._onDidChangeStackFrame = this._register(( new Emitter({ leakWarningThreshold: 1000 })));
|
|
63
63
|
this._previousDebuggingState = _debugService.state;
|
|
64
64
|
this._fontInfo = BareFontInfo.createFromRawSettings(_configurationService.getValue('editor'), PixelRatio.value);
|
|
65
65
|
this._register(_configurationService.onDidChangeConfiguration(e => {
|
|
@@ -79,14 +79,12 @@ let DisassemblyView = class DisassemblyView extends EditorPane {
|
|
|
79
79
|
}
|
|
80
80
|
get fontInfo() { return this._fontInfo; }
|
|
81
81
|
get currentInstructionAddresses() {
|
|
82
|
-
return (
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
map(ref => ref ? this.getReferenceAddress(ref) : undefined))
|
|
89
|
-
);
|
|
82
|
+
return ( ( ( ( this._debugService.getModel().getSessions(false).
|
|
83
|
+
map(session => session.getAllThreads())).
|
|
84
|
+
reduce((prev, curr) => prev.concat(curr), []).
|
|
85
|
+
map(thread => thread.getTopStackFrame())).
|
|
86
|
+
map(frame => frame?.instructionPointerReference)).
|
|
87
|
+
map(ref => ref ? this.getReferenceAddress(ref) : undefined));
|
|
90
88
|
}
|
|
91
89
|
get focusedCurrentInstructionReference() {
|
|
92
90
|
return this._debugService.getViewModel().focusedStackFrame?.thread.getTopStackFrame()?.instructionPointerReference;
|
|
@@ -148,7 +146,7 @@ let DisassemblyView = class DisassemblyView extends EditorPane {
|
|
|
148
146
|
project(row) { return row; }
|
|
149
147
|
},
|
|
150
148
|
{
|
|
151
|
-
label: (
|
|
149
|
+
label: ( localize('disassemblyTableColumnLabel', "instructions")),
|
|
152
150
|
tooltip: '',
|
|
153
151
|
weight: 0.3,
|
|
154
152
|
templateId: InstructionRenderer.TEMPLATE_ID,
|
|
@@ -166,7 +164,7 @@ let DisassemblyView = class DisassemblyView extends EditorPane {
|
|
|
166
164
|
multipleSelectionSupport: false,
|
|
167
165
|
setRowLineHeight: false,
|
|
168
166
|
openOnSingleClick: false,
|
|
169
|
-
accessibilityProvider: (
|
|
167
|
+
accessibilityProvider: ( new AccessibilityProvider()),
|
|
170
168
|
mouseSupport: false
|
|
171
169
|
}));
|
|
172
170
|
if (this.focusedInstructionReference) {
|
|
@@ -298,7 +296,7 @@ let DisassemblyView = class DisassemblyView extends EditorPane {
|
|
|
298
296
|
return 0;
|
|
299
297
|
}
|
|
300
298
|
async primeMemoryReference(instructionReference) {
|
|
301
|
-
if ((
|
|
299
|
+
if (( this._referenceToMemoryAddress.has(instructionReference))) {
|
|
302
300
|
return true;
|
|
303
301
|
}
|
|
304
302
|
const s = await this.debugSession?.disassemble(instructionReference, 0, 0, 1);
|
|
@@ -316,7 +314,7 @@ let DisassemblyView = class DisassemblyView extends EditorPane {
|
|
|
316
314
|
async loadDisassembledInstructions(instructionReference, offset, instructionOffset, instructionCount) {
|
|
317
315
|
const session = this.debugSession;
|
|
318
316
|
const resultEntries = await session?.disassemble(instructionReference, offset, instructionOffset, instructionCount);
|
|
319
|
-
if (!(
|
|
317
|
+
if (!( this._referenceToMemoryAddress.has(instructionReference)) && instructionOffset !== 0) {
|
|
320
318
|
await this.loadDisassembledInstructions(instructionReference, 0, 0, DisassemblyView_1.NUM_INSTRUCTIONS_TO_LOAD);
|
|
321
319
|
}
|
|
322
320
|
if (session && resultEntries && this._disassembledInstructions) {
|
|
@@ -369,7 +367,7 @@ let DisassemblyView = class DisassemblyView extends EditorPane {
|
|
|
369
367
|
return 0;
|
|
370
368
|
}
|
|
371
369
|
const refBaseAddress = this._referenceToMemoryAddress.get(instructionReference);
|
|
372
|
-
const bps = (
|
|
370
|
+
const bps = ( this._instructionBpList.map(p => {
|
|
373
371
|
const base = this._referenceToMemoryAddress.get(p.instructionReference);
|
|
374
372
|
if (!base) {
|
|
375
373
|
return undefined;
|
|
@@ -378,7 +376,7 @@ let DisassemblyView = class DisassemblyView extends EditorPane {
|
|
|
378
376
|
enabled: p.enabled,
|
|
379
377
|
address: base + BigInt(p.offset || 0),
|
|
380
378
|
};
|
|
381
|
-
}))
|
|
379
|
+
}));
|
|
382
380
|
if (refBaseAddress !== undefined) {
|
|
383
381
|
for (const entry of newEntries) {
|
|
384
382
|
const bp = bps.find(p => p?.address === entry.address);
|
|
@@ -459,14 +457,14 @@ let DisassemblyView = class DisassemblyView extends EditorPane {
|
|
|
459
457
|
this._disassembledInstructions?.splice(0, this._disassembledInstructions.length, [disassemblyNotAvailable]);
|
|
460
458
|
}
|
|
461
459
|
};
|
|
462
|
-
DisassemblyView = DisassemblyView_1 = (
|
|
463
|
-
(
|
|
464
|
-
(
|
|
465
|
-
(
|
|
466
|
-
(
|
|
467
|
-
(
|
|
468
|
-
(
|
|
469
|
-
], DisassemblyView))
|
|
460
|
+
DisassemblyView = DisassemblyView_1 = ( __decorate([
|
|
461
|
+
( __param(0, ITelemetryService)),
|
|
462
|
+
( __param(1, IThemeService)),
|
|
463
|
+
( __param(2, IStorageService)),
|
|
464
|
+
( __param(3, IConfigurationService)),
|
|
465
|
+
( __param(4, IInstantiationService)),
|
|
466
|
+
( __param(5, IDebugService))
|
|
467
|
+
], DisassemblyView));
|
|
470
468
|
let BreakpointRenderer = class BreakpointRenderer {
|
|
471
469
|
static { BreakpointRenderer_1 = this; }
|
|
472
470
|
static { this.TEMPLATE_ID = 'breakpoint'; }
|
|
@@ -553,9 +551,9 @@ let BreakpointRenderer = class BreakpointRenderer {
|
|
|
553
551
|
}
|
|
554
552
|
}
|
|
555
553
|
};
|
|
556
|
-
BreakpointRenderer = BreakpointRenderer_1 = (
|
|
557
|
-
(
|
|
558
|
-
], BreakpointRenderer))
|
|
554
|
+
BreakpointRenderer = BreakpointRenderer_1 = ( __decorate([
|
|
555
|
+
( __param(1, IDebugService))
|
|
556
|
+
], BreakpointRenderer));
|
|
559
557
|
let InstructionRenderer = class InstructionRenderer extends Disposable {
|
|
560
558
|
static { InstructionRenderer_1 = this; }
|
|
561
559
|
static { this.TEMPLATE_ID = 'instruction'; }
|
|
@@ -596,12 +594,12 @@ let InstructionRenderer = class InstructionRenderer extends Disposable {
|
|
|
596
594
|
templateData.currentElement.element = element;
|
|
597
595
|
const instruction = element.instruction;
|
|
598
596
|
templateData.sourcecode.innerText = '';
|
|
599
|
-
const sb = (
|
|
597
|
+
const sb = ( new StringBuilder(1000));
|
|
600
598
|
if (this._disassemblyView.isSourceCodeRender && element.showSourceLocation && instruction.location?.path && instruction.line !== undefined) {
|
|
601
599
|
const sourceURI = this.getUriFromSource(instruction);
|
|
602
600
|
if (sourceURI) {
|
|
603
601
|
let textModel = undefined;
|
|
604
|
-
const sourceSB = (
|
|
602
|
+
const sourceSB = ( new StringBuilder(10000));
|
|
605
603
|
const ref = await this.textModelService.createModelReference(sourceURI);
|
|
606
604
|
textModel = ref.object.textEditorModel;
|
|
607
605
|
templateData.cellDisposable.push(ref);
|
|
@@ -680,7 +678,7 @@ let InstructionRenderer = class InstructionRenderer extends Disposable {
|
|
|
680
678
|
};
|
|
681
679
|
this.editorService.openEditor({
|
|
682
680
|
resource: sourceURI,
|
|
683
|
-
description: (
|
|
681
|
+
description: ( localize('editorOpenedFromDisassemblyDescription', "from disassembly")),
|
|
684
682
|
options: {
|
|
685
683
|
preserveFocus: false,
|
|
686
684
|
selection: selection,
|
|
@@ -694,7 +692,7 @@ let InstructionRenderer = class InstructionRenderer extends Disposable {
|
|
|
694
692
|
getUriFromSource(instruction) {
|
|
695
693
|
const path = instruction.location.path;
|
|
696
694
|
if (path && isUri(path)) {
|
|
697
|
-
return this.uriService.asCanonicalUri((
|
|
695
|
+
return this.uriService.asCanonicalUri(( URI.parse(path)));
|
|
698
696
|
}
|
|
699
697
|
if (path && isAbsolute(path)) {
|
|
700
698
|
return this.uriService.asCanonicalUri(URI.file(path));
|
|
@@ -706,29 +704,27 @@ let InstructionRenderer = class InstructionRenderer extends Disposable {
|
|
|
706
704
|
element.style.whiteSpace = 'pre';
|
|
707
705
|
}
|
|
708
706
|
};
|
|
709
|
-
InstructionRenderer = InstructionRenderer_1 = (
|
|
710
|
-
(
|
|
711
|
-
(
|
|
712
|
-
(
|
|
713
|
-
(
|
|
714
|
-
(
|
|
715
|
-
], InstructionRenderer))
|
|
707
|
+
InstructionRenderer = InstructionRenderer_1 = ( __decorate([
|
|
708
|
+
( __param(1, IThemeService)),
|
|
709
|
+
( __param(2, IEditorService)),
|
|
710
|
+
( __param(3, ITextModelService)),
|
|
711
|
+
( __param(4, IUriIdentityService)),
|
|
712
|
+
( __param(5, ILogService))
|
|
713
|
+
], InstructionRenderer));
|
|
716
714
|
class AccessibilityProvider {
|
|
717
715
|
getWidgetAriaLabel() {
|
|
718
|
-
return (
|
|
719
|
-
(localize('disassemblyView', "Disassembly View"))
|
|
720
|
-
);
|
|
716
|
+
return ( localize('disassemblyView', "Disassembly View"));
|
|
721
717
|
}
|
|
722
718
|
getAriaLabel(element) {
|
|
723
719
|
let label = '';
|
|
724
720
|
const instruction = element.instruction;
|
|
725
721
|
if (instruction.address !== '-1') {
|
|
726
|
-
label += `${(
|
|
722
|
+
label += `${( localize('instructionAddress', "Address"))}: ${instruction.address}`;
|
|
727
723
|
}
|
|
728
724
|
if (instruction.instructionBytes) {
|
|
729
|
-
label += `, ${(
|
|
725
|
+
label += `, ${( localize('instructionBytes', "Bytes"))}: ${instruction.instructionBytes}`;
|
|
730
726
|
}
|
|
731
|
-
label += `, ${(
|
|
727
|
+
label += `, ${( localize(`instructionText`, "Instruction"))}: ${instruction.instruction}`;
|
|
732
728
|
return label;
|
|
733
729
|
}
|
|
734
730
|
}
|
|
@@ -762,10 +758,10 @@ let DisassemblyViewContribution = class DisassemblyViewContribution {
|
|
|
762
758
|
this._onDidChangeModelLanguage?.dispose();
|
|
763
759
|
}
|
|
764
760
|
};
|
|
765
|
-
DisassemblyViewContribution = (
|
|
766
|
-
(
|
|
767
|
-
(
|
|
768
|
-
(
|
|
769
|
-
], DisassemblyViewContribution))
|
|
761
|
+
DisassemblyViewContribution = ( __decorate([
|
|
762
|
+
( __param(0, IEditorService)),
|
|
763
|
+
( __param(1, IDebugService)),
|
|
764
|
+
( __param(2, IContextKeyService))
|
|
765
|
+
], DisassemblyViewContribution));
|
|
770
766
|
|
|
771
767
|
export { DisassemblyView, DisassemblyViewContribution };
|
|
@@ -5,25 +5,24 @@ import { IContextMenuService } from 'monaco-editor/esm/vs/platform/contextview/b
|
|
|
5
5
|
import { IConfigurationService } from 'monaco-editor/esm/vs/platform/configuration/common/configuration.js';
|
|
6
6
|
import { RawContextKey, IContextKeyService } from 'monaco-editor/esm/vs/platform/contextkey/common/contextkey.js';
|
|
7
7
|
import { localize } from 'monaco-editor/esm/vs/nls.js';
|
|
8
|
-
import {
|
|
8
|
+
import { IDebugService } from 'vscode/vscode/vs/workbench/contrib/debug/common/debug';
|
|
9
9
|
import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService';
|
|
10
10
|
import { ViewPane } from 'vscode/vscode/vs/workbench/browser/parts/views/viewPane';
|
|
11
11
|
import { IInstantiationService } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
|
|
12
|
-
import {
|
|
13
|
-
import { Registry } from 'monaco-editor/esm/vs/platform/registry/common/platform.js';
|
|
12
|
+
import { IViewDescriptorService } from 'vscode/vscode/vs/workbench/common/views';
|
|
14
13
|
import { IOpenerService } from 'monaco-editor/esm/vs/platform/opener/common/opener.js';
|
|
15
14
|
import { isCodeEditor } from 'monaco-editor/esm/vs/editor/browser/editorBrowser.js';
|
|
16
15
|
import { IStorageService } from 'monaco-editor/esm/vs/platform/storage/common/storage.js';
|
|
17
16
|
import { ITelemetryService } from 'monaco-editor/esm/vs/platform/telemetry/common/telemetry.js';
|
|
18
17
|
import { DisposableStore } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
19
|
-
import { DEBUG_START_COMMAND_ID
|
|
18
|
+
import { DEBUG_START_COMMAND_ID } from './debugCommands.js';
|
|
20
19
|
|
|
21
20
|
const debugStartLanguageKey = 'debugStartLanguage';
|
|
22
|
-
const CONTEXT_DEBUG_START_LANGUAGE = (
|
|
23
|
-
const CONTEXT_DEBUGGER_INTERESTED_IN_ACTIVE_EDITOR = (
|
|
21
|
+
const CONTEXT_DEBUG_START_LANGUAGE = ( new RawContextKey(debugStartLanguageKey, undefined));
|
|
22
|
+
const CONTEXT_DEBUGGER_INTERESTED_IN_ACTIVE_EDITOR = ( new RawContextKey('debuggerInterestedInActiveEditor', false));
|
|
24
23
|
let WelcomeView = class WelcomeView extends ViewPane {
|
|
25
24
|
static { this.ID = 'workbench.debug.welcome'; }
|
|
26
|
-
static { this.LABEL = (
|
|
25
|
+
static { this.LABEL = ( localize('run', "Run")); }
|
|
27
26
|
constructor(options, themeService, keybindingService, contextMenuService, configurationService, contextKeyService, debugService, editorService, instantiationService, viewDescriptorService, openerService, storageSevice, telemetryService) {
|
|
28
27
|
super(options, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService, telemetryService);
|
|
29
28
|
this.debugService = debugService;
|
|
@@ -46,7 +45,7 @@ let WelcomeView = class WelcomeView extends ViewPane {
|
|
|
46
45
|
}
|
|
47
46
|
this.debuggerInterestedContext.set(false);
|
|
48
47
|
};
|
|
49
|
-
const disposables = (
|
|
48
|
+
const disposables = ( new DisposableStore());
|
|
50
49
|
this._register(disposables);
|
|
51
50
|
this._register(editorService.onDidActiveEditorChange(() => {
|
|
52
51
|
disposables.clear();
|
|
@@ -70,33 +69,20 @@ let WelcomeView = class WelcomeView extends ViewPane {
|
|
|
70
69
|
return true;
|
|
71
70
|
}
|
|
72
71
|
};
|
|
73
|
-
WelcomeView = (
|
|
74
|
-
(
|
|
75
|
-
(
|
|
76
|
-
(
|
|
77
|
-
(
|
|
78
|
-
(
|
|
79
|
-
(
|
|
80
|
-
(
|
|
81
|
-
(
|
|
82
|
-
(
|
|
83
|
-
(
|
|
84
|
-
(
|
|
85
|
-
(
|
|
86
|
-
], WelcomeView))
|
|
87
|
-
const viewsRegistry = ( (Registry.as(Extensions.ViewsRegistry)));
|
|
72
|
+
WelcomeView = ( __decorate([
|
|
73
|
+
( __param(1, IThemeService)),
|
|
74
|
+
( __param(2, IKeybindingService)),
|
|
75
|
+
( __param(3, IContextMenuService)),
|
|
76
|
+
( __param(4, IConfigurationService)),
|
|
77
|
+
( __param(5, IContextKeyService)),
|
|
78
|
+
( __param(6, IDebugService)),
|
|
79
|
+
( __param(7, IEditorService)),
|
|
80
|
+
( __param(8, IInstantiationService)),
|
|
81
|
+
( __param(9, IViewDescriptorService)),
|
|
82
|
+
( __param(10, IOpenerService)),
|
|
83
|
+
( __param(11, IStorageService)),
|
|
84
|
+
( __param(12, ITelemetryService))
|
|
85
|
+
], WelcomeView));
|
|
88
86
|
let debugKeybindingLabel = '';
|
|
89
|
-
( (viewsRegistry.registerViewWelcomeContent(WelcomeView.ID, {
|
|
90
|
-
content: `[${( ( localize('runAndDebugAction', "Run and Debug")))}${debugKeybindingLabel}](command:${DEBUG_START_COMMAND_ID})`,
|
|
91
|
-
when: CONTEXT_DEBUGGERS_AVAILABLE,
|
|
92
|
-
group: ViewContentGroups.Debug,
|
|
93
|
-
order: 1
|
|
94
|
-
})));
|
|
95
|
-
( (viewsRegistry.registerViewWelcomeContent(WelcomeView.ID, {
|
|
96
|
-
content: `[${( ( localize('detectThenRunAndDebug', "Show all automatic debug configurations")))}](command:${SELECT_AND_START_ID}).`,
|
|
97
|
-
when: CONTEXT_DEBUGGERS_AVAILABLE,
|
|
98
|
-
group: ViewContentGroups.Debug,
|
|
99
|
-
order: 10
|
|
100
|
-
})));
|
|
101
87
|
|
|
102
88
|
export { WelcomeView };
|