debugopts - Low level control of the debugging facilities
|
Calling Sequence
|
|
debugopts(setting, ...)
|
|
Parameters
|
|
setting
|
-
|
one or more names or equations describing debugging options
|
|
|
|
|
Description
|
|
•
|
The debugopts function is used to monitor, set, and invoke various debugging options and facilities. It is not intended to be called by the user, but rather is a support function for the debugger function.
|
•
|
The arguments to debugopts are each of the form name or of the form name = expr. Some arguments will result in a returned value, and others will not. The debugopts function will return a sequence of any results generated.
|
•
|
The allowable arguments are:
|
interrupt=true
|
Causes Maple to stop before the next statement is executed, as if Ctrl-C or the Interrupt button has been pressed.
|
steplevel=n
|
|
steplevel
|
Sets or queries the minimum evaluation stack level (as returned by kernelopts(level)) at which execution is allowed to continue without the debugger being invoked. The debugger uses this facility to allow single stepping. This setting does not actually take effect until the debugger has been entered, and execution has been continued.
|
stopat=[procName,statNum]
|
Sets or clears a breakpoint at the specified statement number of the specified procedure. If statNum is negative, the breakpoint is cleared; if positive, it is set.
|
addwatch=name
|
The specified name is added to the global variable watch table.
|
delwatch=name
|
The specified name is removed from the global variable watch Rtable.
|
watchtable=[nameList]
|
The watch table is set to the specified list of names.
|
watchtable
|
The current watch table is returned, as a list.
|
adderror=name
|
The specified name is added to the error watch table.
|
delerror=name
|
The specified name is removed from the error watch table.
|
errortable=[errList]
|
The error watch table is set to the specified list of error messages.
|
errortable
|
The current error watch table is returned, as a list.
|
statcount=procName
|
The number of statements in the specified procedure is returned.
|
procdump=procName
|
|
procdump=[procName,statNumber]
|
|
procdump=[procName,statNumber..statNumber]
|
Produces a string containing a printed representation of the specified procedure, with statement numbers. If statement numbers are specified, only that range of statements appears in the representation.
|
callstack
|
Produces a list giving details about the stack of active procedure calls. The list will contain 3n+4 elements. The first element is the name DEBUGSTACK. The remaining elements are in groups of 3. The first element in each group is the name of the called function. The next element is the current statement within that function. The third element is a list of the parameters passed to the function. The last three elements in the list refer to the initial call at the top level. WARNING: debugopts(callstack) can return invalid Maple data structures (intentionally), and should not be called by users.
|
lasterror
|
|
lastexception
|
Returns the value of lasterror or lastexception respectively at the time the debugger was invoked.
|
traceproc=procName
|
|
traceproc=true
|
|
traceproc=false
|
|
traceproc
|
Turns on statement level tracing. If called with a right-hand side giving a procedure name, the specified procedure is instrumented for statement level tracing. If called with `true`, all procedures are instrumented for tracing as soon as they are read from the library. A right-hand side of `false` turns off automatic tracing. If called with no right-hand side, debugopts(traceproc) returns true or false depending on whether automatic tracing of all procedures is active. Tracing data for a procedure is displayed by showstat(procName) or by calling debugopts( traceproctable=procName ).
|
istraceproced=procName
|
Returns true if the given procedure is collecting tracing data. Otherwise it returns false.
|
traceproctable=procName
|
Returns an rtable of the tracing information collected for the given procedure. If the procedure is not being traced an error is raised.
|
|
|
|
|
Thread Safety
|
|
•
|
The debugopts command is thread safe as of Maple 15, however some settings are global and can be effected by the actions of other threads.
|
•
|
interrupt, addwatch, delwatch, watchtable, adderror, delerror, errortable, traceproc=boolean, stopat, statcount, traceproc=procName, procdump, istraceproced and traceproctable have global effect. For those that effect global settings, the current setting will be determined by the order in which the commands a processes. Thus without explicit synchronization, you may not be able to predict which settings are in effect.
|
•
|
callstack, steplevel, lasterror and lastexception have a thread local effect, thus ## calling them will have no effect on other threads.
|
|
|