@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,339 +1,339 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/********************************************************************************
|
|
3
|
-
* Copyright (C) 2021 Ericsson and others.
|
|
4
|
-
*
|
|
5
|
-
* This program and the accompanying materials are made available under the
|
|
6
|
-
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
-
* http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
-
*
|
|
9
|
-
* This Source Code may also be made available under the following Secondary
|
|
10
|
-
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
-
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
-
* with the GNU Classpath Exception which is available at
|
|
13
|
-
* https://www.gnu.org/software/classpath/license.html.
|
|
14
|
-
*
|
|
15
|
-
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
-
********************************************************************************/
|
|
17
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
18
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
19
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
20
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
21
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
22
|
-
};
|
|
23
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
24
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
25
|
-
};
|
|
26
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
-
exports.RegisterOptionsWidget = exports.REGISTER_PRE_SETS_ID = exports.REGISTER_RADIX_ID = exports.REGISTER_FIELD_ID = exports.EMPTY_REGISTERS = void 0;
|
|
28
|
-
const core_1 = require("@theia/core");
|
|
29
|
-
const inversify_1 = require("@theia/core/shared/inversify");
|
|
30
|
-
const React = require("@theia/core/shared/react");
|
|
31
|
-
const debug_session_1 = require("@theia/debug/lib/browser/debug-session");
|
|
32
|
-
const memory_options_widget_1 = require("../memory-widget/memory-options-widget");
|
|
33
|
-
const memory_widget_components_1 = require("../utils/memory-widget-components");
|
|
34
|
-
const memory_widget_utils_1 = require("../utils/memory-widget-utils");
|
|
35
|
-
const memory_widget_variable_utils_1 = require("../utils/memory-widget-variable-utils");
|
|
36
|
-
const multi_select_bar_1 = require("../utils/multi-select-bar");
|
|
37
|
-
const register_filter_service_1 = require("./register-filter-service");
|
|
38
|
-
const debounce = require("@theia/core/shared/lodash.debounce");
|
|
39
|
-
exports.EMPTY_REGISTERS = {
|
|
40
|
-
threadId: undefined,
|
|
41
|
-
registers: [],
|
|
42
|
-
};
|
|
43
|
-
exports.REGISTER_FIELD_ID = 't-mv-register';
|
|
44
|
-
exports.REGISTER_RADIX_ID = 't-mv-radix';
|
|
45
|
-
exports.REGISTER_PRE_SETS_ID = 't-mv-pre-set';
|
|
46
|
-
let RegisterOptionsWidget = class RegisterOptionsWidget extends memory_options_widget_1.MemoryOptionsWidget {
|
|
47
|
-
constructor() {
|
|
48
|
-
super(...arguments);
|
|
49
|
-
this.iconClass = 'register-view-icon';
|
|
50
|
-
this.lockIconClass = 'register-lock-icon';
|
|
51
|
-
this.LABEL_PREFIX = core_1.nls.localize('theia/memory-inspector/register', 'Register');
|
|
52
|
-
this.onRegisterChangedEmitter = new core_1.Emitter();
|
|
53
|
-
this.onRegisterChanged = this.onRegisterChangedEmitter.event;
|
|
54
|
-
this.registerReadResult = exports.EMPTY_REGISTERS;
|
|
55
|
-
this.registerDisplaySet = new Set();
|
|
56
|
-
this.registerDisplayAll = true;
|
|
57
|
-
this.registerFilterUpdate = false;
|
|
58
|
-
this.registerReadError = core_1.nls.localize('theia/memory-inspector/register/readError', 'No Registers currently available.');
|
|
59
|
-
this.showRegisterError = false;
|
|
60
|
-
this.noRadixColumnDisplayed = this.noRadixDisplayed();
|
|
61
|
-
this.columnsDisplayed = {
|
|
62
|
-
register: {
|
|
63
|
-
label: core_1.nls.localize('theia/memory-inspector/register', 'Register'),
|
|
64
|
-
doRender: true
|
|
65
|
-
},
|
|
66
|
-
hexadecimal: {
|
|
67
|
-
label: core_1.nls.localize('theia/memory-inspector/hexadecimal', 'Hexadecimal'),
|
|
68
|
-
doRender: true
|
|
69
|
-
},
|
|
70
|
-
decimal: {
|
|
71
|
-
label: core_1.nls.localize('theia/memory-inspector/decimal', 'Decimal'),
|
|
72
|
-
doRender: false
|
|
73
|
-
},
|
|
74
|
-
octal: {
|
|
75
|
-
label: core_1.nls.localize('theia/memory-inspector/octal', 'Octal'),
|
|
76
|
-
doRender: false
|
|
77
|
-
},
|
|
78
|
-
binary: {
|
|
79
|
-
label: core_1.nls.localize('theia/memory-inspector/binary', 'Binary'),
|
|
80
|
-
doRender: false
|
|
81
|
-
},
|
|
82
|
-
};
|
|
83
|
-
this.assignRegisterRef = reg => {
|
|
84
|
-
this.registerField = reg !== null && reg !== void 0 ? reg : undefined;
|
|
85
|
-
};
|
|
86
|
-
this.setRegFilterFromSelect = (e) => {
|
|
87
|
-
if (this.registerField) {
|
|
88
|
-
this.registerField.value = e.target.value;
|
|
89
|
-
}
|
|
90
|
-
};
|
|
91
|
-
this.updateRegisterView = debounce(this.doUpdateRegisterView.bind(this), memory_widget_utils_1.Constants.DEBOUNCE_TIME, { trailing: true });
|
|
92
|
-
this.doRefresh = (event) => {
|
|
93
|
-
if ('key' in event && event.key !== 'Enter') {
|
|
94
|
-
return;
|
|
95
|
-
}
|
|
96
|
-
this.registerFilterUpdate = true;
|
|
97
|
-
this.updateRegisterView();
|
|
98
|
-
};
|
|
99
|
-
this.doShowRegisterErrors = (doClearError = false) => {
|
|
100
|
-
if (this.errorTimeout !== undefined) {
|
|
101
|
-
clearTimeout(this.errorTimeout);
|
|
102
|
-
}
|
|
103
|
-
if (doClearError) {
|
|
104
|
-
this.showRegisterError = false;
|
|
105
|
-
this.update();
|
|
106
|
-
this.errorTimeout = undefined;
|
|
107
|
-
return;
|
|
108
|
-
}
|
|
109
|
-
this.showRegisterError = true;
|
|
110
|
-
this.update();
|
|
111
|
-
this.errorTimeout = setTimeout(() => {
|
|
112
|
-
this.showRegisterError = false;
|
|
113
|
-
this.update();
|
|
114
|
-
this.errorTimeout = undefined;
|
|
115
|
-
}, memory_widget_utils_1.Constants.ERROR_TIMEOUT);
|
|
116
|
-
};
|
|
117
|
-
}
|
|
118
|
-
get registers() {
|
|
119
|
-
return {
|
|
120
|
-
...this.registerReadResult,
|
|
121
|
-
};
|
|
122
|
-
}
|
|
123
|
-
get options() {
|
|
124
|
-
return this.storeState();
|
|
125
|
-
}
|
|
126
|
-
displayReg(element) {
|
|
127
|
-
return this.registerDisplayAll ||
|
|
128
|
-
this.registerDisplaySet.has(element);
|
|
129
|
-
}
|
|
130
|
-
handleRadixRendering(regVal, radix, _regName) {
|
|
131
|
-
// check if too big for integer
|
|
132
|
-
const bInt = BigInt(regVal);
|
|
133
|
-
return bInt.toString(radix);
|
|
134
|
-
}
|
|
135
|
-
init() {
|
|
136
|
-
this.addClass(memory_options_widget_1.MemoryOptionsWidget.ID);
|
|
137
|
-
this.addClass('reg-options-widget');
|
|
138
|
-
this.title.label = `${this.LABEL_PREFIX} (${this.memoryWidgetOptions.identifier})`;
|
|
139
|
-
this.title.caption = `${this.LABEL_PREFIX} (${this.memoryWidgetOptions.identifier})`;
|
|
140
|
-
this.title.iconClass = this.iconClass;
|
|
141
|
-
this.title.closable = true;
|
|
142
|
-
if (this.memoryWidgetOptions.dynamic !== false) {
|
|
143
|
-
this.toDispose.push(this.sessionManager.onDidChangeActiveDebugSession(({ current }) => {
|
|
144
|
-
this.setUpListeners(current);
|
|
145
|
-
}));
|
|
146
|
-
this.toDispose.push(this.sessionManager.onDidCreateDebugSession(current => {
|
|
147
|
-
this.setUpListeners(current);
|
|
148
|
-
}));
|
|
149
|
-
this.setUpListeners(this.sessionManager.currentSession);
|
|
150
|
-
}
|
|
151
|
-
this.toDispose.push(this.onOptionsChanged(() => this.update()));
|
|
152
|
-
this.update();
|
|
153
|
-
}
|
|
154
|
-
setRegAndUpdate(regName) {
|
|
155
|
-
this.handleRegFromDebugWidgetSelection(regName);
|
|
156
|
-
}
|
|
157
|
-
setUpListeners(session) {
|
|
158
|
-
this.sessionListeners.dispose();
|
|
159
|
-
this.sessionListeners = new core_1.DisposableCollection(core_1.Disposable.create(() => this.handleActiveSessionChange()));
|
|
160
|
-
if (session) {
|
|
161
|
-
this.sessionListeners.push(session.onDidChange(() => this.handleSessionChange()));
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
handleActiveSessionChange() {
|
|
165
|
-
const isDynamic = this.memoryWidgetOptions.dynamic !== false;
|
|
166
|
-
if (isDynamic && this.doUpdateAutomatically) {
|
|
167
|
-
this.registerReadResult = exports.EMPTY_REGISTERS;
|
|
168
|
-
this.fireDidChangeRegister();
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
handleSessionChange() {
|
|
172
|
-
var _a, _b;
|
|
173
|
-
const debugState = (_a = this.sessionManager.currentSession) === null || _a === void 0 ? void 0 : _a.state;
|
|
174
|
-
if (debugState === debug_session_1.DebugState.Inactive) {
|
|
175
|
-
this.registerReadResult = exports.EMPTY_REGISTERS;
|
|
176
|
-
this.fireDidChangeRegister();
|
|
177
|
-
}
|
|
178
|
-
else if (debugState === debug_session_1.DebugState.Stopped) {
|
|
179
|
-
const isReadyForQuery = !!((_b = this.sessionManager.currentSession) === null || _b === void 0 ? void 0 : _b.currentFrame);
|
|
180
|
-
const isDynamic = this.memoryWidgetOptions.dynamic !== false;
|
|
181
|
-
if (isReadyForQuery && isDynamic && this.doUpdateAutomatically && this.registerReadResult !== exports.EMPTY_REGISTERS) {
|
|
182
|
-
this.updateRegisterView();
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
acceptFocus() {
|
|
187
|
-
if (this.doUpdateAutomatically) {
|
|
188
|
-
if (this.registerField) {
|
|
189
|
-
this.registerField.focus();
|
|
190
|
-
this.registerField.select();
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
else {
|
|
194
|
-
const multiSelectBar = this.node.querySelector('.multi-select-bar');
|
|
195
|
-
multiSelectBar === null || multiSelectBar === void 0 ? void 0 : multiSelectBar.focus();
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
radixDisplayed() {
|
|
199
|
-
const { register, ...radices } = this.columnsDisplayed;
|
|
200
|
-
for (const val of Object.values(radices)) {
|
|
201
|
-
if (val['doRender']) {
|
|
202
|
-
return true;
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
return false;
|
|
206
|
-
}
|
|
207
|
-
noRadixDisplayed() {
|
|
208
|
-
return !this.radixDisplayed();
|
|
209
|
-
}
|
|
210
|
-
renderRegisterFieldGroup() {
|
|
211
|
-
return (React.createElement(React.Fragment, null,
|
|
212
|
-
React.createElement("div", { className: 't-mv-group view-group' },
|
|
213
|
-
React.createElement(memory_widget_components_1.MWInputWithSelect, { id: exports.REGISTER_FIELD_ID, label: core_1.nls.localize('theia/memory-inspector/registers', 'Registers'), placeholder: core_1.nls.localize('theia/memory-inspector/register-widget/filter-placeholder', 'Filter (starts with)'), onSelectChange: this.setRegFilterFromSelect, passRef: this.assignRegisterRef, onKeyDown: this.doRefresh, options: [...this.recentLocations.values], disabled: !this.doUpdateAutomatically }),
|
|
214
|
-
React.createElement(multi_select_bar_1.MWMultiSelect, { id: memory_options_widget_1.ASCII_TOGGLE_ID, label: core_1.nls.localize('theia/memory-inspector/columns', 'Columns'), items: this.getOptionalColumns().map(column => ({ ...column, label: column.label.slice(0, 3) })), onSelectionChanged: this.handleColumnSelectionChange }),
|
|
215
|
-
React.createElement("button", { type: 'button', className: 'theia-button main view-group-go-button', onClick: this.doRefresh, disabled: !this.doUpdateAutomatically }, core_1.nls.localizeByDefault('Go'))),
|
|
216
|
-
React.createElement("div", { className: `t-mv-memory-fetch-error${this.showRegisterError ? ' show' : ' hide'}` }, this.registerReadError)));
|
|
217
|
-
}
|
|
218
|
-
doHandleColumnSelectionChange(columnLabel, doShow) {
|
|
219
|
-
const trueColumnLabel = Object.keys(this.columnsDisplayed).find(key => key.startsWith(columnLabel));
|
|
220
|
-
if (trueColumnLabel) {
|
|
221
|
-
super.doHandleColumnSelectionChange(trueColumnLabel, doShow);
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
getObligatoryColumnIds() {
|
|
225
|
-
return ['register'];
|
|
226
|
-
}
|
|
227
|
-
renderInputContainer() {
|
|
228
|
-
return (React.createElement("div", { className: 't-mv-settings-container' },
|
|
229
|
-
React.createElement("div", { className: 't-mv-wrapper' },
|
|
230
|
-
this.renderToolbar(),
|
|
231
|
-
this.renderRegisterFieldGroup())));
|
|
232
|
-
}
|
|
233
|
-
handleRegFromDebugWidgetSelection(regName) {
|
|
234
|
-
this.registerDisplaySet.clear();
|
|
235
|
-
if (this.registerField) {
|
|
236
|
-
this.registerField.value = regName;
|
|
237
|
-
this.registerDisplayAll = false;
|
|
238
|
-
}
|
|
239
|
-
this.doUpdateRegisterView();
|
|
240
|
-
}
|
|
241
|
-
renderToolbar() {
|
|
242
|
-
return (React.createElement("div", { className: 'memory-widget-toolbar' },
|
|
243
|
-
this.memoryWidgetOptions.dynamic !== false && (React.createElement("div", { className: 'memory-widget-auto-updates-container' },
|
|
244
|
-
React.createElement("div", { className: `fa fa-${this.doUpdateAutomatically ? 'unlock' : 'lock'}`, id: memory_options_widget_1.AUTO_UPDATE_TOGGLE_ID, title: this.doUpdateAutomatically ?
|
|
245
|
-
core_1.nls.localize('theia/memory-inspector/register/freeze', 'Freeze memory view') :
|
|
246
|
-
core_1.nls.localize('theia/memory-inspector/register/unfreeze', 'Unfreeze memory view'), onClick: this.toggleAutoUpdate, onKeyDown: this.toggleAutoUpdate, role: 'button', tabIndex: 0 }))),
|
|
247
|
-
this.renderEditableTitleField()));
|
|
248
|
-
}
|
|
249
|
-
validateInputRegs(input) {
|
|
250
|
-
var _a;
|
|
251
|
-
// identify sequences of alphanumeric characters
|
|
252
|
-
const searchTexts = (_a = input.match(/\w+/g)) !== null && _a !== void 0 ? _a : [];
|
|
253
|
-
if (searchTexts.length !== 0) {
|
|
254
|
-
this.registerDisplayAll = false;
|
|
255
|
-
this.registerDisplaySet.clear();
|
|
256
|
-
this.recentLocations.add(input);
|
|
257
|
-
for (const { name } of this.registerReadResult.registers) {
|
|
258
|
-
if (searchTexts.some(x => name.startsWith(x))) {
|
|
259
|
-
this.registerDisplaySet.add(name);
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
else {
|
|
264
|
-
this.registerDisplayAll = true;
|
|
265
|
-
this.registerDisplaySet.clear();
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
async doUpdateRegisterView() {
|
|
269
|
-
var _a;
|
|
270
|
-
try {
|
|
271
|
-
if (!this.registerReadResult.registers || this.registerReadResult.threadId !== ((_a = this.sessionManager.currentThread) === null || _a === void 0 ? void 0 : _a.id)) {
|
|
272
|
-
this.registerReadResult = await this.getRegisters();
|
|
273
|
-
}
|
|
274
|
-
this.updateRegDisplayFilter();
|
|
275
|
-
this.fireDidChangeRegister();
|
|
276
|
-
this.doShowRegisterErrors(true);
|
|
277
|
-
}
|
|
278
|
-
catch (err) {
|
|
279
|
-
this.registerReadError = core_1.nls.localize('theia/memory-inspector/registerReadError', 'There was an error fetching registers.');
|
|
280
|
-
console.error('Failed to read registers', err);
|
|
281
|
-
this.doShowRegisterErrors();
|
|
282
|
-
}
|
|
283
|
-
finally {
|
|
284
|
-
this.registerFilterUpdate = false;
|
|
285
|
-
this.update();
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
updateRegDisplayFilter() {
|
|
289
|
-
if (this.registerField) {
|
|
290
|
-
if (this.registerField.value.length === 0) {
|
|
291
|
-
this.registerDisplayAll = true;
|
|
292
|
-
}
|
|
293
|
-
else {
|
|
294
|
-
this.validateInputRegs(this.registerField.value);
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
async getRegisters() {
|
|
299
|
-
var _a, _b;
|
|
300
|
-
const regResult = await (0, memory_widget_variable_utils_1.getRegisters)(this.sessionManager.currentSession);
|
|
301
|
-
const threadResult = (_b = (_a = this.sessionManager.currentSession) === null || _a === void 0 ? void 0 : _a.currentThread) === null || _b === void 0 ? void 0 : _b.id;
|
|
302
|
-
return { threadId: threadResult, registers: regResult };
|
|
303
|
-
}
|
|
304
|
-
fireDidChangeRegister() {
|
|
305
|
-
this.onRegisterChangedEmitter.fire([this.registerReadResult, this.registerFilterUpdate]);
|
|
306
|
-
}
|
|
307
|
-
storeState() {
|
|
308
|
-
var _a, _b;
|
|
309
|
-
return {
|
|
310
|
-
...super.storeState(),
|
|
311
|
-
reg: (_b = (_a = this.registerField) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : this.reg,
|
|
312
|
-
noRadixColumnDisplayed: this.noRadixDisplayed(),
|
|
313
|
-
};
|
|
314
|
-
}
|
|
315
|
-
restoreState(oldState) {
|
|
316
|
-
var _a;
|
|
317
|
-
this.reg = (_a = oldState.reg) !== null && _a !== void 0 ? _a : this.reg;
|
|
318
|
-
this.noRadixColumnDisplayed = oldState.noRadixColumnDisplayed;
|
|
319
|
-
}
|
|
320
|
-
};
|
|
321
|
-
__decorate([
|
|
322
|
-
(0, inversify_1.inject)(memory_widget_utils_1.RegisterWidgetOptions),
|
|
323
|
-
__metadata("design:type", Object)
|
|
324
|
-
], RegisterOptionsWidget.prototype, "memoryWidgetOptions", void 0);
|
|
325
|
-
__decorate([
|
|
326
|
-
(0, inversify_1.inject)(register_filter_service_1.RegisterFilterService),
|
|
327
|
-
__metadata("design:type", Object)
|
|
328
|
-
], RegisterOptionsWidget.prototype, "filterService", void 0);
|
|
329
|
-
__decorate([
|
|
330
|
-
(0, inversify_1.postConstruct)(),
|
|
331
|
-
__metadata("design:type", Function),
|
|
332
|
-
__metadata("design:paramtypes", []),
|
|
333
|
-
__metadata("design:returntype", void 0)
|
|
334
|
-
], RegisterOptionsWidget.prototype, "init", null);
|
|
335
|
-
RegisterOptionsWidget = __decorate([
|
|
336
|
-
(0, inversify_1.injectable)()
|
|
337
|
-
], RegisterOptionsWidget);
|
|
338
|
-
exports.RegisterOptionsWidget = RegisterOptionsWidget;
|
|
1
|
+
"use strict";
|
|
2
|
+
/********************************************************************************
|
|
3
|
+
* Copyright (C) 2021 Ericsson and others.
|
|
4
|
+
*
|
|
5
|
+
* This program and the accompanying materials are made available under the
|
|
6
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
*
|
|
9
|
+
* This Source Code may also be made available under the following Secondary
|
|
10
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
* with the GNU Classpath Exception which is available at
|
|
13
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
*
|
|
15
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
+
********************************************************************************/
|
|
17
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
18
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
19
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
20
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
21
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
22
|
+
};
|
|
23
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
24
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
25
|
+
};
|
|
26
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
+
exports.RegisterOptionsWidget = exports.REGISTER_PRE_SETS_ID = exports.REGISTER_RADIX_ID = exports.REGISTER_FIELD_ID = exports.EMPTY_REGISTERS = void 0;
|
|
28
|
+
const core_1 = require("@theia/core");
|
|
29
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
30
|
+
const React = require("@theia/core/shared/react");
|
|
31
|
+
const debug_session_1 = require("@theia/debug/lib/browser/debug-session");
|
|
32
|
+
const memory_options_widget_1 = require("../memory-widget/memory-options-widget");
|
|
33
|
+
const memory_widget_components_1 = require("../utils/memory-widget-components");
|
|
34
|
+
const memory_widget_utils_1 = require("../utils/memory-widget-utils");
|
|
35
|
+
const memory_widget_variable_utils_1 = require("../utils/memory-widget-variable-utils");
|
|
36
|
+
const multi_select_bar_1 = require("../utils/multi-select-bar");
|
|
37
|
+
const register_filter_service_1 = require("./register-filter-service");
|
|
38
|
+
const debounce = require("@theia/core/shared/lodash.debounce");
|
|
39
|
+
exports.EMPTY_REGISTERS = {
|
|
40
|
+
threadId: undefined,
|
|
41
|
+
registers: [],
|
|
42
|
+
};
|
|
43
|
+
exports.REGISTER_FIELD_ID = 't-mv-register';
|
|
44
|
+
exports.REGISTER_RADIX_ID = 't-mv-radix';
|
|
45
|
+
exports.REGISTER_PRE_SETS_ID = 't-mv-pre-set';
|
|
46
|
+
let RegisterOptionsWidget = class RegisterOptionsWidget extends memory_options_widget_1.MemoryOptionsWidget {
|
|
47
|
+
constructor() {
|
|
48
|
+
super(...arguments);
|
|
49
|
+
this.iconClass = 'register-view-icon';
|
|
50
|
+
this.lockIconClass = 'register-lock-icon';
|
|
51
|
+
this.LABEL_PREFIX = core_1.nls.localize('theia/memory-inspector/register', 'Register');
|
|
52
|
+
this.onRegisterChangedEmitter = new core_1.Emitter();
|
|
53
|
+
this.onRegisterChanged = this.onRegisterChangedEmitter.event;
|
|
54
|
+
this.registerReadResult = exports.EMPTY_REGISTERS;
|
|
55
|
+
this.registerDisplaySet = new Set();
|
|
56
|
+
this.registerDisplayAll = true;
|
|
57
|
+
this.registerFilterUpdate = false;
|
|
58
|
+
this.registerReadError = core_1.nls.localize('theia/memory-inspector/register/readError', 'No Registers currently available.');
|
|
59
|
+
this.showRegisterError = false;
|
|
60
|
+
this.noRadixColumnDisplayed = this.noRadixDisplayed();
|
|
61
|
+
this.columnsDisplayed = {
|
|
62
|
+
register: {
|
|
63
|
+
label: core_1.nls.localize('theia/memory-inspector/register', 'Register'),
|
|
64
|
+
doRender: true
|
|
65
|
+
},
|
|
66
|
+
hexadecimal: {
|
|
67
|
+
label: core_1.nls.localize('theia/memory-inspector/hexadecimal', 'Hexadecimal'),
|
|
68
|
+
doRender: true
|
|
69
|
+
},
|
|
70
|
+
decimal: {
|
|
71
|
+
label: core_1.nls.localize('theia/memory-inspector/decimal', 'Decimal'),
|
|
72
|
+
doRender: false
|
|
73
|
+
},
|
|
74
|
+
octal: {
|
|
75
|
+
label: core_1.nls.localize('theia/memory-inspector/octal', 'Octal'),
|
|
76
|
+
doRender: false
|
|
77
|
+
},
|
|
78
|
+
binary: {
|
|
79
|
+
label: core_1.nls.localize('theia/memory-inspector/binary', 'Binary'),
|
|
80
|
+
doRender: false
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
|
+
this.assignRegisterRef = reg => {
|
|
84
|
+
this.registerField = reg !== null && reg !== void 0 ? reg : undefined;
|
|
85
|
+
};
|
|
86
|
+
this.setRegFilterFromSelect = (e) => {
|
|
87
|
+
if (this.registerField) {
|
|
88
|
+
this.registerField.value = e.target.value;
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
this.updateRegisterView = debounce(this.doUpdateRegisterView.bind(this), memory_widget_utils_1.Constants.DEBOUNCE_TIME, { trailing: true });
|
|
92
|
+
this.doRefresh = (event) => {
|
|
93
|
+
if ('key' in event && event.key !== 'Enter') {
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
this.registerFilterUpdate = true;
|
|
97
|
+
this.updateRegisterView();
|
|
98
|
+
};
|
|
99
|
+
this.doShowRegisterErrors = (doClearError = false) => {
|
|
100
|
+
if (this.errorTimeout !== undefined) {
|
|
101
|
+
clearTimeout(this.errorTimeout);
|
|
102
|
+
}
|
|
103
|
+
if (doClearError) {
|
|
104
|
+
this.showRegisterError = false;
|
|
105
|
+
this.update();
|
|
106
|
+
this.errorTimeout = undefined;
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
this.showRegisterError = true;
|
|
110
|
+
this.update();
|
|
111
|
+
this.errorTimeout = setTimeout(() => {
|
|
112
|
+
this.showRegisterError = false;
|
|
113
|
+
this.update();
|
|
114
|
+
this.errorTimeout = undefined;
|
|
115
|
+
}, memory_widget_utils_1.Constants.ERROR_TIMEOUT);
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
get registers() {
|
|
119
|
+
return {
|
|
120
|
+
...this.registerReadResult,
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
get options() {
|
|
124
|
+
return this.storeState();
|
|
125
|
+
}
|
|
126
|
+
displayReg(element) {
|
|
127
|
+
return this.registerDisplayAll ||
|
|
128
|
+
this.registerDisplaySet.has(element);
|
|
129
|
+
}
|
|
130
|
+
handleRadixRendering(regVal, radix, _regName) {
|
|
131
|
+
// check if too big for integer
|
|
132
|
+
const bInt = BigInt(regVal);
|
|
133
|
+
return bInt.toString(radix);
|
|
134
|
+
}
|
|
135
|
+
init() {
|
|
136
|
+
this.addClass(memory_options_widget_1.MemoryOptionsWidget.ID);
|
|
137
|
+
this.addClass('reg-options-widget');
|
|
138
|
+
this.title.label = `${this.LABEL_PREFIX} (${this.memoryWidgetOptions.identifier})`;
|
|
139
|
+
this.title.caption = `${this.LABEL_PREFIX} (${this.memoryWidgetOptions.identifier})`;
|
|
140
|
+
this.title.iconClass = this.iconClass;
|
|
141
|
+
this.title.closable = true;
|
|
142
|
+
if (this.memoryWidgetOptions.dynamic !== false) {
|
|
143
|
+
this.toDispose.push(this.sessionManager.onDidChangeActiveDebugSession(({ current }) => {
|
|
144
|
+
this.setUpListeners(current);
|
|
145
|
+
}));
|
|
146
|
+
this.toDispose.push(this.sessionManager.onDidCreateDebugSession(current => {
|
|
147
|
+
this.setUpListeners(current);
|
|
148
|
+
}));
|
|
149
|
+
this.setUpListeners(this.sessionManager.currentSession);
|
|
150
|
+
}
|
|
151
|
+
this.toDispose.push(this.onOptionsChanged(() => this.update()));
|
|
152
|
+
this.update();
|
|
153
|
+
}
|
|
154
|
+
setRegAndUpdate(regName) {
|
|
155
|
+
this.handleRegFromDebugWidgetSelection(regName);
|
|
156
|
+
}
|
|
157
|
+
setUpListeners(session) {
|
|
158
|
+
this.sessionListeners.dispose();
|
|
159
|
+
this.sessionListeners = new core_1.DisposableCollection(core_1.Disposable.create(() => this.handleActiveSessionChange()));
|
|
160
|
+
if (session) {
|
|
161
|
+
this.sessionListeners.push(session.onDidChange(() => this.handleSessionChange()));
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
handleActiveSessionChange() {
|
|
165
|
+
const isDynamic = this.memoryWidgetOptions.dynamic !== false;
|
|
166
|
+
if (isDynamic && this.doUpdateAutomatically) {
|
|
167
|
+
this.registerReadResult = exports.EMPTY_REGISTERS;
|
|
168
|
+
this.fireDidChangeRegister();
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
handleSessionChange() {
|
|
172
|
+
var _a, _b;
|
|
173
|
+
const debugState = (_a = this.sessionManager.currentSession) === null || _a === void 0 ? void 0 : _a.state;
|
|
174
|
+
if (debugState === debug_session_1.DebugState.Inactive) {
|
|
175
|
+
this.registerReadResult = exports.EMPTY_REGISTERS;
|
|
176
|
+
this.fireDidChangeRegister();
|
|
177
|
+
}
|
|
178
|
+
else if (debugState === debug_session_1.DebugState.Stopped) {
|
|
179
|
+
const isReadyForQuery = !!((_b = this.sessionManager.currentSession) === null || _b === void 0 ? void 0 : _b.currentFrame);
|
|
180
|
+
const isDynamic = this.memoryWidgetOptions.dynamic !== false;
|
|
181
|
+
if (isReadyForQuery && isDynamic && this.doUpdateAutomatically && this.registerReadResult !== exports.EMPTY_REGISTERS) {
|
|
182
|
+
this.updateRegisterView();
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
acceptFocus() {
|
|
187
|
+
if (this.doUpdateAutomatically) {
|
|
188
|
+
if (this.registerField) {
|
|
189
|
+
this.registerField.focus();
|
|
190
|
+
this.registerField.select();
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
else {
|
|
194
|
+
const multiSelectBar = this.node.querySelector('.multi-select-bar');
|
|
195
|
+
multiSelectBar === null || multiSelectBar === void 0 ? void 0 : multiSelectBar.focus();
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
radixDisplayed() {
|
|
199
|
+
const { register, ...radices } = this.columnsDisplayed;
|
|
200
|
+
for (const val of Object.values(radices)) {
|
|
201
|
+
if (val['doRender']) {
|
|
202
|
+
return true;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
return false;
|
|
206
|
+
}
|
|
207
|
+
noRadixDisplayed() {
|
|
208
|
+
return !this.radixDisplayed();
|
|
209
|
+
}
|
|
210
|
+
renderRegisterFieldGroup() {
|
|
211
|
+
return (React.createElement(React.Fragment, null,
|
|
212
|
+
React.createElement("div", { className: 't-mv-group view-group' },
|
|
213
|
+
React.createElement(memory_widget_components_1.MWInputWithSelect, { id: exports.REGISTER_FIELD_ID, label: core_1.nls.localize('theia/memory-inspector/registers', 'Registers'), placeholder: core_1.nls.localize('theia/memory-inspector/register-widget/filter-placeholder', 'Filter (starts with)'), onSelectChange: this.setRegFilterFromSelect, passRef: this.assignRegisterRef, onKeyDown: this.doRefresh, options: [...this.recentLocations.values], disabled: !this.doUpdateAutomatically }),
|
|
214
|
+
React.createElement(multi_select_bar_1.MWMultiSelect, { id: memory_options_widget_1.ASCII_TOGGLE_ID, label: core_1.nls.localize('theia/memory-inspector/columns', 'Columns'), items: this.getOptionalColumns().map(column => ({ ...column, label: column.label.slice(0, 3) })), onSelectionChanged: this.handleColumnSelectionChange }),
|
|
215
|
+
React.createElement("button", { type: 'button', className: 'theia-button main view-group-go-button', onClick: this.doRefresh, disabled: !this.doUpdateAutomatically }, core_1.nls.localizeByDefault('Go'))),
|
|
216
|
+
React.createElement("div", { className: `t-mv-memory-fetch-error${this.showRegisterError ? ' show' : ' hide'}` }, this.registerReadError)));
|
|
217
|
+
}
|
|
218
|
+
doHandleColumnSelectionChange(columnLabel, doShow) {
|
|
219
|
+
const trueColumnLabel = Object.keys(this.columnsDisplayed).find(key => key.startsWith(columnLabel));
|
|
220
|
+
if (trueColumnLabel) {
|
|
221
|
+
super.doHandleColumnSelectionChange(trueColumnLabel, doShow);
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
getObligatoryColumnIds() {
|
|
225
|
+
return ['register'];
|
|
226
|
+
}
|
|
227
|
+
renderInputContainer() {
|
|
228
|
+
return (React.createElement("div", { className: 't-mv-settings-container' },
|
|
229
|
+
React.createElement("div", { className: 't-mv-wrapper' },
|
|
230
|
+
this.renderToolbar(),
|
|
231
|
+
this.renderRegisterFieldGroup())));
|
|
232
|
+
}
|
|
233
|
+
handleRegFromDebugWidgetSelection(regName) {
|
|
234
|
+
this.registerDisplaySet.clear();
|
|
235
|
+
if (this.registerField) {
|
|
236
|
+
this.registerField.value = regName;
|
|
237
|
+
this.registerDisplayAll = false;
|
|
238
|
+
}
|
|
239
|
+
this.doUpdateRegisterView();
|
|
240
|
+
}
|
|
241
|
+
renderToolbar() {
|
|
242
|
+
return (React.createElement("div", { className: 'memory-widget-toolbar' },
|
|
243
|
+
this.memoryWidgetOptions.dynamic !== false && (React.createElement("div", { className: 'memory-widget-auto-updates-container' },
|
|
244
|
+
React.createElement("div", { className: `fa fa-${this.doUpdateAutomatically ? 'unlock' : 'lock'}`, id: memory_options_widget_1.AUTO_UPDATE_TOGGLE_ID, title: this.doUpdateAutomatically ?
|
|
245
|
+
core_1.nls.localize('theia/memory-inspector/register/freeze', 'Freeze memory view') :
|
|
246
|
+
core_1.nls.localize('theia/memory-inspector/register/unfreeze', 'Unfreeze memory view'), onClick: this.toggleAutoUpdate, onKeyDown: this.toggleAutoUpdate, role: 'button', tabIndex: 0 }))),
|
|
247
|
+
this.renderEditableTitleField()));
|
|
248
|
+
}
|
|
249
|
+
validateInputRegs(input) {
|
|
250
|
+
var _a;
|
|
251
|
+
// identify sequences of alphanumeric characters
|
|
252
|
+
const searchTexts = (_a = input.match(/\w+/g)) !== null && _a !== void 0 ? _a : [];
|
|
253
|
+
if (searchTexts.length !== 0) {
|
|
254
|
+
this.registerDisplayAll = false;
|
|
255
|
+
this.registerDisplaySet.clear();
|
|
256
|
+
this.recentLocations.add(input);
|
|
257
|
+
for (const { name } of this.registerReadResult.registers) {
|
|
258
|
+
if (searchTexts.some(x => name.startsWith(x))) {
|
|
259
|
+
this.registerDisplaySet.add(name);
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
else {
|
|
264
|
+
this.registerDisplayAll = true;
|
|
265
|
+
this.registerDisplaySet.clear();
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
async doUpdateRegisterView() {
|
|
269
|
+
var _a;
|
|
270
|
+
try {
|
|
271
|
+
if (!this.registerReadResult.registers || this.registerReadResult.threadId !== ((_a = this.sessionManager.currentThread) === null || _a === void 0 ? void 0 : _a.id)) {
|
|
272
|
+
this.registerReadResult = await this.getRegisters();
|
|
273
|
+
}
|
|
274
|
+
this.updateRegDisplayFilter();
|
|
275
|
+
this.fireDidChangeRegister();
|
|
276
|
+
this.doShowRegisterErrors(true);
|
|
277
|
+
}
|
|
278
|
+
catch (err) {
|
|
279
|
+
this.registerReadError = core_1.nls.localize('theia/memory-inspector/registerReadError', 'There was an error fetching registers.');
|
|
280
|
+
console.error('Failed to read registers', err);
|
|
281
|
+
this.doShowRegisterErrors();
|
|
282
|
+
}
|
|
283
|
+
finally {
|
|
284
|
+
this.registerFilterUpdate = false;
|
|
285
|
+
this.update();
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
updateRegDisplayFilter() {
|
|
289
|
+
if (this.registerField) {
|
|
290
|
+
if (this.registerField.value.length === 0) {
|
|
291
|
+
this.registerDisplayAll = true;
|
|
292
|
+
}
|
|
293
|
+
else {
|
|
294
|
+
this.validateInputRegs(this.registerField.value);
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
async getRegisters() {
|
|
299
|
+
var _a, _b;
|
|
300
|
+
const regResult = await (0, memory_widget_variable_utils_1.getRegisters)(this.sessionManager.currentSession);
|
|
301
|
+
const threadResult = (_b = (_a = this.sessionManager.currentSession) === null || _a === void 0 ? void 0 : _a.currentThread) === null || _b === void 0 ? void 0 : _b.id;
|
|
302
|
+
return { threadId: threadResult, registers: regResult };
|
|
303
|
+
}
|
|
304
|
+
fireDidChangeRegister() {
|
|
305
|
+
this.onRegisterChangedEmitter.fire([this.registerReadResult, this.registerFilterUpdate]);
|
|
306
|
+
}
|
|
307
|
+
storeState() {
|
|
308
|
+
var _a, _b;
|
|
309
|
+
return {
|
|
310
|
+
...super.storeState(),
|
|
311
|
+
reg: (_b = (_a = this.registerField) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : this.reg,
|
|
312
|
+
noRadixColumnDisplayed: this.noRadixDisplayed(),
|
|
313
|
+
};
|
|
314
|
+
}
|
|
315
|
+
restoreState(oldState) {
|
|
316
|
+
var _a;
|
|
317
|
+
this.reg = (_a = oldState.reg) !== null && _a !== void 0 ? _a : this.reg;
|
|
318
|
+
this.noRadixColumnDisplayed = oldState.noRadixColumnDisplayed;
|
|
319
|
+
}
|
|
320
|
+
};
|
|
321
|
+
__decorate([
|
|
322
|
+
(0, inversify_1.inject)(memory_widget_utils_1.RegisterWidgetOptions),
|
|
323
|
+
__metadata("design:type", Object)
|
|
324
|
+
], RegisterOptionsWidget.prototype, "memoryWidgetOptions", void 0);
|
|
325
|
+
__decorate([
|
|
326
|
+
(0, inversify_1.inject)(register_filter_service_1.RegisterFilterService),
|
|
327
|
+
__metadata("design:type", Object)
|
|
328
|
+
], RegisterOptionsWidget.prototype, "filterService", void 0);
|
|
329
|
+
__decorate([
|
|
330
|
+
(0, inversify_1.postConstruct)(),
|
|
331
|
+
__metadata("design:type", Function),
|
|
332
|
+
__metadata("design:paramtypes", []),
|
|
333
|
+
__metadata("design:returntype", void 0)
|
|
334
|
+
], RegisterOptionsWidget.prototype, "init", null);
|
|
335
|
+
RegisterOptionsWidget = __decorate([
|
|
336
|
+
(0, inversify_1.injectable)()
|
|
337
|
+
], RegisterOptionsWidget);
|
|
338
|
+
exports.RegisterOptionsWidget = RegisterOptionsWidget;
|
|
339
339
|
//# sourceMappingURL=register-options-widget.js.map
|