How to filter call stack in Eclipse debug view for Java

偶尔善良 提交于 2019-11-27 12:19:21
Ladlestein

The only way I know of to filter the stack trace view is via Mylyn. If you have an active Mylyn task, and you click the "Focus on Active Task (experimental)" button in the Debug View, then the stack trace will be filtered to only show those methods that are in the current task's context.

In this case, you wouldn't be filtering certain items from the stack trace; rather, everything would be out by default, and only certain items would be displayed (those in the task context).

You can look at this answer for more about Mylyn.

Preparation: You can use step filters as described here. Then whenever you step-debug through your code, it will not jump into excluded packages or classes, e.g. from the JDK or some frameworks like Hibernate or Spring. But this is just a prerequisite.

Solution: The stacktrace still contains frames from those those packages. In order to filter out those as well, you need to patch the Eclipse JDT Debug UI plugin. Someone else has done that already for older Eclipse releases up to Indigo. Because I was curious if I could get it running in the current release Luna 4.4.1 as well, I recreated the other guy's changes and pushed the Debug View + Stack Filter Plug-In to GitHub including a download link to the patched plugin. So if you are also on 4.4.1, you are lucky and do not need to patch and compile anything by yourself. Just use my version. Otherwise please clone my repo and look at the changes, then apply them to the plugin version of your choice.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!