Skip to content

Commit ca1a1f8

Browse files
authored
Complete single step before returning. (#319)
This fixes the following error, that has been reported occasionally: Error: 34072 2712 riscv-011.c:1175 reg_cache_get(): Register cache entry for 0 is invalid! openocd: ../src/target/riscv/riscv-011.c:1176: reg_cache_get: Assertion `r->valid' failed. The problem was that we'd tell the target to step, and then gdb (which assumed the target halted already) asked to read a register before the target had actually halted. With this fix the target is actually halted, and everything works. Change-Id: Icfcef456f3cec4bb352fb90186f5bbabb00a5ff8
1 parent 60368dd commit ca1a1f8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/target/riscv/riscv-011.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1451,7 +1451,7 @@ static int step(struct target *target, int current, target_addr_t address,
14511451
if (result != ERROR_OK)
14521452
return result;
14531453
} else {
1454-
return resume(target, 0, true);
1454+
return full_step(target, false);
14551455
}
14561456

14571457
return ERROR_OK;

0 commit comments

Comments
 (0)