gpt4 book ai didi

java - IntelliJ 调试器 : Can I always apply an expression automatically at a breakpoint?

转载 作者:行者123 更新时间:2023-12-05 01:04:03 25 4
gpt4 key购买 nike

IntelliJ 的调试器中是否有任何方法可以始终:

a) 将结果设置为 true 或

b) 使 foo() 返回 true

我知道我可以在断点时更改变量,但我希望它始终自动发生,而不更改代码,因为它是一个反编译的类。

public void foo() {
boolean result = false;
..
return result;
}

最佳答案

return 行上添加断点, 在断点属性中未设置“暂停”,将“评估和记录”设置为 result = true .

如果有多个 return在方法中,您需要修改 result在他们所有人之前的值(value)。

enter image description here

关于java - IntelliJ 调试器 : Can I always apply an expression automatically at a breakpoint?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58627167/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com