MCPcopy Create free account
hub / github.com/RtlZeroMemory/Rezi / parseEventRecord

Function parseEventRecord

packages/core/src/debug/parsers.ts:214–244  ·  view source on GitHub ↗
(bytes: Uint8Array)

Source from the content-addressed store, hash-verified

212 * - _pad0: u32 (bytes 28-31)
213 */
214export function parseEventRecord(bytes: Uint8Array): DebugParseResult<EventRecord> {
215 if (bytes.byteLength < DEBUG_EVENT_RECORD_SIZE) {
216 return fail(
217 "ZR_TRUNCATED",
218 0,
219 `need ${DEBUG_EVENT_RECORD_SIZE} bytes for event record but only ${bytes.byteLength} available`,
220 );
221 }
222
223 const r = new BinaryReader(bytes);
224
225 const frameId = readU64(r);
226 const eventType = r.readU32();
227 const eventFlags = r.readU32();
228 const timeMs = r.readU32();
229 const rawBytesLen = r.readU32();
230 const parseResult = r.readU32();
231 r.readU32(); // Skip _pad0
232
233 return {
234 ok: true,
235 value: {
236 frameId,
237 eventType,
238 eventFlags,
239 timeMs,
240 rawBytesLen,
241 parseResult,
242 },
243 };
244}
245
246/**
247 * Parse an error record payload.

Callers 3

parsePayloadFunction · 0.85
processRecordsFunction · 0.85
parsers.test.tsFile · 0.85

Calls 3

readU32Method · 0.95
readU64Function · 0.85
failFunction · 0.70

Tested by

no test coverage detected