On Tue, Nov 16, 2010 at 2:06 AM, Steve Bennett <ste...@workware.net.au> wrote:
> On 16/11/2010, at 9:27 AM, Andrew Leech wrote:
>
>> Hi all,
>> I've just found a compiling/usage difficulty with the git version on
>> cygwin. Apparently somewhere between 0.4.0 and mainline (possibly
>> jimtcl?) openocd no longer handles dos line endings on config files.
>> Apparently all my config files of my existing 0.4.0 installation have
>> dos line endings and I'd never realised or cared, but I compiled git
>> on cygwin and tried to use it with my existing openocd.cfg and was
>> treated to this error:
>>
>> Open On-Chip Debugger 0.5.0-dev-00589-gfdae512-dirty (2010-11-16-10:00)
>> Licensed under GNU GPL v2
>> For bug reports, read
>>        http://openocd.berlios.de/doc/doxygen/bugs.html
>> Runtime Error: embedded:startup.tcl:57:
>> in procedure 'script'
>> at file "embedded:startup.tcl", line 57
>>
>> This is a very un-user-friendly error message and had me stumped, I
>> though my build was broken or something. It took me a lot of stuffing
>> around with config files to realise it was just a dos2unix on my
>> config file away from working, and now I'm all good.
>> I personally don't have an issue with requiring unix line endings,
>> it's just that this is a nasty way to fail, a cleaner error message
>> would have been useful.
>
> I suspect the problem is here in src/helper/startup.tcl
>
>        set errmsg [format "%s: command requires more arguments" \
>            [concat $name " " $args]]
>
> The backslash newline sequence will likely have a carriage return inserted.
> The easy solution is to ensure that these startup files are read in text mode
> or have the \r\n translated to \n before creating startup_tcl.c
>
> But it would also be nice if each startup script were evaluated independently
> with the original filename, and any error message shown.

A large startup.tcl is generated by the makefiles from many smaller
startup.tcl scripts around the source tree. This startup.tcl is then converted
to .c and linked into openocd. Why? Because it was felt that it was an important
feature to be able to launch openocd without a dependency on the files that
openocd ships with.



-- 
Øyvind Harboe

Can Zylin Consulting help on your project?

US toll free 1-866-980-3434 / International +47 51 63 25 00

http://www.zylin.com/zy1000.html
ARM7 ARM9 ARM11 XScale Cortex
JTAG debugger and flash programmer
_______________________________________________
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to