summaryrefslogtreecommitdiff
path: root/src/helper
diff options
context:
space:
mode:
authorZachary T Welch <zw@superlucidity.net>2009-11-20 09:11:39 -0800
committerZachary T Welch <zw@superlucidity.net>2009-11-20 14:52:56 -0800
commite5b0a69ba99f58991ebb5d07ad947592f09728f1 (patch)
tree682a3660fa38147f40703c07fcef30e65402df03 /src/helper
parent5458fef43ca7072312440301a9469c686ca641e2 (diff)
downloadopenocd+libswd-e5b0a69ba99f58991ebb5d07ad947592f09728f1.tar.gz
openocd+libswd-e5b0a69ba99f58991ebb5d07ad947592f09728f1.tar.bz2
openocd+libswd-e5b0a69ba99f58991ebb5d07ad947592f09728f1.tar.xz
openocd+libswd-e5b0a69ba99f58991ebb5d07ad947592f09728f1.zip
provide command context during cmd_init
For the startup.tcl code to use built-in commands, the context must be associated with the interpreter temporarily. This will be required to add help text.
Diffstat (limited to 'src/helper')
-rw-r--r--src/helper/command.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/helper/command.c b/src/helper/command.c
index f135bb03..0958147e 100644
--- a/src/helper/command.c
+++ b/src/helper/command.c
@@ -869,12 +869,14 @@ struct command_context* command_init(const char *startup_tcl)
#if !BUILD_ECOSBOARD
Jim_EventLoopOnLoad(interp);
#endif
+ Jim_SetAssocData(interp, "context", NULL, context);
if (Jim_Eval_Named(interp, startup_tcl, "embedded:startup.tcl",1) == JIM_ERR)
{
LOG_ERROR("Failed to run startup.tcl (embedded into OpenOCD)");
Jim_PrintErrorMessage(interp);
exit(-1);
}
+ Jim_DeleteAssocData(interp, "context");
register_command(context, NULL, "sleep",
handle_sleep_command, COMMAND_ANY,