Eclipse Plugin‎ > ‎

Debugging in Eclipse

Line breakpoints can be set within the Damson code editor by either double clicking on the left margin of the code edit area, right licking on the margin and selecting Toggle Breakpoint or by selecting Run->Toggle Breakpoint. Breakpoints are then visually indicated by a standard Eclipse breakpoint marker (breakpoint marker).

Breakpoint Properties

Multiple alias may be created from a single node prototype. As such, a breakpoint can be triggered by any alias which reaches the breakpoint. A breakpoint property can be set which instructs the debugger to only stop at the breakpoint of a particular node number. This can be achived by right clicking on the breakpoint in the Damson source editor and selecting "Breakpoint Properties". If the "Enter a DAMSON alias number" checkbox is ticked then a single positive integer value representing a node number can then be entered.

Launching the Damson Debugger

Once a launch configuration for a Damson program has been created debugging is immediately available through the standard Eclipse Debug interface. To launch a Damson program in Debug mode select Run->Debug or select the Debug launch short cut (debug) from the quick menu. If there are no breakpoints set within the Damson program then execution will complete normally within the Damson perspective however if a breakpoint is reached the IDE will suggest switching the perspective to Debug. Confirm the perspective switch by selecting Yes or choose to enter the Debug Perspective manually by choosing Window->Open Perspective->Other->Debug. The debug perspective will open showing the execution paused at the highlighted source line. The Debug Trace will show any active threads and their states (i.e. Running, Waiting, etc.) as well as the call stack for each thread. EAch item on the stack can be examined to view and edit the value of variables.

Damson Debugger

Navigating the Debug Perspective

The debug control of the Damson program use the standard Eclipse debug interface and has the following useful view windows;
  • Debug: Shows the currently running executable including the stack trace for the currently suspended breakpoint. The call stack items can be examined by selecting the call stack functions from this view.
  • Variables: The variables view will show any local (to the current function) variables and their values which may be set at runtime by editing the displayed value.
  • Breakpoints: Shows a list of current project breakpoints and their source line which may be toggled or removed.
  • Damson Source Editor: Shows the source program and breakpoints with highlighting over the current breakpoint. Selecting an item from the call stack will cause the highlighted line to change.
  • Console : Shows the Damson program output.

During breakpoint suspension program execution altered by using the program control short cuts on the Debug view or through the Run menu to either terminate the program, run to the next break point,  step over the next source line, step into the current source line (which has the same effect if the source line does not contain a branch instruction) or step out of the current call function.

To return back to the Damson perspective select Window->Open Perspective->Damson Perspective.


Comments