aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Roberts2004-03-28 20:20:38 +0000
committerNick Roberts2004-03-28 20:20:38 +0000
commitdbefaa008de0ee0997504861950aa4b13178e2dc (patch)
tree2627829d85e28de3dd95d2654d00a450ceecab2a
parent80cce9aeb7abbf6b883b027be4bd2dd03f212b76 (diff)
downloademacs-dbefaa008de0ee0997504861950aa4b13178e2dc.tar.gz
emacs-dbefaa008de0ee0997504861950aa4b13178e2dc.zip
(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.
-rw-r--r--lisp/progmodes/gdb-ui.el27
1 files changed, 19 insertions, 8 deletions
diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el
index 1ae5ce2cfce..08a5a2ccbd3 100644
--- a/lisp/progmodes/gdb-ui.el
+++ b/lisp/progmodes/gdb-ui.el
@@ -119,7 +119,15 @@ The following interactive lisp functions help control operation :
119 (gdb command-line) 119 (gdb command-line)
120 (gdb-ann3)) 120 (gdb-ann3))
121 121
122(defvar gdb-debug-log nil)
123
124(defcustom gdb-enable-debug-log nil
125 "Non-nil means record the process input and output in `gdb-debug-log'."
126 :type 'boolean
127 :group 'gud)
128
122(defun gdb-ann3 () 129(defun gdb-ann3 ()
130 (setq gdb-debug-log nil)
123 (set (make-local-variable 'gud-minor-mode) 'gdba) 131 (set (make-local-variable 'gud-minor-mode) 'gdba)
124 (set (make-local-variable 'gud-marker-filter) 'gud-gdba-marker-filter) 132 (set (make-local-variable 'gud-marker-filter) 'gud-gdba-marker-filter)
125 ;; 133 ;;
@@ -380,7 +388,7 @@ INDENT is the current indentation depth."
380 (setq ,name val)))))) 388 (setq ,name val))))))
381 389
382(def-gdb-var buffer-type nil 390(def-gdb-var buffer-type nil
383 "One of the symbols bound in gdb-buffer-rules") 391 "One of the symbols bound in `gdb-buffer-rules'.")
384 392
385(def-gdb-var burst "" 393(def-gdb-var burst ""
386 "A string of characters from gdb that have not yet been processed.") 394 "A string of characters from gdb that have not yet been processed.")
@@ -407,7 +415,7 @@ Possible values are these symbols:
407 for subsequent processing by a command. This is the 415 for subsequent processing by a command. This is the
408 disposition of output generated by commands that 416 disposition of output generated by commands that
409 gdb mode sends to gdb on its own behalf. 417 gdb mode sends to gdb on its own behalf.
410 post-emacs -- ignore input until the prompt annotation is 418 post-emacs -- ignore output until the prompt annotation is
411 received, then go to USER disposition. 419 received, then go to USER disposition.
412") 420")
413 421
@@ -667,6 +675,7 @@ This filter may simply queue output for a later time."
667 (setq gdb-view-source t)) 675 (setq gdb-view-source t))
668 676
669(defun gdb-send-item (item) 677(defun gdb-send-item (item)
678 (if gdb-enable-debug-log (push (cons 'send item) gdb-debug-log))
670 (gdb-set-current-item item) 679 (gdb-set-current-item item)
671 (if (stringp item) 680 (if (stringp item)
672 (progn 681 (progn
@@ -769,12 +778,13 @@ output from the current command if that happens to be appropriate."
769 (gdb-invalidate-registers) 778 (gdb-invalidate-registers)
770 (gdb-invalidate-locals) 779 (gdb-invalidate-locals)
771 (gdb-invalidate-threads) 780 (gdb-invalidate-threads)
772 (dolist (frame (frame-list)) 781 (unless (eq window-system 'mac)
773 (when (string-equal (frame-parameter frame 'name) "Speedbar") 782 (dolist (frame (frame-list))
774 (setq gdb-var-changed t) ; force update 783 (when (string-equal (frame-parameter frame 'name) "Speedbar")
775 (dolist (var gdb-var-list) 784 (setq gdb-var-changed t) ; force update
776 (setcar (nthcdr 5 var) nil)))) 785 (dolist (var gdb-var-list)
777 (gdb-var-update))) 786 (setcar (nthcdr 5 var) nil))))
787 (gdb-var-update))))
778 (let ((sink (gdb-get-output-sink))) 788 (let ((sink (gdb-get-output-sink)))
779 (cond 789 (cond
780 ((eq sink 'user) t) 790 ((eq sink 'user) t)
@@ -786,6 +796,7 @@ output from the current command if that happens to be appropriate."
786 796
787(defun gud-gdba-marker-filter (string) 797(defun gud-gdba-marker-filter (string)
788 "A gud marker filter for gdb. Handle a burst of output from GDB." 798 "A gud marker filter for gdb. Handle a burst of output from GDB."
799 (if gdb-enable-debug-log (push (cons 'recv string) gdb-debug-log))
789 ;; Recall the left over gud-marker-acc from last time 800 ;; Recall the left over gud-marker-acc from last time
790 (setq gud-marker-acc (concat gud-marker-acc string)) 801 (setq gud-marker-acc (concat gud-marker-acc string))
791 ;; Start accumulating output for the GUD buffer 802 ;; Start accumulating output for the GUD buffer