Merge pull request #1002 from en-sc/en-sc/arch-state

target/riscv: report info about target during `poll`
This commit is contained in:
Jan Matyas 2024-01-25 06:50:42 +01:00 committed by GitHub
commit aa4a80dbed
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 0 deletions

View File

@ -2712,9 +2712,17 @@ static int riscv_get_gdb_reg_list(struct target *target,
static int riscv_arch_state(struct target *target)
{
assert(target->state == TARGET_HALTED);
const bool semihosting_active = target->semihosting &&
target->semihosting->is_active;
LOG_USER("%s halted due to %s.%s",
target_name(target),
debug_reason_name(target),
semihosting_active ? " Semihosting is active." : "");
struct target_type *tt = get_target_type(target);
if (!tt)
return ERROR_FAIL;
assert(tt->arch_state);
return tt->arch_state(target);
}