File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -1889,8 +1889,16 @@ static int handle_halt(struct target *target, bool announce)
18891889
18901890 if (target -> debug_reason == DBG_REASON_BREAKPOINT ) {
18911891 int retval ;
1892- if (riscv_semihosting (target , & retval ) != 0 )
1893- return retval ;
1892+ /* Hotfix: Don't try to handle semihosting before the target is marked as examined. */
1893+ /* TODO: The code should be rearranged so that:
1894+ * - Semihosting is not attempted before the target is examined.
1895+ * - When the target is already halted on a semihosting magic sequence
1896+ * at the time when OpenOCD connects to it, this semihosting attempt
1897+ * gets handled right after the examination.
1898+ */
1899+ if (target_was_examined (target ))
1900+ if (riscv_semihosting (target , & retval ) != SEMIHOSTING_NONE )
1901+ return retval ;
18941902 }
18951903
18961904 if (announce )
You can’t perform that action at this time.
0 commit comments