Conditional breakpoint by caller in Java eclipse

后端 未结 2 832
花落未央
花落未央 2021-02-14 15:06

I am trying to track a change of a value using watchpoint in a Java program in Eclipse debugger. The class hierarchy is pretty complex and the value I am tracking is wrapped in

2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-14 15:18

    It's pretty disgusting and probably slow, but you can use

    Thread.currentThread().getStackTrace()[2].getClassName().contains("A")
    

    as your breakpoint condition.

    Based on this bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=72961 I don't think Eclipse will support it directly

提交回复
热议问题