Contacts

Debugging of the program 1C. Using test data

Debugger It is a built-in tool in the configurator. It helps to debug program modules created in the process of developing an applied solution. The debugger allows you to track the sequence of the embedded language operators and view the values \u200b\u200bof the variables.

The main features of debugging

  • debugging applications performed on remote computersavailable on TCP / IP or HTTP protocol,
  • debugging code executed by the working process of the 1C server cluster: enterprises 8; This supports the end-to-end stack of calls for the client and the server, and through step-to-step debugging of the client and server;
  • debugging code executable in such types of connections as an external connection, background task and WS connection?
  • debugging mobile applications.

Stopping points

The debugger allows you to set a special marker to a specific line of the module - a stop point - when the program module is reached, the execution of the software module stops and the control is transmitted by the debugger. Stopping points may be unconditional or with the condition. When the unconditional stop point is reached, the execution of the software module stops anyway:

When the breakpoint is reached with the condition, the execution of the software module stops only if conditional condition True:

The debugger supports the ability to disconnect the stop points. In this case, the row of the module remains marked, but it does not have any influence on the completion of the module:

For large quantities Stoppoints It is convenient to use a separate window to work with breakpoints, allowing you to view and edit them in a single list:

Step-by-step execution

After when you reach a stop point, the application is transferred to the debugger, it is possible to further execute the module in several modes: step-by-step execution, execution of a function or procedure, interrupt a step-by-step execution of a function or procedure, executing the module to the row on which the cursor is completed or Continuation of the free execution of the module:

View expressions

During step-by-step execution, it is possible to view the values \u200b\u200bof the variables contained in the module and calculate arbitrary values. To do this, use a special window that displays the result of the calculation:

For the objects of the embedded language, their properties are presented in the form of a tree structure. For values \u200b\u200bthat are strings, arrays and collections of values \u200b\u200bare also possible in a separate window:

The current value of the variable can also be viewed by summing up the mouse pointer to this variable. The current value will be shown as a short prompt next to the variable.

Scoreboard and Local Variables

The results of the calculations that need to be viewed throughout the execution of some part of the module can be displayed in a separate window - the scoreboard, in which it is possible to distribute all the expressions on the four pages:

For convenient viewing and changing local variables, which seems the most common task, there is a team Local variables. It opens the scoreboard, which is already automatically filled with all local variables.

Change variables

Primitive types can be changed directly in the cell. Value.

And to change other values, you can use the expression input window.

In this window, the contextual tip is fully functioned.

Stack of calls

The debugger allows you to use a call stack that shows the sequence of calls to procedures and functions given to the module string that is currently debugged:

Double-clicking on the name of the procedure in the call stack you can go to the appropriate line of the procedure.

Error stop

The platform provides the ability to use the error stop mode. In this mode, debugging can be stopped either with each error that occurs, or in an error, in the text of which there is a substring specified by the developer. The substring of the errors of interest are specified in the debugging settings.

During debugging, with such a configuration, debugging will dwell only when errors occur associated with the division on zero.

In this article, I will scatter the basis of working with debugging in. What is debugging and what is it needed for? It is very often necessary to understand how one or another piece of code works, and what values \u200b\u200bcontain various variables. For these purposes, a debugging mechanism has. In this article, we will analyze the highlights of working with debugging.

In order for the program to stop at a certain place, you need to set the stop point. To do this, you need to put the cursor to the desired line and click the mouse over the left field. The red circle appeared on the left. Point stop can be put using the main menu

Or using the context menu

In this place the program will stop to enable the developer to get acquainted with its behavior.

I draw your attention that the stop point must be installed on the place of the code where some operator is written. Or declared implicit variables.

There are several options, consider them all separately.

The first option, you can simply go on the code without entering any procedures and functions. To do this, use the "Step through" button or the F10 key.

Keep in mind that if the debugging transfers the control of some interactive function where the user intervention is required, then either the program will reincarnize you immediately for 1C, or the debugging will hang, and then in 1c the company will have to go on its own.

The second way, you can go on the code and go to all written procedures and functions to see how they work. To do this, click the "Step B" button, or the F11 key.

If we need to get out of some procedure or function, without waiting for its execution, then you must click the "Step from" button or keep the SHIFT key to press the F11 key.

If we need to jump over a certain place of the program, and start debugging already with new StringYou can do this in two ways. First method: set a new stop point and click the "Continue debugging" button or the F5 key. Then the program will immediately go to the desired line of code.

The second way: set the cursor to the desired and click on the "Go to the Cursor" button, or keep the SHIFT key to press the F10 key.

If working with the code you are lost in it and want to quickly return to the current debug line, it is enough to press the "Current Row" button

How to move along the code in debugging, we learned. Now the most important thing, how to find out the values \u200b\u200bof variables? This will help us tablo.

You can open it in several ways.

