If you want to debug a program unit that executes automatically when the application is started, e.g. program units for a Start Exit or the MSGTAC program for start messages then you must start the application in a special way:
You start the main process just like for a UTM production application. However, you must also specify the TEST parameter.
To do this, open a Command Prompt window, change directories to the application directory and enter the following:
utmmain . startparam-file TEST 1>utmp-out.txt <nul
The PATH variable must be set accordingly when this is done, i.e., it must contain
UTMPATH\ex
. The output to stdout is redirected to a file here. nul corresponds to/dev/null
on Unix and Linux systems.The main process utmmain then creates only the timer process and additional resources such as the pipe used to communicate with the work process. No work processes are create, however. The main process requests with message U244 that you start a work process. U244 can appear as follows, for example:
U244 utmmain: Please start ./utmwork with arguments:
V07.0A23 sample01 . ./startp.std 0 0 Y
You will need the second line later for the debugger. The argument 0
means that this process will be restarted, i.e. it does not replace any previously terminated work process. In addition,Y
means that this is the first work process.You may not close the window yet, otherwise the main process is terminated!
Please note that if you are testing in dialog mode then the second work process is a UTM system process and that it may therefore be necessary to start three work processes if, for example, programs are to be tested with PGWT.
You must start the first work process utmwork under the control of the debugger. To do this, proceed as follows:
Open the application project in Microsoft Visual Studioand choose the menu item Project - utmwork properties.
In the navigation area, click Debugging under Configuration Properties, enter the name of the filebase in the work directory field and specify the values from the U244 message in the Command Arguments field.
These values have the following structure:utmversion appliname filebase startparameter-file
0 0 Y
Click OK to start the first work process.
Click the Start Debug command in the Debug menu to start the first work process with the debugger.
You can start additional work processes after that. You should always restart work processes when the main process requests you to do so with message U244. Additional processes always require the value N as the last argument.
Please note that if you are testing in dialog mode then the second work process is a UTM system process and that it may therefore be necessary to start three work processes if, for example, programs are to be tested with PGWT.
You can take the parameters for starting the work processes from the associated message U244.
version appliname filebase startparam-file pid id N
You cannot start more work processes than was specified in the start parameter file for TASKS= . The maximum number of work processes is defined in the UTM generation in the MAX statement. If you try to start more work processes, then this will result in start errors.
If not all work processes have fully completed the scheduled end-of-process handling, you must explicitly terminate the main process after the work processes have been terminated by closing the associated window or terminating the process utmmain.exe using the Task Manager.
You must terminate the utmmain
process when terminating the application by closing the window, for example.
You will find a detailed description of the steps to be taken to start the application in the openUTM manual “Using UTM Applications on Unix, Linux and Windows Systems”.
Behavior in the event of errors
If a work process produces a PEND ER dump, then this work process is terminated and you are requested by message U244 to start a new work process.
To do this, repeat step 2 but replace the following values:
replace the values 0 for pid and id with the values specified in message U244
replace the value Y with E