emacs-diffs
[Top][All Lists]
Advanced

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

emacs-27 2b1e18a 1/2: Protect against errors in gdb-mi.el handlers


From: Eli Zaretskii
Subject: emacs-27 2b1e18a 1/2: Protect against errors in gdb-mi.el handlers
Date: Fri, 31 Jan 2020 04:42:31 -0500 (EST)

branch: emacs-27
commit 2b1e18ae852c1490dfa22adc71f7582a1258da60
Author: Yuan Fu <address@hidden>
Commit: Eli Zaretskii <address@hidden>

    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)
---
 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 2978d4a..4b0fd66 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 ()



reply via email to

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