On 08/11/2010, at 7:46 PM, Antonio Borneo wrote:
> Hi,
>
> after the replacement of JIMTCL with the new version, the command
> "puts" does not work as before.
> It prints nothing in the telnet connection, while is still working in
> the default console.
> Looking at the code, the reason is that the new jimtcl only prints to stdout.
> Of course, it's possible to modify jimtcl library, but the
> modification is quite invasive, and we would diverge from the main
> branch.
>
> The solution I propose, is to switch away from "puts", in favour of "echo".
> The advantage is that "echo" is part of OpenOCD, so no change is
> required inside jimtcl.
>
> 1) the first patch in attachment enhances "echo" with the command
> option "-n", to replace "puts -nonewline"
>
> 2) this patch can be eventually skipped. Anyway, I would like your
> comments on it.
> In order to add help text to "echo" command, I have replaced the
> definition of the command inside the COMMAND_HANDLER syntax.
> Is this correct? In my tests it works properly. I do not know if there
> is any drawback.
>
> 3) this last patch replaces all the "puts" in the tcl files with "echo"
Probably it is a good idea to use echo everywhere for consistency,
but you could simply redefine puts in terms of echo.
proc puts {args} {
tailcall echo {*}$args
}
>
> Best Regards,
> Antonio Borneo
> <0001-JIM-Add-n-option-to-echo.patch><0002-JIM-document-echo-command.patch><0003-TCL-scripts-replace-puts-with-echo.patch.gz>_______________________________________________
> Openocd-development mailing list
> [email protected]
> https://lists.berlios.de/mailman/listinfo/openocd-development
--
µWeb: Embedded Web Framework - http://uweb.workware.net.au/
WorkWare Systems Pty Ltd
W: www.workware.net.au P: 0434 921 300
E: [email protected] F: 07 3102 9221
_______________________________________________
Openocd-development mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/openocd-development