Commit 1ac48e75 authored by oharboe's avatar oharboe
Browse files

OpenOCD commands w/prefix ocd_ now set the primary Tcl return value instead of...

OpenOCD commands w/prefix ocd_ now set the primary Tcl return value instead of messing with ocd_output local variable. Much more straightforward and expected behaviour. The side effect is that the ocd_xxx commands will print output twice(once immediately and once upon completion of command). This is a strange, expected and intentional behaviour.

git-svn-id: svn://svn.berlios.de/openocd/trunk@871 b42882b7-edfa-0310-969c-e2dbd0fdcd60
parent 74eb754a
......@@ -115,7 +115,7 @@ static int script_command(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
log_remove_callback(tcl_output, tclOutput);
/* We dump output into this local variable */
Jim_SetVariableStr(interp, "ocd_output", tclOutput);
Jim_SetResult(interp, tclOutput);
Jim_DecrRefCount(interp, tclOutput);
for (i = 0; i < nwords; i++)
......@@ -205,7 +205,7 @@ command_t* register_command(command_context_t *context, command_t *parent, char
free((void *)full_name);
/* we now need to add an overrideable proc */
const char *override_name=alloc_printf("proc %s%s%s {args} {return [eval \"ocd_%s%s%s $args\"]}", t1, t2, t3, t1, t2, t3);
const char *override_name=alloc_printf("proc %s%s%s {args} {eval \"ocd_%s%s%s $args\";return \"\"}", t1, t2, t3, t1, t2, t3);
Jim_Eval(interp, override_name);
free((void *)override_name);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment