From 91b9f3de0b8e3277ab5c584c6076ddfe491ffc86 Mon Sep 17 00:00:00 2001 From: Øyvind Harboe Date: Mon, 3 May 2010 17:01:53 +0200 Subject: command context: fix errors when running certain commands on startup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Various commands, e.g. "arm mcr xxxx" would fail if invoked upon startup since it there was no command context defined for the jim interpreter in that case. A Jim interpreter is now associated with a command context(telnet, gdb server's) or the default global command context. Signed-off-by: Øyvind Harboe --- src/jtag/tcl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/jtag/tcl.c') diff --git a/src/jtag/tcl.c b/src/jtag/tcl.c index 579ca9e5..ea6d07e3 100644 --- a/src/jtag/tcl.c +++ b/src/jtag/tcl.c @@ -684,7 +684,7 @@ static int jim_jtag_arp_init(Jim_Interp *interp, int argc, Jim_Obj *const *argv) Jim_WrongNumArgs(goi.interp, 1, goi.argv-1, "(no params)"); return JIM_ERR; } - struct command_context *context = Jim_GetAssocData(interp, "context"); + struct command_context *context = current_command_context(interp); int e = jtag_init_inner(context); if (e != ERROR_OK) { Jim_SetResult_sprintf(goi.interp, "error: %d", e); @@ -701,7 +701,7 @@ static int jim_jtag_arp_init_reset(Jim_Interp *interp, int argc, Jim_Obj *const Jim_WrongNumArgs(goi.interp, 1, goi.argv-1, "(no params)"); return JIM_ERR; } - struct command_context *context = Jim_GetAssocData(interp, "context"); + struct command_context *context = current_command_context(interp); int e = jtag_init_reset(context); if (e != ERROR_OK) { Jim_SetResult_sprintf(goi.interp, "error: %d", e); -- cgit v1.2.3