@specy/x86 2.5.0 → 2.6.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/README.md CHANGED
@@ -84,6 +84,8 @@ if (emulator.canUndo()) {
84
84
 
85
85
  History entries include register writes, memory writes, flag changes, and call-stack mutations. `getUndoHistory(max)` returns the newest entries first, as `ExecutionStep[]`, which is useful for instruction-history UIs.
86
86
 
87
+ Every write mutation carries both sides of the change: `old`, the value it replaced, and `new`, the value it left. A `WriteRegister` reports the WHOLE register on both sides, whatever width the store was - `mov $0xff, %al` on an `rax` of `0x1122334455667788` reports `old: 0x1122334455667788n, new: 0x11223344556677ffn` - and a `WriteMemoryBytes` reports the bytes at the width of the write, the ones it overwrote and the ones it left there. Register and FPU values come from the two snapshots the step already takes, so they cost nothing extra. Memory is different: the machine's write journal captures the bytes a store replaced, at that store, but records nothing about what it put there, so `new` is read back out of the machine as the entry is recorded, with the step over and nothing run since. That read is one page lookup per contiguous run of written addresses, and none at all for an instruction that writes no memory. It has one consequence: were one step ever to store twice over the same address, both entries would report the bytes the step ENDED with - no reachable x86 instruction journals two stores to one address, and closing it for good would need a post-image in the native journal, which means rebuilding the wasm. Once recorded, an entry keeps saying what its own step wrote however much has happened afterwards.
88
+
87
89
  ```ts
88
90
  for (const step of emulator.getUndoHistory(10)) {
89
91
  console.log(step.pc, step.mutations)
package/dist/index.d.mts CHANGED
@@ -86,11 +86,20 @@ type ExecutionStep = {
86
86
  file?: string; /** Present only on a `poke` entry: the values the host wrote, old and new. */
87
87
  writes?: PokeWrite[];
88
88
  };
89
+ /**
90
+ * What a history entry says an instruction or a Poke changed. Every write
91
+ * carries BOTH sides of the change: `old`, the value it replaced, and `new`,
92
+ * the value it left, each as this package reports that value elsewhere -
93
+ * a whole 64-bit register as a bigint, memory as a byte array. An entry is
94
+ * fixed when it is recorded and keeps saying what its own step did however
95
+ * much has happened since.
96
+ */
89
97
  type MutationOperation = {
90
98
  type: 'WriteRegister';
91
99
  value: {
92
- register: string;
93
- old: bigint;
100
+ register: string; /** The WHOLE register before the write, whatever width the store was. */
101
+ old: bigint; /** The whole register after it, from the same post-step snapshot the entry was diffed from. */
102
+ new: bigint;
94
103
  size: RegisterSize;
95
104
  };
96
105
  } | {
@@ -98,13 +107,26 @@ type MutationOperation = {
98
107
  value: {
99
108
  address: bigint;
100
109
  old: bigint;
110
+ new: bigint;
101
111
  size: RegisterSize;
102
112
  };
103
113
  } | {
104
114
  type: 'WriteMemoryBytes';
105
115
  value: {
106
- address: bigint;
116
+ address: bigint; /** The bytes the write replaced, at the width of the write. */
107
117
  old: number[];
118
+ /**
119
+ * The bytes the write left at that address, at the same width.
120
+ * The machine's write journal captures only the bytes a store
121
+ * replaced, so these are read out of the machine as the entry is
122
+ * recorded - the step has finished and nothing has run since,
123
+ * which is why they are still the bytes that step left. Were one
124
+ * step ever to store twice over the same address, both entries
125
+ * would report the bytes the step ENDED with; no x86 instruction
126
+ * reachable here journals two stores to one address. Empty when
127
+ * the machine refused to read the range back.
128
+ */
129
+ new: number[];
108
130
  };
109
131
  } | {
110
132
  type: 'PopCallStack';
@@ -548,6 +570,18 @@ type BlinkenlibModule = {
548
570
  blinkenlibGetRegisterSnapshot(): RegisterSnapshot; /** A copy of the packed FPU state block; empty when there is no machine. */
549
571
  blinkenlibGetFpuState(): Uint8Array; /** Restores the whole packed FPU state block; false when there is no machine or the length is wrong. */
550
572
  blinkenlibSetFpuState(bytes: Uint8Array | number[]): boolean;
573
+ /**
574
+ * The host address of a guest byte inside the wasm heap, or 0 when the
575
+ * address is not mapped - the same lookup `blinkenlibReadMemoryBytes` does
576
+ * per byte, without building a JavaScript array. Optional: a build whose
577
+ * bridge does not export it simply has no fast read path.
578
+ */
579
+ _blinkenlib_spy_address?(address: bigint): number; /** The wasm instance's own exports; `memory.buffer` is the heap `_blinkenlib_spy_address` points into. */
580
+ wasmExports?: {
581
+ memory?: {
582
+ buffer: ArrayBuffer;
583
+ };
584
+ };
551
585
  blinkenlibReadMemoryBytes(address: bigint, length: number): MemoryReadResult;
552
586
  blinkenlibWriteMemoryBytes(address: bigint, bytes: Uint8Array | number[]): MemoryWriteResult;
553
587
  blinkenlibGetDisassembly(): DisassemblySnapshot;
@@ -562,6 +596,13 @@ type BlinkenlibModule = {
562
596
  };
563
597
  //#endregion
564
598
  //#region src/blink-runtime.d.ts
599
+ /**
600
+ * The shadow-memory range blink keeps for its own bookkeeping, which the
601
+ * memory bridge refuses to read. Kept in step with `IsShadow` in
602
+ * `blink/blinkenlib.c`, so the fast read path refuses exactly what the bridge
603
+ * refuses.
604
+ */
605
+ declare function isShadowAddress(address: bigint): boolean;
565
606
  type BlinkRuntimeCallbacks = {
566
607
  stdin?: () => number | null;
567
608
  stdout?: (charCode: number) => MaybePromise<void>;
@@ -583,6 +624,8 @@ type BlinkRunOptions = {
583
624
  };
584
625
  declare class BlinkRuntime {
585
626
  readonly module: BlinkenlibModule;
627
+ /** Cached view over the wasm heap, for `spyMemoryBytes`; growth invalidates it. */
628
+ private heapView;
586
629
  mode: AssemblerMode;
587
630
  state: BlinkState;
588
631
  stopReason: StopReason | null;
@@ -668,6 +711,26 @@ declare class BlinkRuntime {
668
711
  runUntilBlocked(options?: BlinkRunOptions): Promise<BlinkState>;
669
712
  provideInput(line: string): void;
670
713
  readMemoryBytes(address: bigint, length: bigint): Uint8Array;
714
+ /**
715
+ * The bytes at `address` read straight out of the machine's own pages,
716
+ * or null when the machine cannot answer for the whole range.
717
+ *
718
+ * `blinkenlibReadMemoryBytes` looks each byte up and then builds a
719
+ * JavaScript array inside the bridge, which costs about four times as much
720
+ * as this does; recording a step reads only addresses the step just wrote,
721
+ * so it takes this path and falls back to the bridge whenever this one
722
+ * declines. The two agree byte for byte because they do the same lookup:
723
+ * `blinkenlib_spy_address` IS the lookup `blinkenlib_read_memory_byte`
724
+ * makes, and the shadow-memory range the bridge refuses is refused here
725
+ * too. A page is contiguous in the host heap and the next page need not
726
+ * be, so the read stops at every page boundary and looks the next one up.
727
+ */
728
+ spyMemoryBytes(address: bigint, length: number): Uint8Array | null;
729
+ /**
730
+ * A view over the wasm heap, rebuilt only when growth has replaced the
731
+ * buffer the last one was taken from.
732
+ */
733
+ private heapBytes;
671
734
  writeMemoryBytes(address: bigint, data: Uint8Array): void;
672
735
  getDisassemblyLines(): string[];
673
736
  getDisassemblyCurrentLine(): number;
@@ -1022,11 +1085,54 @@ declare class X86Emulator extends BaseEmulator<BlinkRuntime, X86RegisterName, X8
1022
1085
  * reverse order.
1023
1086
  */
1024
1087
  private recordPokeMemoryMutations;
1088
+ /**
1089
+ * The memory a step wrote. The native journal hands over the bytes each
1090
+ * store REPLACED, captured in the machine at that store; it records
1091
+ * nothing about what a store PUT there. So `old` is the machine's own
1092
+ * capture, taken at the write, while `new` is read out of the machine as
1093
+ * the entry is recorded - the step has finished and nothing has run since,
1094
+ * so those addresses still hold what the step left.
1095
+ *
1096
+ * The read costs one page lookup per store: one for the single store
1097
+ * almost every store-bearing instruction journals, and none at all for the
1098
+ * majority of instructions, which write no memory. It goes through the
1099
+ * machine's own page lookup rather than the byte-by-byte bridge (see
1100
+ * `BlinkRuntime.spyMemoryBytes`), which keeps it far below the cost of
1101
+ * tracing the step around it.
1102
+ *
1103
+ * What reading rather than journaling costs: were one step to store twice
1104
+ * over the same address, both entries would report the bytes the step
1105
+ * ENDED with rather than the bytes each store left. No x86 instruction
1106
+ * reachable here does that - blink coalesces a `rep` into one record, and
1107
+ * push, call, ret, enter, leave, `xchg` with memory and read-modify-write
1108
+ * arithmetic each journal a single store - so nothing observable turns on
1109
+ * it today. Only a post-image in the native journal would close it, and
1110
+ * that needs the wasm rebuilt, which this package does not do.
1111
+ *
1112
+ * A range the machine refuses to read back - a step can unmap what it
1113
+ * wrote - leaves that entry with no new bytes rather than a guess, and the
1114
+ * read never throws out of recording. Truncated writes keep their existing
1115
+ * `Other` shape and stay out of the undo journal.
1116
+ */
1025
1117
  private recordMemoryMutations;
1118
+ /**
1119
+ * The bytes each of a step's stores left, by the index of that store: what
1120
+ * the addresses that store wrote hold now, at the width of the write. One
1121
+ * lookup per store it can account for, and none for a store it cannot.
1122
+ */
1123
+ private writtenBytes;
1124
+ /**
1125
+ * One read of the machine that answers with nothing rather than throwing,
1126
+ * so recording a step can never fail after the instruction already ran.
1127
+ * It takes the machine's own page lookup when that can answer for the
1128
+ * whole range and the byte-by-byte bridge otherwise; the two read the same
1129
+ * memory the same way.
1130
+ */
1131
+ private readBytes;
1026
1132
  private recordControlFlowMutation;
1027
1133
  private emit;
1028
1134
  }
1029
1135
  declare function createX86Emulator(options?: X86EmulatorOptions): Promise<X86Emulator>;
1030
1136
  //#endregion
1031
- export { AssemblerId, AssemblerMode, BaseEmulator, Binary, BlinkRunOptions, BlinkRuntime, BlinkRuntimeCallbacks, BlinkRuntimeOptions, BlinkState, BlinkenlibModule, BlinkenlibModuleOptions, CompilationError, DEFAULT_ASSEMBLER_ID, DiagnosticLine, DiagnosticSeverity, DiagnosticSpan, DiagnosticsParser, DisassemblySnapshot, EmscriptenFS, EmulatorConfig, EmulatorDecoration, EmulatorStatus, ExecutionStep, ExecutionStepKind, Instruction, LinkerBinary, MaybePromise, MemoryReadResult, MemoryWriteResult, MonacoError, MutationOperation, NativeControlFlowKind, NativeInstruction, NativeMemoryWrite, NativeRunControls, NativeRunStop, NativeRunStopKind, NativeStepInfo, NativeSymbol, PokeWrite, RegisterHex, RegisterSize, RegisterSnapshot, ResourceSource, StackFrame, StatusRegister, StopReason, StopReasonKind, X86Breakpoint, X86CompilationDiagnostic, X86CompileResult, X86Emulator, X86EmulatorEventHandler, X86EmulatorEventMap, X86EmulatorEventName, X86EmulatorOptions, X86FpuState, X86Project, X86ProjectFile, X86RegisterName, X86SourceLocation, X86SseRegisterName, X86X87RegisterName, X86_FPU_STATE_CW_OFFSET, X86_FPU_STATE_DP_OFFSET, X86_FPU_STATE_IP_OFFSET, X86_FPU_STATE_MXCSR_OFFSET, X86_FPU_STATE_OP_OFFSET, X86_FPU_STATE_SIZE, X86_FPU_STATE_ST_OFFSET, X86_FPU_STATE_SW_OFFSET, X86_FPU_STATE_TW_OFFSET, X86_FPU_STATE_XMM_OFFSET, X86_PROJECT_ROOT, X86_REGISTER_NAMES, X86_SSE_REGISTERS, X86_X87_REGISTERS, assemblers, createX86Emulator, decodeFpuState, defaultResourceUrl, emptyFpuStateBlock, encodeFpuState, fasmDiagnostics, fpuStateBlocksEqual, gnuDiagnostics, isNodeRuntime, ldDiagnostics, locateDiagnosticColumn, locateDiagnosticSpan, nasmDiagnostics, observeCallbackResult, readLogicalStBits, readLogicalStTags, readResourceBytes, selectX86Source, stageX86Project, toResourceUrl, validateX86Project, x86ProjectSourcePath, x86ProjectText };
1137
+ export { AssemblerId, AssemblerMode, BaseEmulator, Binary, BlinkRunOptions, BlinkRuntime, BlinkRuntimeCallbacks, BlinkRuntimeOptions, BlinkState, BlinkenlibModule, BlinkenlibModuleOptions, CompilationError, DEFAULT_ASSEMBLER_ID, DiagnosticLine, DiagnosticSeverity, DiagnosticSpan, DiagnosticsParser, DisassemblySnapshot, EmscriptenFS, EmulatorConfig, EmulatorDecoration, EmulatorStatus, ExecutionStep, ExecutionStepKind, Instruction, LinkerBinary, MaybePromise, MemoryReadResult, MemoryWriteResult, MonacoError, MutationOperation, NativeControlFlowKind, NativeInstruction, NativeMemoryWrite, NativeRunControls, NativeRunStop, NativeRunStopKind, NativeStepInfo, NativeSymbol, PokeWrite, RegisterHex, RegisterSize, RegisterSnapshot, ResourceSource, StackFrame, StatusRegister, StopReason, StopReasonKind, X86Breakpoint, X86CompilationDiagnostic, X86CompileResult, X86Emulator, X86EmulatorEventHandler, X86EmulatorEventMap, X86EmulatorEventName, X86EmulatorOptions, X86FpuState, X86Project, X86ProjectFile, X86RegisterName, X86SourceLocation, X86SseRegisterName, X86X87RegisterName, X86_FPU_STATE_CW_OFFSET, X86_FPU_STATE_DP_OFFSET, X86_FPU_STATE_IP_OFFSET, X86_FPU_STATE_MXCSR_OFFSET, X86_FPU_STATE_OP_OFFSET, X86_FPU_STATE_SIZE, X86_FPU_STATE_ST_OFFSET, X86_FPU_STATE_SW_OFFSET, X86_FPU_STATE_TW_OFFSET, X86_FPU_STATE_XMM_OFFSET, X86_PROJECT_ROOT, X86_REGISTER_NAMES, X86_SSE_REGISTERS, X86_X87_REGISTERS, assemblers, createX86Emulator, decodeFpuState, defaultResourceUrl, emptyFpuStateBlock, encodeFpuState, fasmDiagnostics, fpuStateBlocksEqual, gnuDiagnostics, isNodeRuntime, isShadowAddress, ldDiagnostics, locateDiagnosticColumn, locateDiagnosticSpan, nasmDiagnostics, observeCallbackResult, readLogicalStBits, readLogicalStTags, readResourceBytes, selectX86Source, stageX86Project, toResourceUrl, validateX86Project, x86ProjectSourcePath, x86ProjectText };
1032
1138
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/resources.ts","../src/interface.ts","../src/callbacks.ts","../src/types.ts","../src/wasm-assembler.ts","../src/assemblers.ts","../src/wasm-types.ts","../src/blink-runtime.ts","../src/fpu-state.ts","../src/project.ts","../src/x86-emulator.ts"],"mappings":";KAAY,cAAA,YAA0B,GAAA,GAAM,WAAA,GAAc,UAAA;AAAA,iBAE1C,aAAA,CAAA;AAAA,iBAQA,aAAA,CAAc,MAAA,WAAiB,GAAA,GAAM,GAAA;AAAA,iBAS/B,iBAAA,CAAkB,MAAA,EAAQ,cAAA,GAAiB,OAAA,CAAQ,UAAA;AAAA,iBAiCzD,kBAAA,CAAmB,YAAA,UAAsB,OAAA,WAAkB,GAAA;;;KCpD/D,cAAA;EACR,IAAA;EACA,KAAA;EACA,IAAA;AAAA;AAAA,KAEQ,kBAAA;AAAA,KAEA,WAAA;EDPwD,oECShE,IAAA;EACA,SAAA;EACA,MAAA;EDXsD;;;AAE1D;;ECeI,SAAA;EACA,IAAA;IACI,IAAA;IACA,UAAA;EAAA;EAEJ,OAAA;EACA,SAAA,UDb2C;ECe3C,QA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resources.ts","../src/interface.ts","../src/callbacks.ts","../src/types.ts","../src/wasm-assembler.ts","../src/assemblers.ts","../src/wasm-types.ts","../src/blink-runtime.ts","../src/fpu-state.ts","../src/project.ts","../src/x86-emulator.ts"],"mappings":";KAAY,cAAA,YAA0B,GAAA,GAAM,WAAA,GAAc,UAAA;AAAA,iBAE1C,aAAA,CAAA;AAAA,iBAQA,aAAA,CAAc,MAAA,WAAiB,GAAA,GAAM,GAAA;AAAA,iBAS/B,iBAAA,CAAkB,MAAA,EAAQ,cAAA,GAAiB,OAAA,CAAQ,UAAA;AAAA,iBAiCzD,kBAAA,CAAmB,YAAA,UAAsB,OAAA,WAAkB,GAAA;;;KCpD/D,cAAA;EACR,IAAA;EACA,KAAA;EACA,IAAA;AAAA;AAAA,KAEQ,kBAAA;AAAA,KAEA,WAAA;EDPwD,oECShE,IAAA;EACA,SAAA;EACA,MAAA;EDXsD;;;AAE1D;;ECeI,SAAA;EACA,IAAA;IACI,IAAA;IACA,UAAA;EAAA;EAEJ,OAAA;EACA,SAAA,UDb2C;ECe3C,QAAA,GAAW,kBAAA,EDfsC;ECiBjD,IAAA,WDjBoD;ECmBpD,IAAA;AAAA;AAAA,KAGQ,UAAA;EACR,IAAA;EACA,OAAA;EACA,WAAA;EACA,EAAA;EACA,IAAA;EACA,IAAA;EACA,KAAA;AAAA;AAAA,KAGQ,WAAA,IAAe,EAAA,UAAY,EAAA;AAAA,aAE3B,YAAA;EACR,IAAA;EACA,IAAA;EACA,IAAA;EACA,MAAA;EDI0E;ECF1E,IAAA;AAAA;;;;;;KAQQ,iBAAA;AA1DZ;;;;;AAAA,KAiEY,SAAA;EAEF,IAAA;EACA,IAAA;EACA,GAAA;EACA,GAAA;AAAA;EAGA,IAAA;EACA,OAAA;EACA,GAAA;EACA,GAAA;AAAA;AAAA,KAGE,aAAA;EACR,IAAA,EAAM,iBAAA;EACN,SAAA,EAAW,iBAAA;EACX,EAAA;EACA,OAAA;IACI,IAAA;EAAA;EAEJ,OA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
1115
+ /** The machine's page size: a page is contiguous in the host heap, the next page need not be. */
1116
+ const BLINK_PAGE_SIZE = 4096;
1117
+ /**
1118
+ * The shadow-memory range blink keeps for its own bookkeeping, which the
1119
+ * memory bridge refuses to read. Kept in step with `IsShadow` in
1120
+ * `blink/blinkenlib.c`, so the fast read path refuses exactly what the bridge
1121
+ * refuses.
1122
+ */
1123
+ function isShadowAddress(address) {
1124
+ return address >= 2147450880n && address < 17594333528064n;
1125
+ }
1115
1126
  const SIGNALS = {
1116
1127
  SIGTRAP: 5,
1117
1128
  SIGXCPU: 24
@@ -1191,6 +1202,8 @@ const SIGNAL_INFO = {
1191
1202
  };
1192
1203
  var BlinkRuntime = class BlinkRuntime {
1193
1204
  module;
1205
+ /** Cached view over the wasm heap, for `spyMemoryBytes`; growth invalidates it. */
1206
+ heapView = null;
1194
1207
  mode;
1195
1208
  state = "NOT_READY";
1196
1209
  stopReason = null;
@@ -1485,6 +1498,47 @@ var BlinkRuntime = class BlinkRuntime {
1485
1498
  if (!result.ok) throw new Error(`${result.error}: 0x${address.toString(16)}`);
1486
1499
  return Uint8Array.from(result.bytes);
1487
1500
  }
1501
+ /**
1502
+ * The bytes at `address` read straight out of the machine's own pages,
1503
+ * or null when the machine cannot answer for the whole range.
1504
+ *
1505
+ * `blinkenlibReadMemoryBytes` looks each byte up and then builds a
1506
+ * JavaScript array inside the bridge, which costs about four times as much
1507
+ * as this does; recording a step reads only addresses the step just wrote,
1508
+ * so it takes this path and falls back to the bridge whenever this one
1509
+ * declines. The two agree byte for byte because they do the same lookup:
1510
+ * `blinkenlib_spy_address` IS the lookup `blinkenlib_read_memory_byte`
1511
+ * makes, and the shadow-memory range the bridge refuses is refused here
1512
+ * too. A page is contiguous in the host heap and the next page need not
1513
+ * be, so the read stops at every page boundary and looks the next one up.
1514
+ */
1515
+ spyMemoryBytes(address, length) {
1516
+ const spy = this.module._blinkenlib_spy_address;
1517
+ if (!spy || !this.module.wasmExports?.memory) return null;
1518
+ if (!Number.isSafeInteger(length) || length <= 0) return null;
1519
+ if (this.state === "NOT_READY" || this.state === "READY") return null;
1520
+ const bytes = new Uint8Array(length);
1521
+ let offset = 0;
1522
+ while (offset < length) {
1523
+ const target = address + BigInt(offset);
1524
+ if (isShadowAddress(target)) return null;
1525
+ const pointer = spy.call(this.module, target) >>> 0;
1526
+ if (pointer === 0) return null;
1527
+ const take = Math.min(BLINK_PAGE_SIZE - Number(target & 4095n), length - offset);
1528
+ bytes.set(this.heapBytes().subarray(pointer, pointer + take), offset);
1529
+ offset += take;
1530
+ }
1531
+ return bytes;
1532
+ }
1533
+ /**
1534
+ * A view over the wasm heap, rebuilt only when growth has replaced the
1535
+ * buffer the last one was taken from.
1536
+ */
1537
+ heapBytes() {
1538
+ const buffer = this.module.wasmExports.memory.buffer;
1539
+ if (!this.heapView || this.heapView.buffer !== buffer) this.heapView = new Uint8Array(buffer);
1540
+ return this.heapView;
1541
+ }
1488
1542
  writeMemoryBytes(address, data) {
1489
1543
  const result = this.module.blinkenlibWriteMemoryBytes(address, data);
1490
1544
  if (!result.ok) throw new Error(`${result.error}: 0x${address.toString(16)}`);
@@ -1874,6 +1928,14 @@ var BaseEmulator = class {
1874
1928
  };
1875
1929
  //#endregion
1876
1930
  //#region src/x86-emulator-utils.ts
1931
+ /**
1932
+ * Whether a native memory write is one a history entry can report in full:
1933
+ * the machine captured every byte it replaced. A write that overflowed the
1934
+ * native journal keeps its `Other` shape instead and stays out of undo.
1935
+ */
1936
+ function isRecordableWrite(write) {
1937
+ return !write.truncated && write.old.length === write.size;
1938
+ }
1877
1939
  var CircularHistory = class {
1878
1940
  capacity;
1879
1941
  entries;
@@ -2243,6 +2305,7 @@ var X86Emulator = class X86Emulator extends BaseEmulator {
2243
2305
  value: {
2244
2306
  register,
2245
2307
  old,
2308
+ new: value,
2246
2309
  size: 8
2247
2310
  }
2248
2311
  });
@@ -2534,6 +2597,7 @@ var X86Emulator = class X86Emulator extends BaseEmulator {
2534
2597
  value: {
2535
2598
  register,
2536
2599
  old: registersBefore[register],
2600
+ new: registersAfter[register],
2537
2601
  size: 8
2538
2602
  }
2539
2603
  });
@@ -2581,6 +2645,7 @@ var X86Emulator = class X86Emulator extends BaseEmulator {
2581
2645
  value: {
2582
2646
  register: X86_SSE_REGISTERS[index],
2583
2647
  old: stateBefore.xmm[index],
2648
+ new: stateAfter.xmm[index],
2584
2649
  size: 16
2585
2650
  }
2586
2651
  });
@@ -2597,6 +2662,7 @@ var X86Emulator = class X86Emulator extends BaseEmulator {
2597
2662
  value: {
2598
2663
  register: "mxcsr",
2599
2664
  old: BigInt(stateBefore.mxcsr),
2665
+ new: BigInt(stateAfter.mxcsr),
2600
2666
  size: 4
2601
2667
  }
2602
2668
  });
@@ -2616,6 +2682,7 @@ var X86Emulator = class X86Emulator extends BaseEmulator {
2616
2682
  value: {
2617
2683
  register: X86_X87_REGISTERS[index],
2618
2684
  old: stBitsBefore[index],
2685
+ new: stBitsAfter[index],
2619
2686
  size: 8
2620
2687
  }
2621
2688
  });
@@ -2637,6 +2704,7 @@ var X86Emulator = class X86Emulator extends BaseEmulator {
2637
2704
  value: {
2638
2705
  register: word,
2639
2706
  old: BigInt(stateBefore[word]),
2707
+ new: BigInt(stateAfter[word]),
2640
2708
  size: 2
2641
2709
  }
2642
2710
  });
@@ -2689,7 +2757,8 @@ var X86Emulator = class X86Emulator extends BaseEmulator {
2689
2757
  type: "WriteMemoryBytes",
2690
2758
  value: {
2691
2759
  address: range.address,
2692
- old: [...range.old]
2760
+ old: [...range.old],
2761
+ new: [...current]
2693
2762
  }
2694
2763
  });
2695
2764
  writes.push({
@@ -2701,10 +2770,40 @@ var X86Emulator = class X86Emulator extends BaseEmulator {
2701
2770
  }
2702
2771
  return undoWrites;
2703
2772
  }
2773
+ /**
2774
+ * The memory a step wrote. The native journal hands over the bytes each
2775
+ * store REPLACED, captured in the machine at that store; it records
2776
+ * nothing about what a store PUT there. So `old` is the machine's own
2777
+ * capture, taken at the write, while `new` is read out of the machine as
2778
+ * the entry is recorded - the step has finished and nothing has run since,
2779
+ * so those addresses still hold what the step left.
2780
+ *
2781
+ * The read costs one page lookup per store: one for the single store
2782
+ * almost every store-bearing instruction journals, and none at all for the
2783
+ * majority of instructions, which write no memory. It goes through the
2784
+ * machine's own page lookup rather than the byte-by-byte bridge (see
2785
+ * `BlinkRuntime.spyMemoryBytes`), which keeps it far below the cost of
2786
+ * tracing the step around it.
2787
+ *
2788
+ * What reading rather than journaling costs: were one step to store twice
2789
+ * over the same address, both entries would report the bytes the step
2790
+ * ENDED with rather than the bytes each store left. No x86 instruction
2791
+ * reachable here does that - blink coalesces a `rep` into one record, and
2792
+ * push, call, ret, enter, leave, `xchg` with memory and read-modify-write
2793
+ * arithmetic each journal a single store - so nothing observable turns on
2794
+ * it today. Only a post-image in the native journal would close it, and
2795
+ * that needs the wasm rebuilt, which this package does not do.
2796
+ *
2797
+ * A range the machine refuses to read back - a step can unmap what it
2798
+ * wrote - leaves that entry with no new bytes rather than a guess, and the
2799
+ * read never throws out of recording. Truncated writes keep their existing
2800
+ * `Other` shape and stay out of the undo journal.
2801
+ */
2704
2802
  recordMemoryMutations(writes, mutations) {
2705
2803
  const undoWrites = [];
2706
- for (const write of writes) {
2707
- if (write.truncated || write.old.length !== write.size) {
2804
+ const written = this.writtenBytes(writes);
2805
+ for (const [index, write] of writes.entries()) {
2806
+ if (!isRecordableWrite(write)) {
2708
2807
  mutations.push({
2709
2808
  type: "Other",
2710
2809
  value: `Wrote ${write.size} bytes to 0x${write.address.toString(16)}`
@@ -2719,12 +2818,37 @@ var X86Emulator = class X86Emulator extends BaseEmulator {
2719
2818
  type: "WriteMemoryBytes",
2720
2819
  value: {
2721
2820
  address: write.address,
2722
- old: [...write.old]
2821
+ old: [...write.old],
2822
+ new: written[index] ?? []
2723
2823
  }
2724
2824
  });
2725
2825
  }
2726
2826
  return undoWrites;
2727
2827
  }
2828
+ /**
2829
+ * The bytes each of a step's stores left, by the index of that store: what
2830
+ * the addresses that store wrote hold now, at the width of the write. One
2831
+ * lookup per store it can account for, and none for a store it cannot.
2832
+ */
2833
+ writtenBytes(writes) {
2834
+ return writes.map((write) => isRecordableWrite(write) ? this.readBytes(write.address, write.size) : []);
2835
+ }
2836
+ /**
2837
+ * One read of the machine that answers with nothing rather than throwing,
2838
+ * so recording a step can never fail after the instruction already ran.
2839
+ * It takes the machine's own page lookup when that can answer for the
2840
+ * whole range and the byte-by-byte bridge otherwise; the two read the same
2841
+ * memory the same way.
2842
+ */
2843
+ readBytes(address, length) {
2844
+ const spied = this.runtime.spyMemoryBytes(address, length);
2845
+ if (spied) return Array.from(spied);
2846
+ try {
2847
+ return [...this.runtime.readMemoryBytes(address, BigInt(length))];
2848
+ } catch {
2849
+ return [];
2850
+ }
2851
+ }
2728
2852
  recordControlFlowMutation(step, instruction, mutations) {
2729
2853
  if (step.controlFlow === "call") {
2730
2854
  const returnAddress = instruction ? instruction.address + BigInt(instruction.size) : step.pcBefore;
@@ -2767,6 +2891,6 @@ async function createX86Emulator(options = {}) {
2767
2891
  return X86Emulator.create(options);
2768
2892
  }
2769
2893
  //#endregion
2770
- export { BaseEmulator, BlinkRuntime, BlinkState, DEFAULT_ASSEMBLER_ID, EmulatorStatus, RegisterSize, X86Emulator, X86_FPU_STATE_CW_OFFSET, X86_FPU_STATE_DP_OFFSET, X86_FPU_STATE_IP_OFFSET, X86_FPU_STATE_MXCSR_OFFSET, X86_FPU_STATE_OP_OFFSET, X86_FPU_STATE_SIZE, X86_FPU_STATE_ST_OFFSET, X86_FPU_STATE_SW_OFFSET, X86_FPU_STATE_TW_OFFSET, X86_FPU_STATE_XMM_OFFSET, X86_PROJECT_ROOT, X86_REGISTER_NAMES, X86_SSE_REGISTERS, X86_X87_REGISTERS, assemblers, createX86Emulator, decodeFpuState, defaultResourceUrl, emptyFpuStateBlock, encodeFpuState, fasmDiagnostics, fpuStateBlocksEqual, gnuDiagnostics, isNodeRuntime, ldDiagnostics, locateDiagnosticColumn, locateDiagnosticSpan, nasmDiagnostics, observeCallbackResult, readLogicalStBits, readLogicalStTags, readResourceBytes, selectX86Source, stageX86Project, toResourceUrl, validateX86Project, x86ProjectSourcePath, x86ProjectText };
2894
+ export { BaseEmulator, BlinkRuntime, BlinkState, DEFAULT_ASSEMBLER_ID, EmulatorStatus, RegisterSize, X86Emulator, X86_FPU_STATE_CW_OFFSET, X86_FPU_STATE_DP_OFFSET, X86_FPU_STATE_IP_OFFSET, X86_FPU_STATE_MXCSR_OFFSET, X86_FPU_STATE_OP_OFFSET, X86_FPU_STATE_SIZE, X86_FPU_STATE_ST_OFFSET, X86_FPU_STATE_SW_OFFSET, X86_FPU_STATE_TW_OFFSET, X86_FPU_STATE_XMM_OFFSET, X86_PROJECT_ROOT, X86_REGISTER_NAMES, X86_SSE_REGISTERS, X86_X87_REGISTERS, assemblers, createX86Emulator, decodeFpuState, defaultResourceUrl, emptyFpuStateBlock, encodeFpuState, fasmDiagnostics, fpuStateBlocksEqual, gnuDiagnostics, isNodeRuntime, isShadowAddress, ldDiagnostics, locateDiagnosticColumn, locateDiagnosticSpan, nasmDiagnostics, observeCallbackResult, readLogicalStBits, readLogicalStTags, readResourceBytes, selectX86Source, stageX86Project, toResourceUrl, validateX86Project, x86ProjectSourcePath, x86ProjectText };
2771
2895
 
2772
2896
  //# sourceMappingURL=index.mjs.map