|
|
|
|
|
- Overview
- Inserting breakpoints in the code
- Breakpoint properties
- Options for conditional breakpoints
- Available actions for breakpoints
- Adding a message into the debugger trace
- Running the performance profiler
- Memory usage diff
- Handling breakpoints (delete
- Disabling/Enabling a breakpoint
- Deleting one or more breakpoints
- Listing breakpoints
When testing an application in the editor, breakpoints make it possible to automatically launch the debugger from a given line of code. This help page presents: Inserting breakpoints in the code Several methods can be used to insert a breakpoint: - Click on the left of the line where the breakpoint must be inserted. The mouse cursor turns into a hand and the
sign is displayed. - On the "Code" tab, in the "Breakpoints" group, expand "Breakpoint" and select "Add a breakpoint".
- Press Ctrl + B.
- Open the context menu of bar for breakpoint management and select "Add a breakpoint".
Note: Breakpoints are only taken into account when testing the application in the WINDEV, WEBDEV or WINDEV Mobile editor. When using the executable, breakpoints are ignored. By default, breakpoints automatically launch the debugger. In the breakpoint properties window, you can define: You can view the properties of a breakpoint: - in the code editor. To do so, go to the "Code" tab, "Breakpoints" group, expand "Breakpoint" and select "Breakpoint properties".
- via the context menu of the breakpoint. Simply right-click the breakpoint and select "Breakpoint properties".
Options for conditional breakpoints When debugging a loop, it may be useful to trigger the debugger after a number of passages (after the 35th iteration for example). To implement a conditional breakpoint: - Create a breakpoint (Inserting a breakpoint paragraph).
- Display the breakpoint properties.
- Under "Conditions", specify the conditions under which the breakpoint will be taken into account:
- Always (default value): The breakpoint will not be conditional and will always be taken into account.
- When the number of times a breakpoint has occurred is: Sets a conditional breakpoint. To do so, select a condition and the desired number of passages.
- When the expression below is true: Sets a conditional breakpoint. Simply enter the condition directly in the "If" field.
- Confirm. The conditional breakpoint is displayed in the editor (
).
Available actions for breakpoints By default, a breakpoint is used to pause program execution and launch the debugger. A breakpoint can also perform one of the following actions: To set a breakpoint with a specific action: - Create a breakpoint (Inserting a breakpoint paragraph).
- Display the breakpoint properties.
- In the "Actions" box, specify the action to be taken when passing through the breakpoint (these actions can be combined).
- Confirm. The
icon found before the breakpoint indicates that it includes specific properties.
Adding a message into the debugger trace When debugging an application, you may want to know the line of code on which a given process was executed, but without pausing execution and opening the debugger. In this case, a single information must be displayed in the trace window. If the "Add message to debugger trace" option is checked, when execution reaches the breakpoint, the message specified in the " Debugger trace" pane will be added to the trace. Note: If no message is specified, the name of the current process will be displayed in the "Debugger trace" pane. Running the performance profiler In some cases, when debugging, it is necessary to run the performance profiler on a section of code. This makes it possible to get the details of all the actions. corresponding processes and their duration. To implement this functionality, you need to create two breakpoints: One to launch the performance profiler, and another to stop it. At runtime: - The performance profiler is launched after execution of the line corresponding to the performance profiler startup breakpoint.
- Press F7 to continue execution down to the ending breakpoint.
After execution of the line of code that stops the performance profiler, debugging will stop and a window will appear with the results.
Several methods are available for defining the various breakpoints: - Method 1:
- Create two breakpoints to start and stop the performance profiler (see Inserting a breakpoint).
- In the context menu of each breakpoint, expand "Performance profiler" and select the desired option:
- "Start performance profiler". The icon changes to indicate that the breakpoint corresponds to the start of the performance profiler (
). - "Stop performance profiler". The icon changes to indicate that the breakpoint corresponds to the end of the performance profiler (
).
- Method 2:
- Create two breakpoints to start and stop the performance profiler (see Inserting a breakpoint).
- Open the properties of each breakpoint.
- Under "Actions", check Performance profiler and select the desired option to start or stop the performance profiler.
- Confirm. The icon changes to indicate what the breakpoint does:
- Start the performance profiler (
). - Stop the performance profiler (
).
Note: The code analyzed by the performance profiler must not contain any breakpoints. New in SaaSMemory usage diff In some cases, when debugging, it is necessary to measure and compare the amount of memory used by an application. This technique isolates resources that use memory in operations that should be memory-neutral. This allows you to improve the code and add memory freeing commands where necessary (unused queries, unused global object, etc.). To implement this functionality, you need to create two breakpoints: One to launch the memory usage diff, and another to stop it. At runtime: - The memory usage diff is launched after execution of the line on which the starting breakpoint is set.
- Press F5 to continue execution down to the ending breakpoint.
After execution of the line of code that stops the memory usage diff, debugging will stop and a window will appear with the results.
- Method 1:
- Create two breakpoints to start and stop the memory usage diff (see Inserting a breakpoint).
- In the context menu of each breakpoint, expand "Memory usage diff" and select the desired option:
- "Start memory usage diff".
- Method 2:
- Create two breakpoints to start and stop the memory usage diff (see Inserting a breakpoint).
- Open the properties of each breakpoint.
- Under "Actions", check "Memory usage diff" and select the desired option to start or stop the memory usage diff.
- Confirm.
Note: The code analyzed by the memory usage diff must not contain any breakpoints. Handling breakpoints (delete Disabling/Enabling a breakpoint Disabled breakpoints remain in the code editor, but are grayed out and are ignored when debugging the application.
Several methods can be used to disable the breakpoint for the current line:- On the "Code" tab, in the "Breakpoints" group, expand "Breakpoint" and select "Disable breakpoint".
- Press Ctrl + Shift + B.
- Open the context menu of the breakpoint management bar and select "Disable breakpoint":
Note: The breakpoint can be re-enabled at any time with "Enable breakpoint".Deleting one or more breakpoints Several methods can be used to delete a breakpoint: - In the code editor, click the breakpoint. The mouse cursor turns into a hand and the
sign is displayed. - On the "Code" tab, in the "Breakpoints" group, expand "Breakpoint" and select:
- "Delete breakpoint" to delete the breakpoint from the current line.
- "Remove all breakpoints" to remove all breakpoints.
- In the debugger, click
. - Open the context menu of bar for breakpoint management:
- select "Delete breakpoint" to delete the breakpoint found on the current line.
- select "Remove all breakpoints" to delete all breakpoints.
Listing breakpoints There are several methods to list the breakpoints of the current project: - In the code editor, go to the "Code" tab, "Breakpoints" group, expand "Breakpoint" and select "List breakpoints".
- In the debugger, click
. - Open the context menu of the breakpoint bar and select "List breakpoints".
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|