changeset 68902:5de231ae5dc9

(gdb-use-separate-io-buffer) (gdb-display-separate-io-buffer, gdb-frame-separate-io-buffer) (gdb-separate-io-interrupt, gdb-separate-io-quit) (gdb-separate-io-stop, gdb-separate-io-eof): Rename from gdb-inferior-* to gdb-separate-*. (gdb-set-gud-minor-mode-existing-buffers-1): Improve doc string.
author Nick Roberts <nickrob@snap.net.nz>
date Tue, 14 Feb 2006 22:03:20 +0000
parents 95d4c7a9dca8
children 57fa3643220b
files lisp/progmodes/gdb-ui.el
diffstat 1 files changed, 34 insertions(+), 57 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/progmodes/gdb-ui.el	Tue Feb 14 22:03:16 2006 +0000
+++ b/lisp/progmodes/gdb-ui.el	Tue Feb 14 22:03:20 2006 +0000
@@ -185,7 +185,6 @@
   "Font lock keywords used in `gdb-local-mode'.")
 
 ;; Variables for GDB 6.4+
-
 (defvar gdb-register-names nil "List of register names.")
 (defvar gdb-changed-registers nil
   "List of changed register numbers (strings).")
@@ -203,7 +202,7 @@
 
 If `gdb-many-windows' is t, regardless of the value of
 `gdb-show-main', the layout below will appear unless
-`gdb-use-inferior-io-buffer' is nil when the source buffer
+`gdb-use-separate-io-buffer' is nil when the source buffer
 occupies the full width of the frame.  Keybindings are given in
 relevant buffer.
 
@@ -281,26 +280,26 @@
   :group 'gud
   :version "22.1")
 
