stopat - Maple Help

Home : Support : Online Help : Programming : Debugging : stopat

stopat

set a breakpoint in a procedure at a specified statement number

unstopat

clear a breakpoint in a procedure at a specified statement number

 Calling Sequence stopat(procName, statNum, condition) unstopat(procName, statNum)

Parameters

 procName - name of the procedure in which to set a breakpoint statNum - optional statement number at which to set or clear breakpoints condition - optional Boolean condition

Description

 • The stopat function sets a breakpoint at each of the specified statement numbers of the specified procedure. If no statement numbers are specified, the breakpoint is set at the beginning of the procedure.
 • The optional condition indicates a condition which must be true in order for execution to stop. A Boolean expression must be used (ie. one whose top level operator is one of $<$, $<=$, $>=$, $>$, $=$, $<>$, and, or, or not). Calling evalb is not necessary, and is not allowed. The condition can refer to global variables, and local variables and parameters of the procedure in which the breakpoint is being set.
 • Breakpoints in exported members of modules are set or cleared in a way analogous to those in globally defined procedures, except that the module name and :- must be specified.
 Breakpoints in private (local) members of a module can be set or cleared using the syntax moduleName::memberName. This is the only case in which it is possible to refer to a private member of a module from outside that module (unless $\mathrm{kernelopts}\left(\mathrm{opaquemodules}\right)$ is false).
 • If a module, M, has a ModuleApply member function, then the command stopat(M) is equivalent to stopat(M:-ModuleApply) or stopat(M::ModuleApply).
 • The stopat function returns a list of the names of procedures in which breakpoints have been set. If no arguments are passed to stopat, no breakpoints are set, but the list is still returned.
 • Breakpoints in exported members of a module will appear prefixed by their module name if and only if the module has a name. If the module has no name, only the member name will appear. Breakpoints in private members of a module will appear with just the member name.
 Breakpoints in a module's ModuleApply function will appear as the module name, instead of the name ModuleApply.
 • The unstopat function clears the breakpoints at each of the specified statement numbers of the specified procedure. If no statement numbers are specified, all breakpoints in the procedure are cleared.
 • If no arguments are passed to unstopat, all breakpoints in all procedures are cleared.
 • The unstopat function returns a list of the names of procedures in which breakpoints remain set.
 • Breakpoints can be viewed using the showstat function or the showstat command in the debugger.
 • When execution reaches a breakpoint, the debugger is invoked (before the statement at which the breakpoint has been set is executed).

Examples

Note: These examples illustrate the use of these debugger commands in Maple's command-line interface. In the standard (graphical) interface, the debugger runs in its own window, with controls for most of the common commands.  See Interactive Maple Debugger for details.

 > f := proc(x) if x < 3 then print(x); print(x^2) end if; print(-x); x^3 end proc:
 > $\mathrm{stopat}\left(f\right)$

 [f]

 > $\mathrm{stopat}\left(f,3\right)$

 [f]

 > $\mathrm{showstat}\left(f\right)$

 f := proc(x) 1*   if x < 3 then 2      print(x); 3*     print(x^2) end if; 4    print(-x); 5    x^3 end

 > $f\left(2\right)$

 f: 1*   if x < 3 then ... end if; DBG> cont 2 f: 3*   print(x^2) DBG> cont 4 -2

 ${8}$ (1)