code clean-up

This commit is contained in:
folkert van heusden 2024-04-17 08:33:49 +02:00
parent e30cba36b1
commit ba2333e6f1
Signed by untrusted user who does not match committer: folkert
GPG key ID: 6B6455EDFEED3BD1

View file

@ -1038,40 +1038,48 @@ void debugger(console *const cnsl, bus *const b, std::atomic_uint32_t *const sto
break; break;
} }
else if (cmd == "help" || cmd == "h" || cmd == "?") { else if (cmd == "help" || cmd == "h" || cmd == "?") {
cnsl->put_string_lf("disassemble/d - show current instruction (pc=/n=)"); constexpr const char *const help[] = {
cnsl->put_string_lf("go - run until trap or ^e"); "disassemble/d - show current instruction (pc=/n=)",
"go - run until trap or ^e",
#if !defined(ESP32) #if !defined(ESP32)
cnsl->put_string_lf("quit/q - stop emulator"); "quit/q - stop emulator",
#endif #endif
cnsl->put_string_lf("examine/e - show memory address (<octal address> <p|v> [<n>])"); "examine/e - show memory address (<octal address> <p|v> [<n>])",
cnsl->put_string_lf("reset/r - reset cpu/bus/etc"); "reset/r - reset cpu/bus/etc",
cnsl->put_string_lf("single/s - run 1 instruction (implicit 'disassemble' command)"); "single/s - run 1 instruction (implicit 'disassemble' command)",
cnsl->put_string_lf("sbp/cbp/lbp - set/clear/list breakpoint(s)"); "sbp/cbp/lbp - set/clear/list breakpoint(s)",
cnsl->put_string_lf(" e.g.: (pc=0123 and memwv[04000]=0200,0300 and (r4=07,05 or r5=0456))"); " e.g.: (pc=0123 and memwv[04000]=0200,0300 and (r4=07,05 or r5=0456))",
cnsl->put_string_lf(" values seperated by ',', char after mem is w/b (word/byte), then"); " values seperated by ',', char after mem is w/b (word/byte), then",
cnsl->put_string_lf(" follows v/p (virtual/physical), all octal values, mmr0-3 are registers"); " follows v/p (virtual/physical), all octal values, mmr0-3 and psw are",
cnsl->put_string_lf("trace/t - toggle tracing"); " registers",
cnsl->put_string_lf("turbo - toggle turbo mode (cannot be interrupted)"); "trace/t - toggle tracing",
cnsl->put_string_lf("debug - enable CPU debug mode"); "turbo - toggle turbo mode (cannot be interrupted)",
cnsl->put_string_lf("bt - show backtrace - need to enable debug first"); "debug - enable CPU debug mode",
cnsl->put_string_lf("strace - start tracing from address - invoke without address to disable"); "bt - show backtrace - need to enable debug first",
cnsl->put_string_lf("trl - set trace run-level, empty for all"); "strace - start tracing from address - invoke without address to disable",
cnsl->put_string_lf("regdump - dump register contents"); "trl - set trace run-level, empty for all",
cnsl->put_string_lf("mmudump - dump MMU settings (PARs/PDRs)"); "regdump - dump register contents",
cnsl->put_string_lf("mmures - resolve a virtual address"); "mmudump - dump MMU settings (PARs/PDRs)",
cnsl->put_string_lf("setpc - set PC to value"); "mmures - resolve a virtual address",
cnsl->put_string_lf("setmem - set memory (a=) to value (v=), both in octal, one byte"); "setpc - set PC to value",
cnsl->put_string_lf("toggle - set switch (s=, 0...15 (decimal)) of the front panel to state (t=, 0 or 1)"); "setmem - set memory (a=) to value (v=), both in octal, one byte",
cnsl->put_string_lf("cls - clear screen"); "toggle - set switch (s=, 0...15 (decimal)) of the front panel to state (t=, 0 or 1)",
cnsl->put_string_lf("stats - show run statistics"); "cls - clear screen",
"stats - show run statistics",
#if defined(ESP32) #if defined(ESP32)
cnsl->put_string_lf("cfgnet - configure network (e.g. WiFi)"); "cfgnet - configure network (e.g. WiFi)",
cnsl->put_string_lf("startnet - start network"); "startnet - start network",
cnsl->put_string_lf("chknet - check network status"); "chknet - check network status",
cnsl->put_string_lf("serspd - set serial speed in bps (8N1 are default)"); "serspd - set serial speed in bps (8N1 are default)",
cnsl->put_string_lf("init - reload (disk-)configuration from flash"); "init - reload (disk-)configuration from flash",
#endif #endif
cnsl->put_string_lf("cfgdisk - configure disk"); "cfgdisk - configure disk",
nullptr
};
size_t i=0;
while(help[i])
cnsl->put_string_lf(help[i++]);
continue; continue;
} }
else { else {