IRISLIB database
System Class Reference

This class is used internally by InterSystems. More...

Inheritance diagram for System:
Collaboration diagram for System:

Public Member Functions

_.Library.Status OnClose ()
 This class is used internally by InterSystems. More...
 
_.Library.Status Atelierv5EvalOref (_.Library.String oref, _.Library.Integer maxdepth, _.Library.String result)
 Evaluate and return the properties / values of variable which is an oref and any of its child objects, up to maxdepth
 
_.Library.Integer Attach (_.Library.String pid)
 Attach to another process having process id of pid. More...
 
_.Library.Integer Break ()
 Send a BREAK to the target process. More...
 
_.Library.Integer DBGCommand (_.Library.String cmd, _.Library.Integer issys)
 Perform a debug command.
 
_.Library.Integer Eval (_.Library.String expr, _.Library.String result)
 Evaluate and return the value of expression. More...
 
_.Library.Integer EvalOref (_.Library.String oref, _.Library.Binary vararray)
 Evaluate and return the property/value pairs of variable which is an oref.
 
_.Library.Integer GetValue (_.Library.String Variable, _.Library.String Value, _.Library.Integer Lang)
 Gets the value of a variable.
 
_.Library.Integer Go ()
 Continue the current process.
 
_.Library.Integer GoTo (_.Library.String tag)
 Continue the current process at tag.
 
_.Library.Integer Interrupt ()
 Interrupt the target process. More...
 
_.Library.Integer IsStopped (_.Library.Integer timeout)
 Return true if the target is in break mode.
 
_.Library.Integer Resume ()
 Continue the current process without stepping on return.
 
_.Library.Integer SetValue (_.Library.String variable, _.Library.String value)
 Sets a variable to a value.
 
_.Library.Integer StackVars (_.Library.Integer lev, _.Library.String start, _.Library.Binary vararray)
 Get Stack info for target. More...
 
_.Library.Integer StartTarget (_.Library.String target, pWriteOutput)
 Start a local debugging session on a new process. More...
 
 Trace (_.Library.String pMsg)
 Log a trace if tracing enabled.
 
_.Library.Integer Unattach ()
 Unattach from the current process, if any. More...
 
_.Library.Integer Write (_.Library.String data)
 Write to the target process.
 
- Public Member Functions inherited from RegisteredObject
_.Library.Status OnAddToSaveSet (_.Library.Integer depth, _.Library.Integer insert, _.Library.Integer callcount)
 This callback method is invoked when the current object is added to the SaveSet,. More...
 
_.Library.Status OnConstructClone (_.Library.RegisteredObject object, _.Library.Boolean deep, _.Library.String cloned)
 This callback method is invoked by the <METHOD>ConstructClone</METHOD> method to. More...
 
_.Library.Status OnNew ()
 This callback method is invoked by the <METHOD>New</METHOD> method to. More...
 
_.Library.Status OnValidateObject ()
 This callback method is invoked by the <METHOD>ValidateObject</METHOD> method to. More...
 

Static Public Member Functions

 DebugStub (pWriteOutput)
 System stub used by the debugger application. More...
 

Public Attributes

 Attached
 Flag indicating whether we are Attached to a target. More...
 
 CmdId
 Command ID of target process. More...
 
 DebId
 Event id of this debugger instance. More...
 
 Dev
 Device for i/o redirecttion. More...
 
 DevOpen
 Flag indicating we have attempted to open an i/o device. More...
 
 Job
 Job number of target process. More...
 
 Killtarget
 Kill target on disconnect flag. More...
 
 Location
 Current Location info for target process. More...
 
 OutputToDebugDevice
 This property can be used to disable outputing of device data by setting the value to 0. More...
 
 Pid
 Process ID of target process. More...
 
 RsetVars
 Result set for Variables. More...
 
 Sid
 Session ID of target process. More...
 
 Stack
 Current Stack info for target process. More...
 
 Stopped
 Flag indicating if target is stopped. More...
 
 atelierTrace
 Set to non-zero if running under Atelier debugger
More...
 
 trace
   More...
 

Additional Inherited Members

- Static Public Attributes inherited from RegisteredObject
 CAPTION = None
 Optional name used by the Form Wizard for a class when generating forms. More...
 
 JAVATYPE = None
 The Java type to be used when exported.
 
 PROPERTYVALIDATION = None
 This parameter controls the default validation behavior for the object. More...
 

Detailed Description

This class is used internally by InterSystems.

You should not make direct use of it within your applications. There is no guarantee made about either the behavior or future operation of this class.

<font size=+2>>System Debugging in InterSystems IRIS</font>

<font size=+1>>Overview</font>

The system debugger allows external debugging of processes via a set of debugging commands provided by the class Debugger.System. The debugger may be used to attach to processes running ObjectScript routines, or to start routines for debugging. In either case, the user must: <o:p></o:p>

  • Start a target process, specifying what routine it is to execute (optional)
  • Attach to the target process
  • Issue commands to the target process to control its execution

