Skip to content

Add enum for Inspect 0x09 payload #18

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/debug/WARDuino.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -71,5 +85,6 @@ export namespace WARDuino {
br_table?: BRTable;
callbacks?: CallbackMapping[];
events?: InterruptEvent[];
io?: string[];
}
}
8 changes: 5 additions & 3 deletions src/messaging/Message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export interface Request<R> {
}

export namespace Message {
import Inspect = WARDuino.Inspect;
export const run: Request<Ack> = {
type: Interrupt.run,
parser: (line: string) => {
Expand Down Expand Up @@ -83,10 +84,11 @@ export namespace Message {
};
}

export function inspect(payload: string): Request<State> {
export function inspect(fields: Inspect[]): Request<State> {
return {
type: Interrupt.inspect,
payload: () => payload,
payload: () => fields.length.toString(16).padStart(4, '0') + fields.join('')
,
parser: stateParser
}
}
Expand Down Expand Up @@ -211,7 +213,7 @@ export namespace Message {
parser: stateParser
}

export const proxifyRequest: Request<string> = {
export const proxifyRequest: Request<string> = {
type: Interrupt.proxify,
parser: identityParser
};
Expand Down