changeset 71877:28ec37c2aa2c

(gdb-display-buffer): Check for gdb-source-window. Add dedicated argument. (gdb-display-separate-io-buffer, gdb-append-to-inferior-io) (gdb-display-breakpoints-buffer, gdb-display-stack-buffer) (gdb-display-threads-buffer, gdb-display-memory-buffer) (gdb-display-locals-buffer): Use it.
author Nick Roberts <nickrob@snap.net.nz>
date Thu, 13 Jul 2006 21:56:26 +0000
parents 2f32aa94faff
children 30e3082c1a7e
files lisp/progmodes/gdb-ui.el
diffstat 1 files changed, 13 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/progmodes/gdb-ui.el	Thu Jul 13 21:55:47 2006 +0000
+++ b/lisp/progmodes/gdb-ui.el	Thu Jul 13 21:56:26 2006 +0000
@@ -1019,7 +1019,7 @@
   (interactive)
   (if gdb-use-separate-io-buffer
       (gdb-display-buffer
-       (gdb-get-buffer-create 'gdb-inferior-io))))
+       (gdb-get-buffer-create 'gdb-inferior-io) t)))
 
 (defconst gdb-frame-parameters
   '((height . 14) (width . 80)
@@ -1556,7 +1556,7 @@
     (goto-char (point-max))
     (insert-before-markers string))
   (if (not (string-equal string ""))
-      (gdb-display-buffer (gdb-get-buffer-create 'gdb-inferior-io))))
+      (gdb-display-buffer (gdb-get-buffer-create 'gdb-inferior-io) t)))
 
 (defun gdb-clear-inferior-io ()
   (with-current-buffer (gdb-get-buffer-create 'gdb-inferior-io)
@@ -1865,7 +1865,7 @@
   "Display status of user-settable breakpoints."
   (interactive)
   (gdb-display-buffer
-   (gdb-get-buffer-create 'gdb-breakpoints-buffer)))
+   (gdb-get-buffer-create 'gdb-breakpoints-buffer) t))
 
 (defun gdb-frame-breakpoints-buffer ()
   "Display status of user-settable breakpoints in a new frame."
@@ -2041,7 +2041,7 @@
   "Display backtrace of current stack."
   (interactive)
   (gdb-display-buffer
-   (gdb-get-buffer-create 'gdb-stack-buffer)))
+   (gdb-get-buffer-create 'gdb-stack-buffer) t))
 
 (defun gdb-frame-stack-buffer ()
   "Display backtrace of current stack in a new frame."
@@ -2122,7 +2122,7 @@
   "Display IDs of currently known threads."
   (interactive)
   (gdb-display-buffer
-   (gdb-get-buffer-create 'gdb-threads-buffer)))
+   (gdb-get-buffer-create 'gdb-threads-buffer) t))
 
 (defun gdb-frame-threads-buffer ()
   "Display IDs of currently known threads in a new frame."
@@ -2256,7 +2256,7 @@
   "Display integer register contents."
   (interactive)
   (gdb-display-buffer
-   (gdb-get-buffer-create 'gdb-registers-buffer)))
+   (gdb-get-buffer-create 'gdb-registers-buffer) t))
 
 (defun gdb-frame-registers-buffer ()
   "Display integer register contents in a new frame."
@@ -2580,7 +2580,7 @@
   "Display memory contents."
   (interactive)
   (gdb-display-buffer
-   (gdb-get-buffer-create 'gdb-memory-buffer)))
+   (gdb-get-buffer-create 'gdb-memory-buffer) t))
 
 (defun gdb-frame-memory-buffer ()
   "Display memory contents in a new frame."
@@ -2687,7 +2687,7 @@
   "Display local variables of current stack and their values."
   (interactive)
   (gdb-display-buffer
-   (gdb-get-buffer-create 'gdb-locals-buffer)))
+   (gdb-get-buffer-create 'gdb-locals-buffer) t))
 
 (defun gdb-frame-locals-buffer ()
   "Display local variables of current stack and their values in a new frame."
@@ -2698,7 +2698,7 @@
 
 
 ;;;; Window management
-(defun gdb-display-buffer (buf &optional size)
+(defun gdb-display-buffer (buf dedicated &optional size)
   (let ((answer (get-buffer-window buf 0))
 	(must-split nil))
     (if answer
@@ -2707,7 +2707,8 @@
       (pop-to-buffer gud-comint-buffer)	;Select the right frame.
       (let ((window (get-lru-window)))
 	(if (and window
-	    (not (eq window (get-buffer-window gud-comint-buffer))))
+		 (not (memq window `(,(get-buffer-window gud-comint-buffer)
+				     ,gdb-source-window))))
 	    (progn
 	      (set-window-buffer window buf)
 	      (setq answer window))
@@ -2718,7 +2719,7 @@
 		 (new-size (and size (< size cur-size) (- cur-size size))))
 	    (setq answer (split-window largest new-size))
 	    (set-window-buffer answer buf)
-	    (set-window-dedicated-p answer t)))
+	    (set-window-dedicated-p answer dedicated)))
       answer)))
 
 
@@ -3162,7 +3163,7 @@
   (interactive)
   (setq gdb-previous-frame nil)
   (gdb-display-buffer
-   (gdb-get-buffer-create 'gdb-assembler-buffer)))
+   (gdb-get-buffer-create 'gdb-assembler-buffer) t))
 
 (defun gdb-frame-assembler-buffer ()
   "Display disassembly view in a new frame."