From: openocd-gerrit <ope...@us...> - 2025-05-09 12:11:19
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via d6c54b94941294628c5ebff5f9c776c4a7b2aebb (commit) from 618e447278097e41daecf76f6a1e2005f9fc9450 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit d6c54b94941294628c5ebff5f9c776c4a7b2aebb Author: Daniel Goehring <dgo...@os...> Date: Wed Apr 30 22:38:15 2025 -0400 target: cget command fix for result output Function target_configure() when processing a "cget" command needs to print the result to the console. Currently the result is only printed when an error occurs. To fix this, move the command print statement from the error handling section to the common code section. The code was tested by executing a "$target_name cget -dap" command and reviewing the result. Change-Id: Iff1999de8c8e9a837055ba95714137aa03e68d4b Signed-off-by: Daniel Goehring <dgo...@os...> Fixes: 61890e3dc320 ("target: rewrite function target_configure() as COMMAND_HELPER") Reviewed-on: https://review.openocd.org/c/openocd/+/8870 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/src/target/target.c b/src/target/target.c index 8ccab7e0a..a85d3def8 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -4889,16 +4889,18 @@ static COMMAND_HELPER(target_configure, struct target *target, unsigned int inde goi.is_configure = is_configure; int e = (*target->type->target_jim_configure)(target, &goi); index = CMD_ARGC - goi.argc; + + int reslen; + const char *result = Jim_GetString(Jim_GetResult(CMD_CTX->interp), &reslen); + if (reslen > 0) + command_print(CMD, "%s", result); + if (e == JIM_OK) { /* more? */ continue; } if (e == JIM_ERR) { /* An error */ - int reslen; - const char *result = Jim_GetString(Jim_GetResult(CMD_CTX->interp), &reslen); - if (reslen > 0) - command_print(CMD, "%s", result); return ERROR_FAIL; } /* otherwise we 'continue' below */ ----------------------------------------------------------------------- Summary of changes: src/target/target.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) hooks/post-receive -- Main OpenOCD repository |