debug
|
The debug 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. More information on the DRM Virtual Machine can be found in
the Virtual Machine Chapter. The debug function provides commands for setting the Smartbase engine switches and debugger trace settings. Commands and arguments to the "debug" function: 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 retiurns 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) Usage The debug function also operates in cooperation with the debugEval, 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
Expression:
Arguments
Name
Type
Description Argument: command String|Symbol
The String or Symbol command specifying the action to be taken
Returns:
Here are a number of links to Lambda coding examples which contain this instruction in various use cases.
Here are the links to the data types of the function arguments.
Lambda | Boolean | Symbol |
Here are also a number of links to functions having arguments with any of these data types.
Analytic Information Server (AIS)AIS Component Systems
|