|
From: openocd-gerrit <ope...@us...> - 2023-03-25 18:14:43
|
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 6f8c27dcfc51c3775f11785711d44563adb6eb17 (commit)
via 90ddac12e38ab21b1d3934235e0d1242e0f13616 (commit)
from 5d39a8852ab604bed29d9e0d28da2cb5f7a87958 (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 6f8c27dcfc51c3775f11785711d44563adb6eb17
Author: Antonio Borneo <bor...@gm...>
Date: Mon Dec 19 21:00:42 2022 +0100
target: arm_tpiu_swo: rewrite command 'tpiu init' as COMMAND_HANDLER
Change-Id: Iaaccfc62dd85267066a152c434f254d1b9a0c4f1
Signed-off-by: Antonio Borneo <bor...@gm...>
Reviewed-on: https://review.openocd.org/c/openocd/+/7502
Tested-by: jenkins
diff --git a/src/target/arm_tpiu_swo.c b/src/target/arm_tpiu_swo.c
index 55201e6fe..5cea682ec 100644
--- a/src/target/arm_tpiu_swo.c
+++ b/src/target/arm_tpiu_swo.c
@@ -994,23 +994,21 @@ COMMAND_HANDLER(handle_arm_tpiu_swo_names)
return ERROR_OK;
}
-static int jim_arm_tpiu_swo_init(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
+COMMAND_HANDLER(handle_arm_tpiu_swo_init)
{
- struct command_context *cmd_ctx = current_command_context(interp);
struct arm_tpiu_swo_object *obj;
- int retval = JIM_OK;
+ int retval = ERROR_OK;
+
+ if (CMD_ARGC != 0)
+ return ERROR_COMMAND_SYNTAX_ERROR;
- if (argc != 1) {
- Jim_WrongNumArgs(interp, 1, argv, "Too many parameters");
- return JIM_ERR;
- }
list_for_each_entry(obj, &all_tpiu_swo, lh) {
if (!obj->deferred_enable)
continue;
LOG_DEBUG("%s: running enable during init", obj->name);
- int retval2 = command_run_linef(cmd_ctx, "%s enable", obj->name);
+ int retval2 = command_run_linef(CMD_CTX, "%s enable", obj->name);
if (retval2 != ERROR_OK)
- retval = JIM_ERR;
+ retval = retval2;
}
return retval;
}
@@ -1189,7 +1187,7 @@ static const struct command_registration arm_tpiu_swo_subcommand_handlers[] = {
{
.name = "init",
.mode = COMMAND_EXEC,
- .jim_handler = jim_arm_tpiu_swo_init,
+ .handler = handle_arm_tpiu_swo_init,
.usage = "",
.help = "Initialize TPIU and SWO",
},
commit 90ddac12e38ab21b1d3934235e0d1242e0f13616
Author: Antonio Borneo <bor...@gm...>
Date: Mon Dec 19 20:56:40 2022 +0100
target: arm_tpiu_swo: rewrite command 'tpiu names' as COMMAND_HANDLER
While there, format in a human readable way the output list by
using one line per tpiu name.
Change-Id: I937c92b6c1e92509cf8aa96be1517a51bc363600
Signed-off-by: Antonio Borneo <bor...@gm...>
Reviewed-on: https://review.openocd.org/c/openocd/+/7501
Tested-by: jenkins
diff --git a/src/target/arm_tpiu_swo.c b/src/target/arm_tpiu_swo.c
index 3cf306377..55201e6fe 100644
--- a/src/target/arm_tpiu_swo.c
+++ b/src/target/arm_tpiu_swo.c
@@ -981,20 +981,17 @@ err_exit:
return JIM_ERR;
}
-static int jim_arm_tpiu_swo_names(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
+COMMAND_HANDLER(handle_arm_tpiu_swo_names)
{
struct arm_tpiu_swo_object *obj;
- if (argc != 1) {
- Jim_WrongNumArgs(interp, 1, argv, "Too many parameters");
- return JIM_ERR;
- }
- Jim_SetResult(interp, Jim_NewListObj(interp, NULL, 0));
- list_for_each_entry(obj, &all_tpiu_swo, lh) {
- Jim_ListAppendElement(interp, Jim_GetResult(interp),
- Jim_NewStringObj(interp, obj->name, -1));
- }
- return JIM_OK;
+ if (CMD_ARGC != 0)
+ return ERROR_COMMAND_SYNTAX_ERROR;
+
+ list_for_each_entry(obj, &all_tpiu_swo, lh)
+ command_print(CMD, "%s", obj->name);
+
+ return ERROR_OK;
}
static int jim_arm_tpiu_swo_init(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
@@ -1185,7 +1182,7 @@ static const struct command_registration arm_tpiu_swo_subcommand_handlers[] = {
{
.name = "names",
.mode = COMMAND_ANY,
- .jim_handler = jim_arm_tpiu_swo_names,
+ .handler = handle_arm_tpiu_swo_names,
.usage = "",
.help = "Lists all registered TPIU and SWO objects by name",
},
-----------------------------------------------------------------------
Summary of changes:
src/target/arm_tpiu_swo.c | 39 +++++++++++++++++----------------------
1 file changed, 17 insertions(+), 22 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|