Interactive Maple Debugger - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Programming : Debugging : worksheet/interactive/debugger

Interactive Maple Debugger

 

Description

Evaluating Expressions Using the Debugger

Interactive Debugger Window

Other Debugger Commands

Description

  

The interactive Maple Debugger can be invoked with the stopat, stopwhen, and stoperror commands, or by clicking the debug icon ( ) during a running computation.

  

The Debugger is implemented as a Maple function, which is invoked automatically by Maple when a breakpoint or watchpoint is encountered, or when the DEBUG function is executed.

• 

If the interactive Maple Debugger was invoked by a breakpoint (as set by stopat), the displayed expression is the result of the last statement executed.

• 

If it was invoked by a watchpoint on a variable (as set by stopwhen), the expression is an equality, the left-hand side of which is the name of the variable that was being watched, and the right-hand side of which shows the value that was assigned to the variable.

• 

If it was invoked by a watchpoint on an error message (as set by stoperror), the expression is the error message.

Evaluating Expressions Using the Debugger

  

You can evaluate an expression within a procedure in two ways:

• 

The expression is evaluated in the context of the stopped procedure and the result is displayed. The semantics of variable names and evaluation are exactly the same as they would be if the expression had originally appeared within the procedure (except that using a variable as the control variable of seq() will not make that variable local if it is not already local). Because the Debugger runs in its own environment, the expressions lasterror and lastexception do not refer to the error that may have caused the Debugger to be invoked. Use the showerror or showexception commands instead.

• 

Using statement Any-Maple-Expression syntax. Similar to the above, except the expression is evaluated in a global context and the result is displayed. The keyword statement must precede the Maple expression.

Interactive Debugger Window

  

The interactive Maple Debugger window contains the following.

• 

A main text box that displays a procedure name and the Debugger output.

• 

A text box for entering commands and an associated Execute button.

• 

Buttons that perform common debugging functions.

Button Descriptions

  

The buttons at the bottom of the Debugger window perform common debugging functions. Most have an associated command.

• 

step - Step into next statement.

• 

next - Step into next statement on same nesting level.

• 

into - Step into next statement sequence.

• 

outfrom - Step out from statement sequence.

• 

continue - Continue execution until the next breakpoint or watchpoint.

• 

list - List procedure.

• 

showstat - Display procedure.

• 

help - Open the debugger help page.

• 

clear - Delete the contents of the top text box.

• 

return - Return from procedure.

• 

quit - Close the Debugger window.

• 

copy - Copy debug contents to worksheet.

Other Debugger Commands

  

For information on other Debugger commands, see Commands. These commands can be entered in the text box next to the Execute button.

See Also

DEBUG

debugger

showstat

stopat

stoperror

stopwhen