]> git.eshelyaron.com Git - emacs.git/commitdiff
Protect against errors in gdb-mi.el handlers
authorYuan Fu <casouri@gmail.com>
Mon, 7 Oct 2019 22:47:54 +0000 (18:47 -0400)
committerEli Zaretskii <eliz@gnu.org>
Fri, 31 Jan 2020 09:39:12 +0000 (11:39 +0200)
* lisp/progmodes/gdb-mi.el (gdb-handle-reply): Handle errors
in 'handler-function' so the cleanup code after it runs
safely.  (Bug#39178)

lisp/progmodes/gdb-mi.el

index 2978d4a7672de0b610c99adf0d463ffd93ca846e..4b0fd66c7ed5f74d65f2a105f3eab4aca8de92dc 100644 (file)
@@ -324,7 +324,10 @@ in `gdb-handler-list' and clears all pending handlers invalidated
 by the reception of this reply."
   (let ((handler-function (gdb-get-handler-function token-number)))
     (when handler-function
-      (funcall handler-function)
+      (condition-case err
+          ;; protect against errors in handler-function
+          (funcall handler-function)
+        (error (message (error-message-string err))))
       (gdb-delete-handler token-number))))
 
 (defun gdb-remove-all-pending-triggers ()