eclipse 为什么我不能在eclipse中设置断点?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8748070/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
why can't I set up a breakpoint in eclipse?
提问by kloop
For some odd reason, I can't use breakpoints in my eclipse project. All breakpoints that I set have a diagonal line on them, above the dot in the respective line (on the left margin of the window), as if they are blocked. When I run in debug mode, the breakpoints are ignored. Any ideas?
出于某种奇怪的原因,我不能在我的 eclipse 项目中使用断点。我设置的所有断点上都有一条对角线,位于相应行中的点上方(在窗口的左边距上),就好像它们被阻止了一样。当我在调试模式下运行时,断点被忽略。有任何想法吗?
回答by Anthony Accioly
回答by ams
This doesn't exactly answer the OPs question, but when trying to double click to add break points, I was getting messages stating "this feature is not enabled".
这并不能完全回答 OP 问题,但是在尝试双击以添加断点时,我收到消息,指出“此功能未启用”。
I had to right click on the break point bar and select "Breakpoint Types" -> "C/C++ Breakpoints" instead of "Default". Then it worked fine.
我必须右键单击断点栏并选择“断点类型”->“C/C++ 断点”而不是“默认”。然后它工作得很好。
回答by anajem
in python, I had to go to: windows->perspective->Open Perspective->Debug then select the Breakpoints tab and make sure the zero with the slash (skip all breakpoints) is not selected (you can also use Ctrl-Alt-B to toggle it).
在 python 中,我必须去:windows->perspective->Open Perspective->Debug 然后选择 Breakpoints 选项卡并确保没有选择带斜杠的零(跳过所有断点)(您也可以使用 Ctrl-Alt- B 切换它)。
回答by Adel Boutros
- Open
Debug
View - Open
Breakpoint
Perspective - Right-click all breakpointsthere
- Press Enable
- 打开
Debug
视图 - 开放
Breakpoint
视角 - 右键单击那里的所有断点
- 按启用
回答by James Joyce
My "toggle breakpoint" and other menu options were disabled. I restarted Eclipse (Kepler SR1) and they came back enabled. I could set breakpoints again!
我的“切换断点”和其他菜单选项被禁用。我重新启动了 Eclipse (Kepler SR1),它们又重新启用了。我可以再次设置断点!
回答by Theodore Murdock
In my case, I'd edited my code during debugging, adding a null-check so I could place a breakpoint to stop execution only when a certain value was null. I couldn't add a breakpoint because the line of code in question was not present in the running application.
就我而言,我在调试期间编辑了我的代码,添加了一个空检查,这样我就可以放置一个断点以仅在某个值为空时停止执行。我无法添加断点,因为正在运行的应用程序中不存在有问题的代码行。
In Java, certain code changes can be woven in as soon as the file is saved, so in my case, remembering to save the changes was enough to enable placing a breakpoint.
在 Java 中,某些代码更改可以在文件保存后立即加入,因此在我的情况下,记住保存更改就足以启用断点。
For changes that can't be woven in, the application must be restarted before the new lines of code will be present.
对于无法融入的更改,必须在新代码行出现之前重新启动应用程序。
回答by deepwinter
In my case, I opened up the Breakpoints view, clicked 'remove all breakpoints' and then toggled the 'skip all breakpoints' option off, then on. This allowed me to set breakpoints again. This was after a restart of eclipse failed to help.
就我而言,我打开了 Breakpoints 视图,单击“删除所有断点”,然后关闭“跳过所有断点”选项,然后再打开。这让我可以再次设置断点。这是在重新启动 eclipse 后没有帮助。
回答by Sascha N.
I was having a simular issue, for me the standard code-editor changed after installing a new plugin from Marketplace. Apparently the Plugin thought to change the default-editor for a lot of file-types, not only the one I installed it for. The new editor did not allow setting breakpoints but I hadn't known it changed at the time. When I right-clicked my source-file in the Project-explorer I saw under open-with the new editor listed on top. When I opened with the previous editor, everything went back to normal.
我遇到了一个类似的问题,对我来说,从 Marketplace 安装了一个新插件后,标准代码编辑器发生了变化。显然,插件想改变许多文件类型的默认编辑器,而不仅仅是我安装它的那种。新编辑器不允许设置断点,但我当时并不知道它发生了变化。当我在 Project-explorer 中右键单击我的源文件时,我看到了 open-with 新编辑器列在顶部。当我用之前的编辑器打开时,一切都恢复了正常。