我正在查看 Delphi 的出色 dwscript,请参见此处,它提供了一组有用的类来为您的应用程序实现内置的 pascal 脚本。对于如何将提供的调试接口与编辑器链接在一起的示例,我将非常感谢一些帮助,以便我可以创建断点(理想情况下可以查看手表)。请问有人走过这条路吗?谢谢,布赖恩
1 回答
Most of the debugger doc is currently in this post
http://delphitools.info/2010/12/03/spotlight-on-dwss-idebugger/
Also the debugger interface hasn't changed much (if at all) since the original DWScript II (on SourceForge), so the old demos there should hopefully still work with minimal adjustments.
http://sourceforge.net/projects/dws/
For breakpoints, you basically just check the source position of the Expr you get in DoDebug/OnDebug against the list of breakpoints. One simple and efficient way is to merely use TBits -using it as a boolean array of which lines have a breakpoint). Evaluating/watching requires looking up a symbol, which will give you it's stack address, you can then lookup the value in the stack.
I'll try to add/update a debugging tasks demo for v2.2 (unless someone else does it before me ;) )
edit: as of 11-02-14 there is a TdwsDebugger
component to facilitate debugging tasks.