From 291b0d1f585d3702209a05c944a3c0fa6ab18dc8 Mon Sep 17 00:00:00 2001 From: tolauwae Date: Tue, 27 Aug 2024 00:12:49 +0200 Subject: [PATCH 1/2] Add enum for `Inspect 0x09` payload --- src/debug/WARDuino.ts | 14 ++++++++++++++ src/messaging/Message.ts | 8 +++++--- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/src/debug/WARDuino.ts b/src/debug/WARDuino.ts index ac859a8..b7245a0 100644 --- a/src/debug/WARDuino.ts +++ b/src/debug/WARDuino.ts @@ -11,6 +11,20 @@ export namespace WARDuino { tableIndexes: number[] } + export enum Inspect { + counter = '01', + breakpoints = '02', + callstack = '03', + globals = '04', + table = '05', + memory = '06', + branching = '07', + stack = '08', + callbacks = '09', + events = '0a', + io = '0a' + } + export enum Interrupt { run = '01', halt = '02', diff --git a/src/messaging/Message.ts b/src/messaging/Message.ts index 649e362..376aae6 100644 --- a/src/messaging/Message.ts +++ b/src/messaging/Message.ts @@ -28,6 +28,7 @@ export interface Request { } export namespace Message { + import Inspect = WARDuino.Inspect; export const run: Request = { type: Interrupt.run, parser: (line: string) => { @@ -83,10 +84,11 @@ export namespace Message { }; } - export function inspect(payload: string): Request { + export function inspect(fields: Inspect[]): Request { return { type: Interrupt.inspect, - payload: () => payload, + payload: () => fields.length.toString(16).padStart(4, '0') + fields.join('') + , parser: stateParser } } @@ -211,7 +213,7 @@ export namespace Message { parser: stateParser } - export const proxifyRequest: Request = { + export const proxifyRequest: Request = { type: Interrupt.proxify, parser: identityParser }; From ea3e9ae44c81566d2f7a825e1c1da57eed934556 Mon Sep 17 00:00:00 2001 From: tolauwae Date: Fri, 27 Sep 2024 17:06:25 +0200 Subject: [PATCH 2/2] fixup! Add enum for `Inspect 0x09` payload --- src/debug/WARDuino.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/debug/WARDuino.ts b/src/debug/WARDuino.ts index b7245a0..f5fe5ea 100644 --- a/src/debug/WARDuino.ts +++ b/src/debug/WARDuino.ts @@ -22,7 +22,7 @@ export namespace WARDuino { stack = '08', callbacks = '09', events = '0a', - io = '0a' + io = '0b' } export enum Interrupt { @@ -85,5 +85,6 @@ export namespace WARDuino { br_table?: BRTable; callbacks?: CallbackMapping[]; events?: InterruptEvent[]; + io?: string[]; } } \ No newline at end of file