Break when exception is thrown

安稳与你 提交于 2019-11-26 02:06:00

问题


Visual Studio has an option to break automatically into the debugger when an unhandled exception is thrown, does Eclipse have similar functionality?


回答1:


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")




回答2:


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



来源:https://stackoverflow.com/questions/3066199/break-when-exception-is-thrown

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!