简体   繁体   English

在Eclipse Debug Perspective中查找变量值

[英]Finding variable value in Eclipse Debug Perspective

I am debugging a program, and once I step in an instruction, I get a list of variables in the Variables view, or if I hold the mouse on the variable, the its value is shown. 我正在调试一个程序,一旦我进入一个指令,我就会在Variables视图中得到一个变量列表,或者如果我在变量上按住鼠标,它的值就会显示出来。

Now, I have an object that could possibly have many references to other objects, which, in turn, have their own attributes that contain other objects and so on. 现在,我有一个对象可能有很多对其他对象的引用,而这些对象又有自己的属性,包含其他对象等等。 The search space could become very large. 搜索空间可能会变得非常大。 I would like to find where these values could be by searching the object attributes by value . 我想通过按值搜索对象属性来找到这些值的位置 Eclipse already searches these objects by attribute. Eclipse已经按属性搜索这些对象。

I tried EVars plugin, but it doesn't seem to be still compatible with Eclipse 4.4. 我尝试过EVars插件,但它似乎与Eclipse 4.4不兼容。 Any other tools or recommendations on how to do it? 关于如何做的任何其他工具或建议?

Thank you very much! 非常感谢你!

While debugging you can use the "Display" window where you can write pieces of code and "execute" them with inspect (highlight the code -> right click -> inspect). 在调试时,您可以使用“显示”窗口,您可以在其中编写代码片段并使用inspect“执行”它们(突出显示代码 - >右键单击 - >检查)。

In that window you have access to all variables of the breakpoint's context. 在该窗口中,您可以访问断点上下文的所有变量。 You could use some java 8 streams snippets to filter your objects. 您可以使用一些java 8流片段来过滤您的对象。

https://help.eclipse.org/neon/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Freference%2Fviews%2Fdisplay%2Fref-display_view.htm https://help.eclipse.org/neon/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Freference%2Fviews%2Fdisplay%2Fref-display_view.htm

https://help.eclipse.org/neon/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Ftasks%2Ftask-evaluating_expressions.htm https://help.eclipse.org/neon/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Ftasks%2Ftask-evaluating_expressions.htm

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM