Debugging Eclipse helper applications

Eclipse includes some command-line tools for platform developers, which can be launched by providing the -application option to the Equinox launcher JAR (formerly startup.jar). A need may arise to debug one of those helper applications. Proceed as follows:

  1. Import the plug-in org.eclipse.equinox.launcher into workspace (with source code).
  2. Import the plug-in containing the helper application into workspace (with source code). For example: org.eclipse.update.core contains the siteOptimizer application.
  3. Create a debug configuration for the Java class org.eclipse.equinox.launcher.Main. Specify -Dosgi.install.area=/path/to/eclipse/installation/dir as a VM argument. Specify the remaining command-line arguments (e.g. -application ...).
  4. Set a breakpoint at the entry point to the helper application (likely a method called run or start).
  5. If the debugger asks for a source code location, point it to the workspace project.

No comments:

Post a Comment