changeset 54616:47c4cb867a84

(gdb-ann3, gdb-send-item) (gud-gdba-marker-filter): Log the process input and output, if required. (from Stefan Monnier) (gdb-debug-log, gdb-enable-debug-log): New variables. (gdb-post-prompt): Don't do gdb-var-update on Mac OS X.
author Nick Roberts <nickrob@snap.net.nz>
date Sun, 28 Mar 2004 20:20:38 +0000
parents 7f0f4acf41c9
children 9049edac1117 38afc630f7a0
files lisp/progmodes/gdb-ui.el
diffstat 1 files changed, 19 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/progmodes/gdb-ui.el	Sun Mar 28 20:19:41 2004 +0000
+++ b/lisp/progmodes/gdb-ui.el	Sun Mar 28 20:20:38 2004 +0000
@@ -119,7 +119,15 @@
   (gdb command-line)
   (gdb-ann3))
 
+(defvar gdb-debug-log nil)
+
+(defcustom gdb-enable-debug-log nil
+ "Non-nil means record the process input and output in `gdb-debug-log'."
+  :type 'boolean
+  :group 'gud)
+
 (defun gdb-ann3 ()
+  (setq gdb-debug-log nil)
   (set (make-local-variable 'gud-minor-mode) 'gdba)
   (set (make-local-variable 'gud-marker-filter) 'gud-gdba-marker-filter)
   ;;
@@ -380,7 +388,7 @@
 	   (setq ,name val))))))
 
 (def-gdb-var buffer-type nil
-  "One of the symbols bound in gdb-buffer-rules")
+  "One of the symbols bound in `gdb-buffer-rules'.")
 
 (def-gdb-var burst ""
   "A string of characters from gdb that have not yet been processed.")
@@ -407,7 +415,7 @@
 	     for subsequent processing by a command.  This is the
 	     disposition of output generated by commands that
 	     gdb mode sends to gdb on its own behalf.
-    post-emacs -- ignore input until the prompt annotation is
+    post-emacs -- ignore output until the prompt annotation is
 		  received, then go to USER disposition.
 ")
 
@@ -667,6 +675,7 @@
   (setq gdb-view-source t))
 
 (defun gdb-send-item (item)
+  (if gdb-enable-debug-log (push (cons 'send item) gdb-debug-log))
   (gdb-set-current-item item)
   (if (stringp item)
       (progn
@@ -769,12 +778,13 @@
 	(gdb-invalidate-registers)
 	(gdb-invalidate-locals)
 	(gdb-invalidate-threads)
-	(dolist (frame (frame-list))
-	  (when (string-equal (frame-parameter frame 'name) "Speedbar")
-	    (setq gdb-var-changed t)    ; force update
-	    (dolist (var gdb-var-list)
-	      (setcar (nthcdr 5 var) nil))))
-	(gdb-var-update)))
+	(unless (eq window-system 'mac)
+	  (dolist (frame (frame-list))
+	    (when (string-equal (frame-parameter frame 'name) "Speedbar")
+	      (setq gdb-var-changed t)    ; force update
+	      (dolist (var gdb-var-list)
+		(setcar (nthcdr 5 var) nil))))
+	  (gdb-var-update))))
   (let ((sink (gdb-get-output-sink)))
     (cond
      ((eq sink 'user) t)
@@ -786,6 +796,7 @@
 
 (defun gud-gdba-marker-filter (string)
   "A gud marker filter for gdb. Handle a burst of output from GDB."
+  (if gdb-enable-debug-log (push (cons 'recv string) gdb-debug-log))
   ;; Recall the left over gud-marker-acc from last time
   (setq gud-marker-acc (concat gud-marker-acc string))
   ;; Start accumulating output for the GUD buffer