riscv-openocd/src
Jan Matyas a28e713067 riscv-011: Don't trigger semihosting before the target is examined
In riscv-011 target, the handle_halt() function, and thus also
riscv_semihosting(), can get called from within examine() before
the examination is actually complete!

The chain of the function calls is:

- examine() -> riscv011_poll() -> poll_target()
  -> handle_halt() -> riscv_semihosting()

If the target is already halted due to a breakpoint (dcsr.cause = SWBP)
at the time OpenOCD connects to it, semihosting will be attempted before
completing the examination, and the examination will fail.

This issue was observed on HiFive1 Rev A01.

The fix is to handle semihosting only after the target got successfully
examined.

Change-Id: Iccfa0da35d47a430d8674131ebd2eb8e5e2922c0
Signed-off-by: Jan Matyas <jan.matyas@codasip.com>
2025-02-14 15:28:38 +01:00
..
flash Merge up to a510d51a78 from upstream 2025-01-28 22:13:08 +03:00
helper Merge up to a510d51a78 from upstream 2025-01-28 22:13:08 +03:00
jtag Merge up to a510d51a78 from upstream 2025-01-28 22:13:08 +03:00
pld pld: make get_pld_device_by_num() static 2024-11-23 13:46:59 +00:00
rtos Merge up to a510d51a78 from upstream 2025-01-28 22:13:08 +03:00
rtt rtt: drop unused function rtt_started() 2024-11-23 13:46:35 +00:00
server Merge up to 26f2df80c3 from upstream 2025-01-22 17:47:14 +03:00
svf openocd: convert 'unsigned' to 'unsigned int' 2024-10-05 15:46:25 +00:00
target riscv-011: Don't trigger semihosting before the target is examined 2025-02-14 15:28:38 +01:00
transport openocd: convert 'unsigned' to 'unsigned int' 2024-10-05 15:46:25 +00:00
xsvf OpenOCD: fix code indentation 2025-01-25 10:31:06 +00:00
Makefile.am configure: Use pkg-config for jimtcl 2024-08-02 15:59:07 +00:00
hello.c hello: include hello.h 2023-05-18 10:13:41 +00:00
hello.h openocd: src: replace the GPL-2.0-or-later license tag 2022-07-23 13:59:13 +00:00
main.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
openocd.c autoconf: Add support for code coverage 2024-11-16 14:18:57 +00:00
openocd.h openocd: src: replace the GPL-2.0-or-later license tag 2022-07-23 13:59:13 +00:00