diff options
author | wzgpeter <wzgpeter@outlook.com> | 2022-05-17 00:57:22 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-16 09:57:22 -0700 |
commit | a408bdc8db1acfbf37c399668cdf370838645d63 (patch) | |
tree | 0a58ecbcdaf946515c9d6f705426527ef05e34a3 | |
parent | a037b20f2e015859327ab37588792386c4fc942f (diff) | |
download | riscv-openocd-a408bdc8db1acfbf37c399668cdf370838645d63.zip riscv-openocd-a408bdc8db1acfbf37c399668cdf370838645d63.tar.gz riscv-openocd-a408bdc8db1acfbf37c399668cdf370838645d63.tar.bz2 |
fix: semihosting_fileio display the unsupported info (#699)
the abnormal info display below:
semihosting: unsupported call 0
semihosting: unsupported call 0
semihosting: unsupported call 0
semihosting: unsupported call 0
semihosting: unsupported call 0
semihosting: unsupported call 0
semihosting: unsupported call 0
semihosting: unsupported call 0
semihosting: unsupported call 0
semihosting: unsupported call 0
semihosting: unsupported call 0
the PC did not plus 4 before resume, which cause this
abnormal info popup.
Change-Id: I15c1e7426f1925e78f607c566976f9352216506f
Signed-off-by: Wu Zhigang <zhigang.wu@starfivetech.com>
Co-authored-by: Wu Zhigang <zhigang.wu@starfivetech.com>
-rw-r--r-- | src/target/riscv/riscv_semihosting.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/target/riscv/riscv_semihosting.c b/src/target/riscv/riscv_semihosting.c index 1dd8e77..2c53813 100644 --- a/src/target/riscv/riscv_semihosting.c +++ b/src/target/riscv/riscv_semihosting.c @@ -155,16 +155,16 @@ semihosting_result_t riscv_semihosting(struct target *target, int *retval) } } + /* Resume right after the EBREAK 4 bytes instruction. */ + *retval = riscv_set_register(target, GDB_REGNO_PC, pc + 4); + if (*retval != ERROR_OK) + return SEMI_ERROR; + /* * Resume target if we are not waiting on a fileio * operation to complete. */ if (semihosting->is_resumable && !semihosting->hit_fileio) { - /* Resume right after the EBREAK 4 bytes instruction. */ - *retval = riscv_set_register(target, GDB_REGNO_PC, pc + 4); - if (*retval != ERROR_OK) - return SEMI_ERROR; - LOG_DEBUG(" -> HANDLED"); return SEMI_HANDLED; } |