Official Content

In the GeneXus IDE you can debug GeneXus code, such as with other development environments (Visual Studio, NetBeans, etc.).

To debug the application, you have to add a breakpoint and run the application. When the breakpoint is found, GeneXus gets the focus, and you can check attribute and variable values using the "Watch" tool window. In addition, the "Call Stack" window shows you the objects executed from the beginning of the execution.

Follow the basic steps to debug your code:

  1. Go to the Toolbar and select the Debug configuration, as shown in the image:
    Debugging - Step 1 -20221223
    Once you have to select Debug, a pop-up window opens with the following options:
    1. Watch: Allows to visualize the values of variables and attributes at each step of the running process.
      Debugging - Step 1 -20231216-1
    2. Call Stack: Shows the object and the execution lines.
      Debugging - Step 1 -20231216-2
    3. Breakpoints: Displays the objects and lines of code where breakpoints have been added. It also allows you to activate, deactivate, delete, and navigate to where they are defined.
      Debugging - Step 1 -20231216-3
    In addition, the debug tool window (DebuGx) will open.
  2. Add objects you want to debug to the debug tool window by clicking on Add and selecting the objects to debug in the pop-up window:
    Debugging - Step 2 - 20221223
  3. Open an object added to the debug tool window and set a breakpoint on the line of code you need to review. To do this, you can right-click on the line and select Toggle Breakpoint.
    Debugging - Step 4 - 20221223
    Note: Step 2 is not mandatory. You can add the breakpoint in the object's line you want, and it automatically added this object to the debug tool window.
  4. Go to the Watch Window and use the Add button to add the variables and attributes for which you want to know the value.
  5. Run the application by pressing F5.
    During execution, upon encountering a breakpoint, GeneXus will stop its execution and take the focus.
    Debugging - Step 5 - 20221223
  6. Use the Debug toolbar to run, step by step. To do this, right-click anywhere on the Toolbar and select Debug.
    Debugging - Step 6 - 20221223

In the following video, you can see the example of the execution time.

Debugging - 20231223

Notes:

  • Objects added to the debug tool window are generated again with debug information.
  • Objects generated with Debug information execute slower. In case of extreme performance degradation, see SAC #39137.
  • Notice that the release code will be generated after rebuilding using the 'Release' configuration option.
  • The debugger works with Server Side Code.
  • Please review GeneXus Debugger and Profiling common issues, for troubleshooting.

Scope

Object: Procedure, Web Panel, Data Provider
Generator: Java, .NET, .NET Framework
Level: Back end

See Also

Code Coverage and Profiling
Live Editing in Web Applications
HowTo: Enable logging for Native Mobile

Last update: February 2024 | © GeneXus. All rights reserved. GeneXus Powered by Globant