Debugger
The debugger is a supporting tool, helpful in developing and debugging 1C:Enterprise modules. The debugger allows you to:
-
debug client and server applications, external connections both in the file mode and in the client/server mode, web-services and background jobs;
-
execute the module on a step-by-step basis;
-
arrange breakpoints;
-
interrupt and continue the module execution;
-
debug several modules at a time;
-
calculate expressions for variable status analysis;
-
view the stack of procedure/function calls;
-
stop the execution in case of an error;
-
edit modules while debugging.
The concept of the debug item is used to describe the debugger. The debug item is a 1C:Enterprise script context based on the following set of parameters:
-
name of the user who is to execute the 1C:Enterprise script code;
-
debug item type;
-
network name of the computer on which the 1C:Enterprise script code is to be executed;
-
infobase connection number;
-
number of the IP-port used by the Debugger to manage the debug item operation.
Debug item types include:
-
Client-the 1C:Enterprise script code executed in the client application;
-
Server-the 1C:Enterprise script code executed on the server;
-
External connection-the 1C:Enterprise script code executed through COM-connector;
-
Web-service-the 1C:Enterprise script code used to process the calls of web-service methods;
-
Background job-the 1C:Enterprise script code used to process background jobs.
Use of Debugger
To debug the 1C:Enterprise script code, the application in which the code is executed should be started in the debugging mode.
If the 1C:Enterprise mode is not launched, select Debugging- Start Debugging to start the debugging process. The Designer starts the 1C:Enterprise in debug mode.
Where the Enable Debugging Mode option is set or the Begin Debugging on Startup option is specified in the Designer settings (open by selecting Service-Options..., the1C:Enterprise Startup tab), then debugging can be launched using the run mode invoked by the Service-1C:Enterprise command. If you want to debug a code executed by a certain user, then the user on whose behalf the debugging mode is launched can be specified in the settings form.
How to Set up the Application to Run in the Debugging Mode
Client Application Debugging
To set up the debugging mode, you can use the following startup options:
-
In the Designer mode, check Set the Enable Debugging Mode on Startup in the settings form (open by selecting Service-Options..., the 1C:Enterprise Startup tab), then connect the debug item; you can also check the Begin Debugging on Startup option, which enables automatic connection on 1C:Enterprise startup;
-
Open the infobase in the 1C:Enterprise mode using the /Debug command line option (in the debugging mode);
-
If the client application is run, then set the debug mode (check the Debugging Allowed option) in the settings form (open by selecting Service-Options..., the System tab). Note that once the settings have been applied, you will not be able to clear the checkbox.
-
If the 1C:Enterprise mode has been started and you need to enable debugging for each subsequent startup, then set the debugging mode (check the Set the Enable Debugging Mode option) in the settings form (open by selecting Service-Options..., the System tab).
Code Debugging on the Server
To set the debugging mode, run the 1C:Enterprise server using the /Debug command line option (ragent.exe /debug).
Debugging of External Connection and Web-Services
To specify the startup in the debugging mode for the external connection / web-service, use settings from xml-files (comcntrcfg.xml and webservicecfg.xml respectively) located in the CONF subdirectory of the 1C:Enterprise 8 executable file (BIN). If the file is not found, the application will be opened in the ordinary mode.
Debugging
To debug the module, the debug item should be connected for debugging.
To manage the connection, use the Select Debug Item and Configure Connection window.
-
If one debug item is stopped, the others will be also stopped upon the start of the code execution.
-
The Continue command makes the execution of all debug items continue.
-
The Step over command results in shifting to the following string in all debug items.
-
The Step to command (where the module operator being executed is a call of a procedure/function) results in shifting to the first operator within this call, theStep over command is always executed for other debug items.
-
The Step to command (where the module operator being executed is a procedure/function call) results in shifting to the first operator within this call.
-
Selecting the Step out of or Step to options for the last executed operator (where the module operator being executed is a procedure/function code executed on the server, and which has been called from the module run in the client application) results in shifting to the next operator within this call.