Process Dump Files
QM includes the option to generate a process dump file containing a detailed report of the state of the process. There are five ways to generate a process dump:
A process dump will be created automatically if the DUMP.ON.ERROR mode of the OPTION command is active and the process aborts either due to an error detected by QM or from use of the ABORT statement in a QMBasic program.
Use of the DUMPING option in the CATCH clause of a TRY/CATCH block.
Selection of the P option following use of the break key.
Use of the QMBasic PDUMP statement.
Use of the PDUMP command. This can be used to generate a dump of a different process such as a phantom or a QMClient process.
By default, the process dump is directed to an operating system level file named qmdump.n in the QMSYS account directory where n is the QM user number. The directory to receive the dump file can be changed using the DUMPDIR configuration parameter. Because use of PDUMP potentially allows a user to view data from another user's session, reducing system security, the PDUMP configuration parameter can be used to restrict the command to dumping other processes running under the same user name.
The file consists of a number of sections detailing the current state of the user process at the time of the error.
1. Environment data
QM version number
Licence number and site name
Parent user number (zero except in phantom processes)
Values of STATUS() and OS.ERROR()
Transaction id, command processor level and start time (only if in a transaction)
@-variables that are likely to be useful in determining the cause of an error.
3. Active numbered select lists
The report shows all task locks, file locks and record locks owned by the process.
5. Program stack
This contains an entry for each program, working backwards from the program in which the error occurred.
For each program, the dump shows
Program number (used in some cross-references within the dump)
Program name, instruction address and line number. Line numbers cannot be shown if the program was compiled with no cross reference tables or these were removed when the program was catalogued.
Program status flags showing various special program states.
GOSUB return stack, if not empty.
Variables. Local variables are sorted alphabetically. Elements of a common block are shown in memory order and are only dumped on the first program that references the block. Non-printing characters in strings are replaced by \nn where nn is the hexadecimal character value. Backslash characters are shown as \\. Character string data is not line wrapped to simplify exploration of the data using tools such as the SED editor.