开发者

How do you set Instance Breakpoints in Eclipse?

I'm running Eclipse 3.5 and I'm trying to set an "Instance Breakpoint". I've hit a breakpoint in the debugger, and from the Variables view, I right-click on the object instance I want to set a breakpoint for and click on "Instance Breakpoints..."

Then, I get this:

How do you set Instance Breakpoints in Eclipse?

Google give me nothing but a few links that point to the message bundles that contain that mes开发者_StackOverflow中文版sage in the source code.

How can I set a breakpoint on the specific object instance I care about?


You have to have a breakpoint (or watchpoint) where the type of the instance you're trying to break on is going to be in the stack. If one or more such breakpoints exist, then a dialog pops up letting you select the ones that you want to restrict to only apply to the given object instance.

A "watch this instance" feature that automatically sets a watchpoint that only applies to the selected object instance would have been nice too, but at least you can do it.


I think you want to add a "Watchpoint". Right-click a instance-variable in the Debugger.


How I know to do it is like this:

Set a breakpoint or watchpoint in some class, wait for it to trigger in debug mode.
In the "Variables" view, right click on "this" -> instance breakpoints... -> select form a list of breakpoints in this class -> click ok.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