debugDetective

 

 

Overview

The debugDetective Lambda receives synchronous calls from the DRM (Dynamic typed Register Machine) whenever a debugger trace event occurs. The debugDetective Lambda is Lisp programmer supplied. If the Lisp programmer suplies no debugDetective Lambda, then the VM will not trace instructions.

The user supplied debugDetective, in combination with the debugEval function, provide an enhancement to the standard Lisp debugging method, which is to insert writeln instructions at strategic locations in the code. Before the debugDectective function is called, the VM Emulator sets the gTP->DebugSuspended switch to ON so that instuction tracing is inactive until the debugDetective function returns control to the VM Emulator.

The activities of the debugDetective can include the traditional Lisp writeln instructions or they can be as complex and creative as the user supplied debugDetective function can manage.

Once the debugDetective function returns control to the VM Emulator, instruction tracing continues in the normal manner until the debugEval function returns control. Instruction tracing is ONLY active while inside the debugEval function ONLY when JitOFF is true.

The debugDetective function is called under three circumstances as follows:

;; Called by the debug & debugEval functions when the engine state is changed.

(debugDetective)

;; Called by the VM Emulator when a trace break has been requested.

(debugDetective Lambda CodeL Recursion Rv Av Tv Pv Cv Sv Iv void)

;; Called by the VM Emulator when an error has occured.

(debugDetective Lambda CodeL Recursion Rv Av Tv Pv Cv Sv Iv errMsg)

Usage

The debugDetective function also operates in cooperation with the disassemble function and the debugDialog function. For correct operation, the target Analytic Information Server Lambda must have been compiled with (debug compileon:). The disassemble command will display the source and generated DRM virtual machine instructions for any Lambda compiled with (debug compileon:). The displacement nn: arguments, shown in these debug commands, are those generated from the disassemble command.

 

Syntax


Expression:(debugDetective) ;; Called from VM when an engine state change has occurred

Arguments Name Type Description

Returns: The VM ignores any return value



Expression:(debugDetective Lambda CodeL Recursion Rv Av Tv Pv Cv Sv Iv errMsg) ;; Called from VM when an error has occurred

Arguments Name Type Description
Argument:LambdaLambda The Lambda in which the error occurred
Argument:CodeLInteger The VM assembler displacement at which the error occurred
Argument:RecursionInteger The VM recursion level at which the error occurred
Argument:RvStructure The Structure of Registers == value pairs when the error occurred
Argument:AvStructure The Structure of Argument == value pairs when the error occurred
Argument:TvStructure The Structure of vars == value pairs when the error occurred
Argument:PvStructure The Structure of pvars == value pairs when the error occurred
Argument:CvStructure The Structure of cvars == value pairs when the error occurred
Argument:SvStructure The Structure of svars == value pairs when the error occurred
Argument:IvStructure The Structure of Interfaces == value pairs when the error occurred
Argument:errMsgString The String error message when the error occurred

Returns: The VM ignores any return value



Expression:(debugDetective Lambda CodeL Recursion Rv Av Tv Pv Cv Sv Iv errMsg) ;; Called from VM when an instruction trace break has occurred

Arguments Name Type Description
Argument:LambdaLambda The Lambda in which the trace break occurred
Argument:CodeLInteger The VM assembler displacement at which the trace break occurred
Argument:RecursionInteger The VM recursion level at which the trace break occurred
Argument:RvStructure The Structure of Registers == value pairs when the trace break occurred
Argument:AvStructure The Structure of Argument == value pairs when the trace break occurred
Argument:TvStructure The Structure of vars == value pairs when the trace break occurred
Argument:PvStructure The Structure of pvars == value pairs when the trace break occurred
Argument:CvStructure The Structure of cvars == value pairs when the trace break occurred
Argument:SvStructure The Structure of svars == value pairs when the trace break occurred
Argument:IvStructure The Structure of Interfaces == value pairs when the trace break occurred
Argument:errMsgVoid The error message is always void

Returns: The VM ignores any return value


 

Examples

