From 703ce2c3f983cef71943077707085bac8be749f9 Mon Sep 17 00:00:00 2001 From: Nick Roberts Date: Sat, 11 Jan 2003 16:46:35 +0000 Subject: [PATCH] (gud-kill-buffer-hook): Save gud-minor-mode type. (gud-reset): New function. Reset environment at end of debugging. (gud-sentinel): Call gud-reset or gdb-reset. --- lisp/gud.el | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/lisp/gud.el b/lisp/gud.el index 2842ce09ab1..5a6f0a7fdd2 100644 --- a/lisp/gud.el +++ b/lisp/gud.el @@ -2427,10 +2427,17 @@ It is saved for when this flag is not set.") ;; buffer killed ;; Stop displaying an arrow in a source file. (setq overlay-arrow-position nil) - (set-process-buffer proc nil)) + (set-process-buffer proc nil) + (if (eq gud-minor-mode-type 'gdba) + (gdb-reset) + (gud-reset))) ((memq (process-status proc) '(signal exit)) ;; Stop displaying an arrow in a source file. (setq overlay-arrow-position nil) + (with-current-buffer gud-comint-buffer + (if (eq gud-minor-mode 'gdba) + (gdb-reset) + (gud-reset))) (let* ((obuf (current-buffer))) ;; save-excursion isn't the right thing if ;; process-buffer is current-buffer @@ -2456,6 +2463,23 @@ It is saved for when this flag is not set.") ;; if obuf is the gud buffer. (set-buffer obuf)))))) +(defvar gud-minor-mode-type nil) + +(defun gud-kill-buffer-hook () + (if gud-minor-mode + (setq gud-minor-mode-type gud-minor-mode))) + +(add-hook 'kill-buffer-hook 'gud-kill-buffer-hook) + +(defun gud-reset () + (dolist (buffer (buffer-list)) + (if (not (eq buffer gud-comint-buffer)) + (save-excursion + (set-buffer buffer) + (when gud-minor-mode + (setq gud-minor-mode nil) + (kill-local-variable 'tool-bar-map)))))) + (defun gud-display-frame () "Find and obey the last filename-and-line marker from the debugger. Obeying it means displaying in another window the specified file and line." -- 2.39.2