MemoryTrace class final
Global observation hooks for memory reads/writes, keyed by address.
Purely diagnostic: watchers are notified after a read or write has already happened, they cannot cancel or alter the operation. Backends call checkRead/checkWrite themselves after each access; this class only stores and dispatches to registered callbacks.
Not instantiatable, use as a static namespace.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
checkRead(
int address, String source, [dynamic value]) → void -
Called by backend implementations after a read completes.
Dispatches to the global watcher (if any) and any watchers on
address. -
checkWrite(
int address, String source, [dynamic value]) → void -
Called by backend implementations after a write completes.
Dispatches to the global watcher (if any) and any watchers on
address. -
unregisterRead(
int address) → void -
Unregisters any read watchers on
address. -
unregisterWrite(
int address) → void -
Unregisters any write watchers on
address. -
watchRead(
int address, void fn(String source, dynamic value)) → void -
Registers
fnto run wheneveraddressis read from. Multiple watchers on the same address are all called, in registration order. -
watchReadAny(
void fn(MemoryPointer< RType> ptr, String source, dynamic value)?) → void -
Sets a single global callback invoked on every read, regardless of address.
Pass
nullto unsubscribe. Replaces any previously set callback. -
watchWrite(
int address, void fn(String source, dynamic value)) → void -
Registers
fnto run wheneveraddressis written to. Multiple watchers on the same address are all called, in registration order. -
watchWriteAny(
void fn(MemoryPointer< RType> ptr, String source, dynamic value)?) → void -
Sets a single global callback invoked on every write, regardless of address.
Pass
nullto unsubscribe. Replaces any previously set callback.