在Intellij中使用Java调试器时,“Drop Frame”意思? [英] When using the Java debugger in Intellij what does "Drop Frame" mean?

查看:151
本文介绍了在Intellij中使用Java调试器时,“Drop Frame”意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Intellij 8中使用Java调试器,并注意到一个标有drop frame的按钮,有人知道这个服务的目的吗?如何/为什么会被使用/有用?

解决方案

您的应用程序的调用堆栈可以在调试器中查看。使用下降框功能,您可以退回到以前的堆栈框架,在某种意义上回溯到时间。如果您错过了要重新查看的关键点,这将有助于重新输入功能。



如Stack Frame一样,已经成为全局状态(如静态变量,字段值的更改等)将不会被撤销,只有局部变量被重置。这可能导致与最初导致断点的执行路径不同的执行路径。您需要注意这一点 - 我经常认为它是一个有用的功能,可以探索不同的执行路径,而无需重新启动应用程序或导致当前堆栈的特定冗长的进程。结合调试器中可用的变量值的更改,您可以进行各种有趣的事情。



请注意,当然可能有任何副作用发生了 - e。 G。网络流量,文件操作,控制台输出等 - 不能倒带。


I was using the Java debugger within Intellij 8 and noticed a button labeled "drop frame", does anybody know what purpose this serves? How/why would this be used/useful?

解决方案

The call stack of your application can be viewed in the debugger. Using the "Drop Frame" functionality you can "fall back" to a previous stack frame, in a sense going back in time. This can be helpful to re-enter a function if you missed a critical spot you would like to see again.

As the name "Stack Frame" suggests, changes that were already made to global state (like static variables, changes to field values and the like) will not be undone, only local variables are reset. This can lead to a different execution path than the one that originally led to your break point. You need to be aware of this - I often consider it a useful feature to explore different paths of execution without having to restart the application or a particular lengthy process that led to the current stack. Combined with the change of variable values also available through the debugger, you can do all sorts of interesting things.

Please note, that of course, any side effects that might have occurred - e. g. network traffic, file manipulations, console output etc. - cannot be rewound.

这篇关于在Intellij中使用Java调试器时,“Drop Frame”意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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