7

Is there a mechanism for clearing all breakpoints (remove instrumentation en masse) so as to avoid the need to manually run eval-defun on each instrumented function's definition?

ebpa
  • 7,319
  • 26
  • 53
  • 3
    The code of `edebug-instrument-function` shows that the function is not instrumented if `(get symbol 'edebug)` is a marker and the function is instrumented if `(get symbol 'edebug)` is a cons. Currently your version of `edebug-remove-all-instrumentation` evals defuns of uninstrumented functions if they have been instrumented before. – Tobias Apr 18 '17 at 18:44
  • @Tobias Thanks for the observation! I've updated the function. – ebpa Apr 18 '17 at 18:52

1 Answers1

8

Consensus seems to be that there is no such function built-in.

Since edebug instrumentation data is stored on the target symbols, I have been using the following basic function:

(defun ebpa/edebug-remove-all-instrumentation ()
  "Remove all edebug instrumentation by visiting each function
definition and running `eval-defun`."
  (interactive)
  (mapatoms
   (lambda (symbol)
     (when-let (pos (car-safe (get symbol 'edebug)))
       (with-current-buffer (marker-buffer pos)
         (goto-char (marker-position pos))
         (eval-defun nil))))))
Basil
  • 12,019
  • 43
  • 69
ebpa
  • 7,319
  • 26
  • 53