IRISLIB database
Debugger Class Reference

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

Inheritance diagram for Debugger:
Collaboration diagram for Debugger:

Public Member Functions

_.Library.Status OnClose ()
 This class is used internally by InterSystems IRIS. More...
 
_.Library.Status Attach (_.Library.String pid, _.Studio.Project project)
 Attach to another process having process id of pid. More...
 
_.Library.Status AttachToCSP (_.Library.Integer id, _.Studio.Project project)
 Attach to a CSP process, first you must call the <method>GetCSPAttachID</method> More...
 
_.Library.Boolean Break ()
 Send a BREAK to the target process. More...
 
_.Library.Boolean DBGCommand (_.Library.String cmd, _.Library.Integer IsSys)
 Perform a debug command.
 
_.Library.String Eval (_.Library.String expr)
 Evaluate and return the value of expression. More...
 
_.Library.Integer GetCSPAttachID ()
 To attach to a CSP process, first call this method which will return you a unique. More...
 
_.Library.Integer GetOffset (_.Library.String RoutineName, _.Library.Integer BeginCmdLine, _.Library.Integer BeginCmdOffset, _.Library.Integer EndCmdLine, _.Library.Integer EndCmdOffset, _.Library.Integer BeginArgLine, _.Library.Integer BeginArgOffset, _.Library.Integer EndArgLine, _.Library.Integer EndArgOffset, _.Library.String NameSpace)
 Return the current location of the debugger. More...
 
_.Library.String GetSource ()
 Return the routine source at the current location.
 
_.Library.String GetStack ()
 Gets the simple stack information sent from the target.
 
_.Library.String GetStackId ()
 Requests stack variable info.
 
_.Library.Boolean GetValue (_.Library.String variable, _.Library.String value)
 Gets the value of a variable.
 
_.Library.Boolean Go ()
 Continue the current process.
 
_.Library.Boolean GoTo (_.Library.String tag)
 Continue the current process.
 
_.Library.Boolean Interrupt ()
 Interrupt the target process. More...
 
_.Library.Integer IsStopped ()
 Returns 1 if the target is stopped in break mode. More...
 
_.Library.Status MappedOffset (_.Library.String mapping, _.Library.String namespace, _.Library.String flag)
 Return the list of source files that the current break point maps to starting with the INT/BAS routine. More...
 
_.Library.String Pid ()
 return process id of attached target
 
_.Library.Boolean RoutineMap (_.Library.String current, _.Library.String routine, _.Library.String rouns)
 Check if routine is mapped to current namespace. More...
 
_.Library.Boolean SetBreakpointsFromProject (_.Studio.Project project)
 Set all break points defined in project. More...
 
_.Library.Boolean SetValue (_.Library.String variable, _.Library.String value)
 Sets a variable to a value.
 
_.Library.Status StartTarget (_.Library.String tag, _.Library.Boolean StartOption, _.Studio.Project project)
 Job off a routine that executes tag. More...
 
_.Library.Status Unattach (_.Library.Boolean kill)
 Unattach from the current process, if any. More...
 
_.Library.Boolean WriteTarget (_.Library.String data)
 Write to 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

_.Library.String GetInfo (_.Library.Integer Job, _.Library.Integer Pid)
 Gather information about a process.
 
_.Library.Status INTLine (_.Library.String name, _.Library.String label, _.Library.Integer line, _.Library.String intname, _.Library.String intline, _.Library.Integer returntype, _.Library.String pNameSpace)
 Given a document name, label and line offset it returns the name and line corresponding to this in the INT code. More...
 
_.Library.Status MappedFromLine (_.Library.String rtn, _.Library.Integer line, _.Library.String namespace, _.Library.String mapping)
 Return the list of source files that the routine and line map to. More...
 
