Ends a debugging session, or terminates one or more processes of a multiprocess program, allowing any application-declared exit handlers to run. If used within a command procedure or DO clause and no process is specified, it exits the command procedure or DO clause at that point. Format EXIT [process-spec[, . . . ]]
1 – Parameters
process-spec Specifies a process currently under debugger control. Use any of the following forms: [%PROCESS_NAME] process- The process name, if that name does not name contain spaces or lowercase characters. The process name can include the asterisk (*) wildcard character. [%PROCESS_NAME] The process name, if that name contains "process-name " spaces or lowercase characters. You can also use apostrophes (') instead of quotation marks ("). %PROCESS_PID process_id The process identifier (PID, a hexadecimal number). [%PROCESS_NUMBER] The number assigned to a process when process-number it comes under debugger control. A (or %PROC process- new number is assigned sequentially, number) starting with 1, to each process. If a process is terminated with the EXIT or QUIT command, the number can be assigned again during the debugging session. Process numbers appear in a SHOW PROCESS display. Processes are ordered in a circular list so they can be indexed with the built-in symbols %PREVIOUS_PROCESS and %NEXT_PROCESS. process-set-name A symbol defined with the DEFINE/PROCESS_SET command to represent a group of processes. %NEXT_PROCESS The next process after the visible process in the debugger's circular process list. %PREVIOUS_PROCESS The process previous to the visible process in the debugger's circular process list. %VISIBLE_PROCESS The process whose stack, register set, and images are the current context for looking up symbols, register values, routine calls, breakpoints, and so on. You can also use the asterisk (*) wildcard character to specify all processes.
2 – Description
The EXIT command is one of the four debugger commands that can be used to execute your program (the others are CALL, GO, and STEP). Ending a Debugging Session: To end a debugging session, enter the EXIT command at the debugger prompt without specifying any parameters. This causes orderly termination of the session: the program's application- declared exit handlers (if any) are executed, the debugger exit handler is executed (closing log files, restoring the screen and keypad states, and so on), and control is returned to the command interpreter. You cannot then continue to debug your program by entering the DCL command DEBUG or CONTINUE (you must restart the debugger). Because EXIT runs any application-declared exit handlers, you can set breakpoints in such exit handlers, and the breakpoints are triggered upon typing EXIT. Thus, you can use EXIT to debug your exit handlers. To end a debugging session without running any application- declared exit handlers, use the QUIT command instead of EXIT. Using the EXIT Command in Command Procedures and DO Clauses: When the debugger executes an EXIT command (without any parameters) in a command procedure, control returns to the command stream that invoked the command procedure. A command stream can be the terminal, an outer (containing) command procedure, or a DO clause in a command or screen display definition. For example, if the command procedure was invoked from within a DO clause, control returns to that DO clause, where the debugger executes the next command (if any remain in the command sequence). When the debugger executes an EXIT command (without any parameters) in a DO clause, it ignores any remaining commands in that clause and displays its prompt.
3 – Description, Continued...
Terminating Specified Processes: If you are debugging a multiprocess program you can use the EXIT command to terminate specified processes without ending the debugging session. The same techniques and behavior apply, whether you enter the EXIT command at the prompt or use it within a command procedure or DO clause. To terminate one or more processes, enter the EXIT command, specifying these processes as parameters. This causes orderly termination of the images in these processes, executing any application-declared exit handlers associated with these images. Subsequently, the specified processes are no longer identified in a SHOW PROCESS/ALL display. If any specified processes were on hold as the result of a SET PROCESS command, the hold condition is ignored. When the specified processes begin to exit, any unspecified process that is not on hold begins execution. After execution is started, the way in which it continues depends on whether you entered a SET MODE [NO]INTERRUPT command. By default (SET MODE INTERRUPT), execution continues until it is suspended in any process. At that point, execution is interrupted in any other processes that were executing images, and the debugger prompts for input. To terminate specified processes without running any application- declared exit handlers or otherwise starting execution, use the QUIT command instead of EXIT. Related commands: DISCONNECT @ (Execute Procedure) Ctrl/C Ctrl/Y Ctrl/Z QUIT RERUN RUN SET ABORT_KEY SET MODE [NO]INTERRUPT SET PROCESS
4 – Examples
1.DBG> EXIT $ This command ends the debugging session and returns you to DCL level. 2.all> EXIT %NEXT_PROCESS, JONES_3, %PROC 5 all> This command causes orderly termination of three processes of a multiprocess program: the process after the visible process on the process list, process JONES_3, and process 5. Control is returned to the debugger after the specified processes have exited.