Eclipse conditional debug

后端 未结 3 1151
独厮守ぢ
独厮守ぢ 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".

提交回复
热议问题