@codingame/monaco-vscode-debug-service-override 1.82.6 → 1.83.0-next.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.
Files changed (27) hide show
  1. package/package.json +3 -3
  2. package/vscode/src/vs/workbench/contrib/debug/browser/baseDebugView.js +2 -2
  3. package/vscode/src/vs/workbench/contrib/debug/browser/breakpointEditorContribution.js +2 -2
  4. package/vscode/src/vs/workbench/contrib/debug/browser/breakpointWidget.js +1 -1
  5. package/vscode/src/vs/workbench/contrib/debug/browser/breakpointsView.js +4 -3
  6. package/vscode/src/vs/workbench/contrib/debug/browser/callStackView.js +2 -0
  7. package/vscode/src/vs/workbench/contrib/debug/browser/debug.contribution.js +16 -5
  8. package/vscode/src/vs/workbench/contrib/debug/browser/debugAdapterManager.js +1 -0
  9. package/vscode/src/vs/workbench/contrib/debug/browser/debugCommands.js +16 -1
  10. package/vscode/src/vs/workbench/contrib/debug/browser/debugEditorActions.js +40 -18
  11. package/vscode/src/vs/workbench/contrib/debug/browser/debugEditorContribution.js +25 -4
  12. package/vscode/src/vs/workbench/contrib/debug/browser/debugHover.js +1 -1
  13. package/vscode/src/vs/workbench/contrib/debug/browser/debugService.js +4 -4
  14. package/vscode/src/vs/workbench/contrib/debug/browser/debugSession.js +7 -4
  15. package/vscode/src/vs/workbench/contrib/debug/browser/debugTaskRunner.js +7 -6
  16. package/vscode/src/vs/workbench/contrib/debug/browser/debugToolBar.js +13 -5
  17. package/vscode/src/vs/workbench/contrib/debug/browser/disassemblyView.js +226 -118
  18. package/vscode/src/vs/workbench/contrib/debug/browser/exceptionWidget.js +2 -2
  19. package/vscode/src/vs/workbench/contrib/debug/browser/rawDebugSession.js +1 -1
  20. package/vscode/src/vs/workbench/contrib/debug/browser/repl.js +1 -1
  21. package/vscode/src/vs/workbench/contrib/debug/browser/statusbarColorProvider.js +26 -9
  22. package/vscode/src/vs/workbench/contrib/debug/browser/variablesView.js +1 -0
  23. package/vscode/src/vs/workbench/contrib/debug/browser/watchExpressionsView.js +1 -0
  24. package/vscode/src/vs/workbench/contrib/debug/common/debugModel.js +29 -12
  25. package/vscode/src/vs/workbench/contrib/debug/common/debugSchemas.js +8 -0
  26. package/vscode/src/vs/workbench/contrib/debug/common/debugStorage.js +5 -5
  27. package/vscode/src/vs/workbench/contrib/debug/common/debugger.js +10 -0
@@ -1,47 +1,50 @@
1
1
  import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
2
2
  import { PixelRatio } from 'monaco-editor/esm/vs/base/browser/browser.js';
3
3
  import { append, $, addStandardDisposableListener } from 'monaco-editor/esm/vs/base/browser/dom.js';
