Try saving the halted state when examining a target

This commit is contained in:
Palmer Dabbelt 2018-05-30 05:54:56 -07:00
parent 9b19e10f8d
commit f1e8dee522
1 changed files with 5 additions and 1 deletions

View File

@ -692,7 +692,11 @@ static int riscv_examine(struct target *target)
if (result != ERROR_OK)
return result;
return tt->examine(target);
int result = tt->examine(target);
if (result != ERROR_OK)
return result;
target->state = riscv_is_halted(target) ? TARGET_HALTED : TARGET_RUNNING;
}
static int oldriscv_poll(struct target *target)