On Fri, Jul 29, 2011 at 7:34 AM, Spencer Oliver <s...@spen-soft.co.uk> wrote: > On 29 July 2011 11:45, Jie Zhang <jzhang...@gmail.com> wrote: >> Hi, >> >> OpenOCD uses script command to execute config file passed through "-f" >> option. script command is defined as a function >> >> proc script {filename} { >> source [find $filename] >> } >> >> Thus when executing the config file, global variables defined in that >> config file is not global any more. If I define a global variable >> >> set foo 1 >> >> in target config file, then trying to read its value by >> >> obj = Jim_GetGlobalVariableStr (interp, "foo", 0); >> Jim_GetLong(interp, obj, &foo); >> > > use global, eg. > global foo > set foo 1 > This trick works, but not pretty. So I asked why we added "script" wrapper for "source" command
Jie _______________________________________________ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development