Updated 2014-12-01 12:58:26 by dkf

As the man page for tclvars mentions, one can examine [TBC] by generation of Tcl with TCL_COMPILE_DEBUG, followed by execution in a run-time context with at least one of tcl_traceCompile and tcl_traceExec non-zero.

DKF provides a different formula, relying on --enable-symbols=compile, in this [1] comp.lang.tcl posting.

[Tcl 8.5] now has the tcl::unsupported::disassemble command, which is available in even non-symbols builds of Tcl and which generates output in a much more useful way (i.e. as a Tcl result, not by printing directly to C stdout).

[Tcl 8.6.3] now has the tcl::unsupported::getbytecode command, which is designed to be much easier for scripts to work with. It's output is only technically human-readable, being a large dictionary…