From: Nick Roberts Date: Sun, 28 Mar 2004 20:20:38 +0000 (+0000) Subject: (gdb-ann3, gdb-send-item) X-Git-Tag: ttn-vms-21-2-B4~7053 X-Git-Url: https://code.delx.au/gnu-emacs/commitdiff_plain/dbefaa008de0ee0997504861950aa4b13178e2dc (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. --- diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el index 1ae5ce2cfc..08a5a2ccbd 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 : (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 @@ INDENT is the current indentation depth." (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 @@ Possible values are these symbols: 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 @@ This filter may simply queue output for a later time." (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 @@ output from the current command if that happens to be appropriate." (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 @@ output from the current command if that happens to be appropriate." (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