This is an automated email from Gerrit. "Jan Matyas <[email protected]>" just uploaded a new patch set to Gerrit, which you can find at https://review.openocd.org/c/openocd/+/9321
-- gerrit commit 6652a5149829ad6d9e1bf34b4280b9769e9c64b7 Author: Jan Matyas <[email protected]> Date: Thu Dec 18 12:37:29 2025 +0100 target/semihosting: Ignore arm semihosting basedir when opening :tt When the user requests to open the special files ":tt" or ":semihosting-features", any base directory (path) that might have been set by command "arm semihosting_basedir" must be ignored. Change-Id: I55f482dba112a47491b56ee1477429581dd4978c Signed-off-by: Jan Matyas <[email protected]> diff --git a/src/target/semihosting_common.c b/src/target/semihosting_common.c index 345e542c3c..8879cd4e0a 100644 --- a/src/target/semihosting_common.c +++ b/src/target/semihosting_common.c @@ -936,10 +936,10 @@ int semihosting_common(struct target *target) /* TODO: implement the :semihosting-features special file. * */ if (semihosting->is_fileio) { - if (strcmp((char *)fn, ":semihosting-features") == 0) { + if (strcmp((char *)fn + basedir_len, ":semihosting-features") == 0) { semihosting->result = -1; semihosting->sys_errno = EINVAL; - } else if (strcmp((char *)fn, ":tt") == 0) { + } else if (strcmp((char *)fn + basedir_len, ":tt") == 0) { if (mode == 0) { semihosting->result = 0; } else if (mode == 4) { @@ -959,7 +959,7 @@ int semihosting_common(struct target *target) fileio_info->param_4 = 0644; } } else { - if (strcmp((char *)fn, ":tt") == 0) { + if (strcmp((char *)fn + basedir_len, ":tt") == 0) { /* Mode is: * - 0-3 ("r") for stdin, * - 4-7 ("w") for stdout, --
