如何使用 pdb 逐步执行 Subversion 挂钩脚本?
我已经用谷歌搜索了到目前为止&宽阔,却什么也没发现。我用 Python 为 Subversion 编写了一个预提交钩子。如果我将 pdb.setTrace() 插入到我的钩子脚本中并从命令行手动调用它,我可以像平常一样单步执行它。但是,如果我进行提交 &允许 Subversion 调用脚本,对 setTrace() 的调用会导致脚本将一些回溯信息打印到控制台& die,而不是我想要的,即使用调试器单步执行脚本。
有什么解决办法吗?我只需手动调用它就可以让脚本工作,但我真的希望能够在实际使用它时逐步完成它并详细检查它。
我想调试 CGI 脚本也有类似的问题?
PS:我是在虚拟测试存储库上完成所有这些操作,而不是在真实的测试存储库上。我可能很蠢,但我并不蠢;)
I've Googled for this far & wide and turned up nothing. I've written a pre-commit hook for Subversion in Python. If I insert pdb.setTrace() into my hook script and call it manually from the command-line, I can step through it as normal. However, if I do a commit & allow Subversion to call the script, the call to setTrace() causes the script to print some traceback information to the console & die, instead of what I want, which is to step through the script with a debugger.
Is there any solution for this? I can get the script working by just calling it manually, but I would really like to be able to step through it and examine it in detail when it's being used for real.
I imagine there is an analogous problem with debugging CGI scripts?
PS: I'm doing all this on a dummy test repository, not on the real thing. I may be dumb, but I ain't stupid ;)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
像“远程 pdb”之类的东西在这里可能很有用:
http://snippets.dzone.com/posts /show/7248
Something like a "remote pdb" might be useful here:
http://snippets.dzone.com/posts/show/7248