Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

Servoy comes with a full-featured debugging environment to allow developers to debug their script logic using debug clients, including the Smart Client and Web Client.

This chapter provides a general overview of the debugging process, followed by a description of features available in the Debug perspective.

Table of Contents

Getting Started

Debugging uses the following general process: (1) starting a Servoy client, (2) setting breakpoints for errors detected, then (3) switching to the Debug perspective to proceed with debugging.

1. Starting a Servoy Client
Servoy solutions can be tested in the desired environment by launching the (1) Smart Client or (2) Web Client (see image). Image Removed
Clicking on either button launches the Servoy client for the currently active solution.

2. Setting Breakpoints
When an error is encountered while running a Servoy client, developers can set breakpoints for methods in the script that they wish to debug.

Breakpoints can be added to any open script file, regardless of whether or not a Servoy client is running. To add breakpoints:

  1. Open the script that you wish to debug in Script Editor.
  2. Double-click on the left side bar to add a breakpoint to the specific line in the method you that would like to debug.
  3. Repeat the process to add breakpoints as needed.
Info

Note: To remove breakpoints, simply double-click on the breakpoint again.

Image Removed

3. Switching to the Debug Perspective
When a breakpoint is reached while using the Servoy client, a prompt will appear, asking you to confirm that you want to switch to the Debug Perspective. At this point, you can select the option to "Remember my decision." Image Removed

You can then continue with the debugging process in the Debug Perspective.

Info

Note: You also can start debugging at a specific method within the script using the following steps:

  1. Open the script in Script Editor
  2. Set the breakpoint for the method, if one has not been set.
  3. In the Solution Explorer contextual list, right-click the desired method.
  4. Select Debug method. 

This will take you to the Debug perspective, with the particular method being debugged highlighted.
This procedure is only available once a Servoy client has been started.

Info

Note: You can switch between the Debug and Servoy Design perspectives at any time using the following methods:

  • Via the Window menu item>Open Perspective>Debug
  • By clicking on the Open Perspective Icon at the top right corner of the Servoy Design Perspective (see image). Image Removed

You can then continue with the debugging process in the Debug Perspective.

The Debug Perspective

The Debug perspective contains the following views, divided into five main areas, described below from left to right and top to bottom. Image Removed

  1. Debug and Interactive Console
    *The Debug view stack of methods being called while the client is running. Selecting an item in the view highlights the respective line in the Script editor view.
    *Developers use the Interactive Console to interact with the client at runtime (for example, by inputting values to variables) at the method level.
    Info

    Note: In Eclipse, you can also open the Command Console view to interact with the client. *The command console links to the specific client being run and evaluates code on top level within solution (as opposed to the Interactive Console, which evaluates on a line-by-line level). When two clients are active, e.g. the Smart Client and Web Client, the command console allows you switch between active clients.

  2. Variables, Breakpoints, and Expressions
    *The Variables view shows a list of variables and their values active during debugging.
    *The Breakpoints view shows a list of the breakpoints along with a toolbar that can be used to specify options for breakpoints. (Breakpoints are described in greater detail in the following section.)
    *The Expressions view allows you to watch the values being output for a specified expression (to add an expression to the watch list, highlight it in Script editor and use the Watch command in the context menu). This view will also highlight errors caused by undefined expressions.
  3. Editors
  • Any editors (e.g. form and script editors) that were open in the Servoy Design perspective are shown in this area.
  • During active debugging, the context menu provides the following additional items in addition to the normal script editor set: Display, Inspect, and Watch.
  • Display shows a simple output of the value of the selected object
  • Inspect shows any secondary structures that are included within a selected object.
  • Watch adds a selected expression to the watch list in the Expressions view.
  1. Outline
    The outline view shows the list of elements found in the active editor view.
  2. Console and Profiler
  • These views provide additional information during debugging. The console shows data being output to the log during debugging.
  • When enabled (using the Start Profiling button at the top right of the view), the Profiler shows every method being fired, how many times it is fired, the time of execution, and the total execution time as the client runs.!StartProfiling.png|align=left!
  • Other views that were opened in the Servoy Design perspective, such as TODO and Results, may also be found here.
Info

Note: If a desired view is not visible in your Debug perspective, you can open it using the main menu item Window>Show View (Popular debug views are shown in this menu; clicking Other opens a browser that allows you to search all available views).

Note: Many of these views have context-specific toolbars located at the top right of the view that allow easy access to commonly used functions within the view. Users can also access view options by clicking on the inverted triangle found at the top right corner of the view.
Info
Panel
Quick Links: 
Children Display
alltrue