@specy/x86 2.5.0 → 2.7.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 +2 -0
- package/dist/index.d.mts +143 -8
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +154 -31
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
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';
|
|
@@ -202,7 +224,9 @@ declare abstract class BaseEmulator<T, R extends string, CompileResult = {
|
|
|
202
224
|
abstract run(limit?: number, breakpoints?: Array<number | {
|
|
203
225
|
path: string;
|
|
204
226
|
line: number;
|
|
205
|
-
}
|
|
227
|
+
}>, options?: {
|
|
228
|
+
skipBreakpointAtPc?: boolean;
|
|
229
|
+
}): Promise<EmulatorStatus>;
|
|
206
230
|
}
|
|
207
231
|
//#endregion
|
|
208
232
|
//#region src/callbacks.d.ts
|
|
@@ -548,6 +572,18 @@ type BlinkenlibModule = {
|
|
|
548
572
|
blinkenlibGetRegisterSnapshot(): RegisterSnapshot; /** A copy of the packed FPU state block; empty when there is no machine. */
|
|
549
573
|
blinkenlibGetFpuState(): Uint8Array; /** Restores the whole packed FPU state block; false when there is no machine or the length is wrong. */
|
|
550
574
|
blinkenlibSetFpuState(bytes: Uint8Array | number[]): boolean;
|
|
575
|
+
/**
|
|
576
|
+
* The host address of a guest byte inside the wasm heap, or 0 when the
|
|
577
|
+
* address is not mapped - the same lookup `blinkenlibReadMemoryBytes` does
|
|
578
|
+
* per byte, without building a JavaScript array. Optional: a build whose
|
|
579
|
+
* bridge does not export it simply has no fast read path.
|
|
580
|
+
*/
|
|
581
|
+
_blinkenlib_spy_address?(address: bigint): number; /** The wasm instance's own exports; `memory.buffer` is the heap `_blinkenlib_spy_address` points into. */
|
|
582
|
+
wasmExports?: {
|
|
583
|
+
memory?: {
|
|
584
|
+
buffer: ArrayBuffer;
|
|
585
|
+
};
|
|
586
|
+
};
|
|
551
587
|
blinkenlibReadMemoryBytes(address: bigint, length: number): MemoryReadResult;
|
|
552
588
|
blinkenlibWriteMemoryBytes(address: bigint, bytes: Uint8Array | number[]): MemoryWriteResult;
|
|
553
589
|
blinkenlibGetDisassembly(): DisassemblySnapshot;
|
|
@@ -562,6 +598,13 @@ type BlinkenlibModule = {
|
|
|
562
598
|
};
|
|
563
599
|
//#endregion
|
|
564
600
|
//#region src/blink-runtime.d.ts
|
|
601
|
+
/**
|
|
602
|
+
* The shadow-memory range blink keeps for its own bookkeeping, which the
|
|
603
|
+
* memory bridge refuses to read. Kept in step with `IsShadow` in
|
|
604
|
+
* `blink/blinkenlib.c`, so the fast read path refuses exactly what the bridge
|
|
605
|
+
* refuses.
|
|
606
|
+
*/
|
|
607
|
+
declare function isShadowAddress(address: bigint): boolean;
|
|
565
608
|
type BlinkRuntimeCallbacks = {
|
|
566
609
|
stdin?: () => number | null;
|
|
567
610
|
stdout?: (charCode: number) => MaybePromise<void>;
|
|
@@ -583,6 +626,8 @@ type BlinkRunOptions = {
|
|
|
583
626
|
};
|
|
584
627
|
declare class BlinkRuntime {
|
|
585
628
|
readonly module: BlinkenlibModule;
|
|
629
|
+
/** Cached view over the wasm heap, for `spyMemoryBytes`; growth invalidates it. */
|
|
630
|
+
private heapView;
|
|
586
631
|
mode: AssemblerMode;
|
|
587
632
|
state: BlinkState;
|
|
588
633
|
stopReason: StopReason | null;
|
|
@@ -668,6 +713,26 @@ declare class BlinkRuntime {
|
|
|
668
713
|
runUntilBlocked(options?: BlinkRunOptions): Promise<BlinkState>;
|
|
669
714
|
provideInput(line: string): void;
|
|
670
715
|
readMemoryBytes(address: bigint, length: bigint): Uint8Array;
|
|
716
|
+
/**
|
|
717
|
+
* The bytes at `address` read straight out of the machine's own pages,
|
|
718
|
+
* or null when the machine cannot answer for the whole range.
|
|
719
|
+
*
|
|
720
|
+
* `blinkenlibReadMemoryBytes` looks each byte up and then builds a
|
|
721
|
+
* JavaScript array inside the bridge, which costs about four times as much
|
|
722
|
+
* as this does; recording a step reads only addresses the step just wrote,
|
|
723
|
+
* so it takes this path and falls back to the bridge whenever this one
|
|
724
|
+
* declines. The two agree byte for byte because they do the same lookup:
|
|
725
|
+
* `blinkenlib_spy_address` IS the lookup `blinkenlib_read_memory_byte`
|
|
726
|
+
* makes, and the shadow-memory range the bridge refuses is refused here
|
|
727
|
+
* too. A page is contiguous in the host heap and the next page need not
|
|
728
|
+
* be, so the read stops at every page boundary and looks the next one up.
|
|
729
|
+
*/
|
|
730
|
+
spyMemoryBytes(address: bigint, length: number): Uint8Array | null;
|
|
731
|
+
/**
|
|
732
|
+
* A view over the wasm heap, rebuilt only when growth has replaced the
|
|
733
|
+
* buffer the last one was taken from.
|
|
734
|
+
*/
|
|
735
|
+
private heapBytes;
|
|
671
736
|
writeMemoryBytes(address: bigint, data: Uint8Array): void;
|
|
672
737
|
getDisassemblyLines(): string[];
|
|
673
738
|
getDisassemblyCurrentLine(): number;
|
|
@@ -859,6 +924,15 @@ declare function x86ProjectSourcePath(sourcePath: string | undefined, project: P
|
|
|
859
924
|
declare function x86ProjectText(project: X86Project, path: string): string;
|
|
860
925
|
//#endregion
|
|
861
926
|
//#region src/x86-emulator.d.ts
|
|
927
|
+
/** What {@link X86Emulator.run} does with the breakpoint the program counter is on. */
|
|
928
|
+
type X86RunOptions = {
|
|
929
|
+
/**
|
|
930
|
+
* `true` (the default) runs the instruction the program counter is on even
|
|
931
|
+
* when a breakpoint names it, which is what continuing from a breakpoint
|
|
932
|
+
* needs; `false` stops before it, having run nothing.
|
|
933
|
+
*/
|
|
934
|
+
skipBreakpointAtPc?: boolean;
|
|
935
|
+
};
|
|
862
936
|
type X86EmulatorOptions = Omit<BlinkRuntimeOptions, 'callbacks' | 'mode'> & {
|
|
863
937
|
mode?: AssemblerMode | AssemblerId;
|
|
864
938
|
callbacks?: BlinkRuntimeCallbacks;
|
|
@@ -986,12 +1060,30 @@ declare class X86Emulator extends BaseEmulator<BlinkRuntime, X86RegisterName, X8
|
|
|
986
1060
|
*/
|
|
987
1061
|
setFpuState(state: X86FpuState): void;
|
|
988
1062
|
hasTerminated(): boolean;
|
|
989
|
-
|
|
1063
|
+
/**
|
|
1064
|
+
* Runs until the program stops for input, hits one of `breakpoints`, runs
|
|
1065
|
+
* `limit` instructions or ends.
|
|
1066
|
+
*
|
|
1067
|
+
* `options.skipBreakpointAtPc` says what a breakpoint on the instruction
|
|
1068
|
+
* the program counter is *already* on does, and only that one. It defaults
|
|
1069
|
+
* to `true`, which runs it anyway: without that, a run resumed from a
|
|
1070
|
+
* breakpoint stops on the same breakpoint again having executed nothing,
|
|
1071
|
+
* and the program never moves. A caller that resumes mid-program some
|
|
1072
|
+
* other way - after feeding the program its input, or after its own budget
|
|
1073
|
+
* ran out - passes `false`, because the instruction it is about to run has
|
|
1074
|
+
* not run yet.
|
|
1075
|
+
*/
|
|
1076
|
+
run(limit?: number, breakpoints?: X86Breakpoint[], options?: X86RunOptions): Promise<EmulatorStatus>;
|
|
990
1077
|
private assertNoOpenPoke;
|
|
991
1078
|
private validateRunLimit;
|
|
992
1079
|
private resolveBreakpointAddresses;
|
|
993
|
-
|
|
994
|
-
|
|
1080
|
+
/**
|
|
1081
|
+
* One instruction at a time, which is what a breakpoint and the execution
|
|
1082
|
+
* history both need: `step` records the history when tracing is on, and a
|
|
1083
|
+
* breakpoint is checked before the instruction it names executes, so the
|
|
1084
|
+
* program stops with that instruction still to run.
|
|
1085
|
+
*/
|
|
1086
|
+
private runInstructions;
|
|
995
1087
|
private isTracingEnabled;
|
|
996
1088
|
private clearExecutionTrace;
|
|
997
1089
|
private prepareOneInstructionRun;
|
|
@@ -1022,11 +1114,54 @@ declare class X86Emulator extends BaseEmulator<BlinkRuntime, X86RegisterName, X8
|
|
|
1022
1114
|
* reverse order.
|
|
1023
1115
|
*/
|
|
1024
1116
|
private recordPokeMemoryMutations;
|
|
1117
|
+
/**
|
|
1118
|
+
* The memory a step wrote. The native journal hands over the bytes each
|
|
1119
|
+
* store REPLACED, captured in the machine at that store; it records
|
|
1120
|
+
* nothing about what a store PUT there. So `old` is the machine's own
|
|
1121
|
+
* capture, taken at the write, while `new` is read out of the machine as
|
|
1122
|
+
* the entry is recorded - the step has finished and nothing has run since,
|
|
1123
|
+
* so those addresses still hold what the step left.
|
|
1124
|
+
*
|
|
1125
|
+
* The read costs one page lookup per store: one for the single store
|
|
1126
|
+
* almost every store-bearing instruction journals, and none at all for the
|
|
1127
|
+
* majority of instructions, which write no memory. It goes through the
|
|
1128
|
+
* machine's own page lookup rather than the byte-by-byte bridge (see
|
|
1129
|
+
* `BlinkRuntime.spyMemoryBytes`), which keeps it far below the cost of
|
|
1130
|
+
* tracing the step around it.
|
|
1131
|
+
*
|
|
1132
|
+
* What reading rather than journaling costs: were one step to store twice
|
|
1133
|
+
* over the same address, both entries would report the bytes the step
|
|
1134
|
+
* ENDED with rather than the bytes each store left. No x86 instruction
|
|
1135
|
+
* reachable here does that - blink coalesces a `rep` into one record, and
|
|
1136
|
+
* push, call, ret, enter, leave, `xchg` with memory and read-modify-write
|
|
1137
|
+
* arithmetic each journal a single store - so nothing observable turns on
|
|
1138
|
+
* it today. Only a post-image in the native journal would close it, and
|
|
1139
|
+
* that needs the wasm rebuilt, which this package does not do.
|
|
1140
|
+
*
|
|
1141
|
+
* A range the machine refuses to read back - a step can unmap what it
|
|
1142
|
+
* wrote - leaves that entry with no new bytes rather than a guess, and the
|
|
1143
|
+
* read never throws out of recording. Truncated writes keep their existing
|
|
1144
|
+
* `Other` shape and stay out of the undo journal.
|
|
1145
|
+
*/
|
|
1025
1146
|
private recordMemoryMutations;
|
|
1147
|
+
/**
|
|
1148
|
+
* The bytes each of a step's stores left, by the index of that store: what
|
|
1149
|
+
* the addresses that store wrote hold now, at the width of the write. One
|
|
1150
|
+
* lookup per store it can account for, and none for a store it cannot.
|
|
1151
|
+
*/
|
|
1152
|
+
private writtenBytes;
|
|
1153
|
+
/**
|
|
1154
|
+
* One read of the machine that answers with nothing rather than throwing,
|
|
1155
|
+
* so recording a step can never fail after the instruction already ran.
|
|
1156
|
+
* It takes the machine's own page lookup when that can answer for the
|
|
1157
|
+
* whole range and the byte-by-byte bridge otherwise; the two read the same
|
|
1158
|
+
* memory the same way.
|
|
1159
|
+
*/
|
|
1160
|
+
private readBytes;
|
|
1026
1161
|
private recordControlFlowMutation;
|
|
1027
1162
|
private emit;
|
|
1028
1163
|
}
|
|
1029
1164
|
declare function createX86Emulator(options?: X86EmulatorOptions): Promise<X86Emulator>;
|
|
1030
1165
|
//#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 };
|
|
1166
|
+
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, X86RunOptions, 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
1167
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.d.mts.map
CHANGED
|
@@ -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,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;AAA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AkB,WAAA;ETpaE;ESmbrC,uBAAA,CAAA,GAA2B,WAAA;EAW3B,iBAAA,CAAA;EAIA,uBAAA,CAAA,GAA2B,MAAA,CAAO,eAAA;EAMlC,gBAAA,CAAiB,QAAA,EAAU,eAAA,EAAiB,IAAA,GAAM,YAAA;EAIlD,gBAAA,CAAiB,QAAA,EAAU,eAAA,EAAiB,KAAA,UAAe,IAAA,GAAM,YAAA;ETxcjE;;;;;;ESqdA,WAAA,CAAA,GAAe,WAAA;ETzcU;;;;AAO7B;;;;;;;;;;ESodI,WAAA,CAAY,KAAA,EAAO,WAAA;EAInB,aAAA,CAAA;EAIM,GAAA,CAAI,KAAA,WAAgB,WAAA,GAAa,aAAA,KAAuB,OAAA,CAAQ,cAAA;EAAA,QAgB9D,gBAAA;EAAA,QAIA,gBAAA;EAAA,QAOA,0BAAA;EAAA,QAkBM,kBAAA;EAAA,QA6BA,cAAA;EAAA,QA6BN,gBAAA;EAAA,QAIA,mBAAA;EAAA,QAQA,wBAAA;EAAA,QAUA,WAAA;EAAA,QAeA,UAAA;ETzlBF;;;;;;;;;;;EAAA,QS8pBE,kBAAA;ETlpBU;;AAGtB;;;;;;;;;;EAHsB,QS+uBV,yBAAA;EAAA,QAgDA,qBAAA;EAAA,QAyBA,yBAAA;EAAA,QA8BA,IAAA;AAAA;AAAA,iBAKU,iBAAA,CAAkB,OAAA,GAAS,kBAAA,GAA0B,OAAA,CAAQ,WAAA"}
|
|
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,iBA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O,eAAA;EAMlC,gBAAA,CAAiB,QAAA,EAAU,eAAA,EAAiB,IAAA,GAAM,YAAA;EAIlD,gBAAA,CAAiB,QAAA,EAAU,eAAA,EAAiB,KAAA,UAAe,IAAA,GAAM,YAAA;ETvcxC;;AAO7B;;;;ES6cI,WAAA,CAAA,GAAe,WAAA;ET1cT;;;;;;;;;AAWV;;;;;ESidI,WAAA,CAAY,KAAA,EAAO,WAAA;EAInB,aAAA,CAAA;ETxckB;;;;;;;;;;;;;ESydZ,GAAA,CACF,KAAA,WACA,WAAA,GAAa,aAAA,IACb,OAAA,GAAS,aAAA,GACV,OAAA,CAAQ,cAAA;EAAA,QAmBH,gBAAA;EAAA,QAIA,gBAAA;EAAA,QAOA,0BAAA;EThfiB;;;;;;EAAA,QSwgBX,eAAA;EAAA,QA2CN,gBAAA;EAAA,QAIA,mBAAA;EAAA,QAQA,wBAAA;EAAA,QAUA,WAAA;EAAA,QAeA,UAAA;ETzkBE;;;;;;;;;;;EAAA,QSipBF,kBAAA;ETpnBE;;;;;;;;;;AAiBd;;EAjBc,QS6tBF,yBAAA;ET5sBkB;;;;;;;AAQ9B;;;;;AAKA;;;;;;;;;;AAOA;;;;;;;EApB8B,QSyxBlB,qBAAA;EThwBR;;;;;EAAA,QSgyBQ,YAAA;ET5xBc;;;;;;;EAAA,QSyyBd,SAAA;EAAA,QAUA,yBAAA;EAAA,QA8BA,IAAA;AAAA;AAAA,iBAKU,iBAAA,CAAkB,OAAA,GAAS,kBAAA,GAA0B,OAAA,CAAQ,WAAA"}
|
package/dist/index.mjs
CHANGED
|
@@ -1112,6 +1112,17 @@ function emptyFpuStateBlock() {
|
|
|
1112
1112
|
}
|
|
1113
1113
|
//#endregion
|
|
1114
1114
|
//#region src/blink-runtime.ts
|
|
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
|
});
|
|
@@ -2415,15 +2478,27 @@ var X86Emulator = class X86Emulator extends BaseEmulator {
|
|
|
2415
2478
|
hasTerminated() {
|
|
2416
2479
|
return this.runtime.state === "PROGRAM_STOPPED";
|
|
2417
2480
|
}
|
|
2418
|
-
|
|
2481
|
+
/**
|
|
2482
|
+
* Runs until the program stops for input, hits one of `breakpoints`, runs
|
|
2483
|
+
* `limit` instructions or ends.
|
|
2484
|
+
*
|
|
2485
|
+
* `options.skipBreakpointAtPc` says what a breakpoint on the instruction
|
|
2486
|
+
* the program counter is *already* on does, and only that one. It defaults
|
|
2487
|
+
* to `true`, which runs it anyway: without that, a run resumed from a
|
|
2488
|
+
* breakpoint stops on the same breakpoint again having executed nothing,
|
|
2489
|
+
* and the program never moves. A caller that resumes mid-program some
|
|
2490
|
+
* other way - after feeding the program its input, or after its own budget
|
|
2491
|
+
* ran out - passes `false`, because the instruction it is about to run has
|
|
2492
|
+
* not run yet.
|
|
2493
|
+
*/
|
|
2494
|
+
async run(limit, breakpoints = [], options = {}) {
|
|
2419
2495
|
this.assertNoOpenPoke("run");
|
|
2420
2496
|
this.validateRunLimit(limit);
|
|
2421
2497
|
const breakpointAddresses = this.resolveBreakpointAddresses(breakpoints);
|
|
2422
2498
|
const wasExecuting = this.executing;
|
|
2423
2499
|
this.executing = true;
|
|
2424
2500
|
try {
|
|
2425
|
-
if (this.isTracingEnabled()) return await this.
|
|
2426
|
-
if (breakpointAddresses.length) return await this.runWithBreakpoints(limit, breakpointAddresses);
|
|
2501
|
+
if (this.isTracingEnabled() || breakpointAddresses.length) return await this.runInstructions(limit, breakpointAddresses, options);
|
|
2427
2502
|
await this.runtime.runUntilBlocked({
|
|
2428
2503
|
limit,
|
|
2429
2504
|
breakpointAddresses
|
|
@@ -2450,35 +2525,21 @@ var X86Emulator = class X86Emulator extends BaseEmulator {
|
|
|
2450
2525
|
}
|
|
2451
2526
|
return [...addresses.values()];
|
|
2452
2527
|
}
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
if (breakpointSet.has(pc.toString())) {
|
|
2461
|
-
this.runtime.pauseForBreakpoint(pc, this.runtime.getSourceLocationForAddress(pc) ?? void 0);
|
|
2462
|
-
return this.getStatus();
|
|
2463
|
-
}
|
|
2464
|
-
if (hasLimit && executedInstructions >= limit) {
|
|
2465
|
-
this.runtime.pauseForLimit(pc, BigInt(executedInstructions));
|
|
2466
|
-
return this.getStatus();
|
|
2467
|
-
}
|
|
2468
|
-
await this.step();
|
|
2469
|
-
executedInstructions += 1;
|
|
2470
|
-
if (executedInstructions % 1e4 === 0) await deferToHost();
|
|
2471
|
-
}
|
|
2472
|
-
return this.getStatus();
|
|
2473
|
-
}
|
|
2474
|
-
async runWithHistory(limit, breakpointAddresses) {
|
|
2528
|
+
/**
|
|
2529
|
+
* One instruction at a time, which is what a breakpoint and the execution
|
|
2530
|
+
* history both need: `step` records the history when tracing is on, and a
|
|
2531
|
+
* breakpoint is checked before the instruction it names executes, so the
|
|
2532
|
+
* program stops with that instruction still to run.
|
|
2533
|
+
*/
|
|
2534
|
+
async runInstructions(limit, breakpointAddresses, options) {
|
|
2475
2535
|
const breakpointSet = new Set(breakpointAddresses.map((address) => address.toString()));
|
|
2476
2536
|
const hasLimit = limit !== void 0 && limit > 0;
|
|
2477
2537
|
let executedInstructions = 0;
|
|
2478
2538
|
this.prepareOneInstructionRun();
|
|
2539
|
+
let skipAt = options.skipBreakpointAtPc ?? true ? this.getPc().toString() : null;
|
|
2479
2540
|
while (this.runtime.state === "PROGRAM_RUNNING") {
|
|
2480
2541
|
const pc = this.getPc();
|
|
2481
|
-
if (breakpointSet.has(pc.toString())) {
|
|
2542
|
+
if (breakpointSet.has(pc.toString()) && pc.toString() !== skipAt) {
|
|
2482
2543
|
this.runtime.pauseForBreakpoint(pc, this.runtime.getSourceLocationForAddress(pc) ?? void 0);
|
|
2483
2544
|
return this.getStatus();
|
|
2484
2545
|
}
|
|
@@ -2487,6 +2548,7 @@ var X86Emulator = class X86Emulator extends BaseEmulator {
|
|
|
2487
2548
|
return this.getStatus();
|
|
2488
2549
|
}
|
|
2489
2550
|
await this.step();
|
|
2551
|
+
skipAt = null;
|
|
2490
2552
|
executedInstructions += 1;
|
|
2491
2553
|
if (executedInstructions % 1e4 === 0) await deferToHost();
|
|
2492
2554
|
}
|
|
@@ -2534,6 +2596,7 @@ var X86Emulator = class X86Emulator extends BaseEmulator {
|
|
|
2534
2596
|
value: {
|
|
2535
2597
|
register,
|
|
2536
2598
|
old: registersBefore[register],
|
|
2599
|
+
new: registersAfter[register],
|
|
2537
2600
|
size: 8
|
|
2538
2601
|
}
|
|
2539
2602
|
});
|
|
@@ -2581,6 +2644,7 @@ var X86Emulator = class X86Emulator extends BaseEmulator {
|
|
|
2581
2644
|
value: {
|
|
2582
2645
|
register: X86_SSE_REGISTERS[index],
|
|
2583
2646
|
old: stateBefore.xmm[index],
|
|
2647
|
+
new: stateAfter.xmm[index],
|
|
2584
2648
|
size: 16
|
|
2585
2649
|
}
|
|
2586
2650
|
});
|
|
@@ -2597,6 +2661,7 @@ var X86Emulator = class X86Emulator extends BaseEmulator {
|
|
|
2597
2661
|
value: {
|
|
2598
2662
|
register: "mxcsr",
|
|
2599
2663
|
old: BigInt(stateBefore.mxcsr),
|
|
2664
|
+
new: BigInt(stateAfter.mxcsr),
|
|
2600
2665
|
size: 4
|
|
2601
2666
|
}
|
|
2602
2667
|
});
|
|
@@ -2616,6 +2681,7 @@ var X86Emulator = class X86Emulator extends BaseEmulator {
|
|
|
2616
2681
|
value: {
|
|
2617
2682
|
register: X86_X87_REGISTERS[index],
|
|
2618
2683
|
old: stBitsBefore[index],
|
|
2684
|
+
new: stBitsAfter[index],
|
|
2619
2685
|
size: 8
|
|
2620
2686
|
}
|
|
2621
2687
|
});
|
|
@@ -2637,6 +2703,7 @@ var X86Emulator = class X86Emulator extends BaseEmulator {
|
|
|
2637
2703
|
value: {
|
|
2638
2704
|
register: word,
|
|
2639
2705
|
old: BigInt(stateBefore[word]),
|
|
2706
|
+
new: BigInt(stateAfter[word]),
|
|
2640
2707
|
size: 2
|
|
2641
2708
|
}
|
|
2642
2709
|
});
|
|
@@ -2689,7 +2756,8 @@ var X86Emulator = class X86Emulator extends BaseEmulator {
|
|
|
2689
2756
|
type: "WriteMemoryBytes",
|
|
2690
2757
|
value: {
|
|
2691
2758
|
address: range.address,
|
|
2692
|
-
old: [...range.old]
|
|
2759
|
+
old: [...range.old],
|
|
2760
|
+
new: [...current]
|
|
2693
2761
|
}
|
|
2694
2762
|
});
|
|
2695
2763
|
writes.push({
|
|
@@ -2701,10 +2769,40 @@ var X86Emulator = class X86Emulator extends BaseEmulator {
|
|
|
2701
2769
|
}
|
|
2702
2770
|
return undoWrites;
|
|
2703
2771
|
}
|
|
2772
|
+
/**
|
|
2773
|
+
* The memory a step wrote. The native journal hands over the bytes each
|
|
2774
|
+
* store REPLACED, captured in the machine at that store; it records
|
|
2775
|
+
* nothing about what a store PUT there. So `old` is the machine's own
|
|
2776
|
+
* capture, taken at the write, while `new` is read out of the machine as
|
|
2777
|
+
* the entry is recorded - the step has finished and nothing has run since,
|
|
2778
|
+
* so those addresses still hold what the step left.
|
|
2779
|
+
*
|
|
2780
|
+
* The read costs one page lookup per store: one for the single store
|
|
2781
|
+
* almost every store-bearing instruction journals, and none at all for the
|
|
2782
|
+
* majority of instructions, which write no memory. It goes through the
|
|
2783
|
+
* machine's own page lookup rather than the byte-by-byte bridge (see
|
|
2784
|
+
* `BlinkRuntime.spyMemoryBytes`), which keeps it far below the cost of
|
|
2785
|
+
* tracing the step around it.
|
|
2786
|
+
*
|
|
2787
|
+
* What reading rather than journaling costs: were one step to store twice
|
|
2788
|
+
* over the same address, both entries would report the bytes the step
|
|
2789
|
+
* ENDED with rather than the bytes each store left. No x86 instruction
|
|
2790
|
+
* reachable here does that - blink coalesces a `rep` into one record, and
|
|
2791
|
+
* push, call, ret, enter, leave, `xchg` with memory and read-modify-write
|
|
2792
|
+
* arithmetic each journal a single store - so nothing observable turns on
|
|
2793
|
+
* it today. Only a post-image in the native journal would close it, and
|
|
2794
|
+
* that needs the wasm rebuilt, which this package does not do.
|
|
2795
|
+
*
|
|
2796
|
+
* A range the machine refuses to read back - a step can unmap what it
|
|
2797
|
+
* wrote - leaves that entry with no new bytes rather than a guess, and the
|
|
2798
|
+
* read never throws out of recording. Truncated writes keep their existing
|
|
2799
|
+
* `Other` shape and stay out of the undo journal.
|
|
2800
|
+
*/
|
|
2704
2801
|
recordMemoryMutations(writes, mutations) {
|
|
2705
2802
|
const undoWrites = [];
|
|
2706
|
-
|
|
2707
|
-
|
|
2803
|
+
const written = this.writtenBytes(writes);
|
|
2804
|
+
for (const [index, write] of writes.entries()) {
|
|
2805
|
+
if (!isRecordableWrite(write)) {
|
|
2708
2806
|
mutations.push({
|
|
2709
2807
|
type: "Other",
|
|
2710
2808
|
value: `Wrote ${write.size} bytes to 0x${write.address.toString(16)}`
|
|
@@ -2719,12 +2817,37 @@ var X86Emulator = class X86Emulator extends BaseEmulator {
|
|
|
2719
2817
|
type: "WriteMemoryBytes",
|
|
2720
2818
|
value: {
|
|
2721
2819
|
address: write.address,
|
|
2722
|
-
old: [...write.old]
|
|
2820
|
+
old: [...write.old],
|
|
2821
|
+
new: written[index] ?? []
|
|
2723
2822
|
}
|
|
2724
2823
|
});
|
|
2725
2824
|
}
|
|
2726
2825
|
return undoWrites;
|
|
2727
2826
|
}
|
|
2827
|
+
/**
|
|
2828
|
+
* The bytes each of a step's stores left, by the index of that store: what
|
|
2829
|
+
* the addresses that store wrote hold now, at the width of the write. One
|
|
2830
|
+
* lookup per store it can account for, and none for a store it cannot.
|
|
2831
|
+
*/
|
|
2832
|
+
writtenBytes(writes) {
|
|
2833
|
+
return writes.map((write) => isRecordableWrite(write) ? this.readBytes(write.address, write.size) : []);
|
|
2834
|
+
}
|
|
2835
|
+
/**
|
|
2836
|
+
* One read of the machine that answers with nothing rather than throwing,
|
|
2837
|
+
* so recording a step can never fail after the instruction already ran.
|
|
2838
|
+
* It takes the machine's own page lookup when that can answer for the
|
|
2839
|
+
* whole range and the byte-by-byte bridge otherwise; the two read the same
|
|
2840
|
+
* memory the same way.
|
|
2841
|
+
*/
|
|
2842
|
+
readBytes(address, length) {
|
|
2843
|
+
const spied = this.runtime.spyMemoryBytes(address, length);
|
|
2844
|
+
if (spied) return Array.from(spied);
|
|
2845
|
+
try {
|
|
2846
|
+
return [...this.runtime.readMemoryBytes(address, BigInt(length))];
|
|
2847
|
+
} catch {
|
|
2848
|
+
return [];
|
|
2849
|
+
}
|
|
2850
|
+
}
|
|
2728
2851
|
recordControlFlowMutation(step, instruction, mutations) {
|
|
2729
2852
|
if (step.controlFlow === "call") {
|
|
2730
2853
|
const returnAddress = instruction ? instruction.address + BigInt(instruction.size) : step.pcBefore;
|
|
@@ -2767,6 +2890,6 @@ async function createX86Emulator(options = {}) {
|
|
|
2767
2890
|
return X86Emulator.create(options);
|
|
2768
2891
|
}
|
|
2769
2892
|
//#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 };
|
|
2893
|
+
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
2894
|
|
|
2772
2895
|
//# sourceMappingURL=index.mjs.map
|