summaryrefslogtreecommitdiff
path: root/src/target/armv4_5.c
diff options
context:
space:
mode:
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
commit91b9f3de0b8e3277ab5c584c6076ddfe491ffc86 (patch)
tree21967095062de948d60d9ffe775217a7a720b7fa /src/target/armv4_5.c
parent7e33f87b3d25331f3ac366c88e0b0ebb196422ec (diff)
downloadopenocd+libswd-91b9f3de0b8e3277ab5c584c6076ddfe491ffc86.tar.gz
openocd+libswd-91b9f3de0b8e3277ab5c584c6076ddfe491ffc86.tar.bz2
openocd+libswd-91b9f3de0b8e3277ab5c584c6076ddfe491ffc86.tar.xz
openocd+libswd-91b9f3de0b8e3277ab5c584c6076ddfe491ffc86.zip
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/target/armv4_5.c')
-rw-r--r--src/target/armv4_5.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/target/armv4_5.c b/src/target/armv4_5.c
index eeb6694c..1a84a5f4 100644
--- a/src/target/armv4_5.c
+++ b/src/target/armv4_5.c
@@ -820,11 +820,9 @@ static int jim_mcrmrc(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
struct arm *arm;
int retval;
- context = Jim_GetAssocData(interp, "context");
- if (context == NULL) {
- LOG_ERROR("%s: no command context", __func__);
- return JIM_ERR;
- }
+ context = current_command_context(interp);
+ assert( context != NULL);
+
target = get_current_target(context);
if (target == NULL) {
LOG_ERROR("%s: no current target", __func__);