如何在IntelliJ中一步一步?

编程入门 行业动态 更新时间:2024-10-24 06:28:03
本文介绍了如何在IntelliJ中一步一步?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

例如,我尝试了一个名为 abc()期望得到 12 ,但在重新检查返回值后,我注意到它是 5 而不是 12 。我怎么可以重新回到我之前的位置,然后一步一步的去看看发生了什么?我知道你可以在视觉工作室做到这一点,但是我在IntelliJ中找不到如何做到这一点。

解决方案

您可以放下框架,直到达到要建立的位置。这并不是完全倒退的,但是在很多方面都非常相似。

虽然Tiago在下面提到这一点不会恢复您的应用程序的全局状态 - 如果您正在开发无状态服务,这不是一个巨大的问题,但可能是如果你正在开发swing应用程序(如果有人实际上这样做)。

在调试工具栏上,它看起来像这样:。在 Idea 2016.3 中,图标看起来像这样

完整的文档可以在这里: IntelliJ Debugger Docs ,以及有一个 StackOverflow丢帧问题,几个有用的答案

Is it possible to step backwards through executed code in a debug session?

For example I step over a method called abc() expecting to get 12 but after re-checking the value returned I notice it's 5 instead of 12. How can I step back to where I was before and step into the method to see what is going on? I know you can do this in visual studio but I can't find how to do this in intelliJ.

解决方案

You can drop the frames until you reach the point where you want to be. This isn't exactly stepping backwards, but it is quite similar in a lot of respects.

Though as Tiago mentions below this will not revert the global state of your application -- which isn't a huge concern if you're developing stateless services, but could be if you're developing swing applications (if anyone actually does that any more).

On the debugger toolbar it looks like this: . in Idea 2016.3 and up the icon look like this

Full documentation is available here: IntelliJ Debugger Docs, and there is a StackOverflow Drop Frame Question, with a few useful answers

更多推荐

如何在IntelliJ中一步一步?

本文发布于:2023-11-26 21:20:49,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1635235.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何在   IntelliJ

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!