-(defcustom gdb-use-inferior-io-buffer nil
+(defcustom gdb-use-separate-io-buffer nil
   "Non-nil means display output from the inferior in a separate buffer."
   :type 'boolean
   :group 'gud
   :version "22.1")
 
-(defun gdb-use-inferior-io-buffer (arg)
+(defun gdb-use-separate-io-buffer (arg)
   "Toggle separate IO for inferior.
 With arg, use separate IO iff arg is positive."
   (interactive "P")
-  (setq gdb-use-inferior-io-buffer
+  (setq gdb-use-separate-io-buffer
 	(if (null arg)
-	    (not gdb-use-inferior-io-buffer)
+	    (not gdb-use-separate-io-buffer)
 	  (> (prefix-numeric-value arg) 0)))
   (message (format "Separate inferior IO %sabled"
-		   (if gdb-use-inferior-io-buffer "en" "dis")))
+		   (if gdb-use-separate-io-buffer "en" "dis")))
   (if (and gud-comint-buffer
 	   (buffer-name gud-comint-buffer))
       (condition-case nil
-	  (if gdb-use-inferior-io-buffer
+	  (if gdb-use-separate-io-buffer
 	      (gdb-restore-windows)
 	    (kill-buffer (gdb-inferior-io-name)))
 	(error nil))))
@@ -462,7 +461,7 @@
 
   (setq gdb-buffer-type 'gdba)
 
-  (if gdb-use-inferior-io-buffer (gdb-clear-inferior-io))
+  (if gdb-use-separate-io-buffer (gdb-clear-inferior-io))
 
   ;; Hack to see test for GDB 6.4+ (-stack-info-frame was implemented in 6.4)
   (setq gdb-version nil)
@@ -853,7 +852,7 @@
 	  (gdb-get-target-string)
 	  "*"))
 
-(defun gdb-display-inferior-io-buffer ()
+(defun gdb-display-separate-io-buffer ()
   "Display IO of inferior in a separate window."
   (interactive)
   (if gdb-use-inferior-io-buffer
@@ -867,21 +866,21 @@
     (menu-bar-lines . nil)
     (minibuffer . nil)))
 
-(defun gdb-frame-inferior-io-buffer ()
+(defun gdb-frame-separate-io-buffer ()
   "Display IO of inferior in a new frame."
   (interactive)
-  (if gdb-use-inferior-io-buffer
+  (if gdb-use-separate-io-buffer
       (let ((special-display-regexps (append special-display-regexps '(".*")))
 	    (special-display-frame-alist gdb-frame-parameters))
 	(display-buffer (gdb-get-create-buffer 'gdb-inferior-io)))))
 
 (defvar gdb-inferior-io-mode-map
   (let ((map (make-sparse-keymap)))
-    (define-key map "\C-c\C-c" 'gdb-inferior-io-interrupt)
-    (define-key map "\C-c\C-z" 'gdb-inferior-io-stop)
-    (define-key map "\C-c\C-\\" 'gdb-inferior-io-quit)
-    (define-key map "\C-c\C-d" 'gdb-inferior-io-eof)
-    (define-key map "\C-d" 'gdb-inferior-io-eof)
+    (define-key map "\C-c\C-c" 'gdb-separate-io-interrupt)
+    (define-key map "\C-c\C-z" 'gdb-separate-io-stop)
+    (define-key map "\C-c\C-\\" 'gdb-separate-io-quit)
+    (define-key map "\C-c\C-d" 'gdb-separate-io-eof)
+    (define-key map "\C-d" 'gdb-separate-io-eof)
     map))
 
 (define-derived-mode gdb-inferior-io-mode comint-mode "Inferior I/O"
@@ -902,25 +901,25 @@
     (process-send-string proc string)
     (process-send-string proc "\n")))
 
-(defun gdb-inferior-io-interrupt ()
+(defun gdb-separate-io-interrupt ()
   "Interrupt the program being debugged."
   (interactive)
   (interrupt-process
    (get-buffer-process gud-comint-buffer) comint-ptyp))
 
-(defun gdb-inferior-io-quit ()
+(defun gdb-separate-io-quit ()
   "Send quit signal to the program being debugged."
   (interactive)
   (quit-process
    (get-buffer-process gud-comint-buffer) comint-ptyp))
 
-(defun gdb-inferior-io-stop ()
+(defun gdb-separate-io-stop ()
   "Stop the program being debugged."
   (interactive)
   (stop-process
    (get-buffer-process gud-comint-buffer) comint-ptyp))
 
-(defun gdb-inferior-io-eof ()
+(defun gdb-separate-io-eof ()
   "Send end-of-file to the program being debugged."
   (interactive)
   (process-send-eof
@@ -1116,7 +1115,7 @@
      ((eq sink 'user)
       (progn
 	(setq gud-running t)
-	(if gdb-use-inferior-io-buffer
+	(if gdb-use-separate-io-buffer
 	    (setq gdb-output-sink 'inferior))))
      (t
       (gdb-resync)
@@ -1126,7 +1125,7 @@
   "An annotation handler for `breakpoint' and other annotations.
 They say that I/O for the subprocess is now GDB, not the program
 being debugged."
-  (if gdb-use-inferior-io-buffer
+  (if gdb-use-separate-io-buffer
       (let ((sink gdb-output-sink))
 	(cond
 	 ((eq sink 'inferior)
@@ -2467,8 +2466,8 @@
     '("Disassembly" . gdb-display-assembler-buffer))
   (define-key menu [registers] '("Registers" . gdb-display-registers-buffer))
   (define-key menu [inferior]
-    '(menu-item "Inferior IO" gdb-display-inferior-io-buffer
-		:enable gdb-use-inferior-io-buffer))
+    '(menu-item "Inferior IO" gdb-display-separate-io-buffer
+		:enable gdb-use-separate-io-buffer))
   (define-key menu [locals] '("Locals" . gdb-display-locals-buffer))
   (define-key menu [frames] '("Stack" . gdb-display-stack-buffer))
   (define-key menu [breakpoints]
@@ -2484,8 +2483,8 @@
   (define-key menu [disassembly] '("Disassembiy" . gdb-frame-assembler-buffer))
   (define-key menu [registers] '("Registers" . gdb-frame-registers-buffer))
   (define-key menu [inferior]
-    '(menu-item "Inferior IO" gdb-frame-inferior-io-buffer
-		:enable gdb-use-inferior-io-buffer))
+    '(menu-item "Inferior IO" gdb-frame-separate-io-buffer
+		:enable gdb-use-separate-io-buffer))
   (define-key menu [locals] '("Locals" . gdb-frame-locals-buffer))
   (define-key menu [frames] '("Stack" . gdb-frame-stack-buffer))
   (define-key menu [breakpoints]
@@ -2495,11 +2494,11 @@
   (define-key gud-menu-map [ui]
     `(menu-item (if (eq gud-minor-mode 'gdba) "GDB-UI" "GDB-MI")
 		,menu :visible (memq gud-minor-mode '(gdbmi gdba))))
-  (define-key menu [gdb-use-inferior-io]
-  '(menu-item "Separate inferior IO" gdb-use-inferior-io-buffer
+  (define-key menu [gdb-use-separate-io]
+  '(menu-item "Separate inferior IO" gdb-use-separate-io-buffer
 	      :visible (eq gud-minor-mode 'gdba)
 	      :help "Toggle separate IO for inferior."
-	      :button (:toggle . gdb-use-inferior-io-buffer)))
+	      :button (:toggle . gdb-use-separate-io-buffer)))
   (define-key menu [gdb-many-windows]
   '(menu-item "Display Other Windows" gdb-many-windows
 	      :help "Toggle display of locals, stack and breakpoint information"
@@ -2545,7 +2544,7 @@
        (if gud-last-last-frame
 	   (gud-find-file (car gud-last-last-frame))
 	 (gud-find-file gdb-main-file)))
-  (when gdb-use-inferior-io-buffer
+  (when gdb-use-separate-io-buffer
     (split-window-horizontally)
     (other-window 1)
     (gdb-set-window-buffer
@@ -2957,37 +2956,15 @@
   (if (re-search-forward " source language \\(\\S-*\\)\." nil t)
       (setq gdb-current-language (match-string 1)))
   (gdb-invalidate-assembler))
+
 
-
-;; For debugging Emacs only (assumes that usual stack buffer already exists).
-(defun gdb-xbacktrace ()
-  "Generate a full lisp level backtrace with arguments."
-  (interactive)
-  (let ((frames nil)
-	(frame-number gdb-frame-number))
-    (with-current-buffer (gdb-get-buffer 'gdb-stack-buffer)
-      (save-excursion
-	(goto-char (point-min))
-	(while (search-forward "in Ffuncall " nil t)
-	  (goto-char (line-beginning-position))
-	  (looking-at "^#\\([0-9]+\\)")
-	  (push (match-string-no-properties 1) frames)
-	  (forward-line 1))))
-    (dolist (frame frames)
-      (gdb-enqueue-input (list (concat "server frame " frame "\n")
-			       'ignore))
-;     can't use separate buffer because Emacs gets confused by starting
-;     annotation from debug1_print (with output-sink eq 'emacs)
-;    (gdb-enqueue-input (list "server ppargs\n" 'gdb-get-arguments))
-      (gud-basic-call "server ppargs"))
-    (gdb-enqueue-input (list (concat "server frame " frame-number "\n")
-			     'ignore))))
-
 ;; Code specific to GDB 6.4
 (defconst gdb-source-file-regexp-1 "fullname=\"\\(.*?\\)\"")
 
 (defun gdb-set-gud-minor-mode-existing-buffers-1 ()
-  "Create list of source files for current GDB session."
+  "Create list of source files for current GDB session.
+If buffers already exist for any of these files, gud-minor-mode
+is set in them."
   (goto-char (point-min))
   (while (re-search-forward gdb-source-file-regexp-1 nil t)
     (push (match-string 1) gdb-source-file-list))