diff --git a/flake.nix b/flake.nix index 6656094..4492e28 100644 --- a/flake.nix +++ b/flake.nix @@ -65,6 +65,7 @@ devShells.nemu = pkgs.mkShell { packages = with pkgs; [ clang-tools + gdb ]; inputsFrom = [ self.packages.${system}.nemu diff --git a/nemu/src/cpu/cpu-exec.c b/nemu/src/cpu/cpu-exec.c index efb9557..c5696fa 100644 --- a/nemu/src/cpu/cpu-exec.c +++ b/nemu/src/cpu/cpu-exec.c @@ -75,6 +75,9 @@ static void exec_once(Decode *s, vaddr_t pc) { static void execute(uint64_t n) { Decode s; +#ifdef CONFIG_ITRACE + memset(s.logbuf, 0, CONFIG_ITRACE_BUFFER * 128 * sizeof(char)); +#endif for (;n > 0; n --) { exec_once(&s, cpu.pc); g_nr_guest_inst ++;