抛出异常时中断
Visual Studio 可以选择在引发未处理的异常时自动中断调试器,Eclipse 是否有类似的功能?
Visual Studio has an option to break automatically into the debugger when an unhandled exception is thrown, does Eclipse have similar functionality?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以定义要在其上设置断点的精确异常列表,即使这些异常未被捕获(这应该相当于“
unhandled
”)You are able to define the precise list of Exception you want to have a breakpoint on, even if those exceptions are uncaught (which should be the equivalent of "
unhandled
")进入断点窗口,有一个看起来像J!的按钮,在那里你可以为Java异常设置断点,无论是捕获的还是未捕获的。您可以引用类或使用模式匹配器作为异常名称。
另外,在窗口 -> 下首选项,选择 Java ->调试,有一个复选框可以告诉调试器在未捕获的异常上中断
Go to the breakpoints window, there's a button that looks like J!, there you can set breakpoints for Java exceptions, either caught or uncaught. You can reference classes or use pattern matchers for exception names.
Also, under Window -> Preferences, Select Java -> Debug and there's a checkbox to tell the debugger to break on uncaught exceptions