Any process executing routines may be attached to by a user with suitable privileges. <o:p></o:p>

Debugging methods are provided which allow the user to: <o:p></o:p>

  • Attach to the process and put it in break mode <o:p></o:p>
  • Control execution (break, step, step into, step out, continue) <o:p></o:p>
  • Set and clear breakpoints and watchpoints <o:p></o:p>
  • View current location and stack information <o:p></o:p>
  • View and set variables, evaluate expressions, and execute COS commands <o:p></o:p>

Commands may only be issued when the target is in break mode. Since the state of the target is uncertain following any debugger command, the method <METHOD>IsStopped</METHOD> must be used to test if the process is in fact in break mode. After a process has been attached, this method must be called, and return successfully, following every debugger command, before another command may be issued. The exceptions are <METHOD>Unattach</METHOD>(detach from a process and stop debugging), and <METHOD>Break</METHOD> (break into a process which is executing under debugger control). <o:p></o:p>

Location information is automatically returned whenever the process breaks. The property <PROPERTY>Location</PROPERTY> contains the raw location information. The methods <METHOD>GetOffset</METHOD> and <METHOD>GetSource</METHOD> may be used to obtain analysed location and source data. <o:p></o:p>

<font size=+1>>Terminals</font>

Two terminal output windows may be started. One of the windows is started when processes are started by the debugger,and is the principle device for the process. <o:p></o:p>

Another window may be started after any process is attached, which is the debug device for the process. All debugger output is displayed in this window. <o:p></o:p>

Both of these windows are also available when debugging remote processes. In this case, the windows are started on the local platform. <o:p></o:p>

<font size=+1>>Starting a routine</font>

The Debugger provides a stub which is jobbed to create a debug process. This stub awaits debugger commands to open a terminal window, and execute the desired routine. <o:p></o:p>

The method <METHOD>StartTarget</METHOD>, which takes a routine name as an argument, uses this stub to begin debugging a routine. It jobs the stub to begin execution, starts the Cterm windows, attaches to the process, and signals what routine is to be run. Upon completion, the process is ready for debugging. Breakpoints may be set and the routine executed. <o:p></o:p>

<font size=+1>>Attaching a process</font>

Any process may be attached for debugging. The method <METHOD>Attach</METHOD> takes a numeric process id as an argument. Upon successful completion, the target is ready to be debugged. <o:p></o:p>

<font size=+1>>Remote Debugging</font>

Remote and local debugging are identical, except for the sequence of commands required to open the Cterm windows. Since the Cterm windows are on the local platform, a separate Debugger.System instance must be used on the local and remote platforms. <o:p></o:p>

To start a process, the user follows this sequence: <o:p></o:p>

  • (Remote platform) Start the target stub via <METHOD>StartTargetRemote</METHOD> <o:p></o:p>
  • (Local platform) Start the cterm via <METHOD>Cterm</METHOD>, using the output port information returned from <METHOD>StartTargetRemote</METHOD> <o:p></o:p>
  • (Remote platform) Attach the target stub via <METHOD>DebugTarget</METHOD> <o:p></o:p>

Remember that upon successful completion of any command, the target may not be in break mode. The method <METHOD>IsStopped</METHOD> must be explicitly invoked, and return a success code, before any new commands may be issued. </body> </html>

Member Function Documentation

◆ OnClose()

_.Library.Status OnClose ( )

This class is used internally by InterSystems.

You should not make direct use of it within your applications. There is no guarantee made about either the behavior or future operation of this class.

<font size=+2>>System Debugging in InterSystems IRIS</font>

<font size=+1>>Overview</font>

The system debugger allows external debugging of processes via a set of debugging commands provided by the class Debugger.System. The debugger may be used to attach to processes running ObjectScript routines, or to start routines for debugging. In either case, the user must: <o:p></o:p>

  • Start a target process, specifying what routine it is to execute (optional)
  • Attach to the target process
  • Issue commands to the target process to control its execution

Any process executing routines may be attached to by a user with suitable privileges. <o:p></o:p>

Debugging methods are provided which allow the user to: <o:p></o:p>

  • Attach to the process and put it in break mode <o:p></o:p>
  • Control execution (break, step, step into, step out, continue) <o:p></o:p>
  • Set and clear breakpoints and watchpoints <o:p></o:p>
  • View current location and stack information <o:p></o:p>
  • View and set variables, evaluate expressions, and execute COS commands <o:p></o:p>

Commands may only be issued when the target is in break mode. Since the state of the target is uncertain following any debugger command, the method <METHOD>IsStopped</METHOD> must be used to test if the process is in fact in break mode. After a process has been attached, this method must be called, and return successfully, following every debugger command, before another command may be issued. The exceptions are <METHOD>Unattach</METHOD>(detach from a process and stop debugging), and <METHOD>Break</METHOD> (break into a process which is executing under debugger control). <o:p></o:p>

Location information is automatically returned whenever the process breaks. The property <PROPERTY>Location</PROPERTY> contains the raw location information. The methods <METHOD>GetOffset</METHOD> and <METHOD>GetSource</METHOD> may be used to obtain analysed location and source data. <o:p></o:p>

