Merge pull request #860 from riscv/examine_state

target/riscv: set_dcsr_ebreak() while target->state is still changed
This commit is contained in:
Tim Newsome 2023-06-08 09:10:55 -07:00 committed by GitHub
commit 973c72887c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -1862,9 +1862,6 @@ static int examine(struct target *target)
return ERROR_FAIL;
}
target->state = saved_tgt_state;
target->debug_reason = saved_dbg_reason;
/* Now init registers based on what we discovered. */
if (riscv_init_registers(target) != ERROR_OK)
return ERROR_FAIL;
@ -1872,6 +1869,9 @@ static int examine(struct target *target)
if (update_dcsr(target, false) != ERROR_OK)
return ERROR_FAIL;
target->state = saved_tgt_state;
target->debug_reason = saved_dbg_reason;
if (!halted) {
riscv013_step_or_resume_current_hart(target, false);
target->state = TARGET_RUNNING;