_.Library.Status MappedFromPos (_.Library.String routineName, _.Library.Integer beginCmdLine, _.Library.Integer beginCmdOffset, _.Library.Integer endCmdLine, _.Library.Integer endCmdOffset, _.Library.Integer beginArgLine, _.Library.Integer beginArgOffset, _.Library.Integer endArgLine, _.Library.Integer endArgOffset, _.Library.String namespace, _.Library.String mapping, _.Library.String flag)
 Return the list of source files that the position passed in maps to. More...
 
_.Library.Status SourceLine (_.Library.String intName, _.Library.Integer startLine, _.Library.Integer startPos, _.Library.Integer endLine, _.Library.Integer endPos, _.Library.String Namespace, _.Library.String map)
 Given INT routine name and line number and offset in this line return an array of source lines. More...
 

Public Attributes

 Breakpoints
 Current breakpoint information for target process. More...
 
 CSPId
 SessionId if attached to CSP process. More...
 
 Debug
 System Debugger object. More...
 
 IO
 I/O redirection flag. More...
 
 LastError
 Last error. More...
 
 Project
 Project. More...
 
 Watchpoints
 Current watchpoint information for target process. More...
 
 trace
   More...
 

Private Member Functions

_.Library.Integer __Error (_.Library.String err)
 error routine
 

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 IRIS.

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.

Studio debugging interface.

Member Function Documentation

◆ OnClose()

_.Library.Status OnClose ( )

This class is used internally by InterSystems IRIS.

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.

Studio debugging interface.

Reimplemented from RegisteredObject.

◆ Attach()

_.Library.Status Attach ( _.Library.String  pid,
_.Studio.Project  project 
)

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.

◆ AttachToCSP()

_.Library.Status AttachToCSP ( _.Library.Integer  id,
_.Studio.Project  project 
)

Attach to a CSP process, first you must call the <method>GetCSPAttachID</method>

to obtain the ID to pass to this method.

◆ Break()

_.Library.Boolean Break ( )

Send a BREAK to the target process.

A successful return indicates the target will be in break mode on completion of the current command.

Issue IsStopped to determine if target is in break mode.

◆ Eval()

Evaluate and return the value of expression.

expr within the target process.

◆ GetCSPAttachID()

_.Library.Integer GetCSPAttachID ( )

To attach to a CSP process, first call this method which will return you a unique.

ID number. Then display the CSP page but add an extra parameter of 'CSPDEBUG=<ID>' for example 'http://localhost/csp/samples/loop.csp?CSPDEBUG=123456'. Then call the <method>AttachToCSP</method> method which will attach to the process that is running this CSP page.

◆ GetOffset()

_.Library.Integer GetOffset ( _.Library.String  RoutineName,
_.Library.Integer  BeginCmdLine,
_.Library.Integer  BeginCmdOffset,
_.Library.Integer  EndCmdLine,
_.Library.Integer  EndCmdOffset,
_.Library.Integer  BeginArgLine,
_.Library.Integer  BeginArgOffset,
_.Library.Integer  EndArgLine,
_.Library.Integer  EndArgOffset,
_.Library.String  NameSpace 
)

Return the current location of the debugger.

This includes both the command and the argument

positions.

◆ INTLine()

_.Library.Status INTLine ( _.Library.String  name,
_.Library.String  label,
_.Library.Integer  line,
_.Library.String  intname,
_.Library.String  intline,
_.Library.Integer  returntype,
_.Library.String  pNameSpace 
)
static

Given a document name, label and line offset it returns the name and line corresponding to this in the INT code.

returntype values are

  • 0 - Ok
  • 1 - Line given is not mapped so returning the next mapped line as breakpoint instead
  • 2 - No mapping found at all, nothing returned

For example if you wish to find out which line is generated from class 'User.Test' in method 'MyMethod' at offset '+3' you call:

Set sc=##class(Studio.Debugger).INTLine("User.Test.CLS","MyMethod",3,.intname,.intline,.returntype)

type is one of 'CLS' or 'MAC' currently.

◆ Interrupt()

_.Library.Boolean Interrupt ( )

Interrupt the target process.

The current command will be interrupted.

