Skip to main content

%Atelier.v1.XDebugAgent

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

This class serves as a debug agent for debugging cache 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

Method Inventory

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 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()
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 Launched as %Boolean [ InitialExpression = 0 ];
This holds the launched flag
Property methods: LaunchedDisplayToLogical(), LaunchedGet(), LaunchedIsValid(), LaunchedLogicalToDisplay(), LaunchedNormalize(), LaunchedSet()
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 cache stack level mappings to IDE stack level mappings
Property methods: StackLevelMappingsDisplayToLogical(), StackLevelMappingsGet(), StackLevelMappingsIsValid(), StackLevelMappingsLogicalToDisplay(), StackLevelMappingsNormalize(), StackLevelMappingsSet()
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(^CacheTemp.ISC.Atelier("debug"))>0 ];
This holds the TRACE flag
Property methods: Trace(), TraceDisplayToLogical(), TraceGet(), TraceIsValid(), TraceLogicalToDisplay(), 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
Utility method to launch the target given the properties set by set_feature
method CreateErrorResponse(pCmd As %String, pErrorCode As %Integer, pTransactionId As %Integer, pMsg As %String) as %String
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
Given a variable name and a value, create a property for reporting to the IDE
method GetClassProperties(Output pPropList As %String) as %Status
Get the properties for the CLASS context
classmethod GetClientPosFromDebugPos(pServerIntPos, Output pMapped, ByRef pNameSpace, Output pDocName, Output pLabel, Output pOffset)
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
Get InitMsg
method GetStackProperties(pContext As %Integer, pCacheLevel As %Integer, Output pPropList As %String) as %Status
Given a context (LOCAL,GLOBAL) and CacheStack level, get the variables defined at that level
method InitTrace()
Intialize the trace (if required)
classmethod Interpolate(pString, pTerm, pValue) as %String
Utility method to interpolate values in a string
method Launch() as %Status
Utility method to launch the target given the properties set by set_feature
method MapCommandToHandler(pCmdString As %String) as %Status
Map the command to the associated handler (assumes valid command) Some commands are handled inline
method OnPreServer() as %Status
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
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 ReportError(pErrorText As %String) as %Status
Report an event by writing to the WebSocket
method ReportEvent(pEvent As %String, pXmlData="") as %Status
Report an event by writing to the WebSocket
method Server() as %Status
The WebSocket Server
method TidyUp(pStatus) as %Status
Here we do state specific tidy up (will be called if an error has occurred)
method Trace(pMsg As %String)
Log a trace if tracing enabled
method break() as %Status
IDE Command handler FOR 'break' command
method breakpoint_get() as %Status
breakpoint_get -d User.Debug.cls:DebugMe:3 -i 51"
method breakpoint_list() as %Status
breakpoint_list
method breakpoint_remove() as %Status
breakpoint_remove
method breakpoint_set() as %Status
IDE Command handler FOR 'breakpoint_set' command breakpoint_set -m DebugMe -n 3 -r 0 -s enabled -t line -f file:///Users/jamien/eclipse/runtime-EclipseApplication/XDebug/User.Debug.cls -i 10"
method breakpoint_update() as %Status
breakpoint_update
method context_get() as %Status
IDE Command handler FOR 'context_get' command
method context_names() as %Status
IDE Command handler FOR 'context_names' command
method eval() as %Status
IDE Command handler for 'eval' command
method feature_get() as %Status
IDE Command handler FOR 'feature_get' command
method feature_set() as %Status
IDE Command handler FOR 'feature_set' command
method property_get() as %Status
IDE Command handler for 'property_get' command
method property_set() as %Status
IDE Command handler for 'property_set' command
method property_value() as %Status
IDE Command handler for 'property_value' command
classmethod requote(value As %String) as %String
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
IDE Command handler FOR 'run' command
method stack_get() as %Status
IDE Command handler FOR 'stack_get' command
method stderr() as %Status
method stdin() as %Status
IDE Command handler FOR 'stdin' command
method stdout() as %Status
method step_into() as %Status
IDE Command handler for 'step_into' command
method step_out() as %Status
IDE Command handler for 'step_over' command
method step_over() as %Status
IDE Command handler for 'step_over' command
method stop()
IDE Command handler FOR 'stop' command
method watchpoint_set() as %Status
IDE (pseudo) Command handler FOR 'watchpoint_set' command breakpoint_set -m DebugMe -n 2 -r 0 -s enabled -t watch -f file:///Users/haiodo/Develop/workspaces/runtime-New_configuration222/Demo3/User.Debug.cls -i 22 -- WA==

Inherited Members

Inherited Properties

Inherited Methods

FeedbackOpens in a new tab