Debugger#54
Open
tetsuo wants to merge 19 commits intofrancisrstokes:masterfrom
tetsuo:feature/debugger-wsock
Open
Debugger#54tetsuo wants to merge 19 commits intofrancisrstokes:masterfrom tetsuo:feature/debugger-wsock
tetsuo wants to merge 19 commits intofrancisrstokes:masterfrom
tetsuo:feature/debugger-wsock
Conversation
Owner
francisrstokes
left a comment
There was a problem hiding this comment.
This is looking really cool so far @tetsuo !
|
|
||
| const methods = ['step', 'next', 'previous']; | ||
|
|
||
| class Client { |
Owner
There was a problem hiding this comment.
To keep with more style of the rest of the codebase I'd prefer if this was written in terms of a closure rather than a class:
const createClient = (ws, rpc, plex) => ({
close: () => {...},
step: () => {...}
});This provides encode() and decode() methods:
- encode() serializes machine state into a Buffer
- decode() expects an encoded Buffer and returns a plain object which
is in the following form:
{ memory: uint16[], stack: uint16[], registers: object }
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Debugger
Goal
1- Create a server which will serve snapshots.
2- Establish a web socket connection to this host and exchange binary messages.
3- Do debugging on any UI using a nice RPC-like interface.
Example
Protocol
Messages can contain commands from the client (e.g.
step(),next(),setBreakdown(),reset()), or snapshots from the server. Snapshots (memory, stack, registers- in this order) are concatenated into aBufferand returned to the client.Snapshots are decoded as:
{memory: uint16[], stack: uint16[], registers: object}Tasks
cpu.step()Inspector tasks
This will be a different package.
biased-openerFurther
(Not part of this PR)