probe-web / @probe-web/ui / ProbeMemoryView
Class: ProbeMemoryView
Defined in: packages/ui/src/memory-view.ts:55
<probe-memory-view>: a hex/ASCII view of target memory. Bytes per row, grouping (1/2/4/8 bytes) with endianness, refresh at each stop (or manual), changed values highlighted, byte edit (double-click, 1-byte groups), and Intel HEX export (ProbeMemoryView.exportHex, or the Export button).
Lock view (ProbeMemoryView.locked) freezes the shown bytes and address: stops, refreshes and ProbeMemoryView.goTo from other panels leave it alone until it is unlocked. Variable highlights (ProbeMemoryView.highlights, or type a variable name into "watch") colour the bytes of each watched variable, sized from its type.
Fires no events.
Example
<probe-memory-view length="512" group="4"></probe-memory-view>const mem = document.querySelector('probe-memory-view')!;
mem.debugger = session.debugger();
await mem.goTo(0x2000_0000n);
await mem.watch('COUNTER'); // highlight a static's bytesExtends
Constructors
Constructor
new ProbeMemoryView(): ProbeMemoryView;Defined in: node_modules/@lit/reactive-element/development/reactive-element.d.ts:527
Returns
ProbeMemoryView
Inherited from
Properties
| Property | Type | Default value | Description | Inherited from | Defined in |
|---|---|---|---|---|---|
debugger | Debugger | null | null | The debugger to follow (from session.debugger()); the panel shows "no debugger" without one. | DebuggerElement.debugger | packages/ui/src/debugger-element.ts:12 |
address | bigint | 0x2000_0000n | First address shown. Set it and call ProbeMemoryView.refresh, or use ProbeMemoryView.goTo. | - | packages/ui/src/memory-view.ts:77 |
length | number | 256 | Number of bytes read. | - | packages/ui/src/memory-view.ts:79 |
bytesPerRow | number | 16 | Bytes per row of the grid. | - | packages/ui/src/memory-view.ts:81 |
group | 1 | 2 | 4 | 8 | 1 | Bytes per displayed word. Bytes can only be edited with 1-byte groups. | - | packages/ui/src/memory-view.ts:83 |
bigEndian | boolean | false | Show grouped words big-endian rather than little-endian. | - | packages/ui/src/memory-view.ts:85 |
refreshMode | MemoryRefreshMode | 'on-stop' | 'on-stop' re-reads at every halt; 'off' only on ProbeMemoryView.refresh or the Refresh button. | - | packages/ui/src/memory-view.ts:87 |
locked | boolean | false | Freeze the view: ignore stops, refreshes and goTo until unlocked. | - | packages/ui/src/memory-view.ts:89 |
highlights | MemoryHighlight[] | [] | Ranges to colour, later entries winning where they overlap. ProbeMemoryView.watch adds to it. | - | packages/ui/src/memory-view.ts:91 |
pointerBytes | number | 4 | Pointer size for sizing reference types in highlights. | - | packages/ui/src/memory-view.ts:93 |
Methods
refresh()
refresh(): Promise<void>;Defined in: packages/ui/src/memory-view.ts:103
Read the configured range now (no-op while locked).
Returns
Promise<void>
goTo()
goTo(address, length?): Promise<boolean>;Defined in: packages/ui/src/memory-view.ts:117
Go to an address and read. Returns false (and does nothing) while locked.
Parameters
| Parameter | Type |
|---|---|
address | bigint |
length | number |
Returns
Promise<boolean>
watch()
watch(expression, frameId?): Promise<MemoryHighlight>;Defined in: packages/ui/src/memory-view.ts:131
Highlight a variable by name (evaluated in the selected frame, or globally). Its size comes from the type; unknown sizes mark the first byte. Returns the highlight.
Parameters
| Parameter | Type |
|---|---|
expression | string |
frameId? | number |
Returns
Promise<MemoryHighlight>
unwatch()
unwatch(label): void;Defined in: packages/ui/src/memory-view.ts:144
Remove the highlight with this label.
Parameters
| Parameter | Type |
|---|---|
label | string |
Returns
void
highlightAt()
highlightAt(address):
| {
highlight: MemoryHighlight;
index: number;
}
| null;Defined in: packages/ui/src/memory-view.ts:149
The highlight covering address, if any (the last one added wins).
Parameters
| Parameter | Type |
|---|---|
address | bigint |
Returns
| { highlight: MemoryHighlight; index: number; } | null
exportHex()
exportHex(): string;Defined in: packages/ui/src/memory-view.ts:172
Intel HEX of the bytes currently shown.
Returns
string