debugopts - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


debugopts

Low level control of the debugging facilities

 

Calling Sequence

Parameters

Description

Thread Safety

Compatibility

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,statNum]

 

procdump=[procName,statNum..statNum]

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 profiling. If called with a right-hand side giving a procedure name, the specified procedure is instrumented for statement level profiling. If called again with the same procedure name on the right-hand side, it toggles off profiling. If called with `true`, all procedures are instrumented for profiling as soon as they are read from the library. A right-hand side of `false` turns off profiling. If called with no right-hand side, debugopts(traceproc) returns true or false depending on whether profiling of all procedures is active. Profiling data for a procedure is displayed by showstat(procName), or can be retrieved for further processing by calling debugopts(traceproctable=procName).

istraceproced=procName

Returns true if the given procedure is collecting profiling data. Otherwise it returns false.

traceproctable=procName

Returns an rtable of the profiling information collected for the given procedure.  If the procedure is not being profiled, an error is raised.

tracerealtime=true

 

tracerealtime=false

Switches statement level profiling to use real time instead of CPU time. This should be set only once before a profiling session is started, otherwise the reported times will then be an indeterminate mix of real time and CPU time. The default is to use CPU time (i.e. tracerealtime=false)

tracecatch=true

 

tracecatch=false

Deprecated in Maple 2020. Use kernelopts(tracecatch) instead.

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 affect global settings, the current setting will be determined by the order in which the commands are processed.  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.

• 

For more information on thread safety, see index/threadsafe.

Compatibility

• 

The debugopts command was updated in Maple 2020.

See Also

debugger

kernelopts

showstat

stopat

stoperror

stopwhen

stopwhenif