diff options
| author | Nick Roberts | 2003-01-11 16:46:35 +0000 |
|---|---|---|
| committer | Nick Roberts | 2003-01-11 16:46:35 +0000 |
| commit | 703ce2c3f983cef71943077707085bac8be749f9 (patch) | |
| tree | 84c6aa0757100b7417c2649e4fca605d036c1e9e | |
| parent | b208af97d6552da31cb628e9f76d051b0d272ba8 (diff) | |
| download | emacs-703ce2c3f983cef71943077707085bac8be749f9.tar.gz emacs-703ce2c3f983cef71943077707085bac8be749f9.zip | |
(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.
| -rw-r--r-- | lisp/gud.el | 26 |
1 files changed, 25 insertions, 1 deletions
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.") | |||
| 2427 | ;; buffer killed | 2427 | ;; buffer killed |
| 2428 | ;; Stop displaying an arrow in a source file. | 2428 | ;; Stop displaying an arrow in a source file. |
| 2429 | (setq overlay-arrow-position nil) | 2429 | (setq overlay-arrow-position nil) |
| 2430 | (set-process-buffer proc nil)) | 2430 | (set-process-buffer proc nil) |
| 2431 | (if (eq gud-minor-mode-type 'gdba) | ||
| 2432 | (gdb-reset) | ||
| 2433 | (gud-reset))) | ||
| 2431 | ((memq (process-status proc) '(signal exit)) | 2434 | ((memq (process-status proc) '(signal exit)) |
| 2432 | ;; Stop displaying an arrow in a source file. | 2435 | ;; Stop displaying an arrow in a source file. |
| 2433 | (setq overlay-arrow-position nil) | 2436 | (setq overlay-arrow-position nil) |
| 2437 | (with-current-buffer gud-comint-buffer | ||
| 2438 | (if (eq gud-minor-mode 'gdba) | ||
| 2439 | (gdb-reset) | ||
| 2440 | (gud-reset))) | ||
| 2434 | (let* ((obuf (current-buffer))) | 2441 | (let* ((obuf (current-buffer))) |
| 2435 | ;; save-excursion isn't the right thing if | 2442 | ;; save-excursion isn't the right thing if |
| 2436 | ;; process-buffer is current-buffer | 2443 | ;; process-buffer is current-buffer |
| @@ -2456,6 +2463,23 @@ It is saved for when this flag is not set.") | |||
| 2456 | ;; if obuf is the gud buffer. | 2463 | ;; if obuf is the gud buffer. |
| 2457 | (set-buffer obuf)))))) | 2464 | (set-buffer obuf)))))) |
| 2458 | 2465 | ||
| 2466 | (defvar gud-minor-mode-type nil) | ||
| 2467 | |||
| 2468 | (defun gud-kill-buffer-hook () | ||
| 2469 | (if gud-minor-mode | ||
| 2470 | (setq gud-minor-mode-type gud-minor-mode))) | ||
| 2471 | |||
| 2472 | (add-hook 'kill-buffer-hook 'gud-kill-buffer-hook) | ||
| 2473 | |||
| 2474 | (defun gud-reset () | ||
| 2475 | (dolist (buffer (buffer-list)) | ||
| 2476 | (if (not (eq buffer gud-comint-buffer)) | ||
| 2477 | (save-excursion | ||
| 2478 | (set-buffer buffer) | ||
| 2479 | (when gud-minor-mode | ||
| 2480 | (setq gud-minor-mode nil) | ||
| 2481 | (kill-local-variable 'tool-bar-map)))))) | ||
| 2482 | |||
| 2459 | (defun gud-display-frame () | 2483 | (defun gud-display-frame () |
| 2460 | "Find and obey the last filename-and-line marker from the debugger. | 2484 | "Find and obey the last filename-and-line marker from the debugger. |
| 2461 | Obeying it means displaying in another window the specified file and line." | 2485 | Obeying it means displaying in another window the specified file and line." |