~swisschili/toolchain-6502

d3764d4dedaf650f8f2c26c124c9e2e08e03e78c — swissChili 3 months ago 82800a9
Add debugger documentation
3 files changed, 49 insertions(+), 0 deletions(-)

A docs/content/debugger.md
A docs/live-reload.sh
M docs/templates/page.html
A docs/content/debugger.md => docs/content/debugger.md +45 -0
@@ 0,0 1,45 @@
@parent = page.html
@title = Debugger

# Debugger commands

These are the commands that the debugger CLI supports. Due to the asynchronous nature
of the debugger and emulator, commands can be run even while the emulator is actively
executing the program. For instance, try running the `disco.asm` <a href="/examples.html">
example</a> and typing `set A #$0` into the debugger while it's running with a screen
attached, you will be able to modify the program in real time!

<br>
Or, run the emulator on an empty file, and run `set $200 #$FF` to write to the frame
buffer. You can even draw a picture by hand using just the debugger!

<br>
The GUI debugger actually just sends commands like these to the emulator using a
message queue, and you can do the same. Look in `/dev/mqueue` for the message queue
the emulator is using, and try sending a debug command as a null-terminated string
to the queue, you should be able to interact with the emulator from a different
process in real time.

#### `step`, `s`

Step through one CPU instruction

#### `show [$addr]`, `print [$addr]`

Show the value at `$addr` in memory, or, if no address given, show value of all registers.

#### `set $addr #$val`, `set reg #$val`

Set either `$addr` or register `reg` to `#$val`.

#### `run`

Run the emulator.

#### `pause`

Stop running the emulator.

#### `quit`, `exit`

Quit the debugger, emulator, and the screen (if running).

A docs/live-reload.sh => docs/live-reload.sh +3 -0
@@ 0,0 1,3 @@
#!/bin/sh

find | entr bash build.sh

M docs/templates/page.html => docs/templates/page.html +1 -0
@@ 23,6 23,7 @@
					<li><a href="/usage.html">Basic usage</a></li>
					<li><a href="/examples.html">Example programs</a></li>
					<li><a href="/building.html">Building from source</a></li>
					<li><a href="/debugger.html">Debugger commands</a></li>
				</ul>
			</div>
			<div class="body">