# HG changeset patch # User Nick Roberts # Date 1072619511 0 # Node ID c3cf2ae8eba0f281afba7e5b3657942a77091e01 # Parent 961658b5c3d6b2a8bfbd40100008278bae35fd01 (gud-gdb-command-name): Set default to "gdb --annotate=3". (gud-gdb-marker-filter): Look out for annotations. (gdb-first-pre-prompt): New variable. Remove trailing white space. diff -r 961658b5c3d6 -r c3cf2ae8eba0 lisp/progmodes/gud.el --- a/lisp/progmodes/gud.el Sun Dec 28 13:50:43 2003 +0000 +++ b/lisp/progmodes/gud.el Sun Dec 28 13:51:51 2003 +0000 @@ -319,10 +319,10 @@ If the GUD BUFFER is not running a supported debugger, then turn off the specialized speedbar mode." (let ((minor-mode (with-current-buffer buffer gud-minor-mode))) - (cond + (cond ((eq minor-mode 'gdba) (when (or gdb-var-changed - (not (save-excursion + (not (save-excursion (goto-char (point-min)) (let ((case-fold-search t)) (looking-at "Watch Expressions:"))))) @@ -339,8 +339,8 @@ (speedbar-make-tag-line 'bracket ?? nil nil (concat (car var) "\t" (nth 4 var)) 'gdb-edit-value - nil - (if (and (nth 5 var) + nil + (if (and (nth 5 var) gdb-show-changed-values) 'font-lock-warning-face nil) depth) @@ -354,7 +354,7 @@ nil nil depth))) (setq var-list (cdr var-list)))) (setq gdb-var-changed nil))) - (t (if (and (save-excursion + (t (if (and (save-excursion (goto-char (point-min)) (looking-at "Current Stack")) (equal gud-last-last-frame gud-last-speedbar-stackframe)) @@ -406,7 +406,7 @@ ;; History of argument lists passed to gdb. (defvar gud-gdb-history nil) -(defcustom gud-gdb-command-name "gdb --fullname" +(defcustom gud-gdb-command-name "gdb --annotate=3" "Default command to execute an executable under the GDB debugger." :type 'string :group 'gud) @@ -447,6 +447,19 @@ ;; Set the accumulator to the remaining text. gud-marker-acc (substring gud-marker-acc (match-end 0)))) + (while (string-match "\n\032\032\\(.*\\)\n" gud-marker-acc) + (when (string-equal (match-string 1 gud-marker-acc) "prompt") + (require 'gdb-ui) + (gdb-prompt nil)) + (setq + ;; Append any text before the marker to the output we're going + ;; to return - we don't include the marker in this text. + output (concat output + (substring gud-marker-acc 0 (match-beginning 0))) + + ;; Set the accumulator to the remaining text. + gud-marker-acc (substring gud-marker-acc (match-end 0)))) + ;; Does the remaining text look like it might end with the ;; beginning of another marker? If it does, then keep it in ;; gud-marker-acc until we receive the rest of it. Since we @@ -492,6 +505,8 @@ gud-minibuffer-local-map nil hist-sym))) +(defvar gdb-first-pre-prompt t) + ;;;###autoload (defun gdb (command-line) "Run gdb on program FILE in buffer *gud-FILE*. @@ -522,8 +537,8 @@ (local-set-key "\C-i" 'gud-gdb-complete-command) (setq comint-prompt-regexp "^(.*gdb[+]?) *") (setq paragraph-start comint-prompt-regexp) - (run-hooks 'gdb-mode-hook) - ) + (setq gdb-first-pre-prompt t) + (run-hooks 'gdb-mode-hook)) ;; One of the nice features of GDB is its impressive support for ;; context-sensitive command completion. We preserve that feature