TCL脚本调试

发布于 2024-10-30 19:40:41 字数 1539 浏览 3 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

紫轩蝶泪 2024-11-06 19:40:41

我所知道的最好的 Tcl 调试器是 ActiveState 的 TclDevKit 的一部分;它不是免费的,但强烈推荐。 (还有 21 天免费试用版。)

还有其他选项可用。一方面,Tcl 的内置 trace 命令使得添加您自己的断点、观察点、执行单步跟踪等变得非常简单。然而,缺乏适当的免费集成工具(正是因为作为一个社区,我们与 ActiveState 团队相处得很好)。不过,您可能会发现下一个代码示例很有用:

跟踪所有命令调用:

# overwrite at each invocation of this script; pick somewhere else if you prefer
set _Trace_fd [open "/tmp/tcltrace.tmp" w]
fconfigure $_Trace_fd -buffering line

rename proc _proc
_proc proc {name arglist body} {
    uplevel [list _proc $name $arglist $body]
    uplevel trace add execution $name enterstep {::apply {{name cmd op} {
        puts $::_Trace_fd "$name >> $cmd"
    }}}
}

注意,这会使用典型代码产生相当多的输出...

The best debugger I know of for Tcl is part of ActiveState's TclDevKit; it's non-free, but highly recommended. (There's also a free 21-day trial available.)

Other options are available. For one thing, Tcl's built-in trace command makes it pretty simple to add in your own breakpoints, watchpoints, do single-step tracing, etc. Yet there's something of a lack of proper free integrated tools (precisely because as a community we get on really well with the ActiveState crew). Still, you might find the next code sample useful:

Trace all command calls:

# overwrite at each invocation of this script; pick somewhere else if you prefer
set _Trace_fd [open "/tmp/tcltrace.tmp" w]
fconfigure $_Trace_fd -buffering line

rename proc _proc
_proc proc {name arglist body} {
    uplevel [list _proc $name $arglist $body]
    uplevel trace add execution $name enterstep {::apply {{name cmd op} {
        puts $::_Trace_fd "$name >> $cmd"
    }}}
}

Note, this produces rather a lot of output with typical code...

会发光的星星闪亮亮i 2024-11-06 19:40:41

TCL是调试TCL的好工具。查看 trace 命令。还有信息winfo 可能很有用。如果您想要将这些内容封装到更传统的调试器中,可以在 http://wiki.tcl.tk 找到一个列表/473

TCL is a good tool for debugging TCL. have a look at the trace command. Also info and winfo can be useful. if you want something which wraps these up into a more traditional debugger there is a list at http://wiki.tcl.tk/473

ま柒月 2024-11-06 19:40:41

tcl'ers wiki 中已经提到的列表是一个很好的资源,尽管 ActiveState TclDevKit 调试器是最好的可用调试器(也是基于 Eclipse 的 Tcl IDE 使用的调试器),但还有一些其他选项。

其中一个可能是 RamDebugger: http://www.compassis.com/ramdebugger/Intro

The already mentioned list at the tcl'ers wiki is a good resource, and even though the ActiveState TclDevKit debugger is the best available (and also the one used by the Eclipse based Tcl IDE), there are a few other options.

One might be RamDebugger: http://www.compassis.com/ramdebugger/Intro

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文