debug 总会停到fileInputStream.class 106行

google一下,看到stackoverflow论坛上有关于这种情况的解决办法

英语不好,就没翻译成汉语。

        

Window > Preferences > Java > Debug : Suspend execution on uncaught exceptions

alt text

Why does Eclipse work that way?

It goes back to 2002, when the breakpoint object hierarchy has been stripped down.

In order to set a breakpoint, with the old API, a client required Java Model Objects - such as ITypeIField, etc. With the new API, all that is required by the debug model is type names, field names, etc.

This allows clients to set breakpoints when Java Model Objects are not available. Clients now specify the resource to associate a breakpoint with (before we constrained it to the associated Java Model resources).

Breakpoints can now also be "hidden". That is, they need not be registered with the breakpoint manager. Breakpoints can also be selectively persisted (markers only allowed all/none of a marker type to be persisted). This makes the debug model more flexible, and gives clients more building blocks.

This has also simplified some part of our Java debug implementation - for example, the feature "suspend on any uncaught exception", simply sets a breakpoint for the type named "java.lang.Throwable", rather than a specific IType in a specific project. The breakpoint is not registered with the breakpoint manager (i.e. hidden) - it is only known and used by one client. Another example is the "run to line breakpoint". The IJavaRunToLineBreakpoint has been removed, as its special functionality is no longer required. Now, the Java debug ui simply creates a "line breakpoint" that is hidden, non persisted, and has a hit count of 1. This is an example of providing building blocks to clients.

-------------------------------------------------------------------------------

 
That did it! Thank you! Now why does Eclipse even work this way? –   skiphoppy  Apr 6 '09 at 21:36
 
It helps detecting those unchecked runtime exception that are uncaught by your code. –   VonC  Apr 6 '09 at 21:42
 
I'm encountering the same behaviour and I didn't uncheck "suspend execution on uhncaught exceptions". I prefer to leave the option checked but I would be interested in knowing which exception occurred, how can I know this? –   HAL9000  Dec 17 '13 at 11:46
 
@HAL9000 if you leave that option checked, shouldn't you see which exception is occurring? By "I'm encountering the same behaviour ", do you mean you have "phantom" breakpoints? –   VonC  Dec 17 '13 at 12:04
 
Yes I mean phantom breakpoints. Sometimes, in a certain line, a phantom breakpoint is triggered. However neither LogCat, nor Console say anything about exceptions. Also the code seems exception-free, then I was wondering about where to look for an exception message. –   HAL9000  Dec 17 '13 at 12:24

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值