Javid Jamae
Javid Jamae

Reputation: 9029

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:

enter image description here

Google give me nothing but a few links that point to the message bundles that contain that message in the source code.

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

Upvotes: 4

Views: 2566

Answers (3)

Kalec
Kalec

Reputation: 2891

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.

Upvotes: 0

Javid Jamae
Javid Jamae

Reputation: 9029

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.

Upvotes: 1

keuleJ
keuleJ

Reputation: 3496

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

Upvotes: 0

Related Questions