debugEval

 

 

Overview

The debugEval function provides browser oriented debugging features for Lambdas running on the DRM (Dynamic typed Register Machine) Virtual Machine. Lambdas running on native code or on other virtual machines cannot be debugged with this function. The debugEval function operates in cooperation with the debug and the debugDetective functions.

The debugEval function allows a Lisp String to be evaluated in AIS debug trace mode.

The Smartbase engine has two major execution settings: JitON and JitOFF. In JitON mode, the Just-In-Time compiler generates actual machine register code for extremely fast execution. In JitOFF mode, the Virtual Machine Emulator is turned on allowing debugger tracing of instructions.

In JitOFF mode, the Smartbase engine allows tracing of VM Emulated instructions IF AND ONLY IF the instructions have been executed as a result of the debugEval function. For example, the following code

(debugEval "(foo testing:)")

will evaluate the phrase "(foo testing:)" with VM instruction tracing on under the following rules and guidelines.

JitON Rule:

If the Smartbase engine JIT is ON, then debugEval will evaluate the specified expression WITHOUT instruction tracing. Instruction tracing is ONLY available with JitOFF.

Trace Rule:

Once inside the debugEval function, with JitOFF, instruction execution will proceed normally until the current debug trace settings requests a trace break. A trace break is always requested under the following trace rules:

Break Rule:

Once inside the debugEval function, with JitOFF, if a trace break is requested, by the above trace rules, then the VM Emulator calls the "debugDetective" function, which has been supplied by the user. As soon as the debugDetective function returns control (or if debugDetective is VOID), the VM Emulator continues instruction evaluation normally, subject to the above trace rules.

debugDetective:

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 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)


Syntax


Expression(debugEval lispString);; Evaluate the Lisp String with debug tracing on.
ArgumentlispStringThe Lisp String to be evaluated.
ReturnresultThe word result from evaluating the specified Lisp String.

Usage

The debugEval function also operates in cooperation with the debug, debugDetective, and disassemble functions. For correct operation, the target AIS Lambda must have been compiled with (debug compileon:) so that debug info is generated by the compiler. The disassemble command will display the source for any Lambda compiled with (debug compileon:). The 000045: displacements, shown in these source lines, are those generated from the disassemble command, and represent the closest VM assembler displacement to the start of the specified source line

 

Syntax

 

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.

String

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

*= addMethod appendWriteln append
balance binaryInsert binarySearch boolean
character clean closeLog code
compareEQ compareGE compareGT compareLE
compareLT compareNE compare comparison
compress cons count date
day days360 debugBrowsableProcs debugDetective
debugEval dimension disassemble display
downcase encode evalInSyncLocalContext eval
exportCsv exportSbf exportTab fileDir
fileEraseDir fileExists fileMakeDir fileReadAll
fileReadRecord fileSizeOf fileWriteAll find
hashString hour importCsv importSbf
importTab insert inside inspect
integer isAtom isBitVector isBoolean
isByteVector isCharAlphabetic isCharAlphanumeric isCharLowercase
isCharName isCharNumeric isCharUppercase isCharWhitespace
isChar isCharacter isComplex isDate
isDictionary isDirectory isEqual isError
isFloatVector isIdentical isInside isIntegerVector
isInteger isLambda isMatrix isMember
isMoney isNumberMatrix isNumberVector isNumber
isObjectVector isObject isPair isPcodeVector
isString isStructure isSymbol isText
isType isVector julian left
length list loadModule loadWorkspace
macroReplace makeQuotedList makeQuotedSymbol member
mid minute money month
new number offset openLog
pair parent parse pointer
qt ref remove replace
rept right run saveImmediate
saveModule saveObject saveWorkspace second
setCar setCdr setLastCdr set
setf setq sizeof sort
sql stringCiEQ stringCiGE stringCiGT
stringCiLE stringCiLT stringCiNE stringFill
stringToBVector stringToVector string submit
substitute substringCiEQ substringCiGE substringCiGT
substringCiLE substringCiLT substringCiNE substringEQ
substringFill substringGE substringGT substringLE
substringLT substringNE substring symbolToTypeCode
symbol system text time
trim type uniqueInsert upcase
vectorFill 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