On Sunday 27 September 2009, Freddie Chopin wrote:
> > 
> > If it doesn't ... seems buggish, but maybe you
> > could declare it as a global.
> 
> I works when I use a wrapper script, but doesn't work when I use
> -c "set CRYSTAL_FREQ 12000000" -f target/lpc2103.cfg

In fact the same thing happens if you set it in one *.cfg
file and try to reference it from another, with both of
them given as "-f ..." on the command line.

I had the equivalent of one "-f file1.cfg" with

        global J4
        set J4 "NAND"
        proc show_j4 {} { echo SHOW...; echo $J4 }

with another "-f file2.cfg" calling show_j4 ... result was
a Tcl error claiming there's no such variable as J4.


At first glance, the bug seems caused by command_run_line() 
going through some effort to make sure that it doesn't
reuse key parts of the execution environment.  That seems
misguided to me, perhaps associated with the notion that
there be only *one* Tcl interpreter.  From what I recall
back in the early days of Tcl, interpreters are supposed
to be extremely lightweight ... the way to avoid reuse is
to have your own interpreter/context instance handle.

- Dave

_______________________________________________
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to