First: Using the main menu.

Second: Using the Configuration Debug panel.

Third: Using the Ctrl + Alt + W key combination

Downstairs appeared the scoreboard, where we can make any variables and see their values.

In addition to variable primitive types, you have the opportunity to put object type variable variables in the expression, and see their composition of this variable (if you do not debug the code to B).

The scoreboard can also be made and functions (both own and global context) to find out what they will return.

You can find out the value of the variable and without using the scoreboard. It is enough to highlight this variable and click on the "Calculate Expression" button (Keychand the Shift + F9 keys).

See visual work with debugging in this video.

Explore the foundation bases in 1C and learn to program in "1C: Enterprise" with my books:

Excellent development allowance in a managed application 1C, both for beginner developers and experienced programmers.

  1. Very affordable and understandable language of presentation
  2. The book is sent by email in pDF format. Can be opened on any device!
  3. You will understand the ideology of the managed application 1C
  4. Learn how to develop a managed application;
  5. Learn to develop controlled forms 1C;
  6. You can work with the main and necessary elements of controlled forms.
  7. Programming under a managed application will become understandable

Promo code for a discount of 15% - 48pvxheyu.


If you helped this lesson to solve some problem, I liked it or was useful, then you can support my project, listened to any amount:

you can pay manually:

Yandex.Money - 410012882996301.
Web Money - R955262494655

Join my groups.

Debug 1C. - Very powerful and functional 1C 8.3 platform mechanism, allowing you to quickly find errors in the program code (in other programming languages, this is called "debug", from English "Debug").

Below will look at the main methods of using the debugging mechanism in the form of a practical instruction on a specific example.

Attention! If you use client-server operation (on the server), you need.

The easiest way to start debugging in 1C - Open 1C in mode and start the debug mode in the desired operation mode (fine / thick, controlled / ordinary):

Debugging backgrounds 1c

In order to be able to debug background tasks, you need to go to the "Debug - Connection" menu. In the window that opens, click the Automatic Connection button:

In this window, you can set the appropriate flag.

In addition to the background tasks, in this window you can enable debugging external connections, HTTP and.

Setting the stop point (breakpoint)

The second stage in debugging is to install the stop point (in other programming languages \u200b\u200b- breakpoint).

For example, I chose to debug the "when the change" handler on the document form:

In order to establish a stop point, you need to find the desired program code and click twice on the field, to the left of the code input field (or press the F9 button):

To see a list of all installed, you need to go to the Debug menu - a list of stop points (Alt + F9):

Get 267 video tutorials for 1C for free:

1c stop point with condition (blue)

In addition to the usual breakpoint, 1C is another type of breakpoints - with the condition. Graphically, such a point is displayed in blue. Such a stop point is very useful when it is necessary to catch any specific iteration when around bypass in the cycle. Debugging will turn on at the moment when a specific condition is executed.

For example, stop the cycle on the line with the number 25:

Inactive break point (gray)

The gray point stops means that it is not active, the system will not stop at such a point. You can do it not active by pressing the special button on the "Disable Point Point" panel (SHIFT + Ctrl + F9):

Error breakpoint

The system can stop the error called, for this it is necessary in the Debug menu - the error stops to set the appropriate flag:

Also, the error stop has a functionality similar to the stop point with the condition - it allows you to filter exceptions with a specific text of the error.

Step-by-step moving on the program code 1c

After setting the stop point, it is necessary to initiate the execution of the desired software codeSo that the system enters step-by-step code execution. The arrow mapping indicates the start of the step-by-step code mode:

In order to take a step to the next line, you must press the "F11" button (step B).

If you step by step by step the line of the program code and there is a procedure or a function on the line, then you "fall out" inside this procedure (or function).

In order not to "fall out", it is enough instead of F11 (step in) to transition to the row by the F10 button (step through), this button allows you to overplay through procedures in the program code.

To go from the current cursor position to the desired, bypassing the intermediate lines of the code, you need to install the cursor on the desired line and press SHIFT + F10 (go to the cursor).

Analysis of values \u200b\u200bin debug mode 1c

View meanings certain values You can in different ways:

Display value when hovering cursor

When you hover on the variable "highlights" the variable values \u200b\u200bof the variable:

Using "Calculate Expression" or "Table"

  • Form Calculate expression You can call using the context menu or pressing fast keys - (SHIFT + F9), or the menu (debugging - calculate the expression).
  • Tablo Called using fast Ctrl + Alt + W keys or from the menu (Debugging - Table).

These two analysis methods are very similar, the main differences in the interface. The table is more convenient to use for a group of indicators, expressions - for single.

Use these methods is very simple. Just enter the name of the desired variable in the scoreboard. Big plus arbitrary computing - you can add your data to the expression.

For example:

It is very useful to use the calculation of the expression and execute the request, unload the values \u200b\u200bin the table and see it.

