diff options
author | Antonio Borneo <borneo.antonio@gmail.com> | 2021-09-17 18:37:41 +0200 |
---|---|---|
committer | Antonio Borneo <borneo.antonio@gmail.com> | 2021-09-25 13:13:28 +0000 |
commit | e48093b395808692145bf320e6d206561670107c (patch) | |
tree | d2b7c32d3876f18e17b2af9eefce7af3a588188e /src/target | |
parent | 7b504370f732a00d803163cab2b1750bde1927cf (diff) | |
download | riscv-openocd-e48093b395808692145bf320e6d206561670107c.zip riscv-openocd-e48093b395808692145bf320e6d206561670107c.tar.gz riscv-openocd-e48093b395808692145bf320e6d206561670107c.tar.bz2 |
openocd: prevent jimtcl error message while testing commands
The jimtcl API Jim_GetCommand() sets an error message when the
command is not found and flag JIM_ERRMSG is set.
OpenOCD is checking if the command has already been registered,
thus 'command not found' is the desired case.
Pass flag JIM_NONE to prevent jimtcl from setting the error
message.
Change-Id: I3329c2f8722eda0cc9a5f9cbd888a37915b46107
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/6562
Tested-by: jenkins
Diffstat (limited to 'src/target')
-rw-r--r-- | src/target/arm_cti.c | 2 | ||||
-rw-r--r-- | src/target/arm_dap.c | 2 | ||||
-rw-r--r-- | src/target/arm_tpiu_swo.c | 2 | ||||
-rw-r--r-- | src/target/target.c | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/src/target/arm_cti.c b/src/target/arm_cti.c index 7d005e2..c776e9c 100644 --- a/src/target/arm_cti.c +++ b/src/target/arm_cti.c @@ -465,7 +465,7 @@ static int cti_create(struct jim_getopt_info *goi) /* COMMAND */ jim_getopt_obj(goi, &new_cmd); /* does this command exist? */ - cmd = Jim_GetCommand(goi->interp, new_cmd, JIM_ERRMSG); + cmd = Jim_GetCommand(goi->interp, new_cmd, JIM_NONE); if (cmd) { cp = Jim_GetString(new_cmd, NULL); Jim_SetResultFormatted(goi->interp, "Command: %s Exists", cp); diff --git a/src/target/arm_dap.c b/src/target/arm_dap.c index 2f21aa1..94edfc0 100644 --- a/src/target/arm_dap.c +++ b/src/target/arm_dap.c @@ -230,7 +230,7 @@ static int dap_create(struct jim_getopt_info *goi) /* COMMAND */ jim_getopt_obj(goi, &new_cmd); /* does this command exist? */ - cmd = Jim_GetCommand(goi->interp, new_cmd, JIM_ERRMSG); + cmd = Jim_GetCommand(goi->interp, new_cmd, JIM_NONE); if (cmd) { cp = Jim_GetString(new_cmd, NULL); Jim_SetResultFormatted(goi->interp, "Command: %s Exists", cp); diff --git a/src/target/arm_tpiu_swo.c b/src/target/arm_tpiu_swo.c index 8b1d012..f2b5148 100644 --- a/src/target/arm_tpiu_swo.c +++ b/src/target/arm_tpiu_swo.c @@ -880,7 +880,7 @@ static int arm_tpiu_swo_create(Jim_Interp *interp, struct arm_tpiu_swo_object *o assert(cmd_ctx); /* does this command exist? */ - cmd = Jim_GetCommand(interp, Jim_NewStringObj(interp, obj->name, -1), JIM_ERRMSG); + cmd = Jim_GetCommand(interp, Jim_NewStringObj(interp, obj->name, -1), JIM_NONE); if (cmd) { Jim_SetResultFormatted(interp, "Command: %s Exists", obj->name); return JIM_ERR; diff --git a/src/target/target.c b/src/target/target.c index 6d3bf77..fa0c2b2 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -5715,7 +5715,7 @@ static int target_create(struct jim_getopt_info *goi) /* COMMAND */ jim_getopt_obj(goi, &new_cmd); /* does this command exist? */ - cmd = Jim_GetCommand(goi->interp, new_cmd, JIM_ERRMSG); + cmd = Jim_GetCommand(goi->interp, new_cmd, JIM_NONE); if (cmd) { cp = Jim_GetString(new_cmd, NULL); Jim_SetResultFormatted(goi->interp, "Command/target: %s Exists", cp); |