@theia/memory-inspector 1.45.0 → 1.46.0-next.72
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/README.md +71 -71
- package/lib/browser/diff-widget/memory-diff-options-widget.d.ts +36 -36
- package/lib/browser/diff-widget/memory-diff-options-widget.js +132 -132
- package/lib/browser/diff-widget/memory-diff-select-widget.d.ts +50 -50
- package/lib/browser/diff-widget/memory-diff-select-widget.js +137 -137
- package/lib/browser/diff-widget/memory-diff-table-widget.d.ts +77 -77
- package/lib/browser/diff-widget/memory-diff-table-widget.js +314 -314
- package/lib/browser/diff-widget/memory-diff-widget-types.d.ts +41 -41
- package/lib/browser/diff-widget/memory-diff-widget-types.js +23 -23
- package/lib/browser/editable-widget/memory-editable-table-widget.d.ts +64 -64
- package/lib/browser/editable-widget/memory-editable-table-widget.js +324 -324
- package/lib/browser/memory-inspector-frontend-contribution.d.ts +46 -46
- package/lib/browser/memory-inspector-frontend-contribution.js +291 -291
- package/lib/browser/memory-inspector-frontend-module.d.ts +21 -21
- package/lib/browser/memory-inspector-frontend-module.js +87 -87
- package/lib/browser/memory-provider/cdt-gdb-memory-provider.d.ts +35 -35
- package/lib/browser/memory-provider/cdt-gdb-memory-provider.js +136 -136
- package/lib/browser/memory-provider/memory-provider-service.d.ts +36 -36
- package/lib/browser/memory-provider/memory-provider-service.js +101 -101
- package/lib/browser/memory-provider/memory-provider.d.ts +65 -65
- package/lib/browser/memory-provider/memory-provider.js +96 -96
- package/lib/browser/memory-provider/memory-provider.spec.d.ts +16 -16
- package/lib/browser/memory-provider/memory-provider.spec.js +23 -23
- package/lib/browser/memory-widget/memory-options-widget.d.ts +136 -136
- package/lib/browser/memory-widget/memory-options-widget.js +564 -564
- package/lib/browser/memory-widget/memory-table-widget.d.ts +146 -146
- package/lib/browser/memory-widget/memory-table-widget.js +487 -487
- package/lib/browser/memory-widget/memory-widget.d.ts +33 -33
- package/lib/browser/memory-widget/memory-widget.js +112 -112
- package/lib/browser/register-widget/register-filter-service.d.ts +42 -42
- package/lib/browser/register-widget/register-filter-service.js +81 -81
- package/lib/browser/register-widget/register-options-widget.d.ts +81 -81
- package/lib/browser/register-widget/register-options-widget.js +338 -338
- package/lib/browser/register-widget/register-table-widget.d.ts +77 -77
- package/lib/browser/register-widget/register-table-widget.js +230 -230
- package/lib/browser/register-widget/register-widget-types.d.ts +29 -29
- package/lib/browser/register-widget/register-widget-types.js +35 -35
- package/lib/browser/utils/memory-commands.d.ts +27 -27
- package/lib/browser/utils/memory-commands.js +67 -67
- package/lib/browser/utils/memory-hover-renderer.d.ts +33 -33
- package/lib/browser/utils/memory-hover-renderer.js +111 -111
- package/lib/browser/utils/memory-recents.d.ts +27 -27
- package/lib/browser/utils/memory-recents.js +52 -52
- package/lib/browser/utils/memory-widget-components.d.ts +58 -58
- package/lib/browser/utils/memory-widget-components.js +69 -69
- package/lib/browser/utils/memory-widget-manager.d.ts +50 -50
- package/lib/browser/utils/memory-widget-manager.js +182 -182
- package/lib/browser/utils/memory-widget-utils.d.ts +113 -113
- package/lib/browser/utils/memory-widget-utils.js +42 -42
- package/lib/browser/utils/memory-widget-variable-utils.d.ts +57 -57
- package/lib/browser/utils/memory-widget-variable-utils.js +143 -143
- package/lib/browser/utils/multi-select-bar.d.ts +31 -31
- package/lib/browser/utils/multi-select-bar.js +34 -34
- package/lib/browser/wrapper-widgets/memory-dock-panel.d.ts +24 -24
- package/lib/browser/wrapper-widgets/memory-dock-panel.js +48 -48
- package/lib/browser/wrapper-widgets/memory-dockpanel-placeholder-widget.d.ts +23 -23
- package/lib/browser/wrapper-widgets/memory-dockpanel-placeholder-widget.js +57 -57
- package/lib/browser/wrapper-widgets/memory-layout-widget.d.ts +51 -51
- package/lib/browser/wrapper-widgets/memory-layout-widget.js +191 -191
- package/lib/common/util.d.ts +21 -21
- package/lib/common/util.js +30 -30
- package/lib/common/utils.spec.d.ts +16 -16
- package/lib/common/utils.spec.js +45 -45
- package/package.json +4 -4
- package/src/browser/diff-widget/memory-diff-options-widget.tsx +152 -152
- package/src/browser/diff-widget/memory-diff-select-widget.tsx +163 -163
- package/src/browser/diff-widget/memory-diff-table-widget.tsx +366 -366
- package/src/browser/diff-widget/memory-diff-widget-types.ts +45 -45
- package/src/browser/editable-widget/memory-editable-table-widget.tsx +359 -359
- package/src/browser/memory-inspector-frontend-contribution.ts +301 -301
- package/src/browser/memory-inspector-frontend-module.ts +118 -118
- package/src/browser/memory-provider/cdt-gdb-memory-provider.ts +132 -132
- package/src/browser/memory-provider/memory-provider-service.ts +86 -86
- package/src/browser/memory-provider/memory-provider.spec.ts +23 -23
- package/src/browser/memory-provider/memory-provider.ts +119 -119
- package/src/browser/memory-widget/memory-options-widget.tsx +738 -738
- package/src/browser/memory-widget/memory-table-widget.tsx +625 -625
- package/src/browser/memory-widget/memory-widget.ts +114 -114
- package/src/browser/register-widget/register-filter-service.ts +76 -76
- package/src/browser/register-widget/register-options-widget.tsx +393 -393
- package/src/browser/register-widget/register-table-widget.tsx +276 -276
- package/src/browser/register-widget/register-widget-types.ts +45 -45
- package/src/browser/register-widget/register-widget.css +34 -34
- package/src/browser/style/index.css +746 -746
- package/src/browser/style/memory-lock.svg +21 -21
- package/src/browser/style/memory-view.svg +20 -20
- package/src/browser/style/register-lock.svg +29 -29
- package/src/browser/style/register-view.svg +28 -28
- package/src/browser/utils/memory-commands.ts +76 -76
- package/src/browser/utils/memory-hover-renderer.ts +113 -113
- package/src/browser/utils/memory-recents.ts +58 -58
- package/src/browser/utils/memory-widget-components.tsx +193 -193
- package/src/browser/utils/memory-widget-manager.ts +179 -179
- package/src/browser/utils/memory-widget-utils.tsx +132 -132
- package/src/browser/utils/memory-widget-variable-utils.ts +170 -170
- package/src/browser/utils/multi-select-bar.css +61 -61
- package/src/browser/utils/multi-select-bar.tsx +75 -75
- package/src/browser/wrapper-widgets/memory-dock-panel.ts +51 -51
- package/src/browser/wrapper-widgets/memory-dockpanel-placeholder-widget.tsx +38 -38
- package/src/browser/wrapper-widgets/memory-layout-widget.tsx +167 -167
- package/src/common/util.ts +28 -28
- package/src/common/utils.spec.ts +52 -52
|
@@ -1,118 +1,118 @@
|
|
|
1
|
-
/********************************************************************************
|
|
2
|
-
* Copyright (C) 2019 Ericsson and others.
|
|
3
|
-
*
|
|
4
|
-
* This program and the accompanying materials are made available under the
|
|
5
|
-
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
-
* http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
-
*
|
|
8
|
-
* This Source Code may also be made available under the following Secondary
|
|
9
|
-
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
-
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
-
* with the GNU Classpath Exception which is available at
|
|
12
|
-
* https://www.gnu.org/software/classpath/license.html.
|
|
13
|
-
*
|
|
14
|
-
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
-
********************************************************************************/
|
|
16
|
-
|
|
17
|
-
import '../../src/browser/register-widget/register-widget.css';
|
|
18
|
-
import '../../src/browser/style/index.css';
|
|
19
|
-
import '../../src/browser/utils/multi-select-bar.css';
|
|
20
|
-
import { bindContributionProvider } from '@theia/core';
|
|
21
|
-
import { bindViewContribution, FrontendApplicationContribution, WidgetFactory } from '@theia/core/lib/browser';
|
|
22
|
-
import { ColorContribution } from '@theia/core/lib/browser/color-application-contribution';
|
|
23
|
-
import { TabBarToolbarContribution } from '@theia/core/lib/browser/shell/tab-bar-toolbar';
|
|
24
|
-
import { ContainerModule } from '@theia/core/shared/inversify';
|
|
25
|
-
import { DebugFrontendContribution } from './memory-inspector-frontend-contribution';
|
|
26
|
-
import { MemoryDiffOptionsWidget } from './diff-widget/memory-diff-options-widget';
|
|
27
|
-
import { MemoryDiffSelectWidget } from './diff-widget/memory-diff-select-widget';
|
|
28
|
-
import { MemoryDiffTableWidget, MemoryDiffWidget } from './diff-widget/memory-diff-table-widget';
|
|
29
|
-
import { EditableMemoryWidget, MemoryEditableTableWidget } from './editable-widget/memory-editable-table-widget';
|
|
30
|
-
import { DefaultMemoryProvider, MemoryProvider } from './memory-provider/memory-provider';
|
|
31
|
-
import { MemoryProviderService } from './memory-provider/memory-provider-service';
|
|
32
|
-
import { MemoryOptionsWidget } from './memory-widget/memory-options-widget';
|
|
33
|
-
import { MemoryTableWidget } from './memory-widget/memory-table-widget';
|
|
34
|
-
import { MemoryWidget } from './memory-widget/memory-widget';
|
|
35
|
-
import { RegisterOptionsWidget } from './register-widget/register-options-widget';
|
|
36
|
-
import { RegisterTableWidget } from './register-widget/register-table-widget';
|
|
37
|
-
import { RegisterWidget } from './register-widget/register-widget-types';
|
|
38
|
-
import { MemoryHoverRendererService } from './utils/memory-hover-renderer';
|
|
39
|
-
import { MemoryWidgetManager } from './utils/memory-widget-manager';
|
|
40
|
-
import { MemoryDiffWidgetData, MemoryWidgetOptions, RegisterWidgetOptions } from './utils/memory-widget-utils';
|
|
41
|
-
import { MemoryDockPanel } from './wrapper-widgets/memory-dock-panel';
|
|
42
|
-
import { MemoryDockpanelPlaceholder } from './wrapper-widgets/memory-dockpanel-placeholder-widget';
|
|
43
|
-
import { MemoryLayoutWidget } from './wrapper-widgets/memory-layout-widget';
|
|
44
|
-
import { CDTGDBMemoryProvider } from './memory-provider/cdt-gdb-memory-provider';
|
|
45
|
-
|
|
46
|
-
export default new ContainerModule(bind => {
|
|
47
|
-
bindViewContribution(bind, DebugFrontendContribution);
|
|
48
|
-
bind(ColorContribution).toService(DebugFrontendContribution);
|
|
49
|
-
bind(TabBarToolbarContribution).toService(DebugFrontendContribution);
|
|
50
|
-
bind(FrontendApplicationContribution).toService(DebugFrontendContribution);
|
|
51
|
-
|
|
52
|
-
bind(MemoryProviderService).toSelf().inSingletonScope();
|
|
53
|
-
bind(DefaultMemoryProvider).toSelf().inSingletonScope();
|
|
54
|
-
bindContributionProvider(bind, MemoryProvider);
|
|
55
|
-
bind(MemoryProvider).to(CDTGDBMemoryProvider).inSingletonScope();
|
|
56
|
-
bind(MemoryLayoutWidget).toSelf().inSingletonScope();
|
|
57
|
-
bind(MemoryDiffSelectWidget).toSelf().inSingletonScope();
|
|
58
|
-
bind(MemoryDockpanelPlaceholder).toSelf().inSingletonScope();
|
|
59
|
-
bind(MemoryHoverRendererService).toSelf().inSingletonScope();
|
|
60
|
-
bind(MemoryWidgetManager).toSelf().inSingletonScope();
|
|
61
|
-
|
|
62
|
-
bind(WidgetFactory).toDynamicValue(({ container }) => ({
|
|
63
|
-
id: MemoryDockPanel.ID,
|
|
64
|
-
createWidget: (): MemoryDockPanel => MemoryDockPanel.createWidget(container),
|
|
65
|
-
}));
|
|
66
|
-
|
|
67
|
-
bind(WidgetFactory).toDynamicValue(({ container }) => ({
|
|
68
|
-
id: MemoryLayoutWidget.ID,
|
|
69
|
-
createWidget: (): MemoryLayoutWidget => container.get(MemoryLayoutWidget),
|
|
70
|
-
})).inSingletonScope();
|
|
71
|
-
|
|
72
|
-
bind(WidgetFactory).toDynamicValue(({ container }) => ({
|
|
73
|
-
id: MemoryWidget.ID,
|
|
74
|
-
createWidget: (options: MemoryWidgetOptions): MemoryWidget => MemoryWidget.createWidget<MemoryOptionsWidget, MemoryTableWidget>(
|
|
75
|
-
container,
|
|
76
|
-
MemoryOptionsWidget,
|
|
77
|
-
MemoryTableWidget,
|
|
78
|
-
MemoryWidgetOptions,
|
|
79
|
-
options,
|
|
80
|
-
),
|
|
81
|
-
}));
|
|
82
|
-
|
|
83
|
-
bind(WidgetFactory).toDynamicValue(({ container }) => ({
|
|
84
|
-
id: EditableMemoryWidget.ID,
|
|
85
|
-
createWidget: (options: MemoryWidgetOptions): EditableMemoryWidget => MemoryWidget
|
|
86
|
-
.createWidget<MemoryOptionsWidget, MemoryEditableTableWidget>(
|
|
87
|
-
container,
|
|
88
|
-
MemoryOptionsWidget,
|
|
89
|
-
MemoryEditableTableWidget,
|
|
90
|
-
MemoryWidgetOptions,
|
|
91
|
-
options,
|
|
92
|
-
),
|
|
93
|
-
}));
|
|
94
|
-
|
|
95
|
-
bind(WidgetFactory).toDynamicValue(({ container }) => ({
|
|
96
|
-
id: MemoryDiffWidget.ID,
|
|
97
|
-
createWidget: (options: MemoryDiffWidgetData): MemoryDiffWidget => MemoryWidget
|
|
98
|
-
.createWidget<MemoryDiffOptionsWidget, MemoryDiffTableWidget>(
|
|
99
|
-
container,
|
|
100
|
-
MemoryDiffOptionsWidget,
|
|
101
|
-
MemoryDiffTableWidget,
|
|
102
|
-
MemoryDiffWidgetData,
|
|
103
|
-
options,
|
|
104
|
-
),
|
|
105
|
-
}));
|
|
106
|
-
|
|
107
|
-
bind(WidgetFactory).toDynamicValue(({ container }) => ({
|
|
108
|
-
id: RegisterWidget.ID,
|
|
109
|
-
createWidget: (options: RegisterWidgetOptions): RegisterWidget => RegisterWidget
|
|
110
|
-
.createContainer(
|
|
111
|
-
container,
|
|
112
|
-
RegisterOptionsWidget,
|
|
113
|
-
RegisterTableWidget,
|
|
114
|
-
RegisterWidgetOptions,
|
|
115
|
-
options,
|
|
116
|
-
).get(MemoryWidget),
|
|
117
|
-
}));
|
|
118
|
-
});
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (C) 2019 Ericsson and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
*
|
|
8
|
+
* This Source Code may also be made available under the following Secondary
|
|
9
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
* with the GNU Classpath Exception which is available at
|
|
12
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
*
|
|
14
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
+
********************************************************************************/
|
|
16
|
+
|
|
17
|
+
import '../../src/browser/register-widget/register-widget.css';
|
|
18
|
+
import '../../src/browser/style/index.css';
|
|
19
|
+
import '../../src/browser/utils/multi-select-bar.css';
|
|
20
|
+
import { bindContributionProvider } from '@theia/core';
|
|
21
|
+
import { bindViewContribution, FrontendApplicationContribution, WidgetFactory } from '@theia/core/lib/browser';
|
|
22
|
+
import { ColorContribution } from '@theia/core/lib/browser/color-application-contribution';
|
|
23
|
+
import { TabBarToolbarContribution } from '@theia/core/lib/browser/shell/tab-bar-toolbar';
|
|
24
|
+
import { ContainerModule } from '@theia/core/shared/inversify';
|
|
25
|
+
import { DebugFrontendContribution } from './memory-inspector-frontend-contribution';
|
|
26
|
+
import { MemoryDiffOptionsWidget } from './diff-widget/memory-diff-options-widget';
|
|
27
|
+
import { MemoryDiffSelectWidget } from './diff-widget/memory-diff-select-widget';
|
|
28
|
+
import { MemoryDiffTableWidget, MemoryDiffWidget } from './diff-widget/memory-diff-table-widget';
|
|
29
|
+
import { EditableMemoryWidget, MemoryEditableTableWidget } from './editable-widget/memory-editable-table-widget';
|
|
30
|
+
import { DefaultMemoryProvider, MemoryProvider } from './memory-provider/memory-provider';
|
|
31
|
+
import { MemoryProviderService } from './memory-provider/memory-provider-service';
|
|
32
|
+
import { MemoryOptionsWidget } from './memory-widget/memory-options-widget';
|
|
33
|
+
import { MemoryTableWidget } from './memory-widget/memory-table-widget';
|
|
34
|
+
import { MemoryWidget } from './memory-widget/memory-widget';
|
|
35
|
+
import { RegisterOptionsWidget } from './register-widget/register-options-widget';
|
|
36
|
+
import { RegisterTableWidget } from './register-widget/register-table-widget';
|
|
37
|
+
import { RegisterWidget } from './register-widget/register-widget-types';
|
|
38
|
+
import { MemoryHoverRendererService } from './utils/memory-hover-renderer';
|
|
39
|
+
import { MemoryWidgetManager } from './utils/memory-widget-manager';
|
|
40
|
+
import { MemoryDiffWidgetData, MemoryWidgetOptions, RegisterWidgetOptions } from './utils/memory-widget-utils';
|
|
41
|
+
import { MemoryDockPanel } from './wrapper-widgets/memory-dock-panel';
|
|
42
|
+
import { MemoryDockpanelPlaceholder } from './wrapper-widgets/memory-dockpanel-placeholder-widget';
|
|
43
|
+
import { MemoryLayoutWidget } from './wrapper-widgets/memory-layout-widget';
|
|
44
|
+
import { CDTGDBMemoryProvider } from './memory-provider/cdt-gdb-memory-provider';
|
|
45
|
+
|
|
46
|
+
export default new ContainerModule(bind => {
|
|
47
|
+
bindViewContribution(bind, DebugFrontendContribution);
|
|
48
|
+
bind(ColorContribution).toService(DebugFrontendContribution);
|
|
49
|
+
bind(TabBarToolbarContribution).toService(DebugFrontendContribution);
|
|
50
|
+
bind(FrontendApplicationContribution).toService(DebugFrontendContribution);
|
|
51
|
+
|
|
52
|
+
bind(MemoryProviderService).toSelf().inSingletonScope();
|
|
53
|
+
bind(DefaultMemoryProvider).toSelf().inSingletonScope();
|
|
54
|
+
bindContributionProvider(bind, MemoryProvider);
|
|
55
|
+
bind(MemoryProvider).to(CDTGDBMemoryProvider).inSingletonScope();
|
|
56
|
+
bind(MemoryLayoutWidget).toSelf().inSingletonScope();
|
|
57
|
+
bind(MemoryDiffSelectWidget).toSelf().inSingletonScope();
|
|
58
|
+
bind(MemoryDockpanelPlaceholder).toSelf().inSingletonScope();
|
|
59
|
+
bind(MemoryHoverRendererService).toSelf().inSingletonScope();
|
|
60
|
+
bind(MemoryWidgetManager).toSelf().inSingletonScope();
|
|
61
|
+
|
|
62
|
+
bind(WidgetFactory).toDynamicValue(({ container }) => ({
|
|
63
|
+
id: MemoryDockPanel.ID,
|
|
64
|
+
createWidget: (): MemoryDockPanel => MemoryDockPanel.createWidget(container),
|
|
65
|
+
}));
|
|
66
|
+
|
|
67
|
+
bind(WidgetFactory).toDynamicValue(({ container }) => ({
|
|
68
|
+
id: MemoryLayoutWidget.ID,
|
|
69
|
+
createWidget: (): MemoryLayoutWidget => container.get(MemoryLayoutWidget),
|
|
70
|
+
})).inSingletonScope();
|
|
71
|
+
|
|
72
|
+
bind(WidgetFactory).toDynamicValue(({ container }) => ({
|
|
73
|
+
id: MemoryWidget.ID,
|
|
74
|
+
createWidget: (options: MemoryWidgetOptions): MemoryWidget => MemoryWidget.createWidget<MemoryOptionsWidget, MemoryTableWidget>(
|
|
75
|
+
container,
|
|
76
|
+
MemoryOptionsWidget,
|
|
77
|
+
MemoryTableWidget,
|
|
78
|
+
MemoryWidgetOptions,
|
|
79
|
+
options,
|
|
80
|
+
),
|
|
81
|
+
}));
|
|
82
|
+
|
|
83
|
+
bind(WidgetFactory).toDynamicValue(({ container }) => ({
|
|
84
|
+
id: EditableMemoryWidget.ID,
|
|
85
|
+
createWidget: (options: MemoryWidgetOptions): EditableMemoryWidget => MemoryWidget
|
|
86
|
+
.createWidget<MemoryOptionsWidget, MemoryEditableTableWidget>(
|
|
87
|
+
container,
|
|
88
|
+
MemoryOptionsWidget,
|
|
89
|
+
MemoryEditableTableWidget,
|
|
90
|
+
MemoryWidgetOptions,
|
|
91
|
+
options,
|
|
92
|
+
),
|
|
93
|
+
}));
|
|
94
|
+
|
|
95
|
+
bind(WidgetFactory).toDynamicValue(({ container }) => ({
|
|
96
|
+
id: MemoryDiffWidget.ID,
|
|
97
|
+
createWidget: (options: MemoryDiffWidgetData): MemoryDiffWidget => MemoryWidget
|
|
98
|
+
.createWidget<MemoryDiffOptionsWidget, MemoryDiffTableWidget>(
|
|
99
|
+
container,
|
|
100
|
+
MemoryDiffOptionsWidget,
|
|
101
|
+
MemoryDiffTableWidget,
|
|
102
|
+
MemoryDiffWidgetData,
|
|
103
|
+
options,
|
|
104
|
+
),
|
|
105
|
+
}));
|
|
106
|
+
|
|
107
|
+
bind(WidgetFactory).toDynamicValue(({ container }) => ({
|
|
108
|
+
id: RegisterWidget.ID,
|
|
109
|
+
createWidget: (options: RegisterWidgetOptions): RegisterWidget => RegisterWidget
|
|
110
|
+
.createContainer(
|
|
111
|
+
container,
|
|
112
|
+
RegisterOptionsWidget,
|
|
113
|
+
RegisterTableWidget,
|
|
114
|
+
RegisterWidgetOptions,
|
|
115
|
+
options,
|
|
116
|
+
).get(MemoryWidget),
|
|
117
|
+
}));
|
|
118
|
+
});
|
|
@@ -1,132 +1,132 @@
|
|
|
1
|
-
/********************************************************************************
|
|
2
|
-
* Copyright (C) 2019 Ericsson and others.
|
|
3
|
-
*
|
|
4
|
-
* This program and the accompanying materials are made available under the
|
|
5
|
-
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
-
* http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
-
*
|
|
8
|
-
* This Source Code may also be made available under the following Secondary
|
|
9
|
-
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
-
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
-
* with the GNU Classpath Exception which is available at
|
|
12
|
-
* https://www.gnu.org/software/classpath/license.html.
|
|
13
|
-
*
|
|
14
|
-
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
-
********************************************************************************/
|
|
16
|
-
|
|
17
|
-
import { injectable } from '@theia/core/shared/inversify';
|
|
18
|
-
import { DebugScope, DebugVariable } from '@theia/debug/lib/browser/console/debug-console-items';
|
|
19
|
-
import { DebugSession } from '@theia/debug/lib/browser/debug-session';
|
|
20
|
-
import { hexStrToUnsignedLong } from '../../common/util';
|
|
21
|
-
import { VariableRange } from '../utils/memory-widget-variable-utils';
|
|
22
|
-
import { AbstractMemoryProvider } from './memory-provider';
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* @file this file exists to show the customizations possible for specific debug adapters. Within the confines of the DebugAdapterProtocol, different adapters can behave
|
|
26
|
-
* quite differently. In particular, they can differ in the kinds of expressions that they treat as references (in the `memoryReference` field of MemoryReadArguments, for example)
|
|
27
|
-
* and the kinds of expressions that they can evaluate (for example to assist in determining the size of variables). The `MemoryProvider` type exists to allow applications
|
|
28
|
-
* to enhance the base functionality of the Memory Inspector by tapping into specifics of known adapters.
|
|
29
|
-
*/
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Read memory through the current debug session, using the cdt-gdb-adapter
|
|
33
|
-
* extension to read memory.
|
|
34
|
-
*/
|
|
35
|
-
@injectable()
|
|
36
|
-
export class CDTGDBMemoryProvider extends AbstractMemoryProvider {
|
|
37
|
-
|
|
38
|
-
canHandle(session: DebugSession): boolean {
|
|
39
|
-
return session.configuration.type === 'gdb';
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
override async getLocals(session: DebugSession | undefined): Promise<VariableRange[]> {
|
|
43
|
-
if (session === undefined) {
|
|
44
|
-
console.warn('No active debug session.');
|
|
45
|
-
return [];
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
const frame = session.currentFrame;
|
|
49
|
-
if (frame === undefined) {
|
|
50
|
-
throw new Error('No active stack frame.');
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
const ranges: VariableRange[] = [];
|
|
54
|
-
|
|
55
|
-
const scopes = await frame.getScopes();
|
|
56
|
-
const scopesWithoutRegisters = scopes.filter(x => x.render() !== 'Registers');
|
|
57
|
-
for (const scope of scopesWithoutRegisters) {
|
|
58
|
-
const variables = await scope.getElements();
|
|
59
|
-
for (const v of variables) {
|
|
60
|
-
if (v instanceof DebugVariable) {
|
|
61
|
-
const addrExp = `&${v.name}`;
|
|
62
|
-
const sizeExp = `sizeof(${v.name})`;
|
|
63
|
-
const addrResp = await session.sendRequest('evaluate', {
|
|
64
|
-
expression: addrExp,
|
|
65
|
-
context: 'watch',
|
|
66
|
-
frameId: frame.raw.id,
|
|
67
|
-
}).catch(e => { console.warn(`Failed to evaluate ${addrExp}. Corresponding variable will be omitted from Memory Inspector display.`, e); });
|
|
68
|
-
if (!addrResp) { continue; }
|
|
69
|
-
|
|
70
|
-
const sizeResp = await session.sendRequest('evaluate', {
|
|
71
|
-
expression: sizeExp,
|
|
72
|
-
context: 'watch',
|
|
73
|
-
frameId: frame.raw.id,
|
|
74
|
-
}).catch(e => { console.warn(`Failed to evaluate ${sizeExp}. Corresponding variable will be omitted from Memory Inspector display.`, e); });
|
|
75
|
-
if (!sizeResp) { continue; }
|
|
76
|
-
|
|
77
|
-
// Make sure the address is in the format we expect.
|
|
78
|
-
const addressPart = /0x[0-9a-f]+/i.exec(addrResp.body.result);
|
|
79
|
-
if (!addressPart) { continue; }
|
|
80
|
-
|
|
81
|
-
if (!/^[0-9]+$/.test(sizeResp.body.result)) { continue; }
|
|
82
|
-
|
|
83
|
-
const size = parseInt(sizeResp.body.result);
|
|
84
|
-
const address = hexStrToUnsignedLong(addressPart[0]);
|
|
85
|
-
const pastTheEndAddress = address.add(size);
|
|
86
|
-
|
|
87
|
-
ranges.push({
|
|
88
|
-
name: v.name,
|
|
89
|
-
address,
|
|
90
|
-
pastTheEndAddress,
|
|
91
|
-
type: v.type,
|
|
92
|
-
value: v.value,
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
return ranges;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
override supportsVariableReferenceSyntax(session: DebugSession, currentLevel?: DebugVariable): boolean {
|
|
102
|
-
if (this.canHandle(session)) {
|
|
103
|
-
if (!currentLevel) {
|
|
104
|
-
return false;
|
|
105
|
-
}
|
|
106
|
-
while (currentLevel.parent instanceof DebugVariable) {
|
|
107
|
-
currentLevel = currentLevel.parent;
|
|
108
|
-
}
|
|
109
|
-
return currentLevel.parent instanceof DebugScope && currentLevel.parent['raw'].name === 'Local';
|
|
110
|
-
}
|
|
111
|
-
return false;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
override formatVariableReference(session: DebugSession, currentLevel?: DebugVariable): string {
|
|
115
|
-
if (currentLevel && this.canHandle(session)) {
|
|
116
|
-
let { name } = currentLevel;
|
|
117
|
-
while (currentLevel.parent instanceof DebugVariable) {
|
|
118
|
-
const separator = name.startsWith('[') ? '' : '.';
|
|
119
|
-
currentLevel = currentLevel.parent;
|
|
120
|
-
if (name.startsWith(`*${currentLevel.name}.`)) { // Theia has added a layer of pointer dereferencing
|
|
121
|
-
name = name.replace(`*${currentLevel.name}.`, `(*${currentLevel.name})->`);
|
|
122
|
-
} else if (name.startsWith(`*${currentLevel.name}`)) {
|
|
123
|
-
// that's fine, it's what you clicked on and probably what you want to see.
|
|
124
|
-
} else {
|
|
125
|
-
name = `${currentLevel.name}${separator}${name}`;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
return `&(${name})`;
|
|
129
|
-
}
|
|
130
|
-
return '';
|
|
131
|
-
}
|
|
132
|
-
}
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (C) 2019 Ericsson and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
*
|
|
8
|
+
* This Source Code may also be made available under the following Secondary
|
|
9
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
* with the GNU Classpath Exception which is available at
|
|
12
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
*
|
|
14
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
+
********************************************************************************/
|
|
16
|
+
|
|
17
|
+
import { injectable } from '@theia/core/shared/inversify';
|
|
18
|
+
import { DebugScope, DebugVariable } from '@theia/debug/lib/browser/console/debug-console-items';
|
|
19
|
+
import { DebugSession } from '@theia/debug/lib/browser/debug-session';
|
|
20
|
+
import { hexStrToUnsignedLong } from '../../common/util';
|
|
21
|
+
import { VariableRange } from '../utils/memory-widget-variable-utils';
|
|
22
|
+
import { AbstractMemoryProvider } from './memory-provider';
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* @file this file exists to show the customizations possible for specific debug adapters. Within the confines of the DebugAdapterProtocol, different adapters can behave
|
|
26
|
+
* quite differently. In particular, they can differ in the kinds of expressions that they treat as references (in the `memoryReference` field of MemoryReadArguments, for example)
|
|
27
|
+
* and the kinds of expressions that they can evaluate (for example to assist in determining the size of variables). The `MemoryProvider` type exists to allow applications
|
|
28
|
+
* to enhance the base functionality of the Memory Inspector by tapping into specifics of known adapters.
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Read memory through the current debug session, using the cdt-gdb-adapter
|
|
33
|
+
* extension to read memory.
|
|
34
|
+
*/
|
|
35
|
+
@injectable()
|
|
36
|
+
export class CDTGDBMemoryProvider extends AbstractMemoryProvider {
|
|
37
|
+
|
|
38
|
+
canHandle(session: DebugSession): boolean {
|
|
39
|
+
return session.configuration.type === 'gdb';
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
override async getLocals(session: DebugSession | undefined): Promise<VariableRange[]> {
|
|
43
|
+
if (session === undefined) {
|
|
44
|
+
console.warn('No active debug session.');
|
|
45
|
+
return [];
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const frame = session.currentFrame;
|
|
49
|
+
if (frame === undefined) {
|
|
50
|
+
throw new Error('No active stack frame.');
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const ranges: VariableRange[] = [];
|
|
54
|
+
|
|
55
|
+
const scopes = await frame.getScopes();
|
|
56
|
+
const scopesWithoutRegisters = scopes.filter(x => x.render() !== 'Registers');
|
|
57
|
+
for (const scope of scopesWithoutRegisters) {
|
|
58
|
+
const variables = await scope.getElements();
|
|
59
|
+
for (const v of variables) {
|
|
60
|
+
if (v instanceof DebugVariable) {
|
|
61
|
+
const addrExp = `&${v.name}`;
|
|
62
|
+
const sizeExp = `sizeof(${v.name})`;
|
|
63
|
+
const addrResp = await session.sendRequest('evaluate', {
|
|
64
|
+
expression: addrExp,
|
|
65
|
+
context: 'watch',
|
|
66
|
+
frameId: frame.raw.id,
|
|
67
|
+
}).catch(e => { console.warn(`Failed to evaluate ${addrExp}. Corresponding variable will be omitted from Memory Inspector display.`, e); });
|
|
68
|
+
if (!addrResp) { continue; }
|
|
69
|
+
|
|
70
|
+
const sizeResp = await session.sendRequest('evaluate', {
|
|
71
|
+
expression: sizeExp,
|
|
72
|
+
context: 'watch',
|
|
73
|
+
frameId: frame.raw.id,
|
|
74
|
+
}).catch(e => { console.warn(`Failed to evaluate ${sizeExp}. Corresponding variable will be omitted from Memory Inspector display.`, e); });
|
|
75
|
+
if (!sizeResp) { continue; }
|
|
76
|
+
|
|
77
|
+
// Make sure the address is in the format we expect.
|
|
78
|
+
const addressPart = /0x[0-9a-f]+/i.exec(addrResp.body.result);
|
|
79
|
+
if (!addressPart) { continue; }
|
|
80
|
+
|
|
81
|
+
if (!/^[0-9]+$/.test(sizeResp.body.result)) { continue; }
|
|
82
|
+
|
|
83
|
+
const size = parseInt(sizeResp.body.result);
|
|
84
|
+
const address = hexStrToUnsignedLong(addressPart[0]);
|
|
85
|
+
const pastTheEndAddress = address.add(size);
|
|
86
|
+
|
|
87
|
+
ranges.push({
|
|
88
|
+
name: v.name,
|
|
89
|
+
address,
|
|
90
|
+
pastTheEndAddress,
|
|
91
|
+
type: v.type,
|
|
92
|
+
value: v.value,
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
return ranges;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
override supportsVariableReferenceSyntax(session: DebugSession, currentLevel?: DebugVariable): boolean {
|
|
102
|
+
if (this.canHandle(session)) {
|
|
103
|
+
if (!currentLevel) {
|
|
104
|
+
return false;
|
|
105
|
+
}
|
|
106
|
+
while (currentLevel.parent instanceof DebugVariable) {
|
|
107
|
+
currentLevel = currentLevel.parent;
|
|
108
|
+
}
|
|
109
|
+
return currentLevel.parent instanceof DebugScope && currentLevel.parent['raw'].name === 'Local';
|
|
110
|
+
}
|
|
111
|
+
return false;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
override formatVariableReference(session: DebugSession, currentLevel?: DebugVariable): string {
|
|
115
|
+
if (currentLevel && this.canHandle(session)) {
|
|
116
|
+
let { name } = currentLevel;
|
|
117
|
+
while (currentLevel.parent instanceof DebugVariable) {
|
|
118
|
+
const separator = name.startsWith('[') ? '' : '.';
|
|
119
|
+
currentLevel = currentLevel.parent;
|
|
120
|
+
if (name.startsWith(`*${currentLevel.name}.`)) { // Theia has added a layer of pointer dereferencing
|
|
121
|
+
name = name.replace(`*${currentLevel.name}.`, `(*${currentLevel.name})->`);
|
|
122
|
+
} else if (name.startsWith(`*${currentLevel.name}`)) {
|
|
123
|
+
// that's fine, it's what you clicked on and probably what you want to see.
|
|
124
|
+
} else {
|
|
125
|
+
name = `${currentLevel.name}${separator}${name}`;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
return `&(${name})`;
|
|
129
|
+
}
|
|
130
|
+
return '';
|
|
131
|
+
}
|
|
132
|
+
}
|