@theia/debug 1.70.0-next.81 → 1.71.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.
- package/lib/browser/breakpoint/breakpoint-manager.d.ts +80 -45
- package/lib/browser/breakpoint/breakpoint-manager.d.ts.map +1 -1
- package/lib/browser/breakpoint/breakpoint-manager.js +553 -170
- package/lib/browser/breakpoint/breakpoint-manager.js.map +1 -1
- package/lib/browser/breakpoint/breakpoint-manager.spec.d.ts +2 -0
- package/lib/browser/breakpoint/breakpoint-manager.spec.d.ts.map +1 -0
- package/lib/browser/breakpoint/breakpoint-manager.spec.js +861 -0
- package/lib/browser/breakpoint/breakpoint-manager.spec.js.map +1 -0
- package/lib/browser/breakpoint/breakpoint-marker.d.ts +7 -10
- package/lib/browser/breakpoint/breakpoint-marker.d.ts.map +1 -1
- package/lib/browser/breakpoint/breakpoint-marker.js +14 -11
- package/lib/browser/breakpoint/breakpoint-marker.js.map +1 -1
- package/lib/browser/breakpoint/debug-data-breakpoint-actions.js +1 -1
- package/lib/browser/breakpoint/debug-data-breakpoint-actions.js.map +1 -1
- package/lib/browser/debug-frontend-application-contribution.d.ts +1 -2
- package/lib/browser/debug-frontend-application-contribution.d.ts.map +1 -1
- package/lib/browser/debug-frontend-application-contribution.js +13 -21
- package/lib/browser/debug-frontend-application-contribution.js.map +1 -1
- package/lib/browser/debug-frontend-module.d.ts.map +1 -1
- package/lib/browser/debug-frontend-module.js +3 -0
- package/lib/browser/debug-frontend-module.js.map +1 -1
- package/lib/browser/debug-session-manager.d.ts +8 -27
- package/lib/browser/debug-session-manager.d.ts.map +1 -1
- package/lib/browser/debug-session-manager.js +14 -132
- package/lib/browser/debug-session-manager.js.map +1 -1
- package/lib/browser/debug-session.d.ts +1 -21
- package/lib/browser/debug-session.d.ts.map +1 -1
- package/lib/browser/debug-session.js +72 -203
- package/lib/browser/debug-session.js.map +1 -1
- package/lib/browser/disassembly-view/disassembly-view-breakpoint-renderer.js +1 -1
- package/lib/browser/disassembly-view/disassembly-view-breakpoint-renderer.js.map +1 -1
- package/lib/browser/disassembly-view/disassembly-view-widget.d.ts.map +1 -1
- package/lib/browser/disassembly-view/disassembly-view-widget.js +17 -24
- package/lib/browser/disassembly-view/disassembly-view-widget.js.map +1 -1
- package/lib/browser/editor/debug-editor-model.d.ts +15 -5
- package/lib/browser/editor/debug-editor-model.d.ts.map +1 -1
- package/lib/browser/editor/debug-editor-model.js +56 -32
- package/lib/browser/editor/debug-editor-model.js.map +1 -1
- package/lib/browser/model/debug-breakpoint-opener.d.ts +14 -0
- package/lib/browser/model/debug-breakpoint-opener.d.ts.map +1 -0
- package/lib/browser/model/debug-breakpoint-opener.js +67 -0
- package/lib/browser/model/debug-breakpoint-opener.js.map +1 -0
- package/lib/browser/model/debug-breakpoint.d.ts +32 -13
- package/lib/browser/model/debug-breakpoint.d.ts.map +1 -1
- package/lib/browser/model/debug-breakpoint.js +76 -16
- package/lib/browser/model/debug-breakpoint.js.map +1 -1
- package/lib/browser/model/debug-data-breakpoint.d.ts +1 -0
- package/lib/browser/model/debug-data-breakpoint.d.ts.map +1 -1
- package/lib/browser/model/debug-data-breakpoint.js +6 -5
- package/lib/browser/model/debug-data-breakpoint.js.map +1 -1
- package/lib/browser/model/debug-function-breakpoint.d.ts +4 -1
- package/lib/browser/model/debug-function-breakpoint.d.ts.map +1 -1
- package/lib/browser/model/debug-function-breakpoint.js +20 -29
- package/lib/browser/model/debug-function-breakpoint.js.map +1 -1
- package/lib/browser/model/debug-instruction-breakpoint.d.ts +2 -1
- package/lib/browser/model/debug-instruction-breakpoint.d.ts.map +1 -1
- package/lib/browser/model/debug-instruction-breakpoint.js +8 -8
- package/lib/browser/model/debug-instruction-breakpoint.js.map +1 -1
- package/lib/browser/model/debug-source-breakpoint.d.ts +6 -15
- package/lib/browser/model/debug-source-breakpoint.d.ts.map +1 -1
- package/lib/browser/model/debug-source-breakpoint.js +16 -90
- package/lib/browser/model/debug-source-breakpoint.js.map +1 -1
- package/lib/browser/view/debug-breakpoints-source.d.ts +0 -2
- package/lib/browser/view/debug-breakpoints-source.d.ts.map +1 -1
- package/lib/browser/view/debug-breakpoints-source.js +2 -10
- package/lib/browser/view/debug-breakpoints-source.js.map +1 -1
- package/lib/browser/view/debug-breakpoints-widget.d.ts +2 -0
- package/lib/browser/view/debug-breakpoints-widget.d.ts.map +1 -1
- package/lib/browser/view/debug-breakpoints-widget.js +3 -0
- package/lib/browser/view/debug-breakpoints-widget.js.map +1 -1
- package/lib/browser/view/debug-exception-breakpoint.d.ts +18 -11
- package/lib/browser/view/debug-exception-breakpoint.d.ts.map +1 -1
- package/lib/browser/view/debug-exception-breakpoint.js +58 -24
- package/lib/browser/view/debug-exception-breakpoint.js.map +1 -1
- package/lib/browser/view/debug-view-model.d.ts +8 -4
- package/lib/browser/view/debug-view-model.d.ts.map +1 -1
- package/lib/browser/view/debug-view-model.js +16 -9
- package/lib/browser/view/debug-view-model.js.map +1 -1
- package/package.json +16 -16
- package/src/browser/breakpoint/breakpoint-manager.spec.ts +1106 -0
- package/src/browser/breakpoint/breakpoint-manager.ts +583 -194
- package/src/browser/breakpoint/breakpoint-marker.ts +21 -15
- package/src/browser/breakpoint/debug-data-breakpoint-actions.ts +1 -1
- package/src/browser/debug-frontend-application-contribution.ts +18 -23
- package/src/browser/debug-frontend-module.ts +5 -1
- package/src/browser/debug-session-manager.ts +15 -147
- package/src/browser/debug-session.tsx +71 -221
- package/src/browser/disassembly-view/disassembly-view-breakpoint-renderer.ts +1 -1
- package/src/browser/disassembly-view/disassembly-view-widget.ts +17 -23
- package/src/browser/editor/debug-editor-model.ts +58 -35
- package/src/browser/model/debug-breakpoint-opener.ts +51 -0
- package/src/browser/model/debug-breakpoint.tsx +101 -20
- package/src/browser/model/debug-data-breakpoint.tsx +8 -5
- package/src/browser/model/debug-function-breakpoint.tsx +18 -29
- package/src/browser/model/debug-instruction-breakpoint.tsx +10 -8
- package/src/browser/model/debug-source-breakpoint.tsx +23 -101
- package/src/browser/view/debug-breakpoints-source.tsx +2 -9
- package/src/browser/view/debug-breakpoints-widget.ts +6 -0
- package/src/browser/view/debug-exception-breakpoint.tsx +66 -27
- package/src/browser/view/debug-view-model.ts +21 -13
|
@@ -15,85 +15,36 @@
|
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
17
|
import * as React from '@theia/core/shared/react';
|
|
18
|
-
import { DebugProtocol } from '@vscode/debugprotocol
|
|
19
|
-
import {
|
|
18
|
+
import { DebugProtocol } from '@vscode/debugprotocol';
|
|
19
|
+
import { nls, RecursivePartial } from '@theia/core';
|
|
20
20
|
import URI from '@theia/core/lib/common/uri';
|
|
21
21
|
import { EditorWidget, Range } from '@theia/editor/lib/browser';
|
|
22
|
-
import { TREE_NODE_INFO_CLASS, WidgetOpenerOptions, codicon } from '@theia/core/lib/browser';
|
|
22
|
+
import { TREE_NODE_INFO_CLASS, WidgetOpenerOptions, codicon, open } from '@theia/core/lib/browser';
|
|
23
23
|
import { TreeElement } from '@theia/core/lib/browser/source-tree';
|
|
24
|
-
import { SourceBreakpoint } from '../breakpoint/breakpoint-marker';
|
|
25
|
-
import {
|
|
26
|
-
import { DebugBreakpoint, DebugBreakpointOptions, DebugBreakpointData, DebugBreakpointDecoration } from './debug-breakpoint';
|
|
24
|
+
import { DEBUG_BREAKPOINT_SCHEME, SourceBreakpoint } from '../breakpoint/breakpoint-marker';
|
|
25
|
+
import { DebugBreakpoint, DebugBreakpointOptions, DebugBreakpointDecoration } from './debug-breakpoint';
|
|
27
26
|
import { DebugCommands } from '../debug-commands';
|
|
28
27
|
|
|
29
|
-
export class DebugSourceBreakpointData extends DebugBreakpointData {
|
|
30
|
-
readonly origins: SourceBreakpoint[];
|
|
31
|
-
}
|
|
32
|
-
|
|
33
28
|
export class DebugSourceBreakpoint extends DebugBreakpoint<SourceBreakpoint> implements TreeElement {
|
|
34
29
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
constructor(origin: SourceBreakpoint, options: DebugBreakpointOptions, commandService: CommandService) {
|
|
39
|
-
super(new URI(origin.uri), options);
|
|
40
|
-
this.origins = [origin];
|
|
41
|
-
this.commandService = commandService;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
override update(data: Partial<DebugSourceBreakpointData>): void {
|
|
45
|
-
super.update(data);
|
|
30
|
+
static create(origin: SourceBreakpoint, options: DebugBreakpointOptions): DebugSourceBreakpoint {
|
|
31
|
+
return new this(origin, options);
|
|
46
32
|
}
|
|
47
33
|
|
|
48
|
-
|
|
49
|
-
|
|
34
|
+
constructor(readonly origin: SourceBreakpoint, options: DebugBreakpointOptions) {
|
|
35
|
+
super(new URI(origin.uri), options);
|
|
50
36
|
}
|
|
51
37
|
|
|
52
38
|
setEnabled(enabled: boolean): void {
|
|
53
|
-
|
|
54
|
-
let shouldUpdate = false;
|
|
55
|
-
const originLine = this.origin.raw.line;
|
|
56
|
-
const originColumn = this.origin.raw.column;
|
|
57
|
-
let breakpoints = raw && this.doRemove(this.origins.filter(origin => !(origin.raw.line === originLine && origin.raw.column === originColumn)));
|
|
58
|
-
// Check for breakpoints array with at least one entry
|
|
59
|
-
if (breakpoints && breakpoints.length) {
|
|
60
|
-
shouldUpdate = true;
|
|
61
|
-
} else {
|
|
62
|
-
breakpoints = this.breakpoints.getBreakpoints(uri);
|
|
63
|
-
}
|
|
64
|
-
for (const breakpoint of breakpoints) {
|
|
65
|
-
if (breakpoint.raw.line === this.origin.raw.line && breakpoint.raw.column === this.origin.raw.column && breakpoint.enabled !== enabled) {
|
|
66
|
-
breakpoint.enabled = enabled;
|
|
67
|
-
shouldUpdate = true;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
if (shouldUpdate) {
|
|
71
|
-
this.breakpoints.setBreakpoints(this.uri, breakpoints);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
updateOrigins(data: Partial<DebugProtocol.SourceBreakpoint>): void {
|
|
76
|
-
const breakpoints = this.breakpoints.getBreakpoints(this.uri);
|
|
77
|
-
let shouldUpdate = false;
|
|
78
|
-
const originPositions = new Set();
|
|
79
|
-
this.origins.forEach(origin => originPositions.add(origin.raw.line + ':' + origin.raw.column));
|
|
80
|
-
for (const breakpoint of breakpoints) {
|
|
81
|
-
if (originPositions.has(breakpoint.raw.line + ':' + breakpoint.raw.column)) {
|
|
82
|
-
Object.assign(breakpoint.raw, data);
|
|
83
|
-
shouldUpdate = true;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
if (shouldUpdate) {
|
|
87
|
-
this.breakpoints.setBreakpoints(this.uri, breakpoints);
|
|
88
|
-
}
|
|
39
|
+
this.breakpoints.enableBreakpoint(this, enabled);
|
|
89
40
|
}
|
|
90
41
|
|
|
91
42
|
/** 1-based */
|
|
92
43
|
get line(): number {
|
|
93
|
-
return this.raw && this.raw.line || this.
|
|
44
|
+
return this.raw && this.raw.line || this.origin.raw.line;
|
|
94
45
|
}
|
|
95
46
|
get column(): number | undefined {
|
|
96
|
-
return this.raw && this.raw.column || this.
|
|
47
|
+
return this.raw && this.raw.column || this.origin.raw.column;
|
|
97
48
|
}
|
|
98
49
|
get endLine(): number | undefined {
|
|
99
50
|
return this.raw && this.raw.endLine;
|
|
@@ -112,8 +63,8 @@ export class DebugSourceBreakpoint extends DebugBreakpoint<SourceBreakpoint> imp
|
|
|
112
63
|
return this.origin.raw.logMessage;
|
|
113
64
|
}
|
|
114
65
|
|
|
115
|
-
get source():
|
|
116
|
-
return this.raw
|
|
66
|
+
get source(): DebugProtocol.Source | undefined {
|
|
67
|
+
return this.raw?.source;
|
|
117
68
|
}
|
|
118
69
|
|
|
119
70
|
async open(options: WidgetOpenerOptions = {
|
|
@@ -132,17 +83,11 @@ export class DebugSourceBreakpoint extends DebugBreakpoint<SourceBreakpoint> imp
|
|
|
132
83
|
character: typeof endColumn === 'number' ? endColumn - 1 : undefined
|
|
133
84
|
};
|
|
134
85
|
}
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
} else {
|
|
141
|
-
return await this.editorManager.open(this.uri, {
|
|
142
|
-
...options,
|
|
143
|
-
selection
|
|
144
|
-
});
|
|
145
|
-
}
|
|
86
|
+
return open(
|
|
87
|
+
this.openerService,
|
|
88
|
+
URI.fromComponents({ authority: this.id, scheme: DEBUG_BREAKPOINT_SCHEME, path: '', fragment: '', query: '' }),
|
|
89
|
+
{ ...options, selection }
|
|
90
|
+
) as Promise<EditorWidget>;
|
|
146
91
|
}
|
|
147
92
|
|
|
148
93
|
protected override setBreakpointEnabled = (event: React.ChangeEvent<HTMLInputElement>) => {
|
|
@@ -183,23 +128,22 @@ export class DebugSourceBreakpoint extends DebugBreakpoint<SourceBreakpoint> imp
|
|
|
183
128
|
|
|
184
129
|
override doGetDecoration(messages: string[] = []): DebugBreakpointDecoration {
|
|
185
130
|
if (this.logMessage || this.condition || this.hitCondition) {
|
|
186
|
-
const { session } = this;
|
|
187
131
|
if (this.logMessage) {
|
|
188
|
-
if (
|
|
132
|
+
if (this.raw && !this.raw.supportsLogPoints) {
|
|
189
133
|
return this.getUnsupportedBreakpointDecoration(nls.localize('theia/debug/logpointsNotSupported',
|
|
190
134
|
'Logpoints not supported by this debug type'));
|
|
191
135
|
}
|
|
192
136
|
messages.push(nls.localizeByDefault('Log Message: {0}', this.logMessage));
|
|
193
137
|
}
|
|
194
138
|
if (this.condition) {
|
|
195
|
-
if (
|
|
139
|
+
if (this.raw && !this.raw.supportsConditionalBreakpoints) {
|
|
196
140
|
return this.getUnsupportedBreakpointDecoration(nls.localize('theia/debug/conditionalBreakpointsNotSupported',
|
|
197
141
|
'Conditional breakpoints not supported by this debug type'));
|
|
198
142
|
}
|
|
199
143
|
messages.push(nls.localizeByDefault('Condition: {0}', this.condition));
|
|
200
144
|
}
|
|
201
145
|
if (this.hitCondition) {
|
|
202
|
-
if (
|
|
146
|
+
if (this.raw && !this.raw.supportsHitConditionalBreakpoints) {
|
|
203
147
|
return this.getUnsupportedBreakpointDecoration(nls.localize('theia/debug/htiConditionalBreakpointsNotSupported',
|
|
204
148
|
'Hit conditional breakpoints not supported by this debug type'));
|
|
205
149
|
}
|
|
@@ -236,28 +180,6 @@ export class DebugSourceBreakpoint extends DebugBreakpoint<SourceBreakpoint> imp
|
|
|
236
180
|
}
|
|
237
181
|
|
|
238
182
|
remove(): void {
|
|
239
|
-
|
|
240
|
-
if (breakpoints) {
|
|
241
|
-
this.breakpoints.setBreakpoints(this.uri, breakpoints);
|
|
242
|
-
}
|
|
183
|
+
this.breakpoints.removeBreakpoint(this);
|
|
243
184
|
}
|
|
244
|
-
protected doRemove(origins: SourceBreakpoint[]): SourceBreakpoint[] | undefined {
|
|
245
|
-
if (!origins.length) {
|
|
246
|
-
return undefined;
|
|
247
|
-
}
|
|
248
|
-
const { uri } = this;
|
|
249
|
-
const toRemove = new Set();
|
|
250
|
-
origins.forEach(origin => toRemove.add(origin.raw.line + ':' + origin.raw.column));
|
|
251
|
-
let shouldUpdate = false;
|
|
252
|
-
const breakpoints = this.breakpoints.findMarkers({
|
|
253
|
-
uri,
|
|
254
|
-
dataFilter: data => {
|
|
255
|
-
const result = !toRemove.has(data.raw.line + ':' + data.raw.column);
|
|
256
|
-
shouldUpdate = shouldUpdate || !result;
|
|
257
|
-
return result;
|
|
258
|
-
}
|
|
259
|
-
}).map(({ data }) => data);
|
|
260
|
-
return shouldUpdate && breakpoints || undefined;
|
|
261
|
-
}
|
|
262
|
-
|
|
263
185
|
}
|
|
@@ -18,8 +18,6 @@ import { injectable, inject, postConstruct } from '@theia/core/shared/inversify'
|
|
|
18
18
|
import { TreeSource, TreeElement } from '@theia/core/lib/browser/source-tree';
|
|
19
19
|
import { DebugViewModel } from './debug-view-model';
|
|
20
20
|
import { BreakpointManager } from '../breakpoint/breakpoint-manager';
|
|
21
|
-
import { DebugExceptionBreakpoint } from './debug-exception-breakpoint';
|
|
22
|
-
import { CommandService } from '@theia/core/lib/common';
|
|
23
21
|
|
|
24
22
|
@injectable()
|
|
25
23
|
export class DebugBreakpointsSource extends TreeSource {
|
|
@@ -30,9 +28,6 @@ export class DebugBreakpointsSource extends TreeSource {
|
|
|
30
28
|
@inject(BreakpointManager)
|
|
31
29
|
protected readonly breakpoints: BreakpointManager;
|
|
32
30
|
|
|
33
|
-
@inject(CommandService)
|
|
34
|
-
protected readonly commandService: CommandService;
|
|
35
|
-
|
|
36
31
|
@postConstruct()
|
|
37
32
|
protected init(): void {
|
|
38
33
|
this.fireDidChange();
|
|
@@ -40,12 +35,10 @@ export class DebugBreakpointsSource extends TreeSource {
|
|
|
40
35
|
}
|
|
41
36
|
|
|
42
37
|
*getElements(): IterableIterator<TreeElement> {
|
|
43
|
-
|
|
44
|
-
yield new DebugExceptionBreakpoint(exceptionBreakpoint, this.breakpoints, this.commandService);
|
|
45
|
-
}
|
|
46
|
-
yield* this.model.dataBreakpoints;
|
|
38
|
+
yield* this.model.exceptionBreakpoints;
|
|
47
39
|
yield* this.model.functionBreakpoints;
|
|
48
40
|
yield* this.model.instructionBreakpoints;
|
|
41
|
+
yield* this.model.dataBreakpoints;
|
|
49
42
|
yield* this.model.breakpoints;
|
|
50
43
|
}
|
|
51
44
|
}
|
|
@@ -22,6 +22,7 @@ import { DebugBreakpointsSource } from './debug-breakpoints-source';
|
|
|
22
22
|
import { BreakpointManager } from '../breakpoint/breakpoint-manager';
|
|
23
23
|
import { DebugViewModel } from './debug-view-model';
|
|
24
24
|
import { nls } from '@theia/core/lib/common/nls';
|
|
25
|
+
import { DebugSession } from '../debug-session';
|
|
25
26
|
|
|
26
27
|
@injectable()
|
|
27
28
|
export class DebugBreakpointsWidget extends SourceTreeWidget {
|
|
@@ -43,6 +44,7 @@ export class DebugBreakpointsWidget extends SourceTreeWidget {
|
|
|
43
44
|
child.bind(DebugBreakpointsWidget).toSelf();
|
|
44
45
|
return child;
|
|
45
46
|
}
|
|
47
|
+
|
|
46
48
|
static createWidget(parent: interfaces.Container): DebugBreakpointsWidget {
|
|
47
49
|
return DebugBreakpointsWidget.createContainer(parent).get(DebugBreakpointsWidget);
|
|
48
50
|
}
|
|
@@ -56,6 +58,10 @@ export class DebugBreakpointsWidget extends SourceTreeWidget {
|
|
|
56
58
|
@inject(DebugBreakpointsSource)
|
|
57
59
|
protected readonly breakpointsSource: DebugBreakpointsSource;
|
|
58
60
|
|
|
61
|
+
get currentSession(): DebugSession | undefined {
|
|
62
|
+
return this.viewModel.currentSession;
|
|
63
|
+
}
|
|
64
|
+
|
|
59
65
|
@postConstruct()
|
|
60
66
|
protected override init(): void {
|
|
61
67
|
super.init();
|
|
@@ -18,41 +18,47 @@ import * as React from '@theia/core/shared/react';
|
|
|
18
18
|
import { TreeElement } from '@theia/core/lib/browser/source-tree';
|
|
19
19
|
import { BreakpointManager } from '../breakpoint/breakpoint-manager';
|
|
20
20
|
import { ExceptionBreakpoint } from '../breakpoint/breakpoint-marker';
|
|
21
|
-
import { SingleTextInputDialog
|
|
22
|
-
import {
|
|
23
|
-
import { nls
|
|
21
|
+
import { SingleTextInputDialog } from '@theia/core/lib/browser/dialogs';
|
|
22
|
+
import { TREE_NODE_INFO_CLASS, codicon, TreeWidget } from '@theia/core/lib/browser';
|
|
23
|
+
import { nls } from '@theia/core';
|
|
24
|
+
import { DebugBreakpoint, DebugBreakpointDecoration, DebugBreakpointOptions } from '../model/debug-breakpoint';
|
|
24
25
|
import { DebugCommands } from '../debug-commands';
|
|
25
26
|
|
|
26
|
-
export class DebugExceptionBreakpoint implements TreeElement {
|
|
27
|
+
export class DebugExceptionBreakpoint extends DebugBreakpoint<ExceptionBreakpoint> implements TreeElement {
|
|
27
28
|
|
|
28
|
-
readonly
|
|
29
|
-
|
|
29
|
+
protected readonly sessionEnablement = new Set<string>();
|
|
30
|
+
/** Determines which exception breakpoints to show when no session is active. */
|
|
31
|
+
protected persistentlyVisible = false;
|
|
32
|
+
|
|
33
|
+
static create(origin: ExceptionBreakpoint,
|
|
34
|
+
options: DebugBreakpointOptions): DebugExceptionBreakpoint {
|
|
35
|
+
return new this(origin, options);
|
|
36
|
+
}
|
|
30
37
|
|
|
31
38
|
constructor(
|
|
32
|
-
readonly
|
|
33
|
-
readonly
|
|
34
|
-
protected readonly commandService: CommandService
|
|
39
|
+
readonly origin: ExceptionBreakpoint,
|
|
40
|
+
readonly options: DebugBreakpointOptions
|
|
35
41
|
) {
|
|
36
|
-
|
|
42
|
+
super(BreakpointManager.EXCEPTION_URI, options);
|
|
37
43
|
}
|
|
38
44
|
|
|
39
|
-
render(host: TreeWidget): React.ReactNode {
|
|
45
|
+
override render(host: TreeWidget): React.ReactNode {
|
|
40
46
|
this.treeWidget = host;
|
|
41
|
-
return <div title={this.
|
|
47
|
+
return <div title={this.origin.raw.description || this.origin.raw.label} className='theia-source-breakpoint'>
|
|
42
48
|
<span className='theia-debug-breakpoint-icon' />
|
|
43
|
-
<input type='checkbox' checked={this.
|
|
49
|
+
<input type='checkbox' checked={this.origin.enabled} onChange={this.toggle} />
|
|
44
50
|
<span className='line-info'>
|
|
45
|
-
<span className='name'>{this.
|
|
46
|
-
{this.
|
|
47
|
-
<span title={nls.localizeByDefault('Expression condition: {0}', this.
|
|
48
|
-
className={'path ' + TREE_NODE_INFO_CLASS}>{this.
|
|
51
|
+
<span className='name'>{this.origin.raw.label} </span>
|
|
52
|
+
{this.origin.condition &&
|
|
53
|
+
<span title={nls.localizeByDefault('Expression condition: {0}', this.origin.condition)}
|
|
54
|
+
className={'path ' + TREE_NODE_INFO_CLASS}>{this.origin.condition} </span>}
|
|
49
55
|
</span>
|
|
50
56
|
{this.renderActions()}
|
|
51
57
|
</div>;
|
|
52
58
|
}
|
|
53
59
|
|
|
54
60
|
protected renderActions(): React.ReactNode {
|
|
55
|
-
if (this.
|
|
61
|
+
if (this.origin.raw.supportsCondition) {
|
|
56
62
|
return <div className='theia-debug-breakpoint-actions'>
|
|
57
63
|
<div className={codicon('edit', true)} title={nls.localizeByDefault('Edit Condition...')} onClick={this.onEdit} />
|
|
58
64
|
</div>;
|
|
@@ -65,19 +71,45 @@ export class DebugExceptionBreakpoint implements TreeElement {
|
|
|
65
71
|
this.commandService.executeCommand(DebugCommands.EDIT_BREAKPOINT_CONDITION.id);
|
|
66
72
|
};
|
|
67
73
|
|
|
68
|
-
|
|
69
|
-
if (
|
|
70
|
-
this.
|
|
74
|
+
setSessionEnablement(sessionId: string, enabled: boolean): void {
|
|
75
|
+
if (enabled) {
|
|
76
|
+
this.sessionEnablement.add(sessionId);
|
|
77
|
+
} else {
|
|
78
|
+
this.sessionEnablement.delete(sessionId);
|
|
71
79
|
}
|
|
72
80
|
}
|
|
73
81
|
|
|
74
|
-
|
|
82
|
+
isEnabledForSession(sessionId: string): boolean {
|
|
83
|
+
return this.sessionEnablement.has(sessionId);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
setPersistentVisibility(visible: boolean): void {
|
|
87
|
+
this.persistentlyVisible = visible;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
isPersistentlyVisible(): boolean {
|
|
91
|
+
return this.persistentlyVisible;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
protected override doRender(): React.ReactNode {
|
|
95
|
+
return undefined;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
protected toggle = (e: React.ChangeEvent<HTMLInputElement>) => this.setEnabled(e.currentTarget.checked);
|
|
99
|
+
|
|
100
|
+
override setEnabled(enabled: boolean): void {
|
|
101
|
+
this.breakpoints.enableBreakpoint(this, enabled);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
override remove(): void {
|
|
105
|
+
this.breakpoints.enableBreakpoint(this, false);
|
|
106
|
+
}
|
|
75
107
|
|
|
76
108
|
async editCondition(): Promise<void> {
|
|
77
109
|
const inputDialog = new SingleTextInputDialog({
|
|
78
|
-
title: this.
|
|
79
|
-
placeholder: this.
|
|
80
|
-
initialValue: this.
|
|
110
|
+
title: this.origin.raw.label,
|
|
111
|
+
placeholder: this.origin.raw.conditionDescription,
|
|
112
|
+
initialValue: this.origin.condition
|
|
81
113
|
});
|
|
82
114
|
let condition = await inputDialog.open();
|
|
83
115
|
if (condition === undefined) {
|
|
@@ -86,8 +118,15 @@ export class DebugExceptionBreakpoint implements TreeElement {
|
|
|
86
118
|
if (condition === '') {
|
|
87
119
|
condition = undefined;
|
|
88
120
|
}
|
|
89
|
-
if (condition !== this.
|
|
90
|
-
this.breakpoints.
|
|
121
|
+
if (condition !== this.origin.condition) {
|
|
122
|
+
this.breakpoints.updateBreakpoint(this, { condition });
|
|
91
123
|
}
|
|
92
124
|
}
|
|
125
|
+
|
|
126
|
+
protected override getBreakpointDecoration(message?: string[] | undefined): DebugBreakpointDecoration {
|
|
127
|
+
return {
|
|
128
|
+
className: 'never-decorated',
|
|
129
|
+
message: message ?? []
|
|
130
|
+
};
|
|
131
|
+
}
|
|
93
132
|
}
|
|
@@ -28,6 +28,8 @@ import { DebugWatchManager } from '../debug-watch-manager';
|
|
|
28
28
|
import { DebugFunctionBreakpoint } from '../model/debug-function-breakpoint';
|
|
29
29
|
import { DebugInstructionBreakpoint } from '../model/debug-instruction-breakpoint';
|
|
30
30
|
import { DebugSessionOptionsBase } from '../debug-session-options';
|
|
31
|
+
import { BreakpointManager } from '../breakpoint/breakpoint-manager';
|
|
32
|
+
import { DebugExceptionBreakpoint } from './debug-exception-breakpoint';
|
|
31
33
|
import { DebugDataBreakpoint } from '../model/debug-data-breakpoint';
|
|
32
34
|
import { DebugVariable } from '../console/debug-console-items';
|
|
33
35
|
|
|
@@ -71,6 +73,9 @@ export class DebugViewModel implements Disposable {
|
|
|
71
73
|
@inject(DebugSessionManager)
|
|
72
74
|
protected readonly manager: DebugSessionManager;
|
|
73
75
|
|
|
76
|
+
@inject(BreakpointManager)
|
|
77
|
+
protected readonly breakpointManager: BreakpointManager;
|
|
78
|
+
|
|
74
79
|
@inject(DebugWatchManager)
|
|
75
80
|
protected readonly watch: DebugWatchManager;
|
|
76
81
|
|
|
@@ -100,9 +105,8 @@ export class DebugViewModel implements Disposable {
|
|
|
100
105
|
// This ensures threads view updates for all sessions
|
|
101
106
|
this.fireDidChange();
|
|
102
107
|
}));
|
|
103
|
-
this.toDispose.push(this.
|
|
104
|
-
|
|
105
|
-
this.fireDidChangeBreakpoints(uri);
|
|
108
|
+
this.toDispose.push(this.breakpointManager.onDidChangeBreakpoints(e => {
|
|
109
|
+
this.fireDidChangeBreakpoints(e.uri);
|
|
106
110
|
}));
|
|
107
111
|
this.toDispose.push(this.manager.onDidResolveLazyVariable(({ session, variable }) => {
|
|
108
112
|
if (session === this.currentSession) {
|
|
@@ -118,8 +122,7 @@ export class DebugViewModel implements Disposable {
|
|
|
118
122
|
}
|
|
119
123
|
|
|
120
124
|
get currentSession(): DebugSession | undefined {
|
|
121
|
-
|
|
122
|
-
return currentSession;
|
|
125
|
+
return this.manager.currentSession;
|
|
123
126
|
}
|
|
124
127
|
set currentSession(currentSession: DebugSession | undefined) {
|
|
125
128
|
this.manager.currentSession = currentSession;
|
|
@@ -138,20 +141,25 @@ export class DebugViewModel implements Disposable {
|
|
|
138
141
|
return currentThread && currentThread.currentFrame;
|
|
139
142
|
}
|
|
140
143
|
|
|
141
|
-
get breakpoints(): DebugSourceBreakpoint[] {
|
|
142
|
-
return this.
|
|
144
|
+
get breakpoints(): readonly DebugSourceBreakpoint[] {
|
|
145
|
+
return this.breakpointManager.getBreakpoints();
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
get functionBreakpoints(): readonly DebugFunctionBreakpoint[] {
|
|
149
|
+
return this.breakpointManager.getFunctionBreakpoints();
|
|
143
150
|
}
|
|
144
151
|
|
|
145
|
-
get
|
|
146
|
-
return this.
|
|
152
|
+
get instructionBreakpoints(): readonly DebugInstructionBreakpoint[] {
|
|
153
|
+
return this.breakpointManager.getInstructionBreakpoints();
|
|
147
154
|
}
|
|
148
155
|
|
|
149
|
-
get
|
|
150
|
-
return this.
|
|
156
|
+
get exceptionBreakpoints(): readonly DebugExceptionBreakpoint[] {
|
|
157
|
+
return this.breakpointManager.getExceptionBreakpoints()
|
|
158
|
+
.filter(candidate => this.currentSession ? candidate.isEnabledForSession(this.currentSession.id) : candidate.isPersistentlyVisible());
|
|
151
159
|
}
|
|
152
160
|
|
|
153
|
-
get dataBreakpoints(): DebugDataBreakpoint[] {
|
|
154
|
-
return this.
|
|
161
|
+
get dataBreakpoints(): readonly DebugDataBreakpoint[] {
|
|
162
|
+
return this.breakpointManager.getDataBreakpoints();
|
|
155
163
|
}
|
|
156
164
|
|
|
157
165
|
async start(options: Partial<Pick<DebugSessionOptionsBase, 'startedByUser'>> = {}): Promise<void> {
|