Eclipse conditional debug

后端 未结 3 1060
独厮守ぢ
独厮守ぢ 2021-01-05 19:33

I\'m wondering if there is a way to add a conditional break point in eclipse while debuging. Sample: if city==\"New York\" then break.

相关标签:
3条回答
  • 2021-01-05 20:29

    Yes. Right-click on the breakpoint, select "Breakpoint properties", enable "Conditional" and then enter the condition. Note that city == "New York" wouldn't be a good condition due to the way equality works in Java, but "New York".equals(city) would be fine. Note that Eclipse allows simple Boolean conditions like this, and also "suspend when value changes".

    0 讨论(0)
  • 2021-01-05 20:37

    Open the context menu over a break point on the left bar of the code editor, select "Breakppoint properties..." and "Enable condition"

    0 讨论(0)
  • 2021-01-05 20:39

    Here is the detailed tutorials. http://wiki.eclipse.org/FAQ_How_do_I_set_a_conditional_breakpoint%3F

    0 讨论(0)
提交回复
热议问题