From c39552375661e495b344e8386649ade92a4d45b2 Mon Sep 17 00:00:00 2001 From: Alejandro Soto Date: Wed, 7 Dec 2022 19:18:04 -0600 Subject: Implement single-stepping --- tb/top/conspiracion.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'tb/top') diff --git a/tb/top/conspiracion.cpp b/tb/top/conspiracion.cpp index 96fd57f..bd1086a 100644 --- a/tb/top/conspiracion.cpp +++ b/tb/top/conspiracion.cpp @@ -391,6 +391,7 @@ int main(int argc, char **argv) ttyJ0.takeover(); } + top.step = 0; top.halt = start_halted; top.rst_n = 0; cycle(); @@ -458,6 +459,9 @@ int main(int argc, char **argv) if(top.cpu_halted) { + top.step = 0; + top.halt = 0; + do_reg_dump(); std::fputs("=== halted ===\n", ctrl); @@ -486,7 +490,10 @@ int main(int argc, char **argv) const char *cmd = std::strtok(line, " "); if(!std::strcmp(cmd, "continue")) { - top.halt = 0; + break; + } else if(!std::strcmp(cmd, "step")) + { + top.step = 1; break; } else if(!std::strcmp(cmd, "dump-mem")) { -- cgit v1.2.3