diff options
author | Øyvind Harboe <oyvind.harboe@zylin.com> | 2010-05-03 17:01:53 +0200 |
---|---|---|
committer | Øyvind Harboe <oyvind.harboe@zylin.com> | 2010-05-05 15:24:24 +0200 |
commit | 91b9f3de0b8e3277ab5c584c6076ddfe491ffc86 (patch) | |
tree | 21967095062de948d60d9ffe775217a7a720b7fa /src/jtag | |
parent | 7e33f87b3d25331f3ac366c88e0b0ebb196422ec (diff) |
command context: fix errors when running certain commands on startup
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 <oyvind.harboe@zylin.com>
Diffstat (limited to 'src/jtag')
-rw-r--r-- | src/jtag/tcl.c | 4 |
1 files changed, 2 insertions, 2 deletions
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); |