在Eclipse中调试时查找类的所有实例 [英] Find all instances of a class while debugging in Eclipse

查看:239
本文介绍了在Eclipse中调试时查找类的所有实例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道Java / JVM的工作方式是否像Eclipse这样的调试工具可以显示给定类的所有实例的列表?我想可以写一些反思代码,但是我不想每次都在同一个地方打破执行,而是我喜欢打破执行,并列出所有的 MyClass123 对象在调试窗口。



这是甚么可能吗?是否在Eclipse或任何插件中提供?

解决方案

是的,可以在标准的eclipse调试器中。请参阅这里。调试时,右键单击变量视图中的变量条目,然后单击所有实例:





这将打开一个这样的列表:




I was wondering if the way Java/JVM works means debugging tools like Eclipse can show me a list of all instances of a given class? I suppose one could write some reflection code but I don't want to break execution at the same place every time... rather I;d like to break execution and bring up a list of all MyClass123 objects in a debug window.

Is this even possible? Is it provided in Eclipse or any plugin?

解决方案

Yes, it's possible in the standard eclipse debugger. See here. While debugging, right-click on a variable entry in the 'Variables View' and then click on 'All Instances':

This will open a list like this:

这篇关于在Eclipse中调试时查找类的所有实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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