From: Tim Newsome Date: Sun, 13 Mar 2016 20:13:15 +0000 (-0700) Subject: Add some tests that pass and test something. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=651ad043cee90de1c80d07b70a12c81d26b48c95;p=riscv-isa-sim.git Add some tests that pass and test something. --- diff --git a/Makefile.in b/Makefile.in index 1e353ab..a0f119a 100644 --- a/Makefile.in +++ b/Makefile.in @@ -335,7 +335,7 @@ deps : $(deps) bintest_outs = $(bintests:=.out) junk += $(bintest_outs) %.out: % all - ./$^ < /dev/null 2>&1 | tee $@ + ./$* < /dev/null 2>&1 | tee $@ check-cpp : $(test_outs) echo; grep -h -e'Unit Tests' -e'FAILED' -e'Segmentation' $^ < /dev/null; echo diff --git a/riscv/gdbserver.cc b/riscv/gdbserver.cc index 70dac13..39bfdf8 100644 --- a/riscv/gdbserver.cc +++ b/riscv/gdbserver.cc @@ -529,7 +529,8 @@ void gdbserver_t::handle_breakpoint(const std::vector &packet) return send_packet("E53"); } - mmu_t* mmu = sim->debug_mmu; + processor_t *p = sim->get_core(0); + mmu_t* mmu = p->mmu; if (insert) { bp.insert(mmu); breakpoints[bp.address] = bp; @@ -540,8 +541,7 @@ void gdbserver_t::handle_breakpoint(const std::vector &packet) breakpoints.erase(bp.address); } mmu->flush_icache(); - processor_t *p = sim->get_core(0); - p->mmu->flush_icache(); + sim->debug_mmu->flush_icache(); return send_packet("OK"); } diff --git a/tests/debug.c b/tests/debug.c new file mode 100644 index 0000000..2cad88f --- /dev/null +++ b/tests/debug.c @@ -0,0 +1,27 @@ +#include + +char c = 'x'; + +void print_row(int length) +{ + for (int x=0; x