<font size=+1>>Terminals</font>

Two terminal output windows may be started. One of the windows is started when processes are started by the debugger,and is the principle device for the process. <o:p></o:p>

Another window may be started after any process is attached, which is the debug device for the process. All debugger output is displayed in this window. <o:p></o:p>

Both of these windows are also available when debugging remote processes. In this case, the windows are started on the local platform. <o:p></o:p>

<font size=+1>>Starting a routine</font>

The Debugger provides a stub which is jobbed to create a debug process. This stub awaits debugger commands to open a terminal window, and execute the desired routine. <o:p></o:p>

The method <METHOD>StartTarget</METHOD>, which takes a routine name as an argument, uses this stub to begin debugging a routine. It jobs the stub to begin execution, starts the Cterm windows, attaches to the process, and signals what routine is to be run. Upon completion, the process is ready for debugging. Breakpoints may be set and the routine executed. <o:p></o:p>

<font size=+1>>Attaching a process</font>

Any process may be attached for debugging. The method <METHOD>Attach</METHOD> takes a numeric process id as an argument. Upon successful completion, the target is ready to be debugged. <o:p></o:p>

<font size=+1>>Remote Debugging</font>

Remote and local debugging are identical, except for the sequence of commands required to open the Cterm windows. Since the Cterm windows are on the local platform, a separate Debugger.System instance must be used on the local and remote platforms. <o:p></o:p>

To start a process, the user follows this sequence: <o:p></o:p>

  • (Remote platform) Start the target stub via <METHOD>StartTargetRemote</METHOD> <o:p></o:p>
  • (Local platform) Start the cterm via <METHOD>Cterm</METHOD>, using the output port information returned from <METHOD>StartTargetRemote</METHOD> <o:p></o:p>
  • (Remote platform) Attach the target stub via <METHOD>DebugTarget</METHOD> <o:p></o:p>

Remember that upon successful completion of any command, the target may not be in break mode. The method <METHOD>IsStopped</METHOD> must be explicitly invoked, and return a success code, before any new commands may be issued. </body> </html>

Reimplemented from RegisteredObject.

◆ Attach()

Attach to another process having process id of pid.

Fails if already attached (use <method>Unattach</method> first),or if pid is invalid.

On successful completion, process is attached and a break issued. The process will be in break mode upon completion of its current operation.

◆ Break()

_.Library.Integer Break ( )

Send a BREAK to the target process.

On successful completion, a break has been issued. The process will be in break mode upon completion of its current operation.

◆ DebugStub()

DebugStub (   pWriteOutput)
static

System stub used by the debugger application.

This class method is jobbed in order to start a target process.

The stub waits on the input event for the debugger to pass the name of the target routine to be executed.

When signalled, the stub then executes target routine

◆ Eval()

Evaluate and return the value of expression.

expr within the target process.

◆ Interrupt()

_.Library.Integer Interrupt ( )

Interrupt the target process.

The target process is sent a software interrupt. This causes the target to break. The next line of code will be executed when the target is resumed.

◆ StackVars()

_.Library.Integer StackVars ( _.Library.Integer  lev,
_.Library.String  start,
_.Library.Binary  vararray 
)

Get Stack info for target.

Show the call stack, state and variables using ^STACK lev,start,.vararray,.next

◆ StartTarget()

_.Library.Integer StartTarget ( _.Library.String  target,
  pWriteOutput 
)

Start a local debugging session on a new process.

Job the cterm debug stub Start a cterm connected to the target Run DebugTarget to run the process

On exit from this routine, the target is in break mode waiting for a command

◆ Unattach()

_.Library.Integer Unattach ( )

Unattach from the current process, if any.

Assumes the target has been stopped

Returns $$$OK if successful, error code if nothing to detach from

Member Data Documentation

◆ Attached

Attached

Flag indicating whether we are Attached to a target.

 

◆ CmdId

CmdId

Command ID of target process.

Target waits for commands on this Event

 

◆ DebId

DebId

Event id of this debugger instance.

 

◆ Dev

Dev

Device for i/o redirecttion.

 

◆ DevOpen

DevOpen

Flag indicating we have attempted to open an i/o device.

 

◆ Job

Job

Job number of target process.

 

◆ Killtarget

Killtarget

Kill target on disconnect flag.

 

◆ Location

Location

Current Location info for target process.

 

◆ OutputToDebugDevice

OutputToDebugDevice

This property can be used to disable outputing of device data by setting the value to 0.

 

◆ Pid

Pid

Process ID of target process.

 

◆ RsetVars

RsetVars

Result set for Variables.

 

◆ Sid

Sid

Session ID of target process.

Target signals on this Event.

 

◆ Stack

Current Stack info for target process.

 

◆ Stopped

Stopped

Flag indicating if target is stopped.

 

◆ atelierTrace

atelierTrace

Set to non-zero if running under Atelier debugger

-1 means no trace
>0 is the Atelier trace node  

◆ trace

trace