简体   繁体   English

扩展Eclipse JDT

[英]Extending Eclipse JDT

I'm trying to write a plugin that will alter (more like add) functionality of the current eclipse java debugger. 我正在尝试编写一个插件,它将改变当前eclipse java调试器的功能(更像是添加)。 For details of what I am trying to accomplish, you can see this thread: Writing a custom eclipse debugger . 有关我想要完成的内容的详细信息,您可以看到以下线程: 编写自定义eclipse调试器 I'm making a new question to address some confusion over specifics of how eclipse plugins work. 我正在提出一个新问题来解决关于eclipse插件如何工作的细节问题。

So if I wanted to adjust the debugger (or any part of JDT), it is to my understanding that what allows this to happen via plugins are what are known as extension points, basically points that grant access for extending functionality and control what you can or cannot do to an extent. 因此,如果我想调整调试器(或JDT的任何部分),我的理解是通过插件实现这一点的是所谓的扩展点,基本上是为扩展功能提供访问权限并控制你能做什么的点或者不能做到某种程度。 My first question is, is this a correct understanding of the concept, and if so how do you find these extension points (and ultimately is it a good starting point to my specific debugging problem)? 我的第一个问题是,这是对这个概念的正确理解,如果是这样,你如何找到这些扩展点(最终它是我特定调试问题的一个很好的起点)?

My second question is specifically regarding the debugger, if I wanted to some how pull data from the debugger (like variable/stackframe information, basically information its displaying out to the user) and use it in my own plugin, is this possible/how would you begin to approach it (is this a matter of extension points)? 我的第二个问题是关于调试器,如果我想要一些如何从调试器中提取数据(如变量/ stackframe信息,基本上是向用户显示的信息)并在我自己的插件中使用它,这是可能的/怎么会你开始接近它(这是扩展点的问题)?

I've looked through the eclipse debugger source code, and I have a general idea of whats going on in the debugging process, but how do I get my plugin to communicate/pull data that the debugger itself is receiving in the debugging process? 我已经查看了eclipse调试器源代码,并且我对调试过程中发生了什么有一个大概的了解,但是如何让我的插件在调试过程中通信/拉取调试器本身正在接收的数据?

BTW if anyone can answer some of these questions, especially ones pertaining to my specific problem, feel free to post in the other thread as there is still an open +200 bounty and the questions here can perhaps help answer the more broad question that is posted there. 顺便说一句,如果有人能够回答其中一些问题,特别是那些与我的具体问题有关的问题,请随意在另一个帖子中发帖,因为仍有开放的+200赏金,这里的问题可能有助于回答发布的更广泛的问题那里。

Thank you very much for any help. 非常感谢您的帮助。

You are right about the extension concept: an existing plug-in might provide an extension point - a place where it expects other plug-ins to contribute functionality. 您对扩展概念是正确的:现有插件可能提供扩展点 - 它希望其他插件提供功能的地方。

In case of Debug plug-ins you can use the static methods of the org.eclipse.debug.ui.DebugUITools; 在Debug插件的情况下,您可以使用org.eclipse.debug.ui.DebugUITools的静态方法; class: the getDebugContext() method returns the currently active debug context, and the getDebugContextManager() service adds support for listening to context changes. class:getDebugContext()方法返回当前活动的调试上下文,getDebugContextManager()服务添加了对上下文更改的支持。 We have a plug-in implemented like that: it listens to Debug Context changes, and visualizes the current variables in a Zest graph. 我们有一个这样实现的插件:它监听Debug Context的变化,并在Zest图中可视化当前变量。 The context information is gathered around line 183 in the file http://code.google.com/a/eclipselabs.org/p/debugvisualisation/source/browse/hu.cubussapiens.debugvisualisation/src/hu/cubussapiens/debugvisualisation/views/DebugVisualisationView.java Might worth taking a look. 上下文信息收集在文件中的第183行附近http://code.google.com/a/eclipselabs.org/p/debugvisualisation/source/browse/hu.cubussapiens.debugvisualisation/src/hu/cubussapiens/debugvisualisation/views /DebugVisualisationView.java可能值得一看。

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

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