From 9b9653ab7da8678ba93f72db9f4d30df8e727515 Mon Sep 17 00:00:00 2001 From: Tim Newsome Date: Thu, 16 Jun 2016 13:27:18 -0700 Subject: [PATCH] Use hardware single step. --- src/target/riscv/riscv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/target/riscv/riscv.c b/src/target/riscv/riscv.c index 0a3562cfd..4a5a6c532 100644 --- a/src/target/riscv/riscv.c +++ b/src/target/riscv/riscv.c @@ -827,12 +827,12 @@ static int riscv_halt(struct target *target) static int riscv_step(struct target *target, int current, uint32_t address, int handle_breakpoints) { - riscv_info_t *info = (riscv_info_t *) target->arch_info; jtag_add_ir_scan(target->tap, &select_dbus, TAP_IDLE); // Hardware single step doesn't exist yet. -#if 0 +#if 1 return resume(target, current, address, handle_breakpoints, 0, true); #else + riscv_info_t *info = (riscv_info_t *) target->arch_info; uint32_t next_pc = info->dpc + 4; // TODO: write better next pc prediction code if (breakpoint_add(target, next_pc, 4, BKPT_SOFT) != ERROR_OK) {