diff --git a/src/debugger/help.txt b/src/debugger/help.txt new file mode 100644 index 0000000..8932f24 --- /dev/null +++ b/src/debugger/help.txt @@ -0,0 +1,62 @@ +------- LACE DEBUGGER ------- +Available Commands: + + * help + Show this message. + + * step (t) + Execute next instruction or jump into subroutine. + - COUNT: Integer (default: 1) + + * next (n) + Execute next instruction or whole subroutine. + - COUNT: Integer (default: 1) + + * continue (c) + Continue execution until breakpoint or `HALT`. + + * finish (f) + Continue execution until end of subroutine, breakpoint, or `HALT`. + + * get (g) + Print the value at a register, address, or label. + - LOCATION: Register | Address+ | Label+ + + * set (s) + Set the value at a register, address, or label. + - LOCATION: Register | Address+ | Label+ + - VALUE: Integer + + * registers (r) + Print the value of all registers. + + * break add (ba) + Add breakpoint at an address/label/PC. + - LOCATION: Address(offset?) | Label+ (default: PC) + + * break remove (br) + Remove breakpoint at an address/label/PC. + - LOCATION: Address+ | Label+ (default: PC) + + * break list (bl) + List all breakpoints. + + * reset + Reset all memory and registers to original state. + + * source + Print corresponding line and line number of source code from address/label/PC. + - COUNT: Integer (default: 1) + - LOCATION: Address+ | Label+ (default: PC) + + * eval + Simulate an instruction. Note that labels cannot be created or modified. + - Instruction: OPCODE OPERANDS... + + * quit (q) + Stop debugger and continue execution as normal. + + * exit (e) + Exit debugger and simulator. + +Note: Address+ and Label+ arguments can include an offset, eg. `HelloWorld+4` diff --git a/src/debugger/mod.rs b/src/debugger/mod.rs index 4f7766f..3a0c0a5 100644 --- a/src/debugger/mod.rs +++ b/src/debugger/mod.rs @@ -193,8 +193,7 @@ impl Debugger { Command::Exit => return Some(Action::ExitProgram), Command::Help => { - dprintln!("-- LACE DEBUGGER --"); - dprintln!("um idk figure it out yourself."); + dprintln!("\n{}", include_str!("./help.txt")); } Command::Continue => {