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

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

问题描述

我在 IntelliJ 8 中使用 Java 调试器时注意到一个标记为丢帧"的按钮.有谁知道这是为了什么目的?如何/为什么会使用/有用?

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?

推荐答案

可以在调试器中查看应用程序的调用堆栈.使用Drop Frame"功能,您可以回退"到前一个堆栈帧,从某种意义上说可以回到过去.如果您错过了想要再次查看的关键点,这有助于重新输入函数.

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.

请注意,当然,可能发生的任何副作用 - e.G.网络流量、文件操作、控制台输出等 - 无法回滚.

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天全站免登陆