Discussion:
[OpenOCD-devel] missing tcl commands in 0.10.0
M***@Emerson.com
2017-02-15 18:14:14 UTC
Permalink
I was just trying out the 0.10.0 Windows build of openocd
from www.freddiechopin.info and it seems that some jimtcl
commands are missing. Specifically I noticed that
"file" is not found.

--------
This is from the previous development build:

./openocd-0.10.0-dev-2/bin/openocd.exe \
-c 'puts [info commands f*]; file atime TESTFILE'
Open On-Chip Debugger 0.10.0-dev-00247-g73b676c (2016-03-12-15:04) ...
...
finalize {file copy} for {file delete force} flash function format
flush foreach fconfigure fileevent file find
...
1487147061

Error: Debug Adapter has to be specified, see "interface" command

--------
This is from the 0.10.0 build:

./openocd-0.10.0/bin/openocd.exe \
-c 'puts [info commands f*]; file atime TESTFILE'
Open On-Chip Debugger 0.10.0
...
function format finalize foreach {file copy} for {file delete force}
fileevent flash find
...
invalid command name "file"

--------
$ openocd -c 'puts [info commands f*]; file atime TESTFILE'
Open On-Chip Debugger 0.10.0
...
function format finalize foreach {file copy} for {file delete force}
fileevent flash find
...
invalid command name "file"
---
Mitch
Paul Fertser
2017-02-15 19:09:42 UTC
Permalink
Hello Mitch,
Post by M***@Emerson.com
I was just trying out the 0.10.0 Windows build of openocd
from www.freddiechopin.info and it seems that some jimtcl
commands are missing. Specifically I noticed that
"file" is not found.
Nobody objected to the patch so the jimtcl build got trimmed a
little.

