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
deinit
Tim Newsome 2018-11-05 11:48:52 -08:00 committed by GitHub
parent 60368dd62e
commit ca1a1f8db7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -1451,7 +1451,7 @@ static int step(struct target *target, int current, target_addr_t address,
if (result != ERROR_OK) if (result != ERROR_OK)
return result; return result;
} else { } else {
return resume(target, 0, true); return full_step(target, false);
} }
return ERROR_OK; return ERROR_OK;