32.2.4. Step-by-step execution
In the step-by-step execution mode, the debug item completes each command and waits for a debugger command to continue execution.
When the first debug item is attached, the system adds debug management commands to the Debug menu.
There are several options for each step of module execution. Use the following commands from the Debug menu to select an option.
Command |
Description |
Step In |
If the next executable module operator is a function or procedure call, it is incrementally executed, otherwise the debugger proceeds to the next operator. |
Step over |
If the next executable module operator is a function or procedure call, it is executed completely (not step by step), and the debugger proceeds to the next operator. |
Step Out |
Interrupt incremental execution of a function or procedure and stop at the first operator after it is called |
Go to cursor |
Interrupt step-by-step module execution, execute all statements up to the line where the cursor is set |
Continue |
Break the step-by-step module execution and continue free execution |
When you debug applications, keep in mind that if there is the Execute() operator in the program code to debug, then:
- Step-by-step execution of the program code passed as an operator parameter (including procedure and function calls) is not supported.
- Interruption of program code execution using breakpoints located inside procedures and functions and called from the program code passed as the Execute() operator parameter is supported.
If you debug multiple debug items, then there is a number of features of incremental implementation:
- If you stop a debug item, other debug items are also stopped when you execute the code.
- If you select Continue, it resumes execution of all debug items.
- If you select Step Over, it proceeds to the next line for all debug items.
- If you select Step In (if the executable module operator calls a function or a procedure), it proceeds to the first operator in the call, while the Step Over command is performed for other debug items.
If you debug the client/server mode and the code is sequentially executed on the client and on the server (client and server debug items are attached), then:
- If you select Step In (if the executable module operator calls a function or a procedure on the server), it proceeds to the first operator in the call.
- If you select Step Out or Step Over for the last executable operator (if the executable module operator calls a function or a procedure executed on the server and called from the module executed in the client application), it proceeds to the next executable operator in the call.
The current debug item can be selected in a special Debug Items toolbar. The toolbar has the only selection field displaying the current debug item. The selection field is only accessible when the Debugger controls one of the attached debug items (for example, after the breakpoint is triggered). The list of debug items only contains items that are currently controlled by the debugger, including the current debug item.
Use the immediate window and the Expression dialog box to get values for the relevant expressions. Call Stack can be used to trace the sequence of call procedures and functions.
If a step-by-step process is performed, the call stack and variable values (in the immediate window and the Expression dialog box) are displayed for the current debug item. When you change the debug item, it also changes the call stack and variable values.
IMPORTANT. If the client and server debug items are attached and the transition is made from the client to the server, then no calculations are made at the client levels of the call stack. These levels are highlighted in grey in the call stack window.
If you need to continue the module execution, select Debug ‑ Continue Debugging to enable free module execution for the attached debug items (up to the next breakpoint). If a client application is attached for debugging, it is activated automatically.
To interrupt the entire debugging process (except for background jobs), remove all breakpoints from all modules and run the Debug ‑ Continue Debugging command, if a breakpoint has been triggered. If you need to interrupt debugging and terminate the operation of the attached debug items, you should use the Debug‑ Finish command. In the latter case BeforeExit() and OnExit() procedures are not executed.
You can edit the current configuration and save changes during debugging.
IMPORTANT. Although during the debugging process it is possible to edit the module being debugged, the debugger does not compile the changed code ‑debugging is continued for the database configuration code (at the moment when debugger is started or attached). To debug the changes made to the configuration, you should update the database configuration.
If exclusive mode is set in 1C:Enterprise mode, you will not be able to save the current configuration until the exclusive mode is removed.
If a file infobase is in the state of stepping through 1C:Enterprise language code or is at a breakpoint, and there is an open transaction (explicit or implicit), executing some operations (for example, an attempt to lock objects in the configuration repository) may cause an error: Configuration repository operation failed. (Error while collecting information for the configuration repository) Lock conflict during the transaction. Could not lock FILES table. It is recommended to shut down the client application before retrying. To perform the operation during which an error occurred, you should continue 1C:Enterprise language code execution until the transaction is completed.
Table of key combinations for debugger operations can be retrieved in Help when using the application.