4
+ import { binarySearch2 } from 'monaco-editor/esm/vs/base/common/arrays.js';
5
+ import { Emitter } from 'monaco-editor/esm/vs/base/common/event.js';
6
+ import { dispose, Disposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
7
+ import { isAbsolute } from 'monaco-editor/esm/vs/base/common/path.js';
8
+ import { URI } from 'monaco-editor/esm/vs/base/common/uri.js';
9
+ import { applyFontInfo } from 'monaco-editor/esm/vs/editor/browser/config/domFontInfo.js';
10
+ import { isCodeEditor } from 'monaco-editor/esm/vs/editor/browser/editorBrowser.js';
4
11
  import { BareFontInfo } from 'monaco-editor/esm/vs/editor/common/config/fontInfo.js';
12
+ import { Range } from 'monaco-editor/esm/vs/editor/common/core/range.js';
13
+ import { StringBuilder } from 'monaco-editor/esm/vs/editor/common/core/stringBuilder.js';
14
+ import { ITextModelService } from 'monaco-editor/esm/vs/editor/common/services/resolverService.js';
5
15
  import { localize } from 'monaco-editor/esm/vs/nls.js';
6
16
  import { IConfigurationService } from 'monaco-editor/esm/vs/platform/configuration/common/configuration.js';
17
+ import { IContextKeyService } from 'monaco-editor/esm/vs/platform/contextkey/common/contextkey.js';
7
18
  import { IInstantiationService } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
8
19
  import { WorkbenchTable } from 'monaco-editor/esm/vs/platform/list/browser/listService.js';
20
+ import { ILogService } from 'monaco-editor/esm/vs/platform/log/common/log.js';
9
21
  import { IStorageService } from 'monaco-editor/esm/vs/platform/storage/common/storage.js';
10
22
  import { ITelemetryService } from 'monaco-editor/esm/vs/platform/telemetry/common/telemetry.js';
11
23
  import { editorBackground } from 'monaco-editor/esm/vs/platform/theme/common/colorRegistry.js';
12
24
  import { IThemeService } from 'monaco-editor/esm/vs/platform/theme/common/themeService.js';
25
+ import { IUriIdentityService } from 'monaco-editor/esm/vs/platform/uriIdentity/common/uriIdentity.js';
13
26
  import { EditorPane } from 'vscode/vscode/vs/workbench/browser/parts/editor/editorPane';
14
- import { DISASSEMBLY_VIEW_ID, CONTEXT_LANGUAGE_SUPPORTS_DISASSEMBLE_REQUEST, IDebugService } from 'vscode/vscode/vs/workbench/contrib/debug/common/debug';
15
- import { breakpoint, debugBreakpointHint, debugStackframe, debugStackframeFocused } from 'vscode/vscode/vs/workbench/contrib/debug/browser/debugIcons';
16
- import { StringBuilder } from 'monaco-editor/esm/vs/editor/common/core/stringBuilder.js';
17
- import { dispose, Disposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
18
- import { Emitter } from 'monaco-editor/esm/vs/base/common/event.js';
19
27
  import { topStackFrameColor, focusedStackFrameColor } from './callStackEditorContribution.js';
28
+ import { breakpoint, debugBreakpointHint, debugStackframe, debugStackframeFocused } from 'vscode/vscode/vs/workbench/contrib/debug/browser/debugIcons';
29
+ import { DISASSEMBLY_VIEW_ID, CONTEXT_LANGUAGE_SUPPORTS_DISASSEMBLE_REQUEST, IDebugService } from 'vscode/vscode/vs/workbench/contrib/debug/common/debug';
20
30
  import { InstructionBreakpoint } from '../common/debugModel.js';
21
- import { IContextKeyService } from 'monaco-editor/esm/vs/platform/contextkey/common/contextkey.js';
22
- import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService';
23
- import { isCodeEditor } from 'monaco-editor/esm/vs/editor/browser/editorBrowser.js';
24
31
  import { getUriFromSource } from '../common/debugSource.js';
25
- import { IUriIdentityService } from 'monaco-editor/esm/vs/platform/uriIdentity/common/uriIdentity.js';
26
- import { ITextModelService } from 'monaco-editor/esm/vs/editor/common/services/resolverService.js';
27
- import { Range } from 'monaco-editor/esm/vs/editor/common/core/range.js';
28
- import { URI } from 'monaco-editor/esm/vs/base/common/uri.js';
29
- import { isUri } from 'vscode/vscode/vs/workbench/contrib/debug/common/debugUtils';
30
- import { isAbsolute } from 'monaco-editor/esm/vs/base/common/path.js';
31
- import { applyFontInfo } from 'monaco-editor/esm/vs/editor/browser/config/domFontInfo.js';
32
- import { binarySearch2 } from 'monaco-editor/esm/vs/base/common/arrays.js';
33
- import { ILogService } from 'monaco-editor/esm/vs/platform/log/common/log.js';
32
+ import { isUri, sourcesEqual } from 'vscode/vscode/vs/workbench/contrib/debug/common/debugUtils';
33
+ import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService';
34
34
 
35
35
  var DisassemblyView_1, BreakpointRenderer_1, InstructionRenderer_1;
36
36
  const disassemblyNotAvailable = {
37
37
  allowBreakpoint: false,
38
38
  isBreakpointSet: false,
39
39
  isBreakpointEnabled: false,
40
+ instructionReference: '',
41
+ instructionOffset: 0,
42
+ instructionReferenceOffset: 0,
43
+ address: 0n,
40
44
  instruction: {
41
45
  address: '-1',
42
46
  instruction: ( (localize('instructionNotAvailable', "Disassembly not available.")))
43
47
  },
44
- instructionAddress: BigInt(-1)
45
48
  };
46
49
  let DisassemblyView = class DisassemblyView extends EditorPane {
47
50
  static { DisassemblyView_1 = this; }
@@ -54,8 +57,9 @@ let DisassemblyView = class DisassemblyView extends EditorPane {
54
57
  this._instructionBpList = [];
55
58
  this._enableSourceCodeRender = true;
56
59
  this._loadingLock = false;
60
+ this._referenceToMemoryAddress = ( (new Map()));
57
61
  this._disassembledInstructions = undefined;
58
- this._onDidChangeStackFrame = ( (new Emitter()));
62
+ this._onDidChangeStackFrame = this._register(( (new Emitter({ leakWarningThreshold: 1000 }))));
59
63
  this._previousDebuggingState = _debugService.state;
60
64
  this._fontInfo = BareFontInfo.createFromRawSettings(_configurationService.getValue('editor'), PixelRatio.value);
61
65
  this._register(_configurationService.onDidChangeConfiguration(e => {
@@ -66,7 +70,6 @@ let DisassemblyView = class DisassemblyView extends EditorPane {
66
70
  const newValue = this._configurationService.getValue('debug').disassemblyView.showSourceCode;
67
71
  if (this._enableSourceCodeRender !== newValue) {
68
72
  this._enableSourceCodeRender = newValue;
69
- this.reloadDisassembly(undefined);
70
73
  }
71
74
  else {
72
75
  this._disassembledInstructions?.rerender();
@@ -77,24 +80,42 @@ let DisassemblyView = class DisassemblyView extends EditorPane {
77
80
  get fontInfo() { return this._fontInfo; }
78
81
  get currentInstructionAddresses() {
79
82
  return (
80
- (( (( (this._debugService.getModel().getSessions(false).
83
+ (( (( (( (this._debugService.getModel().getSessions(false).
81
84
  map(session => session.getAllThreads()))).
82
85
  reduce((prev, curr) => prev.concat(curr), []).
83
86
  map(thread => thread.getTopStackFrame()))).
84
- map(frame => frame?.instructionPointerReference))
87
+ map(frame => frame?.instructionPointerReference))).
88
+ map(ref => ref ? this.getReferenceAddress(ref) : undefined))
85
89
  );
86
90
  }
87
- get focusedCurrentInstructionAddress() {
91
+ get focusedCurrentInstructionReference() {
88
92
  return this._debugService.getViewModel().focusedStackFrame?.thread.getTopStackFrame()?.instructionPointerReference;
89
93
  }
90
- get focusedInstructionAddress() {
94
+ get focusedCurrentInstructionAddress() {
95
+ const ref = this.focusedCurrentInstructionReference;
96
+ return ref ? this.getReferenceAddress(ref) : undefined;
97
+ }
98
+ get focusedInstructionReference() {
91
99
  return this._debugService.getViewModel().focusedStackFrame?.instructionPointerReference;
92
100
  }
101
+ get focusedInstructionAddress() {
102
+ const ref = this.focusedInstructionReference;
103
+ return ref ? this.getReferenceAddress(ref) : undefined;
104
+ }
93
105
  get isSourceCodeRender() { return this._enableSourceCodeRender; }
94
106
  get debugSession() {
95
107
  return this._debugService.getViewModel().focusedSession;
96
108
  }
97
109
  get onDidChangeStackFrame() { return this._onDidChangeStackFrame.event; }
110
+ get focusedAddressAndOffset() {
111
+ const element = this._disassembledInstructions?.getFocusedElements()[0];
112
+ if (!element) {
113
+ return undefined;
114
+ }
115
+ const reference = element.instructionReference;
116
+ const offset = Number(element.address - this.getReferenceAddress(reference));
117
+ return { reference, offset, address: element.address };
118
+ }
98
119
  createEditor(parent) {
99
120
  this._enableSourceCodeRender = this._configurationService.getValue('debug').disassemblyView.showSourceCode;
100
121
  const lineHeight = this.fontInfo.lineHeight;
@@ -104,7 +125,7 @@ let DisassemblyView = class DisassemblyView extends EditorPane {
104
125
  this.headerRowHeight = 0;
105
126
  }
106
127
  getHeight(row) {
107
- if (thisOM.isSourceCodeRender && row.instruction.location?.path && row.instruction.line) {
128
+ if (thisOM.isSourceCodeRender && row.showSourceLocation && row.instruction.location?.path && row.instruction.line) {
108
129
  if (row.instruction.endLine) {
109
130
  return lineHeight * (row.instruction.endLine - row.instruction.line + 2);
110
131
  }
@@ -148,17 +169,19 @@ let DisassemblyView = class DisassemblyView extends EditorPane {
148
169
  accessibilityProvider: ( (new AccessibilityProvider())),
149
170
  mouseSupport: false
150
171
  }));
151
- this.reloadDisassembly();
172
+ if (this.focusedInstructionReference) {
173
+ this.reloadDisassembly(this.focusedInstructionReference, 0);
174
+ }
152
175
  this._register(this._disassembledInstructions.onDidScroll(e => {
153
176
  if (this._loadingLock) {
154
177
  return;
155
178
  }
156
179
  if (e.oldScrollTop > e.scrollTop && e.scrollTop < e.height) {
157
180
  this._loadingLock = true;
158
- const topElement = Math.floor(e.scrollTop / this.fontInfo.lineHeight) + DisassemblyView_1.NUM_INSTRUCTIONS_TO_LOAD;
159
- this.scrollUp_LoadDisassembledInstructions(DisassemblyView_1.NUM_INSTRUCTIONS_TO_LOAD).then((success) => {
160
- if (success) {
161
- this._disassembledInstructions.reveal(topElement, 0);
181
+ const prevTop = Math.floor(e.scrollTop / this.fontInfo.lineHeight);
182
+ this.scrollUp_LoadDisassembledInstructions(DisassemblyView_1.NUM_INSTRUCTIONS_TO_LOAD).then((loaded) => {
183
+ if (loaded > 0) {
184
+ this._disassembledInstructions.reveal(prevTop + loaded, 0);
162
185
  }
163
186
  this._loadingLock = false;
164
187
  });
@@ -168,18 +191,18 @@ let DisassemblyView = class DisassemblyView extends EditorPane {
168
191
  this.scrollDown_LoadDisassembledInstructions(DisassemblyView_1.NUM_INSTRUCTIONS_TO_LOAD).then(() => { this._loadingLock = false; });
169
192
  }
170
193
  }));
171
- this._register(this._debugService.getViewModel().onDidFocusStackFrame((stackFrame) => {
172
- if (this._disassembledInstructions) {
173
- this.goToAddress();
174
- this._onDidChangeStackFrame.fire();
194
+ this._register(this._debugService.getViewModel().onDidFocusStackFrame(({ stackFrame }) => {
195
+ if (this._disassembledInstructions && stackFrame?.instructionPointerReference) {
196
+ this.goToInstructionAndOffset(stackFrame.instructionPointerReference, 0);
175
197
  }
198
+ this._onDidChangeStackFrame.fire();
176
199
  }));
177
200
  this._register(this._debugService.getModel().onDidChangeBreakpoints(bpEvent => {
178
201
  if (bpEvent && this._disassembledInstructions) {
179
202
  let changed = false;
180
203
  bpEvent.added?.forEach((bp) => {
181
204
  if (bp instanceof InstructionBreakpoint) {
182
- const index = this.getIndexFromAddress(bp.instructionReference);
205
+ const index = this.getIndexFromReferenceAndOffset(bp.instructionReference, bp.offset);
183
206
  if (index >= 0) {
184
207
  this._disassembledInstructions.row(index).isBreakpointSet = true;
185
208
  this._disassembledInstructions.row(index).isBreakpointEnabled = bp.enabled;
@@ -189,7 +212,7 @@ let DisassemblyView = class DisassemblyView extends EditorPane {
189
212
  });
190
213
  bpEvent.removed?.forEach((bp) => {
191
214
  if (bp instanceof InstructionBreakpoint) {
192
- const index = this.getIndexFromAddress(bp.instructionReference);
215
+ const index = this.getIndexFromReferenceAndOffset(bp.instructionReference, bp.offset);
193
216
  if (index >= 0) {
194
217
  this._disassembledInstructions.row(index).isBreakpointSet = false;
195
218
  changed = true;
@@ -198,7 +221,7 @@ let DisassemblyView = class DisassemblyView extends EditorPane {
198
221
  });
199
222
  bpEvent.changed?.forEach((bp) => {
200
223
  if (bp instanceof InstructionBreakpoint) {
201
- const index = this.getIndexFromAddress(bp.instructionReference);
224
+ const index = this.getIndexFromReferenceAndOffset(bp.instructionReference, bp.offset);
202
225
  if (index >= 0) {
203
226
  if (this._disassembledInstructions.row(index).isBreakpointEnabled !== bp.enabled) {
204
227
  this._disassembledInstructions.row(index).isBreakpointEnabled = bp.enabled;
@@ -208,6 +231,9 @@ let DisassemblyView = class DisassemblyView extends EditorPane {
208
231
  }
209
232
  });
210
233
  this._instructionBpList = this._debugService.getModel().getInstructionBreakpoints();
234
+ for (const bp of this._instructionBpList) {
235
+ this.primeMemoryReference(bp.instructionReference);
236
+ }
211
237
  if (changed) {
212
238
  this._onDidChangeStackFrame.fire();
213
239
  }
@@ -216,24 +242,35 @@ let DisassemblyView = class DisassemblyView extends EditorPane {
216
242
  this._register(this._debugService.onDidChangeState(e => {
217
243
  if (((e === 3 || e === 2) ) &&
218
244
  ((this._previousDebuggingState !== 3 && this._previousDebuggingState !== 2) )) {
219
- this._disassembledInstructions?.splice(0, this._disassembledInstructions.length, [disassemblyNotAvailable]);
245
+ this.clear();
220
246
  this._enableSourceCodeRender = this._configurationService.getValue('debug').disassemblyView.showSourceCode;
221
247
  }
222
248
  this._previousDebuggingState = e;
249
+ this._onDidChangeStackFrame.fire();
223
250
  }));
224
251
  }
225
252
  layout(dimension) {
226
253
  this._disassembledInstructions?.layout(dimension.height);
227
254
  }
255
+ async goToInstructionAndOffset(instructionReference, offset, focus) {
256
+ let addr = this._referenceToMemoryAddress.get(instructionReference);
257
+ if (addr === undefined) {
258
+ await this.loadDisassembledInstructions(instructionReference, 0, -DisassemblyView_1.NUM_INSTRUCTIONS_TO_LOAD, DisassemblyView_1.NUM_INSTRUCTIONS_TO_LOAD);
259
+ addr = this._referenceToMemoryAddress.get(instructionReference);
260
+ }
261
+ if (addr) {
262
+ this.goToAddress(addr + BigInt(offset), focus);
263
+ }
264
+ }
265
+ getReferenceAddress(instructionReference) {
266
+ return this._referenceToMemoryAddress.get(instructionReference);
267
+ }
228
268
  goToAddress(address, focus) {
229
269
  if (!this._disassembledInstructions) {
230
- return;
231
- }
232
- if (!address) {
233
- address = this.focusedInstructionAddress;
270
+ return false;
234
271
  }
235
272
  if (!address) {
236
- return;
273
+ return false;
237
274
  }
238
275
  const index = this.getIndexFromAddress(address);
239
276
  if (index >= 0) {
@@ -242,41 +279,53 @@ let DisassemblyView = class DisassemblyView extends EditorPane {
242
279
  this._disassembledInstructions.domFocus();
243
280
  this._disassembledInstructions.setFocus([index]);
244
281
  }
282
+ return true;
245
283
  }
246
- else if (this._debugService.state === 2 ) {
247
- this.reloadDisassembly(address);
248
- }
284
+ return false;
249
285
  }
250
286
  async scrollUp_LoadDisassembledInstructions(instructionCount) {
251
- if (this._disassembledInstructions && this._disassembledInstructions.length > 0) {
252
- const address = this._disassembledInstructions?.row(0).instruction.address;
253
- return this.loadDisassembledInstructions(address, -instructionCount, instructionCount);
287
+ const first = this._disassembledInstructions?.row(0);
288
+ if (first) {
289
+ return this.loadDisassembledInstructions(first.instructionReference, first.instructionReferenceOffset, first.instructionOffset - instructionCount, instructionCount);
254
290
  }
255
- return false;
291
+ return 0;
256
292
  }
257
293
  async scrollDown_LoadDisassembledInstructions(instructionCount) {
258
- if (this._disassembledInstructions && this._disassembledInstructions.length > 0) {
259
- const address = this._disassembledInstructions?.row(this._disassembledInstructions?.length - 1).instruction.address;
260
- return this.loadDisassembledInstructions(address, 1, instructionCount);
294
+ const last = this._disassembledInstructions?.row(this._disassembledInstructions?.length - 1);
295
+ if (last) {
296
+ return this.loadDisassembledInstructions(last.instructionReference, last.instructionReferenceOffset, last.instructionOffset + 1, instructionCount);
261
297
  }
262
- return false;
298
+ return 0;
263
299
  }
264
- async loadDisassembledInstructions(address, instructionOffset, instructionCount) {
265
- if (!address || address === '-1') {
266
- address = this.focusedInstructionAddress;
300
+ async primeMemoryReference(instructionReference) {
301
+ if (( (this._referenceToMemoryAddress.has(instructionReference)))) {
302
+ return true;
267
303
  }
268
- if (!address) {
269
- return false;
304
+ const s = await this.debugSession?.disassemble(instructionReference, 0, 0, 1);
305
+ if (s && s.length > 0) {
306
+ try {
307
+ this._referenceToMemoryAddress.set(instructionReference, BigInt(s[0].address));
308
+ return true;
309
+ }
310
+ catch {
311
+ return false;
312
+ }
270
313
  }
314
+ return false;
315
+ }
316
+ async loadDisassembledInstructions(instructionReference, offset, instructionOffset, instructionCount) {
271
317
  const session = this.debugSession;
272
- const resultEntries = await session?.disassemble(address, 0, instructionOffset, instructionCount);
318
+ const resultEntries = await session?.disassemble(instructionReference, offset, instructionOffset, instructionCount);
319
+ if (!( (this._referenceToMemoryAddress.has(instructionReference))) && instructionOffset !== 0) {
320
+ await this.loadDisassembledInstructions(instructionReference, 0, 0, DisassemblyView_1.NUM_INSTRUCTIONS_TO_LOAD);
321
+ }
273
322
  if (session && resultEntries && this._disassembledInstructions) {
274
323
  const newEntries = [];
275
324
  let lastLocation;
276
325
  let lastLine;
277
326
  for (let i = 0; i < resultEntries.length; i++) {
278
- const found = this._instructionBpList.find(p => p.instructionReference === resultEntries[i].address);
279
327
  const instruction = resultEntries[i];
328
+ const thisInstructionOffset = instructionOffset + i;
280
329
  if (instruction.location) {
281
330
  lastLocation = instruction.location;
282
331
  lastLine = undefined;
@@ -293,64 +342,121 @@ let DisassemblyView = class DisassemblyView extends EditorPane {
293
342
  instruction.location = lastLocation;
294
343
  }
295
344
  }
296
- newEntries.push({ allowBreakpoint: true, isBreakpointSet: found !== undefined, isBreakpointEnabled: !!found?.enabled, instruction: instruction });
345
+ let address;
346
+ try {
347
+ address = BigInt(instruction.address);
348
+ }
349
+ catch {
350
+ console.error(`Could not parse disassembly address ${instruction.address} (in ${JSON.stringify(instruction)})`);
351
+ continue;
352
+ }
353
+ const entry = {
354
+ allowBreakpoint: true,
355
+ isBreakpointSet: false,
356
+ isBreakpointEnabled: false,
357
+ instructionReference,
358
+ instructionReferenceOffset: offset,
359
+ instructionOffset: thisInstructionOffset,
360
+ instruction,
361
+ address,
362
+ };
363
+ newEntries.push(entry);
364
+ if (offset === 0 && thisInstructionOffset === 0) {
365
+ this._referenceToMemoryAddress.set(instructionReference, address);
366
+ }
297
367
  }
298
- const specialEntriesToRemove = this._disassembledInstructions.length === 1 ? 1 : 0;
299
- if (instructionOffset >= 0) {
300
- this._disassembledInstructions.splice(this._disassembledInstructions.length, specialEntriesToRemove, newEntries);
368
+ if (newEntries.length === 0) {
369
+ return 0;
301
370
  }
302
- else {
303
- this._disassembledInstructions.splice(0, specialEntriesToRemove, newEntries);
371
+ const refBaseAddress = this._referenceToMemoryAddress.get(instructionReference);
372
+ const bps = ( (this._instructionBpList.map(p => {
373
+ const base = this._referenceToMemoryAddress.get(p.instructionReference);
374
+ if (!base) {
375
+ return undefined;
376
+ }
377
+ return {
378
+ enabled: p.enabled,
379
+ address: base + BigInt(p.offset || 0),
380
+ };
381
+ })));
382
+ if (refBaseAddress !== undefined) {
383
+ for (const entry of newEntries) {
384
+ const bp = bps.find(p => p?.address === entry.address);
385
+ if (bp) {
386
+ entry.isBreakpointSet = true;
387
+ entry.isBreakpointEnabled = bp.enabled;
388
+ }
389
+ }
304
390
  }
305
- return true;
391
+ const da = this._disassembledInstructions;
392
+ if (da.length === 1 && this._disassembledInstructions.row(0) === disassemblyNotAvailable) {
393
+ da.splice(0, 1);
394
+ }
395
+ const firstAddr = newEntries[0].address;
396
+ const lastAddr = newEntries[newEntries.length - 1].address;
397
+ const startN = binarySearch2(da.length, i => Number(da.row(i).address - firstAddr));
398
+ const start = startN < 0 ? ~startN : startN;
399
+ const endN = binarySearch2(da.length, i => Number(da.row(i).address - lastAddr));
400
+ const end = endN < 0 ? ~endN : endN;
401
+ const toDelete = end - start;
402
+ let lastLocated;
403
+ for (let i = start - 1; i >= 0; i--) {
404
+ const { instruction } = da.row(i);
405
+ if (instruction.location && instruction.line !== undefined) {
406
+ lastLocated = instruction;
407
+ break;
408
+ }
409
+ }
410
+ const shouldShowLocation = (instruction) => instruction.line !== undefined && instruction.location !== undefined &&
411
+ (!lastLocated || !sourcesEqual(instruction.location, lastLocated.location) || instruction.line !== lastLocated.line);
412
+ for (const entry of newEntries) {
413
+ if (shouldShowLocation(entry.instruction)) {
414
+ entry.showSourceLocation = true;
415
+ lastLocated = entry.instruction;
416
+ }
417
+ }
418
+ da.splice(start, toDelete, newEntries);
419
+ return newEntries.length - toDelete;
306
420
  }
307
- return false;
421
+ return 0;
308
422
  }
309
- getIndexFromAddress(instructionAddress) {
423
+ getIndexFromReferenceAndOffset(instructionReference, offset) {
424
+ const addr = this._referenceToMemoryAddress.get(instructionReference);
425
+ if (addr === undefined) {
426
+ return -1;
427
+ }
428
+ return this.getIndexFromAddress(addr + BigInt(offset));
429
+ }
430
+ getIndexFromAddress(address) {
310
431
  const disassembledInstructions = this._disassembledInstructions;
311
432
  if (disassembledInstructions && disassembledInstructions.length > 0) {
312
- const address = BigInt(instructionAddress);
313
- if (address) {
314
- return binarySearch2(disassembledInstructions.length, index => {
315
- const row = disassembledInstructions.row(index);
316
- this.ensureAddressParsed(row);
317
- if (row.instructionAddress > address) {
318
- return 1;
319
- }
320
- else if (row.instructionAddress < address) {
321
- return -1;
322
- }
323
- else {
324
- return 0;
325
- }
326
- });
327
- }
433
+ return binarySearch2(disassembledInstructions.length, index => {
434
+ const row = disassembledInstructions.row(index);
435
+ return Number(row.address - address);
436
+ });
328
437
  }
329
438
  return -1;
330
439
  }
331
- ensureAddressParsed(entry) {
332
- if (entry.instructionAddress !== undefined) {
440
+ reloadDisassembly(instructionReference, offset) {
441
+ if (!this._disassembledInstructions) {
333
442
  return;
334
443
  }
335
- else {
336
- entry.instructionAddress = BigInt(entry.instruction.address);
337
- }
338
- }
339
- reloadDisassembly(targetAddress) {
340
- if (this._disassembledInstructions) {
341
- this._loadingLock = true;
342
- this._disassembledInstructions.splice(0, this._disassembledInstructions.length, [disassemblyNotAvailable]);
343
- this._instructionBpList = this._debugService.getModel().getInstructionBreakpoints();
344
- this.loadDisassembledInstructions(targetAddress, -DisassemblyView_1.NUM_INSTRUCTIONS_TO_LOAD * 4, DisassemblyView_1.NUM_INSTRUCTIONS_TO_LOAD * 8).then(() => {
345
- if (this._disassembledInstructions.length > 0) {
346
- const targetIndex = Math.floor(this._disassembledInstructions.length / 2);
347
- this._disassembledInstructions.reveal(targetIndex, 0.5);
348
- this._disassembledInstructions.domFocus();
349
- this._disassembledInstructions.setFocus([targetIndex]);
350
- }
351
- this._loadingLock = false;
352
- });
353
- }
444
+ this._loadingLock = true;
445
+ this.clear();
446
+ this._instructionBpList = this._debugService.getModel().getInstructionBreakpoints();
447
+ this.loadDisassembledInstructions(instructionReference, offset, -DisassemblyView_1.NUM_INSTRUCTIONS_TO_LOAD * 4, DisassemblyView_1.NUM_INSTRUCTIONS_TO_LOAD * 8).then(() => {
448
+ if (this._disassembledInstructions.length > 0) {
449
+ const targetIndex = Math.floor(this._disassembledInstructions.length / 2);
450
+ this._disassembledInstructions.reveal(targetIndex, 0.5);
451
+ this._disassembledInstructions.domFocus();
452
+ this._disassembledInstructions.setFocus([targetIndex]);
453
+ }
454
+ this._loadingLock = false;
455
+ });
456
+ }
457
+ clear() {
458
+ this._referenceToMemoryAddress.clear();
459
+ this._disassembledInstructions?.splice(0, this._disassembledInstructions.length, [disassemblyNotAvailable]);
354
460
  }
355
461
  };
356
462
  DisassemblyView = DisassemblyView_1 = ( (__decorate([
@@ -398,11 +504,13 @@ let BreakpointRenderer = class BreakpointRenderer {
398
504
  addStandardDisposableListener(container, 'click', () => {
399
505
  if (currentElement.element?.allowBreakpoint) {
400
506
  icon.classList.add(this._breakpointHintIcon);
507
+ const reference = currentElement.element.instructionReference;
508
+ const offset = Number(currentElement.element.address - this._disassemblyView.getReferenceAddress(reference));
401
509
  if (currentElement.element.isBreakpointSet) {
402
- this._debugService.removeInstructionBreakpoints(currentElement.element.instruction.address);
510
+ this._debugService.removeInstructionBreakpoints(reference, offset);
403
511
  }
404
512
  else if (currentElement.element.allowBreakpoint && !currentElement.element.isBreakpointSet) {
405
- this._debugService.addInstructionBreakpoint(currentElement.element.instruction.address, 0);
513
+ this._debugService.addInstructionBreakpoint(reference, offset, currentElement.element.address);
406
514
  }
407
515
  }
408
516
  })
@@ -418,10 +526,10 @@ let BreakpointRenderer = class BreakpointRenderer {
418
526
  templateData.disposables = [];
419
527
  }
420
528
  rerenderDebugStackframe(icon, element) {
421
- if (element?.instruction.address === this._disassemblyView.focusedCurrentInstructionAddress) {
529
+ if (element?.address === this._disassemblyView.focusedCurrentInstructionAddress) {
422
530
  icon.classList.add(this._debugStackframe);
423
531
  }
424
- else if (element?.instruction.address === this._disassemblyView.focusedInstructionAddress) {
532
+ else if (element?.address === this._disassemblyView.focusedInstructionAddress) {
425
533
  icon.classList.add(this._debugStackframeFocused);
426
534
  }
427
535
  else {
@@ -489,7 +597,7 @@ let InstructionRenderer = class InstructionRenderer extends Disposable {
489
597
  const instruction = element.instruction;
490
598
  templateData.sourcecode.innerText = '';
491
599
  const sb = ( (new StringBuilder(1000)));
492
- if (this._disassemblyView.isSourceCodeRender && instruction.location?.path && instruction.line) {
600
+ if (this._disassemblyView.isSourceCodeRender && element.showSourceLocation && instruction.location?.path && instruction.line !== undefined) {
493
601
  const sourceURI = this.getUriFromSource(instruction);
494
602
  if (sourceURI) {
495
603
  let textModel = undefined;
@@ -546,10 +654,10 @@ let InstructionRenderer = class InstructionRenderer extends Disposable {
546
654
  templateData.disposables = [];
547
655
  }
548
656
  rerenderBackground(instruction, sourceCode, element) {
549
- if (element && this._disassemblyView.currentInstructionAddresses.includes(element.instruction.address)) {
657
+ if (element && this._disassemblyView.currentInstructionAddresses.includes(element.address)) {
550
658
  instruction.style.background = this._topStackFrameColor?.toString() || 'transparent';
551
659
  }
552
- else if (element?.instruction.address === this._disassemblyView.focusedInstructionAddress) {
660
+ else if (element?.address === this._disassemblyView.focusedInstructionAddress) {
553
661
  instruction.style.background = this._focusedStackFrameColor?.toString() || 'transparent';
554
662
  }
555
663
  else {
@@ -627,7 +735,7 @@ class AccessibilityProvider {
627
735
  let DisassemblyViewContribution = class DisassemblyViewContribution {
628
736
  constructor(editorService, debugService, contextKeyService) {
629
737
  contextKeyService.bufferChangeEvents(() => {
630
- this._languageSupportsDisassemleRequest = CONTEXT_LANGUAGE_SUPPORTS_DISASSEMBLE_REQUEST.bindTo(contextKeyService);
738
+ this._languageSupportsDisassembleRequest = CONTEXT_LANGUAGE_SUPPORTS_DISASSEMBLE_REQUEST.bindTo(contextKeyService);
631
739
  });
632
740
  const onDidActiveEditorChangeListener = () => {
633
741
  if (this._onDidChangeModelLanguage) {
@@ -637,13 +745,13 @@ let DisassemblyViewContribution = class DisassemblyViewContribution {
637
745
  const activeTextEditorControl = editorService.activeTextEditorControl;
638
746
  if (isCodeEditor(activeTextEditorControl)) {
639
747
  const language = activeTextEditorControl.getModel()?.getLanguageId();
640
- this._languageSupportsDisassemleRequest?.set(!!language && debugService.getAdapterManager().someDebuggerInterestedInLanguage(language));
748
+ this._languageSupportsDisassembleRequest?.set(!!language && debugService.getAdapterManager().someDebuggerInterestedInLanguage(language));
641
749
  this._onDidChangeModelLanguage = activeTextEditorControl.onDidChangeModelLanguage(e => {
642
- this._languageSupportsDisassemleRequest?.set(debugService.getAdapterManager().someDebuggerInterestedInLanguage(e.newLanguage));
750
+ this._languageSupportsDisassembleRequest?.set(debugService.getAdapterManager().someDebuggerInterestedInLanguage(e.newLanguage));
643
751
  });
644
752
  }
645
753
  else {
646
- this._languageSupportsDisassemleRequest?.set(false);
754
+ this._languageSupportsDisassembleRequest?.set(false);
647
755
  }
648
756
  };
649
757
  onDidActiveEditorChangeListener();
@@ -46,7 +46,7 @@ let ExceptionWidget = class ExceptionWidget extends ZoneWidget {
46
46
  }
47
47
  _fillContainer(container) {
48
48
  this.setCssClass('exception-widget');
49
- const fontInfo = this.editor.getOption(49 );
49
+ const fontInfo = this.editor.getOption(50 );
50
50
  container.style.fontSize = `${fontInfo.fontSize}px`;
51
51
  container.style.lineHeight = `${fontInfo.lineHeight}px`;
52
52
  container.tabIndex = 0;
@@ -85,7 +85,7 @@ let ExceptionWidget = class ExceptionWidget extends ZoneWidget {
85
85
  }
86
86
  _doLayout(_heightInPixel, _widthInPixel) {
87
87
  this.container.style.height = 'initial';
88
- const lineHeight = this.editor.getOption(65 );
88
+ const lineHeight = this.editor.getOption(66 );
89
89
  const arrowHeight = Math.round(lineHeight / 3);
90
90
  const computedLinesNumber = Math.ceil((this.container.offsetHeight + arrowHeight) / lineHeight);
91
91
  this._relayout(computedLinesNumber);
@@ -100,7 +100,7 @@ let RawDebugSession = class RawDebugSession {
100
100
  case 'terminated':
101
101
  this._onDidTerminateDebugee.fire(event);
102
102
  break;
103
- case 'exit':
103
+ case 'exited':
104
104
  this._onDidExitDebugee.fire(event);
105
105
  break;
106
106
  case 'progressStart':
@@ -282,7 +282,7 @@ let Repl = class Repl extends FilterViewPane {
282
282
  lineHeight: this.replOptions.replConfiguration.lineHeight,
283
283
  fontFamily: this.replOptions.replConfiguration.fontFamily === 'default' ? EDITOR_FONT_DEFAULTS.fontFamily : this.replOptions.replConfiguration.fontFamily
284
284
  });
285
- const replInputLineHeight = this.replInput.getOption(65 );
285
+ const replInputLineHeight = this.replInput.getOption(66 );
286
286
  this.styleElement.textContent = `
287
287
  .repl .repl-input-wrapper .repl-input-chevron {
288
288
  line-height: ${replInputLineHeight}px