简体   繁体   English

eclipse调试器-在特定位置引发异常时的断点

[英]eclipse debugger - breakpoint when exception is thrown on a specific place

Is it possible to break execution in the debugger of eclipse when exception is thrown on a specific line or in a specific class? 当在特定行或特定类中引发异常时,是否有可能在Eclipse调试器中中断执行?

Globally we can break when exception is thrown easily: Break when exception is thrown 在全球范围内,我们可以在轻松引发异常时中断在引发异常时中断

我没有尝试过,但是当您单击“断点属性”时,也有“过滤”选项卡,您可以在其中指定位置,何时停止或不停止在断点上。

Yes it is possible to break the execution in the debugger of eclipse. 是的,有可能中断Eclipse调试器中的执行。 Only the exceptions thrown (checked and unchecked exceptions) will be able to break the execution. 只有抛出的异常(检查和未检查的异常)才可以中断执行。

You can add the class name in 'Class load breakpoint' to enable to debugger. 您可以在“类加载断点”中添加类名称以启用调试器。 To enable 'Class load breakpoint' Navigate to Eclipse - Menu - Run - Add Class Load Breakpoint - Add your class name. 要启用“类加载断点”,请导航至Eclipse-菜单-运行-添加类加载断点-添加您的类名称。 Refer the snapshot below 请参考下面的快照

添加类负载断点

In case of any specific line in a class you have to manually break the execution using terminate button. 如果类中有任何特定行,则必须使用终止按钮手动中断执行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM