Skip to content

Commit

Permalink
Merge pull request #1002 from en-sc/en-sc/arch-state
Browse files Browse the repository at this point in the history
target/riscv: report info about target during `poll`
  • Loading branch information
JanMatCodasip authored Jan 25, 2024
2 parents f677656 + b503fde commit aa4a80d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/target/riscv/riscv.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit aa4a80d

Please sign in to comment.