Thank you for the report, I'll send a patch to add "file" back
tomorrow.
--
Be free, use free (http://www.gnu.org/philosophy/free-sw.html) software!
mailto:***@gmail.com
M***@Emerson.com
2017-02-15 20:07:00 UTC
Permalink
Looking a bit closer, it appears there are a number of missing
commands which will probably cause problems in my existing scripts.

The ones that jump out are:

- binary
- cd
- close
- eof
- exec
- file
- glob
- open
- pwd
- read
- seek
- stderr
- tell



For reference, below is a diff between the list of commands in the
dev build and the list of commands in the final release build:

============================================
--- 0.10.0-dev-commands.txt 2017-02-15 12:53:38.041350200 -0700
+++ 0.10.0-commands.txt 2017-02-15 12:53:40.889350200 -0700
@@ -2,8 +2,6 @@

*
/
-{binary format}
-{binary scan}
{dict append}
{dict for}
{dict incr}
@@ -17,36 +15,6 @@
{file copy}
{file delete force}
{info nameofexecutable}
-{namespace code}
-{namespace delete}
-{namespace import}
-{namespace info}
-{namespace inscope}
-{namespace origin}
-{namespace upvar}
-{namespace which}
-{tree children}
-{tree classname}
-{tree classvars}
-{tree depth}
-{tree destroy}
-{tree dump}
-{tree eval}
-{tree finalize}
-{tree get}
-{tree getall}
-{tree insert}
-{tree keyexists}
-{tree lappend}
-{tree method}
-{tree methods}
-{tree new}
-{tree next}
-{tree numchildren}
-{tree parent}
-{tree set}
-{tree vars}
-{tree walk}
+
adapter_khz
adapter_name
@@ -61,15 +29,11 @@
apply
armv4_5
array
-binary
-binary::nextarg
+bindto
break
capture
catch
-cd
-class
clock
-close
collect
command
concat
@@ -83,21 +47,16 @@
dict
echo
env
-eof
error
errorInfo
eval
-exec
exists
exit
expr
-fconfigure
-file
fileevent
finalize
find
flash
-flush
for
foreach
format
@@ -111,14 +70,8 @@
gdb_sync
gdb_target_description
getref
-gets
-glob
-glob.explode
-glob.glob
-glob.globdir
global
help
-history
if
incr
info
@@ -149,7 +102,6 @@
list
llength
lmap
-load
local
log_output
loop
@@ -163,7 +115,6 @@
measure_clk
mflash
ms
-namespace
nand
new_target_name
noinit
@@ -173,6 +124,7 @@
ocd_add_help_text
ocd_add_script_search_dir
ocd_add_usage_text
+ocd_bindto
ocd_bouncer
ocd_command
ocd_debug_level
@@ -214,9 +166,6 @@
ocd_telnet_port
ocd_transport
ocd_usage
-open
-pack
-package
parray
pid
pld
@@ -228,11 +177,8 @@
program
program_error
puts
-pwd
rand
range
-read
-readdir
ref
regexp
regsub
@@ -241,7 +187,6 @@
return
scan
script
-seek
set
set_default_target_event
setref
@@ -253,9 +198,6 @@
srst_deasserted
stackdump
stacktrace
-stderr
-stdin
-stdout
stlink
stlink_device_desc
stlink_layout
@@ -268,23 +210,18 @@
stm32x
string
subst
-super
switch
tailcall
target
targets
-tcl::prefix
tcl_notifications
tcl_port
tcl_trace
-tell
telnet_port
throw
time
transport
-tree
try
-unpack
unset
upcall
update
@@ -294,7 +231,6 @@
using_hla
using_jtag
using_swd
-variable
version
vwait
while
============================================
-----Original Message-----
Sent: Wednesday, February 15, 2017 12:10 PM
To: Frazier, Mitch [AUTOSOL/FLMC/US]
Subject: Re: [OpenOCD-devel] missing tcl commands in 0.10.0
Hello Mitch,
Post by M***@Emerson.com
I was just trying out the 0.10.0 Windows build of openocd
from www.freddiechopin.info and it seems that some jimtcl
commands are missing. Specifically I noticed that
"file" is not found.
Nobody objected to the patch so the jimtcl build got trimmed a
little.
Thank you for the report, I'll send a patch to add "file" back
tomorrow.
--
Be free, use free (http://www.gnu.org/philosophy/free-sw.html)
software!
Paul Fertser
2017-02-18 10:50:06 UTC
Permalink
Post by M***@Emerson.com
Looking a bit closer, it appears there are a number of missing
commands which will probably cause problems in my existing scripts.
Please see if http://openocd.zylin.com/4001 covers your usecases.
--
Be free, use free (http://www.gnu.org/philosophy/free-sw.html) software!
mailto:***@gmail.com
M***@Emerson.com
2017-02-27 16:15:27 UTC
Permalink
I built a new openocd exe with the changes from your patch, and that does indeed fix the problem for me.
-----Original Message-----
Sent: Saturday, February 18, 2017 3:50 AM
To: Frazier, Mitch [AUTOSOL/FLMC/US]
Subject: Re: [OpenOCD-devel] missing tcl commands in 0.10.0
Post by M***@Emerson.com
Looking a bit closer, it appears there are a number of missing
commands which will probably cause problems in my existing scripts.
Please see if http://openocd.zylin.com/4001 covers your usecases.
--
Be free, use free (http://www.gnu.org/philosophy/free-sw.html)
software!
M***@Emerson.com
2017-03-07 15:32:17 UTC
Permalink
info commands file
file
info commands glob
# no output
info commands binary
# no output

Note that both these extensions are pure tcl extensions.


This is the relevant part from my modified configure.ac:

AS_IF([test "x$use_internal_jimtcl" = "xyes"], [
AS_IF([test -f "$srcdir/jimtcl/configure.ac"], [
AX_CONFIG_SUBDIR_OPTION([jimtcl], [--disable-install-jim --with-ext="eventloop array clock regexp stdlib tclcompat aio binary exec file glob" --without-ext="default"])
], [
AC_MSG_ERROR([jimtcl not found, run git submodule init and git submodule update.])
])
])

I reran bootstrap after modifying the file.

The jimtcl build directory does appear to have built and called the initialization code for both extensions, but neither seems to be present.
-----Original Message-----
From: Frazier, Mitch [AUTOSOL/FLMC/US]
Sent: Monday, February 27, 2017 9:15 AM
To: 'Paul Fertser'
Subject: RE: [OpenOCD-devel] missing tcl commands in 0.10.0
I built a new openocd exe with the changes from your patch, and that
does indeed fix the problem for me.
-----Original Message-----
Sent: Saturday, February 18, 2017 3:50 AM
To: Frazier, Mitch [AUTOSOL/FLMC/US]
Subject: Re: [OpenOCD-devel] missing tcl commands in 0.10.0
Post by M***@Emerson.com
Looking a bit closer, it appears there are a number of missing
commands which will probably cause problems in my existing scripts.
Please see if http://openocd.zylin.com/4001 covers your usecases.
--
Be free, use free (http://www.gnu.org/philosophy/free-sw.html) software!
M***@Emerson.com
2017-03-08 15:21:15 UTC
Permalink
I did some more debugging on this and found that the "glob" and "binary" commands fail to load due to the fact that the "package" command is not included in the build.

Adding "package" to the "--with-ext" option in configure.ac fixes the problem, but possibly the "better" solution is to add the dependency to auto.def. The following patch does that. I also added the dependency to "rlprompt" and "tree", which also require "package" Both approaches fix the problem.


diff --git a/auto.def b/auto.def
index fc32b68..a692eb7 100644
--- a/auto.def
+++ b/auto.def
@@ -286,17 +286,17 @@ dict set extdb attrs {
# check=[expr] expression to evaluate to determine if the extension can be used
# libdep=list of 'define' symbols for dependent libraries
dict set extdb info {
- binary { dep pack }
+ binary { dep {package pack} }
exec { check {([have-feature vfork] && [have-feature waitpid]) || [have-feature system]} }
- glob { dep readdir }
+ glob { dep {package readdir} }
load { check {[have-feature dlopen-compat] || [cc-check-function-in-lib dlopen dl]} libdep lib_dlopen }
mk { check {[check-metakit]} libdep lib_mk }
namespace { dep nshelper }
posix { check {[have-feature waitpid]} }
readdir { check {[have-feature opendir]} }
readline { pkg-config readline check {[cc-check-function-in-lib readline readline]} libdep lib_readline}
- rlprompt { dep readline }
- tree { dep oo }
+ rlprompt { dep {package readline} }
+ tree { dep {package oo} }
sdl { pkg-config SDL_gfx check {[cc-check-function-in-lib SDL_SetVideoMode SDL] && [cc-check-function-in-lib rectangleRGBA SDL_gfx]}
libdep {lib_SDL_SetVideoMode lib_rectangleRGBA}
}
@@ -304,7 +304,7 @@ dict set extdb info {
sqlite3 { pkg-config sqlite3 check {[cc-check-function-in-lib sqlite3_prepare_v2 sqlite3]} libdep lib_sqlite3_prepare_v2 }
zlib { pkg-config zlib check {[cc-check-function-in-lib deflate z]} libdep lib_deflate }
syslog { check {[have-feature syslog]} }
- tree { dep oo }
+ tree { dep {package oo} }
win32 { check {[have-feature windows]} }
}

--
-----Original Message-----
From: Frazier, Mitch [AUTOSOL/FLMC/US]
Sent: Tuesday, March 07, 2017 8:32 AM
To: Frazier, Mitch [AUTOSOL/FLMC/US]; 'Paul Fertser'
Subject: RE: [OpenOCD-devel] missing tcl commands in 0.10.0
Looks like I jumped the gun: this does not entirely fix my problem.
info commands file
file
info commands glob
# no output
info commands binary
# no output
Note that both these extensions are pure tcl extensions.
AS_IF([test "x$use_internal_jimtcl" = "xyes"], [
AS_IF([test -f "$srcdir/jimtcl/configure.ac"], [
AX_CONFIG_SUBDIR_OPTION([jimtcl], [--disable-install-jim --with-
ext="eventloop array clock regexp stdlib tclcompat aio binary exec file
glob" --without-ext="default"])
], [
AC_MSG_ERROR([jimtcl not found, run git submodule init and git
submodule update.])
])
])
I reran bootstrap after modifying the file.
The jimtcl build directory does appear to have built and called the
initialization code for both extensions, but neither seems to be
present.
-----Original Message-----
From: Frazier, Mitch [AUTOSOL/FLMC/US]
Sent: Monday, February 27, 2017 9:15 AM
To: 'Paul Fertser'
Subject: RE: [OpenOCD-devel] missing tcl commands in 0.10.0
I built a new openocd exe with the changes from your patch, and that
does indeed fix the problem for me.
-----Original Message-----
Sent: Saturday, February 18, 2017 3:50 AM
To: Frazier, Mitch [AUTOSOL/FLMC/US]
Subject: Re: [OpenOCD-devel] missing tcl commands in 0.10.0
Post by M***@Emerson.com
Looking a bit closer, it appears there are a number of missing
commands which will probably cause problems in my existing
scripts.
Please see if http://openocd.zylin.com/4001 covers your usecases.
--
Be free, use free (http://www.gnu.org/philosophy/free-sw.html) software!
Continue reading on narkive:
Loading...