Next: , Previous: , Up: Edebug   [Contents][Index]


22.4.10 Evaluation List Buffer

You can use the evaluation list buffer, called ‘*edebug*’, to evaluate expressions interactively. You can also set up the evaluation list of expressions to be evaluated automatically each time Edebug updates the display.

E

Switch to the evaluation list buffer ‘*edebug*’ (edebug-visit-eval-list).

In the ‘*edebug*’ buffer you can use the commands of Lisp Interaction as well as these special commands:

LFD

Evaluate the expression before point, in the outside context, and insert the value in the buffer (edebug-eval-print-last-sexp).

C-x C-e

Evaluate the expression before point, in the context outside of Edebug (edebug-eval-last-sexp).

C-c C-u

Build a new evaluation list from the first expression of each group, reevaluate and redisplay (edebug-update-eval-list). Groups are separated by comment lines.

C-c C-d

Delete the evaluation list group that point is in (edebug-delete-eval-item).

C-c C-w

Switch back to the source code buffer at the current stop point (edebug-where).

You can evaluate expressions in the evaluation list window with LFD or C-x C-e, just as you would in ‘*scratch*’; but they are evaluated in the context outside of Edebug.

The expressions you enter interactively (and their results) are lost when you continue execution unless you add them to the evaluation list with C-c C-u. This command builds a new list from the first expression of each evaluation list group. Groups are separated by comment lines. Be careful not to add expressions that execute instrumented code otherwise an infinite loop will result.

When the evaluation list is redisplayed, each expression is displayed followed by the result of evaluating it, and a comment line. If an error occurs during an evaluation, the error message is displayed in a string as if it were the result. Therefore expressions that, for example, use variables not currently valid do not interrupt your debugging.

Here is an example of what the evaluation list window looks like after several expressions have been added to it:

(current-buffer)
#<buffer *scratch*>
;---------------------------------------------------------------
(selected-window)
#<window 16 on *scratch*>
;---------------------------------------------------------------
(point)
196
;---------------------------------------------------------------
bad-var
"Symbol's value as variable is void: bad-var"
;---------------------------------------------------------------
(recursion-depth)
0
;---------------------------------------------------------------
this-command
eval-last-sexp
;---------------------------------------------------------------

To delete a group, move point into it and type C-c C-d, or simply delete the text for the group and update the evaluation list with C-c C-u. When you add a new group, be sure it is separated from its neighbors by a comment line.

After selecting ‘*edebug*’, you can return to the source code buffer with C-c C-w. The ‘*edebug*’ buffer is killed when you continue execution, and recreated next time it is needed.


Next: , Previous: , Up: Edebug   [Contents][Index]