aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvgeniy Naydanov <evgeniy.naydanov@syntacore.com>2024-01-22 18:21:25 +0300
committerEvgeniy Naydanov <evgeniy.naydanov@syntacore.com>2024-01-24 10:43:51 +0300
commitb503fdef02fa6fb76442d84e3a088fcf01cc6394 (patch)
tree24bca4dda42d9b1e3e4a398934462d5dd5ee3641
parent78a719fad3ed151dd525dbcc2e2ea7b3140e142e (diff)
downloadriscv-openocd-b503fdef02fa6fb76442d84e3a088fcf01cc6394.zip
riscv-openocd-b503fdef02fa6fb76442d84e3a088fcf01cc6394.tar.gz
riscv-openocd-b503fdef02fa6fb76442d84e3a088fcf01cc6394.tar.bz2
target/riscv: report info about target during `poll`
Addresses issue #196. Change-Id: I71146c7bc769cb9727e57da33e9f514eedef9ce4 Signed-off-by: Evgeniy Naydanov <evgeniy.naydanov@syntacore.com>
-rw-r--r--src/target/riscv/riscv.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/target/riscv/riscv.c b/src/target/riscv/riscv.c
index 3ebc76a..b187161 100644
--- a/src/target/riscv/riscv.c
+++ b/src/target/riscv/riscv.c
@@ -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);
}