gnu.org (original) (raw)
19.1.5 Entering the debugger when a variable is modified
Sometimes a problem with a function is due to a wrong setting of a variable. Setting up the debugger to trigger whenever the variable is changed is a quick way to find the origin of the setting.
Command: debug-on-variable-change variable ¶
This function arranges for the debugger to be called whenevervariable is modified.
It is implemented using the watchpoint mechanism, so it inherits the same characteristics and limitations: all aliases of variablewill be watched together, only dynamic variables can be watched, and changes to the objects referenced by variables are not detected. For details, see Running a function when a variable is changed..
Command: cancel-debug-on-variable-change &optional variable ¶
This function undoes the effect of debug-on-variable-change
onvariable. When called interactively, it prompts forvariable in the minibuffer. If variable is omitted ornil
, it cancels break-on-change for all variables. Callingcancel-debug-on-variable-change
does nothing to a variable which is not currently set up to break on change.