aboutsummaryrefslogtreecommitdiff
path: root/src/openocd.c
diff options
context:
space:
mode:
authoroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-07-09 15:22:05 +0000
committeroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-07-09 15:22:05 +0000
commit66410d2537bad8e455e803d1868e7de6bf8cabbd (patch)
tree7f49709672e23ed31eacffd26cd7929d88c46650 /src/openocd.c
parent525de2ed3d019bccffe3f060b3fee7baa5487425 (diff)
downloadriscv-openocd-66410d2537bad8e455e803d1868e7de6bf8cabbd.zip
riscv-openocd-66410d2537bad8e455e803d1868e7de6bf8cabbd.tar.gz
riscv-openocd-66410d2537bad8e455e803d1868e7de6bf8cabbd.tar.bz2
"flash banks" is now implemented in Tcl on top of "flash_banks". openocd_throw prefix is no longer required when executing OpenOCD commands from tcl.
git-svn-id: svn://svn.berlios.de/openocd/trunk@779 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src/openocd.c')
-rw-r--r--src/openocd.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/openocd.c b/src/openocd.c
index 4698fc1..b2a8ade 100644
--- a/src/openocd.c
+++ b/src/openocd.c
@@ -379,6 +379,12 @@ int jim_command(command_context_t *context, char *line)
line = Jim_GetString(objPtr, NULL);
LOG_USER_N("In procedure '%s' called at file \"%s\", line %s" JIM_NL, proc, file, line);
}
+ long t;
+ if (Jim_GetLong(interp, Jim_GetVariableStr(interp, "openocd_result", JIM_ERRMSG), &t)==JIM_OK)
+ {
+ return t;
+ }
+ return ERROR_FAIL;
} else if (retcode == JIM_EXIT) {
/* ignore. */
/* exit(Jim_GetExitCode(interp)); */
@@ -419,6 +425,13 @@ static int Jim_Command_openocd_ignore(Jim_Interp *interp, int argc, Jim_Obj *con
log_add_callback(tcl_output, tclOutput);
retval=command_run_line_internal(active_cmd_ctx, cmd);
+
+ /* we need to be able to get at the retval, so we store in a variable
+ */
+ Jim_Obj *resultvar=Jim_NewIntObj(interp, retval);
+ Jim_IncrRefCount(resultvar);
+ Jim_SetGlobalVariableStr(interp, "openocd_result", resultvar);
+ Jim_DecrRefCount(interp, resultvar);
if (startLoop)
{