From d47c318cc894415c601eefa2612be5c667586323 Mon Sep 17 00:00:00 2001 From: Nick Roberts Date: Tue, 7 Feb 2006 06:57:27 +0000 Subject: [PATCH] (gdb-post-prompt): Regenerate breakpoints buffer if necessary. (gdb-delete-frame-or-window): New function. (gdb-breakpoints-mode-map): Bind "q" to it. --- lisp/progmodes/gdb-ui.el | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el index e7bda34e080..5f58a3c2ec0 100644 --- a/lisp/progmodes/gdb-ui.el +++ b/lisp/progmodes/gdb-ui.el @@ -77,16 +77,9 @@ ;;; TODO: ;; 1) Use MI command -data-read-memory for memory window. -;; 2) Highlight changed register values (use MI commands -;; -data-list-register-values and -data-list-changed-registers instead -;; of 'info registers' after release of 22.1. -;; 3) Use tree-widget.el instead of the speedbar for watch-expressions? -;; 4) Mark breakpoint locations on scroll-bar of source buffer? -;; 5) After release of 22.1, use "-var-list-children --all-values" -;; and "-stack-list-locals --simple-values" which need GDB 6.1 onwards. -;; 6) After release of 22.1, use "-var-update --all-values" which needs -;; GDB 6.4 onwards. -;; 7) With gud-print and gud-pstar, print the variable name in the GUD +;; 2) Use tree-widget.el instead of the speedbar for watch-expressions? +;; 3) Mark breakpoint locations on scroll-bar of source buffer? +;; 4) With gud-print and gud-pstar, print the variable name in the GUD ;; buffer instead of the value's history number. ;;; Code: @@ -1192,6 +1185,8 @@ happens to be appropriate." (unless (or gdb-pending-triggers gdb-first-post-prompt) (gdb-get-selected-frame) (gdb-invalidate-frames) + ;; Regenerate breakpoints buffer in case it has been inadvertantly deleted. + (gdb-get-create-buffer 'gdb-breakpoints-buffer) (gdb-invalidate-breakpoints) ;; Do this through gdb-get-selected-frame -> gdb-frame-handler ;; so gdb-frame-address is updated. @@ -1645,12 +1640,19 @@ static char *magick[] = { (define-key map [menu-bar breakpoints] (cons "Breakpoints" menu)) (define-key map " " 'gdb-toggle-breakpoint) (define-key map "D" 'gdb-delete-breakpoint) - (define-key map "q" 'kill-this-buffer) + ;; Don't bind "q" to kill-this-buffer as we need it for breakpoint icons. + (define-key map "q" 'gdb-delete-frame-or-window) (define-key map "\r" 'gdb-goto-breakpoint) (define-key map [mouse-2] 'gdb-goto-breakpoint) (define-key map [follow-link] 'mouse-face) map)) +(defun gdb-delete-frame-or-window () + "Delete frame if there is only one window. Otherwise delete the window." + (interactive) + (if (one-window-p) (delete-frame) + (delete-window))) + (defun gdb-breakpoints-mode () "Major mode for gdb breakpoints. -- 2.39.2