|
From: openocd-gerrit <ope...@us...> - 2023-03-25 18:14:03
|
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 f76e67a440bb1761b90ea0cab89e0422a4224779 (commit)
via fbb7a50cbd5b9cda29698b3192e2a4596b3a6371 (commit)
from 254598ba25265b79bac4a5e32fa2abb5d252d2cb (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 f76e67a440bb1761b90ea0cab89e0422a4224779
Author: Antonio Borneo <bor...@gm...>
Date: Mon Dec 19 18:35:23 2022 +0100
target: arm_dap: rewrite command 'dap names' as COMMAND_HANDLER
While there, format in a human readable way the output list by
using one line per dap name.
Change-Id: I24a47350105b90db15808c61790f05d807120739
Signed-off-by: Antonio Borneo <bor...@gm...>
Reviewed-on: https://review.openocd.org/c/openocd/+/7498
Tested-by: jenkins
diff --git a/src/target/arm_dap.c b/src/target/arm_dap.c
index e21136dd6..bc9d96236 100644
--- a/src/target/arm_dap.c
+++ b/src/target/arm_dap.c
@@ -421,20 +421,16 @@ static int jim_dap_create(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
return dap_create(&goi);
}
-static int jim_dap_names(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
+COMMAND_HANDLER(handle_dap_names)
{
+ if (CMD_ARGC != 0)
+ return ERROR_COMMAND_SYNTAX_ERROR;
+
struct arm_dap_object *obj;
+ list_for_each_entry(obj, &all_dap, lh)
+ command_print(CMD, "%s", obj->name);
- 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_dap, lh) {
- Jim_ListAppendElement(interp, Jim_GetResult(interp),
- Jim_NewStringObj(interp, obj->name, -1));
- }
- return JIM_OK;
+ return ERROR_OK;
}
COMMAND_HANDLER(handle_dap_init)
@@ -500,7 +496,7 @@ static const struct command_registration dap_subcommand_handlers[] = {
{
.name = "names",
.mode = COMMAND_ANY,
- .jim_handler = jim_dap_names,
+ .handler = handle_dap_names,
.usage = "",
.help = "Lists all registered DAP instances by name",
},
commit fbb7a50cbd5b9cda29698b3192e2a4596b3a6371
Author: Antonio Borneo <bor...@gm...>
Date: Mon Dec 19 18:29:08 2022 +0100
jtag: rewrite command 'flush_count' as COMMAND_HANDLER
While there:
- check the number of command parameters;
- add the mandatory 'usage' field.
Change-Id: I7cd16f049753caedf19f313f7dc84be98efdba42
Signed-off-by: Antonio Borneo <bor...@gm...>
Reviewed-on: https://review.openocd.org/c/openocd/+/7497
Tested-by: jenkins
diff --git a/src/jtag/tcl.c b/src/jtag/tcl.c
index c6ca04810..b3cbc48b4 100644
--- a/src/jtag/tcl.c
+++ b/src/jtag/tcl.c
@@ -249,12 +249,15 @@ static int jim_command_pathmove(Jim_Interp *interp, int argc, Jim_Obj * const *a
return JIM_OK;
}
-
-static int jim_command_flush_count(Jim_Interp *interp, int argc, Jim_Obj * const *args)
+COMMAND_HANDLER(handle_jtag_flush_count)
{
- Jim_SetResult(interp, Jim_NewIntObj(interp, jtag_get_flush_queue_count()));
+ if (CMD_ARGC != 0)
+ return ERROR_COMMAND_SYNTAX_ERROR;
- return JIM_OK;
+ int count = jtag_get_flush_queue_count();
+ command_print_sameline(CMD, "%d", count);
+
+ return ERROR_OK;
}
/* REVISIT Just what about these should "move" ... ?
@@ -279,9 +282,10 @@ static const struct command_registration jtag_command_handlers_to_move[] = {
{
.name = "flush_count",
.mode = COMMAND_EXEC,
- .jim_handler = jim_command_flush_count,
+ .handler = handle_jtag_flush_count,
.help = "Returns the number of times the JTAG queue "
"has been flushed.",
+ .usage = "",
},
{
.name = "pathmove",
-----------------------------------------------------------------------
Summary of changes:
src/jtag/tcl.c | 14 +++++++++-----
src/target/arm_dap.c | 20 ++++++++------------
2 files changed, 17 insertions(+), 17 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|