>From 9d7dce80836fa39fbd9a75261a2b66c8f8dfb552 Mon Sep 17 00:00:00 2001 From: Yuan Fu Date: Mon, 7 Oct 2019 18:47:54 -0400 Subject: [PATCH] Protect against errors in handlers in gdb-mi MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * lisp/progmodes/gdb-mi.el (gdb-handle-reply): Handle error in ’handler-function’ so the cleanup code after it runs safely. --- lisp/progmodes/gdb-mi.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el index 60852e4ad6..5baf4e1690 100644 --- a/lisp/progmodes/gdb-mi.el +++ b/lisp/progmodes/gdb-mi.el @@ -324,7 +324,10 @@ gdb-handle-reply 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 () -- 2.23.0