|
From: openocd-gerrit <ope...@us...> - 2025-05-25 12:42:57
|
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 3c7725ea703e186c9d9ced3b0e03231982abdbfd (commit)
via 6cec67251d29a4a62d330ff6289807babee04fda (commit)
from e9c78512b30b13fc6a9714e3fad0074bc2387bb5 (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 3c7725ea703e186c9d9ced3b0e03231982abdbfd
Author: Antonio Borneo <bor...@gm...>
Date: Thu Dec 22 12:34:41 2022 +0100
checkpatch: drop camelcase symbols not used anymore
With the rewrite of jim_handler commands as COMMAND_HANDLER, some
camelcase symbol from jimtcl are not referenced anymore in OpenOCD
code.
Drop such symbols from the camelcase whitelist.
Change-Id: I723be1820f13fe2cec7e4f0512a5e9da12889199
Signed-off-by: Antonio Borneo <bor...@gm...>
Reviewed-on: https://review.openocd.org/c/openocd/+/8902
Tested-by: jenkins
diff --git a/tools/scripts/camelcase.txt b/tools/scripts/camelcase.txt
index 6c6c28daa..058df4d80 100644
--- a/tools/scripts/camelcase.txt
+++ b/tools/scripts/camelcase.txt
@@ -87,20 +87,14 @@ Jim_AppendString
Jim_AppendStrings
Jim_Cmd
Jim_CmdPrivData
-Jim_CmdProc
-Jim_CompareStringImmediate
-Jim_ConcatObj
Jim_CreateCommand
Jim_CreateInterp
Jim_DecrRefCount
-Jim_DelCmdProc
Jim_DeleteAssocData
Jim_DeleteCommand
-Jim_DictAddElement
Jim_DictPairs
Jim_DuplicateObj
Jim_Eval
-Jim_EvalExpression
Jim_EvalObj
Jim_EvalObjPrefix
Jim_EvalSource
@@ -113,46 +107,31 @@ Jim_GetDouble
Jim_GetEnum
Jim_GetExitCode
Jim_GetGlobalVariableStr
-Jim_GetIntRepPtr
-Jim_GetLong
Jim_GetResult
Jim_GetString
-Jim_GetVariable
Jim_GetWide
Jim_IncrRefCount
Jim_InitStaticExtensions
Jim_Interp
-Jim_Length
-Jim_ListAppendElement
Jim_ListGetIndex
Jim_ListLength
Jim_MakeErrorMessage
-Jim_NewDictObj
Jim_NewEmptyStringObj
Jim_NewIntObj
-Jim_NewListObj
Jim_NewStringObj
-Jim_NewWideObj
Jim_Obj
Jim_ProcessEvents
Jim_RegisterCoreCommands
Jim_SetAssocData
Jim_SetEmptyResult
Jim_SetResult
-Jim_SetResultBool
Jim_SetResultFormatted
-Jim_SetResultInt
Jim_SetResultString
-Jim_SetVariable
Jim_String
Jim_WrongNumArgs
cmdProc
-currentScriptObj
-delProc
-emptyObj
privData
returnCode
-typePtr
# from elf.h
Elf32_Addr
commit 6cec67251d29a4a62d330ff6289807babee04fda
Author: Antonio Borneo <bor...@gm...>
Date: Sat Dec 16 17:39:12 2023 +0100
command: drop Jim Command handler, at last
With all OpenOCD commands converted to COMMAND_HANDLER, we can
drop the management of jim_handler commands.
Drop also from documentation the subsection on Jim Command
Registration.
Change-Id: I4d13abc7e384e64ecb155cb40bbbd52bb79ec672
Signed-off-by: Antonio Borneo <bor...@gm...>
Reviewed-on: https://review.openocd.org/c/openocd/+/8901
Tested-by: jenkins
diff --git a/doc/manual/helper.txt b/doc/manual/helper.txt
index 6cf3c977b..29e84e6f0 100644
--- a/doc/manual/helper.txt
+++ b/doc/manual/helper.txt
@@ -97,18 +97,6 @@ registration, while the @c unregister_command() and
These may be called at any time, allowing the command set to change in
response to system actions.
-@subsection helpercmdjim Jim Command Registration
-
-The command_registration structure provides support for registering
-native Jim command handlers (@c jim_handler) too. For these handlers,
-the module can provide help and usage support; however, this mechanism
-allows Jim handlers to be called as sub-commands of other commands.
-These commands may be registered with a private data value (@c
-jim_handler_data) that will be available when called, as with low-level
-Jim command registration.
-
-A command may have a normal @c handler or a @c jim_handler, but not both.
-
@subsection helpercmdregisterchains Command Chaining
When using register_commands(), the array of commands may reference
diff --git a/src/helper/command.c b/src/helper/command.c
index 218f0581e..b70081a4d 100644
--- a/src/helper/command.c
+++ b/src/helper/command.c
@@ -130,13 +130,13 @@ static struct command *command_new(struct command_context *cmd_ctx,
assert(cr->name);
/*
- * If it is a non-jim command with no .usage specified,
+ * If it is a command with no .usage specified,
* log an error.
*
* strlen(.usage) == 0 means that the command takes no
* arguments.
*/
- if (!cr->jim_handler && !cr->usage)
+ if (!cr->usage)
LOG_ERROR("BUG: command '%s' does not have the "
"'.usage' field filled out",
full_name);
@@ -152,7 +152,6 @@ static struct command *command_new(struct command_context *cmd_ctx,
}
c->handler = cr->handler;
- c->jim_handler = cr->jim_handler;
c->mode = cr->mode;
if (cr->help || cr->usage)
@@ -425,9 +424,6 @@ static bool command_can_run(struct command_context *cmd_ctx, struct command *c,
static int exec_command(Jim_Interp *interp, struct command_context *context,
struct command *c, int argc, Jim_Obj * const *argv)
{
- if (c->jim_handler)
- return c->jim_handler(interp, argc, argv);
-
/* use c->handler */
const char **words = malloc(argc * sizeof(char *));
if (!words) {
@@ -841,7 +837,7 @@ static int jim_command_dispatch(Jim_Interp *interp, int argc, Jim_Obj * const *a
script_debug(interp, argc, argv);
struct command *c = jim_to_command(interp);
- if (!c->jim_handler && !c->handler) {
+ if (!c->handler) {
Jim_EvalObjPrefix(interp, Jim_NewStringObj(interp, "usage", -1), 1, argv);
return JIM_ERR;
}
diff --git a/src/helper/command.h b/src/helper/command.h
index 18fe56178..8bd2430e0 100644
--- a/src/helper/command.h
+++ b/src/helper/command.h
@@ -197,7 +197,6 @@ typedef __COMMAND_HANDLER((*command_handler_t));
struct command {
char *name;
command_handler_t handler;
- Jim_CmdProc *jim_handler;
void *jim_handler_data;
/* Command handlers can use it for any handler specific data */
struct target *jim_override_target;
@@ -234,7 +233,6 @@ static inline struct command *jim_to_command(Jim_Interp *interp)
struct command_registration {
const char *name;
command_handler_t handler;
- Jim_CmdProc *jim_handler;
enum command_mode mode;
const char *help;
/** a string listing the options and arguments, required or optional */
diff --git a/src/server/telnet_server.c b/src/server/telnet_server.c
index 2c3f76980..3634a2a59 100644
--- a/src/server/telnet_server.c
+++ b/src/server/telnet_server.c
@@ -671,7 +671,7 @@ static void telnet_auto_complete(struct connection *connection)
} else if (jimcmd_is_oocd_command(jim_cmd)) {
struct command *cmd = jimcmd_privdata(jim_cmd);
- if (cmd && !cmd->handler && !cmd->jim_handler) {
+ if (cmd && !cmd->handler) {
/* Initial part of a multi-word command. Ignore it! */
ignore_cmd = true;
} else if (cmd && cmd->mode == COMMAND_CONFIG) {
-----------------------------------------------------------------------
Summary of changes:
doc/manual/helper.txt | 12 ------------
src/helper/command.c | 10 +++-------
src/helper/command.h | 2 --
src/server/telnet_server.c | 2 +-
tools/scripts/camelcase.txt | 21 ---------------------
5 files changed, 4 insertions(+), 43 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|