From: Yuan Fu Date: Mon, 7 Oct 2019 22:47:54 +0000 (-0400) Subject: Protect against errors in gdb-mi.el handlers X-Git-Tag: emacs-27.0.90~83 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=2b1e18ae85;p=emacs.git Protect against errors in gdb-mi.el handlers * lisp/progmodes/gdb-mi.el (gdb-handle-reply): Handle errors in 'handler-function' so the cleanup code after it runs safely. (Bug#39178) --- diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el index 2978d4a7672..4b0fd66c7ed 100644 --- a/lisp/progmodes/gdb-mi.el +++ b/lisp/progmodes/gdb-mi.el @@ -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 ()