Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

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.

Quick Links: 

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.

  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.

    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.

  1. 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.
  1. 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.
  1. 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.

    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.

Working With Breakpoints

The following properties can be assigned for a selected breakpoint using the context menu item Breakpoint Properties, accessed by right-clicking on the desired breakpoint in the editor view or the Breakpoints view:

  • Enable or disable the breakpoint (disabled breakpoints will show as white circles instead of blue on the vertical bar, and their checkboxes will be unchecked in the Breakpoints view).
  • Specify a hit count condition for breaking.
  • Specify other breakpoint conditions.
    In addition, the following functions are available via the toolbar in the Breakpoints view:
  1. Delete selected breakpoint.
  2. Delete all breakpoints (Caution: Breakpoints in all open editors will be deleted.)
  3. Show breakpoints supported by selected target (shows only the breakpoints for the currently selected script editor view).
  4. Go to file for breakpoint (goes to breakpoint location in Script editor).
  5. Skip all breakpoints at runtime.
  6. Toggle Global ExceptionBreak (only stops the process and shows the breakpoint when an error occurs)
  7. Toggle Global EntryBreak (breaks the process every time a method attempts to execute, with or without a breakpoint)
  8. Toggle Global ExitBreak (breaks the process after the execution of a method, with or without a breakpoint)
  9. Expand all
  10. Collapse all
  11. Link with Debug view (highlights the selected breakpoint in the Debug script editor view)

Accessing Log Files

During debugging, Servoy Developer logs the activities of the debug client in the following file:
An additional (external) console window providing more detailed information can be launched by Eclipse by adding "-consoleLog" to the top of the servoy.ini file (for Mac users, this file is exposed when you view the Servoy application package contents and browse to the MacOS folder.) This console is useful for getting additional feedback during debugging.

  • No labels