在 Eclipse 中调试时未显示变量

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5490509/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 20:05:32  来源:igfitidea点击:

Variables not showing while debugging in Eclipse

eclipsedebugging

提问by well actually

I am running Eclipse Galileo for developers.

我正在为开发人员运行 Eclipse Galileo。

When I run in debug mode, the current variables and their values are not coming up in the Variableswindow. The window remains empty when I step through my code after a breakpoint.

当我在调试模式下运行时,当前变量及其值不会出现在“变量”窗口中。当我在断点后单步执行代码时,窗口保持为空。

Last night it was working, so I'm perplexed. Any reason why this might be happening and any tip on troubleshooting?

昨晚它正在工作,所以我很困惑。发生这种情况的任何原因以及有关故障排除的任何提示?

回答by well actually

I ended up trying something easy by resetting the Debug perspective, which seemed to work:

我最终通过重置调试视角来尝试一些简单的方法,这似乎有效:

Window => Perspective => Reset Perspective...

窗口 => 透视 => 重置透视...

Thanks for the comments.

感谢您的评论。

回答by jaciefan

Window --> Show View --> Variables

窗口 --> 显示视图 --> 变量

回答by lfvv

My problem was that I couldn't see variables names, but just the value. After trying quite a while I got the solution: Click on the down arrow (in degub Variables tab) --> Layout --> show columns

我的问题是我看不到变量名称,而只能看到值。尝试了一段时间后,我得到了解决方案:单击向下箭头(在调试变量选项卡中)--> 布局--> 显示列

It did the trick!

它成功了!

回答by tonyeva

Resetting the perspective wasn't quite enough for me, I had to first delete the "Variables" tab and then reset the perspective (which reinstated the Variables tab in a working state). One other thing not mentioned above which might help others - when the variables tab is not working, the tab title is in italics (whatever that signifies). When it's working it goes back to normal font.

重置视角对我来说还不够,我必须首先删除“变量”选项卡,然后重置视角(这将变量选项卡恢复到工作状态)。上面没有提到的另一件事可能会帮助其他人 - 当变量选项卡不起作用时,选项卡标题为斜体(无论表示什么)。当它工作时,它会恢复正常字体。

回答by Michal

I restarted Eclipse and it worked again.

我重新启动了 Eclipse,它又工作了。

回答by Lova Chittumuri

Windows -- > showView --> variable

Windows --> showView --> 变量

or you can reset the perspective

或者你可以重置视角

windows -- > preferences -- > perspective --> restore Defaults

windows --> 首选项 --> 透视 --> 恢复默认值

回答by Fender

try a right click on the variable and select inspect, then it should come up in a popup window

尝试右键单击变量并选择检查,然后它应该出现在弹出窗口中

回答by Fender

I found I needed to remove static declarations if I wanted to see the variables, but this works better...

我发现如果我想查看变量,我需要删除静态声明,但这效果更好......

Modify/view static variables while debugging in Eclipse

在 Eclipse 中调试时修改/查看静态变量

回答by Fender

What worked for me is the following: I had a blank Variables view for the top stack frame. I selected a lower stack frame, then reselected the top one, and the Variables view refreshed itself somehow. Note: I'm using Eclipse Mars, so this bug appears to have returned in this version (or perhaps it's a different one, with the same symptoms?).

对我有用的是以下内容:我有一个顶部堆栈框架的空白变量视图。我选择了一个较低的堆栈框架,然后重新选择了顶部的一个,并且变量视图以某种方式刷新了自己。注意:我使用的是 Eclipse Mars,所以这个 bug 似乎在这个版本中又回来了(或者它可能是一个不同的,具有相同的症状?)。

回答by Vic Seedoubleyew

Also: your process needs to be suspended for Eclipse to show variables. If it is running, Eclipse won't show any variable.

另外:您的流程需要暂停以便 Eclipse 显示变量。如果它正在运行,Eclipse 将不会显示任何变量。

To suspend a thread, select a thread in the "debug" view, and hit "Suspend"

要暂停线程,请在“调试”视图中选择一个线程,然后点击“暂停”