Using the Debug perspective to debug a pluglet

The default perspective for the pluglet debugger workbench is the Debug perspective. Immediately after launching the pluglet debugger, the pluglet debugger workbench opens an editor window containing your most recently launched pluglet.

Procedure

To debug the pluglet:

  1. Launch the debugger workbench by clicking Run > Internal Tools > Pluglet Debugger. The Launching Pluglet Debugger dialog box is displayed while the debugger workbench is starting up.
  2. Using the global toolbar in the debugger workbench, click Run > Internal Tools. Notice that this menu contains the same pluglet launch history and favorites menu groups that you have in your target workbench. Only your workspace pluglets can be debugged. Notice that the debugger workbench menu contains launch menu items that correspond to your workspace pluglets.
  3. Set a breakpoint somewhere in the pluglet editor window in the debugger workbench. For example, double-click in the thin pane to the left of the source text on the line where you want to set a breakpoint. A breakpoint mark is displayed.
  4. Click Run > Internal Tools and select the menu item that corresponds to the pluglet that you want to launch. Clicking these pluglet launch menu items launches the pluglet in the target workbench and not in the debugger workbench. Since you have set a breakpoint, the debugger workbench will indicate that the target workbench has stopped at the breakpoint. The Debug view now displays information about the target workbench threads and the call stack of the thread, which is stopped at the breakpoint.

Results

Use the Debug view toolbar buttons to resume or single-step the pluglet as it runs. You can also click the Disconnect button on the Debug view toolbar to allow the pluglet to resume and run to completion without hitting any more breakpoints. The debugger will automatically reconnect when you launch a pluglet from the workbench.

What to do next

Notice that the Debug and Variables views only display information while a pluglet launch is running. The debugger automatically connects and disconnects from the target workbench before and after the pluglet is launched. When you are not debugging the pluglet, you can switch back to the target workbench and launch pluglets from the target workbench without interacting with the debugger.

You can let the debugger workbench run for extended periods of time. Because the debugger workbench automatically disconnects from the target workbench when you finish debugging a pluglet, you can leave the debugger workbench up and just switch back to your target workbench to continue working there. This way, you can avoid the overhead of relaunching the debugger workbench when you want to debug a pluglet.

To debug or edit a different pluglet, you can switch to the Java perspective and open it from the Package Explorer view, or you can open the Package Explorer view in the Debug perspective.

When you shut down the target workbench, the debugger workbench is automatically shut down.


Feedback