diff --git a/src/debug/WARDuino.ts b/src/debug/WARDuino.ts index ac859a8..f5fe5ea 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 = '0b' + } + export enum Interrupt { run = '01', halt = '02', @@ -71,5 +85,6 @@ export namespace WARDuino { br_table?: BRTable; callbacks?: CallbackMapping[]; events?: InterruptEvent[]; + io?: string[]; } } \ No newline at end of file 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 };