pydev 中的异常中断
是否可以让 pydev 调试器在异常时中断?
Is it possible to get the pydev debugger to break on exception?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
是否可以让 pydev 调试器在异常时中断?
Is it possible to get the pydev debugger to break on exception?
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(3)
这是由 PyDev 作者在 Run > 下添加的 管理 Python 异常断点
This was added by the PyDev author, under Run > Manage Python Exception Breakpoints
有任何异常吗?如果我没记错的话,在 PyDev(在 Eclipse 中)中这是可能的。
EDIT: went through it again, checked pdb documentation, can't find a way to set an exception breakpoint.
如果我可以建议一个非常粗略的解决方法,但如果必须的话,您可以从
try- except
块中调用您的程序,在那里设置一个断点,一旦它在except< /code> 块只是进入堆栈并调试您的错误。
另一个编辑此功能已添加到 PyDev
On any exception?If my memory serves me right, in PyDev (in Eclipse) this is possible.
EDIT: went through it again, checked pdb documentation, can't find a way to set an exception breakpoint.
If I may suggest a really crude workaround, but if you must, you can call your program from within a
try-except
block, set a breakpoint there, and once it breaks in theexcept
block just go up the stack and debug your error.Another edit This functionality has been added to PyDev
我已经尝试了大的 try- except 技巧,但它没有按预期工作,你得到了它中断的堆栈,即在 except: 块中,你无法到达从那里引发异常的堆栈,那是没有意义的。
更新:pydev 从 1.6.0 开始确实有异常中断功能,但还没有 UI,需要一些代码:
https://sourceforge.net/tracker/?func =detail&aid=2970886&group_id=85796&atid=577332
I've tried the big try-except trick but it didn't work as expected, you got the stack where it breaks, that is in the except: block, you can't get to the stack where the exception was raised from there, that's pointless.
update: pydev does have break-on-exception facility since 1.6.0, but no UI yet, need some code:
https://sourceforge.net/tracker/?func=detail&aid=2970886&group_id=85796&atid=577332