Merge pull request #221 from riscv/reg_running

Error instead of asserting on reg access failure
sba_tests
Tim Newsome 2018-03-07 12:22:33 -08:00 committed by GitHub
commit fd9de02fac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -1045,8 +1045,8 @@ static int register_write_direct(struct target *target, unsigned number,
int result = register_write_abstract(target, number, value,
register_size(target, number));
if (result == ERROR_OK ||
info->progbufsize + r->impebreak < 2)
if (result == ERROR_OK || info->progbufsize + r->impebreak < 2 ||
!riscv_is_halted(target))
return result;
struct riscv_program program;
@ -1110,8 +1110,8 @@ static int register_read_direct(struct target *target, uint64_t *value, uint32_t
int result = register_read_abstract(target, value, number,
register_size(target, number));
if (result != ERROR_OK &&
info->progbufsize + r->impebreak >= 2) {
if (result != ERROR_OK && info->progbufsize + r->impebreak >= 2 &&
riscv_is_halted(target)) {
assert(number != GDB_REGNO_S0);
struct riscv_program program;