setpc (debugger)
This commit is contained in:
parent
b50b75f1a0
commit
62205273aa
1 changed files with 18 additions and 1 deletions
19
debugger.cpp
19
debugger.cpp
|
@ -149,8 +149,11 @@ void debugger(console *const cnsl, bus *const b, std::atomic_uint32_t *const sto
|
||||||
if (parts.empty())
|
if (parts.empty())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (cmd == "go")
|
if (cmd == "go") {
|
||||||
single_step = false;
|
single_step = false;
|
||||||
|
|
||||||
|
*stop_event = EVENT_NONE;
|
||||||
|
}
|
||||||
else if (parts[0] == "single" || parts[0] == "s") {
|
else if (parts[0] == "single" || parts[0] == "s") {
|
||||||
single_step = true;
|
single_step = true;
|
||||||
|
|
||||||
|
@ -204,6 +207,19 @@ void debugger(console *const cnsl, bus *const b, std::atomic_uint32_t *const sto
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
else if (parts[0] == "setpc") {
|
||||||
|
if (parts.size() == 2) {
|
||||||
|
uint16_t new_pc = std::stoi(parts.at(1), nullptr, 8);
|
||||||
|
c->setPC(new_pc);
|
||||||
|
|
||||||
|
cnsl->put_string_lf(format("Set PC to %06o", new_pc));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
cnsl->put_string_lf("setpc requires an (octal address as) parameter");
|
||||||
|
}
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
else if (parts[0] == "trace" || parts[0] == "t") {
|
else if (parts[0] == "trace" || parts[0] == "t") {
|
||||||
tracing = !tracing;
|
tracing = !tracing;
|
||||||
|
|
||||||
|
@ -308,6 +324,7 @@ void debugger(console *const cnsl, bus *const b, std::atomic_uint32_t *const sto
|
||||||
cnsl->put_string_lf("trace/t - toggle tracing");
|
cnsl->put_string_lf("trace/t - toggle tracing");
|
||||||
cnsl->put_string_lf("strace - start tracing from address - invoke without address to disable");
|
cnsl->put_string_lf("strace - start tracing from address - invoke without address to disable");
|
||||||
cnsl->put_string_lf("mmudump - dump MMU settings (PARs/PDRs)");
|
cnsl->put_string_lf("mmudump - dump MMU settings (PARs/PDRs)");
|
||||||
|
cnsl->put_string_lf("setpc - set PC to value");
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue