%Atelier.v2.XDebugAgent

class %Atelier.v2.XDebugAgent extends %CSP.WebSocket

This class serves as a debug agent for debugging processes. It receives client debugging commands, sends then to the debug target, gets responses, and sends them back to the client. The implementation is based on the XDEBUG DBGP protocol used by the eclipse DLTK.
http://xdebug.org/docs-dbgp.php

Property Inventory (Including Private)

Method Inventory (Including Private)

Parameters

parameter CLASS = 2;
This is the CLASS context for variable display in the IDE
parameter DOMAIN = %XDEBUG;
Parameter for Localization
parameter EXITSTATE = 1;
parameter IDLE = OnIdle;
parameter NULLSTATE = 0;
parameter PRIVATE = 0;
This is the PRIVATE context for variable display in the IDE
parameter PUBLIC = 1;
This is the PUBLIC context for variable display in the IDE
parameter SECURITYRESOURCE = %Development;
Require development resource
parameter STOP = 2;
parameter TIMEOUT = 0.1;

Properties

property Attached as %Boolean [ InitialExpression = 0 ];
This holds the attached flag
Property methods: AttachedDisplayToLogical(), AttachedGet(), AttachedIsValid(), AttachedLogicalToDisplay(), AttachedNormalize(), AttachedSet()
property BreakPoints as %String [ MultiDimensional ];
Breakpoints
Property methods: BreakPointsDisplayToLogical(), BreakPointsGet(), BreakPointsIsValid(), BreakPointsLogicalToDisplay(), BreakPointsLogicalToOdbc(), BreakPointsNormalize(), BreakPointsSet()
property CSPId as %String;
SessionId if attached to a CSP process
Property methods: CSPIdDisplayToLogical(), CSPIdGet(), CSPIdIsValid(), CSPIdLogicalToDisplay(), CSPIdLogicalToOdbc(), CSPIdNormalize(), CSPIdSet()
property Command as %String [ MultiDimensional ];
This holds the current command
Property methods: CommandDisplayToLogical(), CommandGet(), CommandIsValid(), CommandLogicalToDisplay(), CommandLogicalToOdbc(), CommandNormalize(), CommandSet()
property ContinuationCmdIssued as %Boolean [ InitialExpression = 0 ];
This holds the Continuation command issued flag
Property methods: ContinuationCmdIssuedDisplayToLogical(), ContinuationCmdIssuedGet(), ContinuationCmdIssuedIsValid(), ContinuationCmdIssuedLogicalToDisplay(), ContinuationCmdIssuedNormalize(), ContinuationCmdIssuedSet()
property Debug as %Debugger.System;
This holds the debugger instance
Property methods: DebugGet(), DebugGetSwizzled(), DebugIsValid(), DebugNewObject(), DebugSet(), DebugTargetDisplayToLogical(), DebugTargetGet(), DebugTargetIsValid(), DebugTargetLogicalToDisplay(), DebugTargetLogicalToOdbc(), DebugTargetNormalize(), DebugTargetSet()
property DebugTarget as %String;
This holds the debug_target (passsed to us by set_feature)
Property methods: DebugTargetDisplayToLogical(), DebugTargetGet(), DebugTargetIsValid(), DebugTargetLogicalToDisplay(), DebugTargetLogicalToOdbc(), DebugTargetNormalize(), DebugTargetSet()
property DeviceList as %List;
This holds the device list for $System.Socket.Select
Property methods: DeviceListGet(), DeviceListIsValid(), DeviceListLogicalToOdbc(), DeviceListOdbcToLogical(), DeviceListSet()
property Features as %String [ MultiDimensional ];
This holds the values of the features set by the IDE
Property methods: FeaturesDisplayToLogical(), FeaturesGet(), FeaturesIsValid(), FeaturesLogicalToDisplay(), FeaturesLogicalToOdbc(), FeaturesNormalize(), FeaturesSet()
property FirstRunCommandSeen as %Boolean [ InitialExpression = 0 ];
This holds the first run command flag
Property methods: FirstRunCommandSeenDisplayToLogical(), FirstRunCommandSeenGet(), FirstRunCommandSeenIsValid(), FirstRunCommandSeenLogicalToDisplay(), FirstRunCommandSeenNormalize(), FirstRunCommandSeenSet()
property LastContinuationCmd as %String;
This holds the last 'continuation' command issued Continuation commands are 'run','step_into','step_over','step_out' 'stop' and 'detach'. We need to record this so that the appropriate status message can be reported to the client when a breakpoint is hit or the program ends.
Property methods: LastContinuationCmdDisplayToLogical(), LastContinuationCmdGet(), LastContinuationCmdIsValid(), LastContinuationCmdLogicalToDisplay(), LastContinuationCmdLogicalToOdbc(), LastContinuationCmdNormalize(), LastContinuationCmdSet()
property NextState as %String [ InitialExpression = ..#NULLSTATE ];
This holds the next state to switch to
Property methods: NextStateDisplayToLogical(), NextStateGet(), NextStateIsValid(), NextStateLogicalToDisplay(), NextStateLogicalToOdbc(), NextStateNormalize(), NextStateSet()
property StackLevelMappings as %Integer [ MultiDimensional ];
This holds the mappings from server stack level to IDE stack level
Property methods: StackLevelMappingsDisplayToLogical(), StackLevelMappingsGet(), StackLevelMappingsIsValid(), StackLevelMappingsLogicalToDisplay(), StackLevelMappingsNormalize(), StackLevelMappingsSet()
property StartedAttach as %Boolean [ InitialExpression = 0 ];
This says we started via Attach instead of Launch
Property methods: StartedAttachDisplayToLogical(), StartedAttachGet(), StartedAttachIsValid(), StartedAttachLogicalToDisplay(), StartedAttachNormalize(), StartedAttachSet()
property TargetOrPID as %String;
This holds the target OR PID
Property methods: TargetOrPIDDisplayToLogical(), TargetOrPIDGet(), TargetOrPIDIsValid(), TargetOrPIDLogicalToDisplay(), TargetOrPIDLogicalToOdbc(), TargetOrPIDNormalize(), TargetOrPIDSet()
property Trace as %Boolean [ InitialExpression = $Get(^IRIS.Temp.Atelier("debug"))>0 ];
This holds the TRACE flag
Property methods: Trace(), TraceDisplayToLogical(), TraceGet(), TraceIsValid(), TraceLogicalToDisplay(), TraceNodeDisplayToLogical(), TraceNodeGet(), TraceNodeIsValid(), TraceNodeLogicalToDisplay(), TraceNodeNormalize(), TraceNodeSet(), TraceNormalize(), TraceSet()
property TraceNode as %Integer;
This holds the TRACE global node for this session
Property methods: TraceNodeDisplayToLogical(), TraceNodeGet(), TraceNodeIsValid(), TraceNodeLogicalToDisplay(), TraceNodeNormalize(), TraceNodeSet()
property TransactionId as %String [ MultiDimensional ];
This holds the current transaction identifier
Property methods: TransactionIdDisplayToLogical(), TransactionIdGet(), TransactionIdIsValid(), TransactionIdLogicalToDisplay(), TransactionIdLogicalToOdbc(), TransactionIdNormalize(), TransactionIdSet()
property WebSocketDevice as %String;
This holds the websocket device
Property methods: WebSocketDeviceDisplayToLogical(), WebSocketDeviceGet(), WebSocketDeviceIsValid(), WebSocketDeviceLogicalToDisplay(), WebSocketDeviceLogicalToOdbc(), WebSocketDeviceNormalize(), WebSocketDeviceSet()

Methods

method Attach() as %Status [ Language = objectscript ]
Utility method to attach to the target process
method AttachCSP() as %Status [ Language = objectscript ]
Utility method to attach to a CSP process
method CreateErrorResponse(pCmd As %String, pErrorCode As %Integer, pTransactionId As %Integer, pMsg As %String) as %String [ Language = objectscript ]
Create an error response including error code and message to be displayed by IDE
method CreatePropertyResponse(pVarName As %String, pVarValue As %String, Output pXML As %String, pNumChildren=0) as %Status [ Language = objectscript ]
Given a variable name and a value, create a property for reporting to the IDE
method FlushOutput() [ Language = objectscript ]
Flush output before breaking the connection
method GetClassProperties(Output pPropList As %String) as %Status [ Language = objectscript ]
Get the properties for the CLASS context
classmethod GetClientPosFromDebugPos(pServerIntPos, Output pMapped, ByRef pNameSpace, Output pDocName, Output pLabel, Output pOffset) [ Language = objectscript ]
This method is given the debugger position (in the INT code) and returns a logical docname,label and offset The client will have to perform addtional logic to find exactly where in the source document the location is If pMapped is 0, then there is no source
method GetInitMsg(Output pInitMsg) as %Status [ Language = objectscript ]
Get InitMsg
method GetStackProperties(pContext As %Integer, pServerLevel As %Integer, Output pPropList As %String) as %Status [ Language = objectscript ]
Given a context (LOCAL,GLOBAL) and stack level, get the variables defined at that level
method InitTrace() [ Language = objectscript ]
Intialize the trace (if required)
classmethod Interpolate(pString, pTerm, pValue) as %String [ Language = objectscript ]
Utility method to interpolate values in a string
method Launch() as %Status [ Language = objectscript ]
Utility method to launch the target given the properties set by set_feature
method MapCommandToHandler(pCmdString As %String) as %Status [ Language = objectscript ]
Map the command to the associated handler (assumes valid command) Some commands are handled inline
method OnPreServer() as %Status [ Language = objectscript ]
Event handler for the PreServer event: this is invoked before starting the WebSockets Server. Changes to the SharedConnection flag must be made here.
method ParseCommand(pCmdString As %String, Output pParsed) as %Status [ Language = objectscript ]
Parse XDebug command Definition:- cmd : cmdname [ arglist ]; cmdname : lowercase STRING arglist : arg | [ arg arglist ]; arg : argid argval argid : '-' CHAR argval : STRING Example:- feature_get -i 6 -n language_supports_threads The command string is parsed into this structure:- var="feature_get" var("-i")=6 var("-n")="language_supports_threads"
method ReportEvent(pEvent As %String, pXmlData="") as %Status [ Language = objectscript ]
Report an event by writing to the WebSocket
method Server() as %Status [ Language = objectscript ]
The WebSocket Server
method TidyUp(pStatus) as %Status [ Language = objectscript ]
Here we do state specific tidy up (will be called if an error has occurred)
method Trace(pMsg As %String) [ Language = objectscript ]
Log a trace if tracing enabled
method break() as %Status [ Language = objectscript ]
IDE Command handler for 'break' command
method breakpoint_get() as %Status [ Language = objectscript ]
breakpoint_get -d User.Debug.cls:DebugMe:3 -i 51"
method breakpoint_list() as %Status [ Language = objectscript ]
breakpoint_list
method breakpoint_remove() as %Status [ Language = objectscript ]
breakpoint_remove
method breakpoint_set() as %Status [ Language = objectscript ]
IDE Command handler for 'breakpoint_set' command breakpoint_set -m DebugMe -n 3 -r 0 -s enabled -t line -f dbgp://|USER|User.Debug.cls -i 10"
method breakpoint_update() as %Status [ Language = objectscript ]
breakpoint_update
method context_get() as %Status [ Language = objectscript ]
IDE Command handler for 'context_get' command
method context_names() as %Status [ Language = objectscript ]
IDE Command handler for 'context_names' command
method detach() [ Language = objectscript ]
IDE Command handler for 'detach' command
method eval() as %Status [ Language = objectscript ]
IDE Command handler for 'eval' command
method feature_get() as %Status [ Language = objectscript ]
IDE Command handler for 'feature_get' command
method feature_set() as %Status [ Language = objectscript ]
IDE Command handler for 'feature_set' command
method property_get() as %Status [ Language = objectscript ]
IDE Command handler for 'property_get' command
method property_set() as %Status [ Language = objectscript ]
IDE Command handler for 'property_set' command
method property_value() as %Status [ Language = objectscript ]
IDE Command handler for 'property_value' command
classmethod requote(value As %String) as %String [ Language = objectscript ]
Given a string that is the output of Quote(), check for control characters that were left inside a quoted literal. If found, Quote that literal and insert it back into the original string. This is done carefully so we don't end up with double-double quotes.
method run() as %Status [ Language = objectscript ]
IDE Command handler for 'run' command
method stack_get() as %Status [ Language = objectscript ]
IDE Command handler for 'stack_get' command
method stderr() as %Status [ Language = objectscript ]
method stdin() as %Status [ Language = objectscript ]
IDE Command handler for 'stdin' command
method stdout() as %Status [ Language = objectscript ]
method step_into() as %Status [ Language = objectscript ]
IDE Command handler for 'step_into' command
method step_out() as %Status [ Language = objectscript ]
IDE Command handler for 'step_over' command
method step_over() as %Status [ Language = objectscript ]
IDE Command handler for 'step_over' command
method stop() [ Language = objectscript ]
IDE Command handler for 'stop' command
method watchpoint_set() as %Status [ Language = objectscript ]
IDE (pseudo) Command handler for 'watchpoint_set' command breakpoint_set -m DebugMe -n 2 -r 0 -s enabled -t watch -f dbgp://|USER|User.Debug.cls -i 22 -- WA==

Inherited Members

Inherited Properties (Including Private)

Inherited Methods (Including Private)

Feedback