IDEA:条件断点不会在指定的调用上下文中被触发

时间:2021-02-28 23:00:44

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)

(我正在使用IDEA 9.0.1)

1 个解决方案

#1


1  

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.

在这里,您可以设置当前依赖的断点。因此,依赖的从属断点被有条件地禁用 - 只有在命中主断点时才会启用它。此外,在依赖断点被命中后,它将再次被禁用,直到下次命中主控。因此,您可以形成级联的从属断点以满足任何要求。此功能适用于所有其他条件,过滤器等。

#1


1  

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.

在这里,您可以设置当前依赖的断点。因此,依赖的从属断点被有条件地禁用 - 只有在命中主断点时才会启用它。此外,在依赖断点被命中后,它将再次被禁用,直到下次命中主控。因此,您可以形成级联的从属断点以满足任何要求。此功能适用于所有其他条件,过滤器等。