debugopts - Maple Programming Help

Online Help

All Products    Maple    MapleSim

Home : Support : Online Help : Programming : Debugging : debugopts


Low level control of the debugging facilities


Calling Sequence



Thread Safety

Calling Sequence

debugopts(setting, ...)




one or more names or equations describing debugging options



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:


Causes Maple to stop before the next statement is executed, as if Ctrl-C or the Interrupt button has been pressed.




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.


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.


The specified name is added to the global variable watch table.


The specified name is removed from the global variable watch Rtable.


The watch table is set to the specified list of names.


The current watch table is returned, as a list.


The specified name is added to the error watch table.


The specified name is removed from the error watch table.


The error watch table is set to the specified list of error messages.


The current error watch table is returned, as a list.


The number of statements in the specified procedure is returned.






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.


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.




Returns the value of lasterror or lastexception respectively at the time the debugger was invoked.








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 can be retrieved for further processing by calling debugopts(traceproctable=procName).




Switches statement level tracing to use real time instead of CPU time. This should be set only once before a tracing 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)


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


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.


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

See Also








Download Help Document

Was this information helpful?

Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam