Guardian Programmer's Guide

Table Of Contents
Debugging, Trap Handling, and Signal Handling
Guardian Programmer’s Guide 421922-014
25 - 4
Getting a Process Into the Debug State
You can accomplish the same thing using the PROCESS_LAUNCH_ procedure. The
difference is that the debug options bits are passed to PROCESS_LAUNCH_ in a field
in a structure instead of in a separate parameter.
The following example uses PROCESS_CREATE_ to start a new process in the
Debug state:
OBJFILE ':=' "REQFILE" -> @S^PTR;
OBJFILENAME^LENGTH := @S^PTR ‘-’ @OBJFILE;
NAME^OPTION := ZSYS^VAL^PCREATOPT^NAMEINCALL;
PROCESS^NAME ':=' "$REQ" -> @S^PTR;
PROCESS^NAME^LENGTH := @S^PTR ‘-’ @PROCESS^NAME;
DEBUG^OPTIONS := 0;
DEBUG^OPTIONS.<12> := 1;
ERROR := PROCESS_CREATE_(OBJFILE:OBJFILENAME^LENGTH,
!library^file:length!,
!swap^file:length!,
!ext^swap^file:length!,
!priority!,
!processor!,
PROCESS^HANDLE,
!error^detail!,
NAME^OPTION,
PROCESS^NAME:PROCESS^NAME^LENGTH,
PROCESS^DESCRIPTOR:MAXLEN,
PROCESS^DESCRIPTOR^LENGTH,
!nowait^tag!,
!hometerm:length!,
!memory^pages!,
!job^id!,
!create^options!,
!defines:length!,
DEBUG^OPTIONS);
Using the RUND Command
You can use the RUND command to start a process in the Debug state. You must
supply the name of an object file as the parameter to the RUND command.
RUND OBJFILE
To invoke the debugger, you must either have the process access ID of the process
you want to debug, be the group manager of that process, or be the super ID user.
Using the RUNV Command
The RUNV command runs a process under control of Visual Inspect. The equivalent
OSS command is runv. For example:
>RUNV WSADDR=MYPC GPROG (Guardian)
$ runv -wsaddr=MYPC oss prog (OSS)
These commands start a Visual Inspect debug session on the workstation MYPC.