在Intellij中使用Java调试器时,“Drop Frame”意思? [英] When using the Java debugger in Intellij what does "Drop Frame" mean?
问题描述
您的应用程序的调用堆栈可以在调试器中查看。使用下降框功能,您可以退回到以前的堆栈框架,在某种意义上回溯到时间。如果您错过了要重新查看的关键点,这将有助于重新输入功能。
如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屋!