Execution will proceed with the next command.

◆ IsStopped()

_.Library.Integer IsStopped ( )

Returns 1 if the target is stopped in break mode.

0 indicates target is still running. 2 indicates target has exited debugger or fatal error.

◆ MappedFromLine()

_.Library.Status MappedFromLine ( _.Library.String  rtn,
_.Library.Integer  line,
_.Library.String  namespace,
_.Library.String  mapping 
)
static

Return the list of source files that the routine and line map to.

The format of each source file data is:

routineName.routineType,label,line,namespace

◆ MappedFromPos()

_.Library.Status MappedFromPos ( _.Library.String  routineName,
_.Library.Integer  beginCmdLine,
_.Library.Integer  beginCmdOffset,
_.Library.Integer  endCmdLine,
_.Library.Integer  endCmdOffset,
_.Library.Integer  beginArgLine,
_.Library.Integer  beginArgOffset,
_.Library.Integer  endArgLine,
_.Library.Integer  endArgOffset,
_.Library.String  namespace,
_.Library.String  mapping,
_.Library.String  flag 
)
static

Return the list of source files that the position passed in maps to.

Each source file is separated by a space character. The format of each source file data is:

routineName,label,beginCmdLine,beginCmdOffset,endCmdLine,endCmdOffset,beginArgLine,beginArgOffset,endArgLine,endArgOffset,Namespace

◆ MappedOffset()

_.Library.Status MappedOffset ( _.Library.String  mapping,
_.Library.String  namespace,
_.Library.String  flag 
)

Return the list of source files that the current break point maps to starting with the INT/BAS routine.

Each source file is separated by a space character. The format of each source file data is:

routineName,label,beginCmdLine,beginCmdOffset,endCmdLine,endCmdOffset,beginArgLine,beginArgOffset,endArgLine,endArgOffset,Namespace

◆ RoutineMap()

_.Library.Boolean RoutineMap ( _.Library.String  current,
_.Library.String  routine,
_.Library.String  rouns 
)

Check if routine is mapped to current namespace.

Returns 1 if successful, 0 if not mapped to current

◆ SetBreakpointsFromProject()

_.Library.Boolean SetBreakpointsFromProject ( _.Studio.Project  project)

Set all break points defined in project.

Return 0 if project=NULL, else return status code from SetBreakpoint

◆ SourceLine()

_.Library.Status SourceLine ( _.Library.String  intName,
_.Library.Integer  startLine,
_.Library.Integer  startPos,
_.Library.Integer  endLine,
_.Library.Integer  endPos,
_.Library.String  Namespace,
_.Library.String  map 
)
static

Given INT routine name and line number and offset in this line return an array of source lines.

that map to this INT line. The format of this return array is:

map(type,StartEnd)=$listbuild(sourceName,sourceLabel,sourceLine,Offset,Namespace)

Where StartEnd is 1 for the start of the map and 2 for the end, sourceName is the name of the source file, sourceLabel is the method/label name, sourceLine is the number of lines from this label to the location, Offset is the offset on the line, Namespace is the location of the source file.

◆ StartTarget()

_.Library.Status StartTarget ( _.Library.String  tag,
_.Library.Boolean  StartOption,
_.Studio.Project  project 
)

Job off a routine that executes tag.

If breakpoints are specified, the target will halt at the first breakpoint.

◆ Unattach()

_.Library.Status Unattach ( _.Library.Boolean  kill)

Unattach from the current process, if any.

Returns $$$OK if successful, $$$ERROR if nothing to detach from

Member Data Documentation

◆ Breakpoints

Breakpoints

Current breakpoint information for target process.

 

◆ CSPId

CSPId

SessionId if attached to CSP process.

 

◆ Debug

Debug

System Debugger object.

 

◆ IO

IO

I/O redirection flag.

 

◆ LastError

LastError

Last error.

 

◆ Project

◆ Watchpoints

Watchpoints

Current watchpoint information for target process.

 

◆ trace

trace