emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 34963d6: Fix edebug--restore-breakpoints re-instrum


From: Lars Ingebrigtsen
Subject: [Emacs-diffs] master 34963d6: Fix edebug--restore-breakpoints re-instrumentinging bug-out
Date: Sun, 20 Oct 2019 08:27:48 -0400 (EDT)

branch: master
commit 34963d632dbf6dc7752962de8aa7dba8af3b8a85
Author: Lars Ingebrigtsen <address@hidden>
Commit: Lars Ingebrigtsen <address@hidden>

    Fix edebug--restore-breakpoints re-instrumentinging bug-out
    
    * lisp/emacs-lisp/edebug.el (edebug--restore-breakpoints): Don't
    bug out when instrumenting/de-instrumenting/re-instrumenting.
---
 lisp/emacs-lisp/edebug.el | 35 ++++++++++++++++++-----------------
 1 file changed, 18 insertions(+), 17 deletions(-)

diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el
index a3ab23c..2eceb82 100644
--- a/lisp/emacs-lisp/edebug.el
+++ b/lisp/emacs-lisp/edebug.el
@@ -1415,23 +1415,24 @@ contains a circular object."
       )))
 
 (defun edebug--restore-breakpoints (name)
-  (let* ((data (get name 'edebug))
-         (offsets (nth 2 data))
-         (breakpoints (nth 1 data))
-         (start (nth 0 data))
-         index)
-    ;; Breakpoints refer to offsets from the start of the function.
-    ;; The start position is a marker, so it'll move around in a
-    ;; similar fashion as the breakpoint markers.  If we find a
-    ;; breakpoint marker that refers to an offset (which is a place
-    ;; where breakpoints can be made), then we restore it.
-    (cl-loop for breakpoint in breakpoints
-             for marker = (nth 3 breakpoint)
-             when (and (marker-position marker)
-                       (setq index (seq-position
-                                    offsets
-                                    (- (marker-position marker) start))))
-             collect (cons index (cdr breakpoint)))))
+  (let ((data (get name 'edebug)))
+    (when (listp data)
+      (let ((offsets (nth 2 data))
+            (breakpoints (nth 1 data))
+            (start (nth 0 data))
+            index)
+        ;; Breakpoints refer to offsets from the start of the function.
+        ;; The start position is a marker, so it'll move around in a
+        ;; similar fashion as the breakpoint markers.  If we find a
+        ;; breakpoint marker that refers to an offset (which is a place
+        ;; where breakpoints can be made), then we restore it.
+        (cl-loop for breakpoint in breakpoints
+                 for marker = (nth 3 breakpoint)
+                 when (and (marker-position marker)
+                           (setq index (seq-position
+                                        offsets
+                                        (- (marker-position marker) start))))
+                 collect (cons index (cdr breakpoint)))))))
 
 (defun edebug-new-definition (def-name)
   "Set up DEF-NAME to use Edebug's instrumentation functions."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]