Eclipse条件调试 [英] Eclipse conditional debug

查看:119
本文介绍了Eclipse条件调试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否有办法在调试期间在日食中添加条件断点。
样本:if city ==New York然后休息。

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.

推荐答案

是的。右键单击断点,选择断点属性,启用条件,然后输入条件。请注意, city ==New York由于Java中的相等方式,但New York,因此不是一个好的条件。等于(城市)会没事的。请注意,Eclipse允许这样的简单布尔条件,并且在值更改时暂停。

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".

这篇关于Eclipse条件调试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