Don't always error if a debug program fails

This is often expected, and the calling code should decide whether to
emit an error or not.

Change-Id: Ic21f38b4c75f01e6b40034fdc60dde6ba7a55f4a
sba_tests
Tim Newsome 2018-03-02 20:01:12 -08:00
parent 1d00d03dc0
commit 84c0fdd5d1
2 changed files with 6 additions and 2 deletions

View File

@ -64,7 +64,7 @@ int riscv_program_exec(struct riscv_program *p, struct target *t)
return ERROR_FAIL;
if (riscv_execute_debug_buffer(t) != ERROR_OK) {
LOG_ERROR("Unable to execute program %p", p);
LOG_DEBUG("Unable to execute program %p", p);
return ERROR_FAIL;
}

View File

@ -1092,6 +1092,7 @@ static int register_write_direct(struct target *target, unsigned number,
}
int exec_out = riscv_program_exec(&program, target);
/* Don't message on error. Probably the register doesn't exist. */
/* Restore S0. */
if (register_write_direct(target, GDB_REGNO_S0, s0) != ERROR_OK)
@ -1161,6 +1162,7 @@ static int register_read_direct(struct target *target, uint64_t *value, uint32_t
/* Execute program. */
result = riscv_program_exec(&program, target);
/* Don't message on error. Probably the register doesn't exist. */
if (use_scratch) {
if (scratch_read64(target, &scratch, value) != ERROR_OK)
@ -2597,8 +2599,10 @@ static int maybe_execute_fence_i(struct target *target)
riscv_program_init(&program, target);
if (riscv_program_fence_i(&program) != ERROR_OK)
return ERROR_FAIL;
if (riscv_program_exec(&program, target) != ERROR_OK)
if (riscv_program_exec(&program, target) != ERROR_OK) {
LOG_ERROR("Failed to execute fence.i");
return ERROR_FAIL;
}
}
return ERROR_OK;
}