How to find out where the procedure is called in debugging - call stack

It is often necessary to understand where one or another procedure or a function is called from and with what parameters. For this, 1C provides special function - "Stack of calls." To start the call stack, you need to press hot keys - Ctrl + Alt + C or through the menu (Debugging - Call Stack).

With it, you can find out in detail where the procedure has been caused from and with what parameters:

If you are interested in an assessment of productivity when debugging -.

See also overview video by debugging in 1C:

Use the 1C debug mode is necessary when designing and testing typical and independently developed configurations of any complexity. This mechanism helps developers not only to eliminate the identified errors, but also provide many bottlenecks before running the system. To use all the possibilities of this 1C platform mode: Enterprise 8.3, it is necessary not only to include it, but also know the purpose of its main tools.

Enable debug mode on 1C server

If you work in the client-server version, it is necessary to use all the 1C debugger features, go through the debugging procedure on the server. It does not occupy a lot of time and does not require extensive knowledge, but neat to be still have to do, because the process will affect the change in the registry on the server.

Include debugging in 1C You can follow the following algorithm:

  • Go to the 1C server and open the register through the "Run" function from the Start menu. You can also use the simultaneous press. windows keys and R on the keyboard. Enter the Opening Team of the Register - "Regedit";
  • In the window that opens in the tree on the left, go along the way: "HKEY_LOCAL_MACHINE", "SYSTEM", "CONTROLSET001", "SERVICES", "1C: ENTERPRISE 8.3 Server Agent";
  • Having highlight the bottom item, we find the props on the name "imagepath" and change it using the context menu. To connect debugging on the server, add the "-debug" string to the existing path;
  • It remains only to restart the 1C server agent and you can use the debug mode on the server.

To start debugging through the client application, go in 1C in the configurator mode and select the desired mode in the Debug menu. Most modern configurations operate in a thin client mode, respectively, and debug performance better in this form of the client. If your configuration is used different kinds Customers, then for greater calm, it is possible to test the functionality in all modes. At the time of launching the debug mode, 1C opens the "Enterprise" mode.


Once the launch of 1C in debug mode occurred, you will see an almost similar program window. The only difference will be from below - 1C shows statistics on challenges on a gray background. But if you switch at this time to the configurator, then notice that the top panel has changed. There are new buttons with which you will manage the debug mode.

To get a maximum of benefit from debugging server procedures, you need to know the main possibilities of this mode, their purpose and methods of application. Of course, it is impossible to understand everything on theoretical level, but when you familiarize yourself with the basics, then in practice you will be much easier. In addition, most of the debugging features are rarely used, so deep knowledge of this mechanism can be useful only in a few years of work.

Among those capabilities of the debugging "Enterprise", which 1C developers are used regularly, the following can be distinguished:

  • Stoppoints;
  • Step-by-step debugging code;
  • View values;
  • Call stack.

Functions of debugging 1C.

The main possibility of debugging is to start debugging and verifying when working in the enterprise mode of 1C. For this, the 1C developers set a stop point on the algorithm string. To do this, you need to highlight the row with the mouse and click the button with the image of the red circle. You can also click twice on the left of the module text or use the "hot" key F9.

To see the installed stoppoints, use the Debug menu. There you can remove all points, disable them, add a new one and familiarize yourself with the "hot" keys. Also in this menu you can set the stop point with the condition (as a blue circle). It will come in handy in situations when you need to check the code when performing the condition that you have to register when the point is set.


Another useful mechanism from this menu is "Stop by mistake", which allows you to stop only in unacceptable situations. After stopping, you fall into the configurator and you can use other debug capabilities. For example, navigate through the code lines using the special keys described in the Debug menu, where more popular functions are displayed on top. The difference between F10 and F11 lies in the fact that in the first case you will fall into nested functions and procedures.


The server debugging in 1C is also good as you can view the value of variables after each row of code. The simplest option - Just hover the mouse cursor, and 1c will highlight the value in a swimming window. But in the platform, in the Debug menu, two more tools are built:

  • When the call, a window opens in which you can drag variables, highlighting them by double pressing in the code. The window shows their value and the type throughout the debugging - can be monitored by the change in the process of performing the algorithm;

  • The mechanism for situations where the developer wants to simulate what data it can receive the algorithm on the current location. Allows you to write any expressions and shows their meaning.


Sometimes developers need to know the sequence of calling procedures in the algorithm. For this, they use the challenge stack mechanism from the Debug menu. When it is called, a window opens in which you can see, from which procedure it was caused by the one where the debug cursor is.


It is important to know and apply all these tools for conducting tests before transferring your refinement to the working database. The above-mentioned set of mechanisms is more than enough for the successful productive work of the developer in 1C. But it is also important to monitor the new functionality, since the debugging on the server 1C 8.3 in a few years can acquire new features.



Did you like the article? Share it