Java中的断点和逐步调试? [英] Breakpoints and step by step debug in Java?

查看:162
本文介绍了Java中的断点和逐步调试?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对不起我的问题的陌生名称。我不知道如何寻找这个,因为我不知道这些东西是如何调用的。

Sorry for the strange name of my question. I don't know how to look for this because I don't know how these things are called.

Visual Studio中有一个功能,至少你可以点击在代码的左边,设置一个大红点的起点。然后你运行程序,你可以通过按f8或f5(实际上是不同的f)跟踪步骤,你会看到每一步的变量值等等。我发现它非常有用,因为我可以看到错误发生的位置以及程序的行为方式。

There's a features in Visual Studio at least where you can click on the left of the code and set a starting point which is a big red dot. Then you run the program and you can trace the steps by pressing f8 or f5 (different f's really) and you see the variable values on each step etc. I find it extremely useful because I can see where an error occurs and how the program behaves.

我不知道这叫做什么,我想问一下NetBeans IDE 8.0.2或jGrasp或任何java编译器中是否有这样的东西?

I have no idea what this is called and I want to ask is there such a thing in NetBeans IDE 8.0.2 or jGrasp or any java compiler?

对不起,如果有什么事情听起来很愚蠢,我就是新手了。
谢谢大家

Sorry if anything sounds stupid, I'm kind of a newbie. Thank you all

推荐答案

大多数IDE都内置了调试功能。

Most IDEs have debugging functionality built in.

在Netbeans中,您只需单击源编辑器右侧的行号即可轻松添加/删除断点(您也可以通过编辑器弹出菜单执行)

In Netbeans, you can easily add/remove a break point by simply clicking the line number on right side of the source editor (you can also do via the editor popup menu)

你开始调试器通过 F5 Shift F5 调试当前文件)或通过工具栏上的调试图标

You start the debugger through F5 (ShiftF5 for debug the current file) or via the debug icon on the toolbar

您可以使用 F8 跳过命令/方法调用, F7 进入方法。您可以在调试器运行时使用 F5 继续运行程序。

You can use F8 to step over the command/method call, F7 to step into a method. You can resume running the program using F5 while the debugger is running.

请参阅 Debugger and Profiler 使用NetBeans IDE中的Visual Debugger 获取更多详细信息

See Debugger and Profiler and Using the Visual Debugger in NetBeans IDE for more details

这篇关于Java中的断点和逐步调试?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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