Here are a number of links to Lambda coding examples which contain this instruction in various use cases.

 

Argument Types

Here are the links to the data types of the function arguments.

Integer String Structure Vector

Here are also a number of links to functions having arguments with any of these data types.

++ += + /=
/ *= * --
-= - addMethod addi
appendWriteln append apply avg
badd balance bdiv binaryInsert
binaryNand binaryNor binaryNot binaryNxor
binarySearch bitToNumberVector bitwiseAnd bitwiseNand
bitwiseNor bitwiseNot bitwiseNxor bitwiseOr
bitwiseShiftLeft bitwiseShiftRight bitwiseXor bmod
bmul boolean cadd cdiv
cdr char character class
clean closeLog cmod cmul
code compareEQ compareGE compareGT
compareLE compareLT compareNE compare
comparison compress cons copy
count csub date day
days360 debugBrowsableProcs debugDetective debugEval
defineStructure defstruct deleteRows delete
dimension disassemble display divi
downcase encode evalInSyncLocalContext eval
exit exportCsv exportSbf exportTab
fact fdisplay fieldsOf fileClose
fileCopy fileDir fileDisplay fileEraseDir
fileErase fileExists fileMakeDir fileOpen
fileReadAll fileReadRecord fileRead fileResize
fileSeek fileSizeOf fileWriteAll fileWrite
filewriteln findBlock find floor
fraction freeBlock gcd getRecursionCount
hashString hour iadd icompareEQ
icompareGE icompareGT icompareLE icompareLT
icompareNE idiv imod importCsv
importSbf importTab imul insertRows
insert inside inspect integer
isAtom isBitVector isBoolean isBound
isByteVector isCharAlphabetic isCharAlphanumeric isCharLowercase
isCharName isCharNumeric isCharUppercase isCharWhitespace
isChar isCharacter isClass isComplex
isDate isDictionary isDirectory isEqual
isError isEven isFloatVector isIdentical
isInside isIntegerVector isInteger isLambda
isMatrix isMember isMoney isNumberMatrix
isNumberVector isNumber isObjectVector isObject
isPair isPcodeVector isString isStructure
isSymbol isText isType isVector
isub julian kurtosis lcm
left length list loadModule
loadWorkspace macroReplace makeGramMatrix makeQuotedList
makeQuotedSymbol makeStructure map mapc
max median member mid
min minute mod modi
money month muli new
number objectToList objectToMatrix objectToNumMatrix
objectToNumVector objectToStructure objectToVector offset
openLog pair parent parse
pointer preAllocateFixedMemoryBlocks product proprecord
putprop qt random randomize
range rank refAttributes refValues
ref remProp remove replace
rept resize reverse right
round run saveImmediate saveModule
saveObject saveWorkspace second send
setAttributes setBlock setCar setCdr
setLastCdr set setf setq
sizeof skew sort sql
sqrt srandom stdev stdevp
stringCiEQ stringCiGE stringCiGT stringCiLE
stringCiLT stringCiNE stringFill stringToBVector
stringToVector string subi submit
substitute substringCiEQ substringCiGE substringCiGT
substringCiLE substringCiLT substringCiNE substringEQ
substringFill substringGE substringGT substringLE
substringLT substringNE substring sum
sumsqr super svmRegression symbolToTypeCode
symbol system text time
trim type uniqueInsert upcase
var varp vectorBinaryInnerProduct vectorBipolarInnerProduct
vectorCosineInnerProduct vectorCubeInnerProduct vectorDelete vectorExpInnerProduct
vectorFill vectorInnerProduct vectorLogInnerProduct vectorQuartInnerProduct
vectorQuintInnerProduct vectorSigmoidInnerProduct vectorSineInnerProduct vectorSquareInnerProduct
vectorTanInnerProduct vectorTanhInnerProduct writelg writeln
year

Analytic Information Server (AIS)

AIS Component Systems

  • Smartbase Engine
  • QT C++ Libraries
  • MySQL Relational Database
  • AIS Lisp Libraries
  • Rapid Analytic Demo IDE