如何设置已部署的 eclipse RCP 应用程序的调试选项?
我想为我部署的 RCP 应用程序的特定插件启用“调试”选项。但我怎样才能做到这一点呢?我是否必须打开捆绑包的 jar 来操作 .options
文件?或者安装文件夹中是否有工作副本?
http://wiki.eclipse.org/FAQ_How_do_I_use_the_platform_debug_tracing_facility%3F
该文档说可以在 RCP-App 的安装目录中找到 .options
-File,但什么也没有。
I want to enable the "Debug" option for a specific plugin of my deployed RCP application. But how can I do that? Do I have to open the jar of the bundle a manipulate the .options
-File? Or is there a working copy somewhere in the installation folder?
http://wiki.eclipse.org/FAQ_How_do_I_use_the_platform_debug_tracing_facility%3F
This document says the .options
-File can found in the installation directory of the RCP-App, but there is nothing.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
正如您已经发现的那样,调试选项是使用 .options 文件设置的。该文件通常包含以下行:
...其中第一行启用整个插件的调试,第二行启用特定的调试选项。
如果插件使用调试跟踪,那么在部署插件时包含 .options 文件是一个好习惯,但这不是必需的(例如,org.eclipse.core.runtime 确实有它) )。因此,如果您想要启用调试的插件具有 .options 文件,那么您可以将其复制到应用程序安装目录。如果没有,那么您需要弄清楚使用了哪些选项并自己创建。
.options 文件仅与
-debug
命令行参数一起使用。您还可以在-debug
之后指定 .options 文件的位置。Debug options are set using .options file as you already discovered. This file usually contains lines like:
...where the first line enables debugging for the plugin as a whole and the second line enables specific debug option.
If a plugin uses debug tracing then it is a good practice to include .options file when a plugin is deployed, but this is not a requirement (for example, org.eclipse.core.runtime does have it). So, if the plugin that you want to enable debugging for has the .options file then you can copy it to your application installation directory. If not, then you need to figure out which options are used and create it yourself.
.options file will only be used with
-debug
command line argument. You can also specify location of .options file after-debug
.对于已部署的应用程序,我建议使用跟踪插件提供的跟踪首选项页面(自 Juno 起可用)。
如文档所述:“首选项页面可以包含在其他产品中。它包含在 org.eclipse.ui.trace 插件中,并且不依赖于 PDE。”[1]
这将允许用户打开或关闭跟踪按组件关闭,并设置输出的位置(使用旋转文件)。这是教程 [2] 的链接。
[1] http ://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.pde.doc.user%2FwhatsNew%2Fpde_whatsnew.html
[2] http://www.vogella.com/tutorials/EclipsePerformance/article。 html#tracing_runonatruntime
For deployed applications, I would suggest using the tracing preference page offered by the tracing plugin (available since Juno).
As documented: "The preference page can be included in other products. It is contained in the org.eclipse.ui.trace plug-in and has no dependencies on PDE."[1]
This would allow the user to toggle tracing on or off, by component, and set the location of the output (with rotating files). Here's a link to a tutorial [2].
[1] http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.pde.doc.user%2FwhatsNew%2Fpde_whatsnew.html
[2] http://www.vogella.com/tutorials/EclipsePerformance/article.html#tracing_runonatruntime