diff --git a/src/helper/command.c b/src/helper/command.c index 4422b4abe..14746a095 100644 --- a/src/helper/command.c +++ b/src/helper/command.c @@ -126,13 +126,12 @@ extern struct command_context *global_cmd_ctx; /* dump a single line to the log for the command. * Do nothing in case we are not at debug level 3 */ -void script_debug(Jim_Interp *interp, const char *name, - unsigned argc, Jim_Obj * const *argv) +void script_debug(Jim_Interp *interp, unsigned int argc, Jim_Obj * const *argv) { if (debug_level < LOG_LVL_DEBUG) return; - char *dbg = alloc_printf("command - %s", name); + char *dbg = alloc_printf("command -"); for (unsigned i = 0; i < argc; i++) { int len; const char *w = Jim_GetString(argv[i], &len); @@ -213,7 +212,7 @@ static int script_command(Jim_Interp *interp, int argc, Jim_Obj *const *argv) struct command *c = interp->cmdPrivData; assert(c); - script_debug(interp, c->name, argc, argv); + script_debug(interp, argc, argv); return script_command_run(interp, argc, argv, c); } @@ -1032,8 +1031,7 @@ static int run_usage(Jim_Interp *interp, int argc_valid, int argc, Jim_Obj * con static int command_unknown(Jim_Interp *interp, int argc, Jim_Obj *const *argv) { - const char *cmd_name = Jim_GetString(argv[0], NULL); - script_debug(interp, cmd_name, argc, argv); + script_debug(interp, argc, argv); struct command_context *cmd_ctx = current_command_context(interp); struct command *c = cmd_ctx->commands; diff --git a/src/helper/command.h b/src/helper/command.h index 672ccd02b..a20c4620d 100644 --- a/src/helper/command.h +++ b/src/helper/command.h @@ -448,7 +448,6 @@ COMMAND_HELPER(handle_command_parse_bool, bool *out, const char *label); #define COMMAND_PARSE_ENABLE(in, out) \ COMMAND_PARSE_BOOL(in, out, "enable", "disable") -void script_debug(Jim_Interp *interp, const char *cmd, - unsigned argc, Jim_Obj * const *argv); +void script_debug(Jim_Interp *interp, unsigned int argc, Jim_Obj * const *argv); #endif /* OPENOCD_HELPER_COMMAND_H */ diff --git a/src/jtag/tcl.c b/src/jtag/tcl.c index f52cbd606..01210bd69 100644 --- a/src/jtag/tcl.c +++ b/src/jtag/tcl.c @@ -108,7 +108,7 @@ static int Jim_Command_drscan(Jim_Interp *interp, int argc, Jim_Obj *const *args endstate = TAP_IDLE; - script_debug(interp, "drscan", argc, args); + script_debug(interp, argc, args); /* validate arguments as numbers */ e = JIM_OK; @@ -229,7 +229,7 @@ static int Jim_Command_pathmove(Jim_Interp *interp, int argc, Jim_Obj *const *ar return JIM_ERR; } - script_debug(interp, "pathmove", argc, args); + script_debug(interp, argc, args); int i; for (i = 0; i < argc-1; i++) { @@ -261,7 +261,7 @@ static int Jim_Command_pathmove(Jim_Interp *interp, int argc, Jim_Obj *const *ar static int Jim_Command_flush_count(Jim_Interp *interp, int argc, Jim_Obj *const *args) { - script_debug(interp, "flush_count", argc, args); + script_debug(interp, argc, args); Jim_SetResult(interp, Jim_NewIntObj(interp, jtag_get_flush_queue_count()));