views:

11

answers:

1

Is there a way to put a conditional breakpoint which won't be hit when the method the breakpoint is in is called from other specified method?

(I'm using IDEA 9.0.1)

+1  A: 

There is no such feature for the conditional breakpoints, however you can achieve similar behavior by using the breakpoint dependencies.

Here you can set a breakpoint the current one will depend on. Thus the dependent, slave breakpoint is conditionally disabled - it becomes enabled only if the master breakpoint is hit. Moreover, after the dependent breakpoint is hit, it becomes disabled again until the master is hit next time. Hence you can form cascades of dependent breakpoints to satisfy any requirements. This feature works with all other conditions, filters, etc.

CrazyCoder
Looks like a nice feature, though in the case I needed it it would be more convenient to use an exclusive approach so that the breakpoint is not hit when the method is called from within a certain method and it is hit in all other cases. It might work with the dependency feature if it disabled the slave breakpoint when the master breakpoint is hit and re-enabled it afterwards.
axk

related questions