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
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user