aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorKaroly Lorentey2003-12-29 13:59:23 +0000
committerKaroly Lorentey2003-12-29 13:59:23 +0000
commit096d4be33fc8bd54c363d05fff24f9f029acbf0a (patch)
treefaa3777d2d5975b644784640ff5db7682f815a94 /lisp
parentb2af72d2f0da11c271cac6fc823053d0018068b2 (diff)
parentc4383667201d2a2fa071c380caea36df2219261f (diff)
downloademacs-096d4be33fc8bd54c363d05fff24f9f029acbf0a.tar.gz
emacs-096d4be33fc8bd54c363d05fff24f9f029acbf0a.zip
Merged in changes from CVS head
Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-4 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-22
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog26
-rw-r--r--lisp/gdb-ui.el151
-rw-r--r--lisp/net/ange-ftp.el4
-rw-r--r--lisp/progmodes/gud.el31
4 files changed, 156 insertions, 56 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index c737c003eb9..56587ae22ed 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,25 @@
12003-12-28 Sam Steingold <sds@gnu.org>
2
3 * net/ange-ftp.el (ange-ftp-file-attributes): Add new optional
4 parameter ID-FORMAT to conform with the 2003-11-30 patch.
5
62003-12-28 Nick Roberts <nick@nick.uklinux.net>
7
8 * progmodes/gud.el (gud-gdb-command-name): Set default to
9 "gdb --annotate=3".
10 (gud-gdb-marker-filter): Look out for annotations.
11 (gdb-first-pre-prompt): New variable.
12 Remove trailing white space.
13
14 * gdb-ui.el (gdb-prompt): Change filter for level 3 annotations,
15 if necessary.
16 (gdb-ann3): New function. Initialise M-x gdb as for M-x gdba if
17 annotations are detected.
18 (gud-gdba-marker-filter): Use global variable gud-marker-acc
19 instead of a local one to allow transition from
20 gud-gdb-marker-filter.
21 Remove trailing white space.
22
12003-12-27 Kim F. Storm <storm@cua.dk> 232003-12-27 Kim F. Storm <storm@cua.dk>
2 24
3 * ido.el: Handle non-readable directories. 25 * ido.el: Handle non-readable directories.
@@ -112,7 +134,7 @@
112 (group, documentation-string): Removed redundant (per 2003-10-25 134 (group, documentation-string): Removed redundant (per 2003-10-25
113 change) calls to `widget-children-value-delete'. 135 change) calls to `widget-children-value-delete'.
114 (widget-choice-value-get, widget-choice-value-inline): Removed 136 (widget-choice-value-get, widget-choice-value-inline): Removed
115 functions. 137 functions.
116 (menu-choice): Updated widget. 138 (menu-choice): Updated widget.
117 139
1182003-12-03 Kenichi Handa <handa@m17n.org> 1402003-12-03 Kenichi Handa <handa@m17n.org>
@@ -1888,7 +1910,7 @@
1888 which does not exist in LaTeX. 1910 which does not exist in LaTeX.
1889 (reftex-cite-format-builtin): Added amsrefs support. 1911 (reftex-cite-format-builtin): Added amsrefs support.
1890 (reftex-toc-confirm-promotion): New option 1912 (reftex-toc-confirm-promotion): New option
1891 1913
1892 * reftex-toc.el 1914 * reftex-toc.el
1893 (reftex-toc): Use `reftex-toc-split-windows-fraction'. 1915 (reftex-toc): Use `reftex-toc-split-windows-fraction'.
1894 (reftex-toc-demote, reftex-toc-promote) 1916 (reftex-toc-demote, reftex-toc-promote)
diff --git a/lisp/gdb-ui.el b/lisp/gdb-ui.el
index 2c9b3390b58..9a1e112b02a 100644
--- a/lisp/gdb-ui.el
+++ b/lisp/gdb-ui.el
@@ -42,8 +42,8 @@
42;; info manual. Some GDB/MI commands are also used through th CLI command 42;; info manual. Some GDB/MI commands are also used through th CLI command
43;; 'interpreter mi <mi-command>'. 43;; 'interpreter mi <mi-command>'.
44;; 44;;
45;; Known Bugs: 45;; Known Bugs:
46;; 46;;
47 47
48;;; Code: 48;;; Code:
49 49
@@ -144,8 +144,10 @@ The following interactive lisp functions help control operation :
144 (gud-call "until *%a" arg))) 144 (gud-call "until *%a" arg)))
145 "\C-u" "Continue to current line or address.") 145 "\C-u" "Continue to current line or address.")
146 146
147 (define-key gud-minor-mode-map [left-margin mouse-1] 'gdb-mouse-toggle-breakpoint) 147 (define-key gud-minor-mode-map [left-margin mouse-1]
148 (define-key gud-minor-mode-map [left-fringe mouse-1] 'gdb-mouse-toggle-breakpoint) 148 'gdb-mouse-toggle-breakpoint)
149 (define-key gud-minor-mode-map [left-fringe mouse-1]
150 'gdb-mouse-toggle-breakpoint)
149 151
150 (setq comint-input-sender 'gdb-send) 152 (setq comint-input-sender 'gdb-send)
151 ;; 153 ;;
@@ -158,6 +160,7 @@ The following interactive lisp functions help control operation :
158 (setq gdb-selected-view 'source) 160 (setq gdb-selected-view 'source)
159 (setq gdb-var-list nil) 161 (setq gdb-var-list nil)
160 (setq gdb-var-changed nil) 162 (setq gdb-var-changed nil)
163 (setq gdb-first-pre-prompt nil)
161 ;; 164 ;;
162 (mapc 'make-local-variable gdb-variables) 165 (mapc 'make-local-variable gdb-variables)
163 (setq gdb-buffer-type 'gdba) 166 (setq gdb-buffer-type 'gdba)
@@ -184,7 +187,7 @@ speedbar."
184 "Watch expression at point." 187 "Watch expression at point."
185 (interactive) 188 (interactive)
186 (let ((expr (tooltip-identifier-from-point (point)))) 189 (let ((expr (tooltip-identifier-from-point (point))))
187 (if (and (string-equal gdb-current-language "c") 190 (if (and (string-equal gdb-current-language "c")
188 gdb-use-colon-colon-notation) 191 gdb-use-colon-colon-notation)
189 (setq expr (concat gdb-current-frame "::" expr))) 192 (setq expr (concat gdb-current-frame "::" expr)))
190 (catch 'already-watched 193 (catch 'already-watched
@@ -212,9 +215,9 @@ speedbar."
212 (speedbar 1) 215 (speedbar 1)
213 (if (equal (nth 2 var) "0") 216 (if (equal (nth 2 var) "0")
214 (gdb-enqueue-input 217 (gdb-enqueue-input
215 (list (concat "server interpreter mi \"-var-evaluate-expression " 218 (list (concat "server interpreter mi \"-var-evaluate-expression "
216 (nth 1 var) "\"\n") 219 (nth 1 var) "\"\n")
217 `(lambda () (gdb-var-evaluate-expression-handler 220 `(lambda () (gdb-var-evaluate-expression-handler
218 ,(nth 1 var) nil)))) 221 ,(nth 1 var) nil))))
219 (setq gdb-var-changed t))) 222 (setq gdb-var-changed t)))
220 (if (re-search-forward "Undefined command" nil t) 223 (if (re-search-forward "Undefined command" nil t)
@@ -267,11 +270,11 @@ speedbar."
267 (push varchild var-list) 270 (push varchild var-list)
268 (if (equal (nth 2 varchild) "0") 271 (if (equal (nth 2 varchild) "0")
269 (gdb-enqueue-input 272 (gdb-enqueue-input
270 (list 273 (list
271 (concat 274 (concat
272 "server interpreter mi \"-var-evaluate-expression " 275 "server interpreter mi \"-var-evaluate-expression "
273 (nth 1 varchild) "\"\n") 276 (nth 1 varchild) "\"\n")
274 `(lambda () (gdb-var-evaluate-expression-handler 277 `(lambda () (gdb-var-evaluate-expression-handler
275 ,(nth 1 varchild) nil)))))))) 278 ,(nth 1 varchild) nil))))))))
276 (push var var-list))) 279 (push var var-list)))
277 (setq gdb-var-list (nreverse var-list)))))) 280 (setq gdb-var-list (nreverse var-list))))))
@@ -279,7 +282,7 @@ speedbar."
279(defun gdb-var-update () 282(defun gdb-var-update ()
280 (if (not (member 'gdb-var-update (gdb-get-pending-triggers))) 283 (if (not (member 'gdb-var-update (gdb-get-pending-triggers)))
281 (progn 284 (progn
282 (gdb-enqueue-input (list "server interpreter mi \"-var-update *\"\n" 285 (gdb-enqueue-input (list "server interpreter mi \"-var-update *\"\n"
283 'gdb-var-update-handler)) 286 'gdb-var-update-handler))
284 (gdb-set-pending-triggers (cons 'gdb-var-update 287 (gdb-set-pending-triggers (cons 'gdb-var-update
285 (gdb-get-pending-triggers)))))) 288 (gdb-get-pending-triggers))))))
@@ -292,9 +295,9 @@ speedbar."
292 (while (re-search-forward gdb-var-update-regexp nil t) 295 (while (re-search-forward gdb-var-update-regexp nil t)
293 (let ((varnum (match-string 1))) 296 (let ((varnum (match-string 1)))
294 (gdb-enqueue-input 297 (gdb-enqueue-input
295 (list (concat "server interpreter mi \"-var-evaluate-expression " 298 (list (concat "server interpreter mi \"-var-evaluate-expression "
296 varnum "\"\n") 299 varnum "\"\n")
297 `(lambda () (gdb-var-evaluate-expression-handler 300 `(lambda () (gdb-var-evaluate-expression-handler
298 ,varnum t))))))) 301 ,varnum t)))))))
299 (gdb-set-pending-triggers 302 (gdb-set-pending-triggers
300 (delq 'gdb-var-update (gdb-get-pending-triggers)))) 303 (delq 'gdb-var-update (gdb-get-pending-triggers))))
@@ -683,6 +686,9 @@ output from a previous command if that happens to be in effect."
683(defun gdb-prompt (ignored) 686(defun gdb-prompt (ignored)
684 "An annotation handler for `prompt'. 687 "An annotation handler for `prompt'.
685This sends the next command (if any) to gdb." 688This sends the next command (if any) to gdb."
689 (when gdb-first-pre-prompt
690 (gdb-ann3)
691 (setq gdb-first-pre-prompt nil))
686 (let ((sink (gdb-get-output-sink))) 692 (let ((sink (gdb-get-output-sink)))
687 (cond 693 (cond
688 ((eq sink 'user) t) 694 ((eq sink 'user) t)
@@ -702,6 +708,66 @@ This sends the next command (if any) to gdb."
702 (gdb-set-prompting t) 708 (gdb-set-prompting t)
703 (gud-display-frame))))) 709 (gud-display-frame)))))
704 710
711(defun gdb-ann3 ()
712 (set (make-local-variable 'gud-minor-mode) 'gdba)
713 (set (make-local-variable 'gud-marker-filter) 'gud-gdba-marker-filter)
714 ;;
715 (gud-def gud-break (if (not (string-equal mode-name "Machine"))
716 (gud-call "break %f:%l" arg)
717 (save-excursion
718 (beginning-of-line)
719 (forward-char 2)
720 (gud-call "break *%a" arg)))
721 "\C-b" "Set breakpoint at current line or address.")
722 ;;
723 (gud-def gud-remove (if (not (string-equal mode-name "Machine"))
724 (gud-call "clear %f:%l" arg)
725 (save-excursion
726 (beginning-of-line)
727 (forward-char 2)
728 (gud-call "clear *%a" arg)))
729 "\C-d" "Remove breakpoint at current line or address.")
730 ;;
731 (gud-def gud-until (if (not (string-equal mode-name "Machine"))
732 (gud-call "until %f:%l" arg)
733 (save-excursion
734 (beginning-of-line)
735 (forward-char 2)
736 (gud-call "until *%a" arg)))
737 "\C-u" "Continue to current line or address.")
738
739 (define-key gud-minor-mode-map [left-margin mouse-1]
740 'gdb-mouse-toggle-breakpoint)
741 (define-key gud-minor-mode-map [left-fringe mouse-1]
742 'gdb-mouse-toggle-breakpoint)
743
744 (setq comint-input-sender 'gdb-send)
745 ;;
746 ;; (re-)initialise
747 (setq gdb-current-address "main")
748 (setq gdb-previous-address nil)
749 (setq gdb-previous-frame nil)
750 (setq gdb-current-frame "main")
751 (setq gdb-view-source t)
752 (setq gdb-selected-view 'source)
753 (setq gdb-var-list nil)
754 (setq gdb-var-changed nil)
755 ;;
756 (mapc 'make-local-variable gdb-variables)
757 (setq gdb-buffer-type 'gdba)
758 ;;
759 (gdb-clear-inferior-io)
760 ;;
761 (if (eq window-system 'w32)
762 (gdb-enqueue-input (list "set new-console off\n" 'ignore)))
763 (gdb-enqueue-input (list "set height 0\n" 'ignore))
764 ;; find source file and compilation directory here
765 (gdb-enqueue-input (list "server list main\n" 'ignore)) ; C program
766 (gdb-enqueue-input (list "server list MAIN__\n" 'ignore)) ; Fortran program
767 (gdb-enqueue-input (list "server info source\n" 'gdb-source-info))
768 ;;
769 (run-hooks 'gdba-mode-hook))
770
705(defun gdb-subprompt (ignored) 771(defun gdb-subprompt (ignored)
706 "An annotation handler for non-top-level prompts." 772 "An annotation handler for non-top-level prompts."
707 (gdb-set-prompting t)) 773 (gdb-set-prompting t))
@@ -775,15 +841,14 @@ output from the current command if that happens to be appropriate."
775 841
776(defun gud-gdba-marker-filter (string) 842(defun gud-gdba-marker-filter (string)
777 "A gud marker filter for gdb. Handle a burst of output from GDB." 843 "A gud marker filter for gdb. Handle a burst of output from GDB."
778 (let ( 844 ;; Recall the left over gud-marker-acc from last time
779 ;; Recall the left over burst from last time 845 (setq gud-marker-acc (concat gud-marker-acc string))
780 (burst (concat (gdb-get-burst) string)) 846 ;; Start accumulating output for the GUD buffer
781 ;; Start accumulating output for the GUD buffer 847 (let ((output ""))
782 (output ""))
783 ;; 848 ;;
784 ;; Process all the complete markers in this chunk. 849 ;; Process all the complete markers in this chunk.
785 (while (string-match "\n\032\032\\(.*\\)\n" burst) 850 (while (string-match "\n\032\032\\(.*\\)\n" gud-marker-acc)
786 (let ((annotation (match-string 1 burst))) 851 (let ((annotation (match-string 1 gud-marker-acc)))
787 ;; 852 ;;
788 ;; Stuff prior to the match is just ordinary output. 853 ;; Stuff prior to the match is just ordinary output.
789 ;; It is either concatenated to OUTPUT or directed 854 ;; It is either concatenated to OUTPUT or directed
@@ -791,11 +856,11 @@ output from the current command if that happens to be appropriate."
791 (setq output 856 (setq output
792 (gdb-concat-output 857 (gdb-concat-output
793 output 858 output
794 (substring burst 0 (match-beginning 0)))) 859 (substring gud-marker-acc 0 (match-beginning 0))))
795 860 ;;
796 ;; Take that stuff off the burst. 861 ;; Take that stuff off the gud-marker-acc.
797 (setq burst (substring burst (match-end 0))) 862 (setq gud-marker-acc (substring gud-marker-acc (match-end 0)))
798 863 ;;
799 ;; Parse the tag from the annotation, and maybe its arguments. 864 ;; Parse the tag from the annotation, and maybe its arguments.
800 (string-match "\\(\\S-*\\) ?\\(.*\\)" annotation) 865 (string-match "\\(\\S-*\\) ?\\(.*\\)" annotation)
801 (let* ((annotation-type (match-string 1 annotation)) 866 (let* ((annotation-type (match-string 1 annotation))
@@ -812,25 +877,23 @@ output from the current command if that happens to be appropriate."
812 )))) 877 ))))
813 ;; 878 ;;
814 ;; Does the remaining text end in a partial line? 879 ;; Does the remaining text end in a partial line?
815 ;; If it does, then keep part of the burst until we get more. 880 ;; If it does, then keep part of the gud-marker-acc until we get more.
816 (if (string-match "\n\\'\\|\n\032\\'\\|\n\032\032.*\\'" 881 (if (string-match "\n\\'\\|\n\032\\'\\|\n\032\032.*\\'"
817 burst) 882 gud-marker-acc)
818 (progn 883 (progn
819 ;; Everything before the potential marker start can be output. 884 ;; Everything before the potential marker start can be output.
820 (setq output 885 (setq output
821 (gdb-concat-output output 886 (gdb-concat-output output
822 (substring burst 0 (match-beginning 0)))) 887 (substring gud-marker-acc 0
888 (match-beginning 0))))
823 ;; 889 ;;
824 ;; Everything after, we save, to combine with later input. 890 ;; Everything after, we save, to combine with later input.
825 (setq burst (substring burst (match-beginning 0)))) 891 (setq gud-marker-acc (substring gud-marker-acc (match-beginning 0))))
826 ;; 892 ;;
827 ;; In case we know the burst contains no partial annotations: 893 ;; In case we know the gud-marker-acc contains no partial annotations:
828 (progn 894 (progn
829 (setq output (gdb-concat-output output burst)) 895 (setq output (gdb-concat-output output gud-marker-acc))
830 (setq burst ""))) 896 (setq gud-marker-acc "")))
831 ;;
832 ;; Save the remaining burst for the next call to this function.
833 (gdb-set-burst burst)
834 output)) 897 output))
835 898
836(defun gdb-concat-output (so-far new) 899(defun gdb-concat-output (so-far new)
@@ -1552,7 +1615,7 @@ the source buffer."
1552) 1615)
1553 1616
1554(let ((menu (make-sparse-keymap "View"))) 1617(let ((menu (make-sparse-keymap "View")))
1555 (define-key gud-menu-map [view] 1618 (define-key gud-menu-map [view]
1556 `(menu-item "View" ,menu :visible (eq gud-minor-mode 'gdba))) 1619 `(menu-item "View" ,menu :visible (eq gud-minor-mode 'gdba)))
1557; (define-key menu [both] '(menu-item "Both" gdb-view-both 1620; (define-key menu [both] '(menu-item "Both" gdb-view-both
1558; :help "Display both source and assembler" 1621; :help "Display both source and assembler"
@@ -1619,7 +1682,7 @@ the source buffer."
1619 (other-window 1) 1682 (other-window 1)
1620 (switch-to-buffer (gdb-locals-buffer-name)) 1683 (switch-to-buffer (gdb-locals-buffer-name))
1621 (other-window 1) 1684 (other-window 1)
1622 (if (and gdb-view-source 1685 (if (and gdb-view-source
1623 (eq gdb-selected-view 'source)) 1686 (eq gdb-selected-view 'source))
1624 (switch-to-buffer 1687 (switch-to-buffer
1625 (if gud-last-last-frame 1688 (if gud-last-last-frame
@@ -1665,7 +1728,7 @@ This arrangement depends on the value of `gdb-many-windows'."
1665 (delete-other-windows) 1728 (delete-other-windows)
1666 (split-window) 1729 (split-window)
1667 (other-window 1) 1730 (other-window 1)
1668 (if (and gdb-view-source 1731 (if (and gdb-view-source
1669 (eq gdb-selected-view 'source)) 1732 (eq gdb-selected-view 'source))
1670 (switch-to-buffer 1733 (switch-to-buffer
1671 (if gud-last-last-frame 1734 (if gud-last-last-frame
@@ -1888,7 +1951,7 @@ BUFFER nil or omitted means use the current buffer."
1888 (unless (string-equal gdb-current-frame gdb-previous-frame) 1951 (unless (string-equal gdb-current-frame gdb-previous-frame)
1889 (if (or (not (member 'gdb-invalidate-assembler 1952 (if (or (not (member 'gdb-invalidate-assembler
1890 (gdb-get-pending-triggers))) 1953 (gdb-get-pending-triggers)))
1891 (not (string-equal gdb-current-address 1954 (not (string-equal gdb-current-address
1892 gdb-previous-address))) 1955 gdb-previous-address)))
1893 (progn 1956 (progn
1894 ;; take previous disassemble command off the queue 1957 ;; take previous disassemble command off the queue
@@ -1896,7 +1959,7 @@ BUFFER nil or omitted means use the current buffer."
1896 (let ((queue (gdb-get-input-queue)) (item)) 1959 (let ((queue (gdb-get-input-queue)) (item))
1897 (dolist (item queue) 1960 (dolist (item queue)
1898 (if (equal (cdr item) '(gdb-assembler-handler)) 1961 (if (equal (cdr item) '(gdb-assembler-handler))
1899 (gdb-set-input-queue 1962 (gdb-set-input-queue
1900 (delete item (gdb-get-input-queue))))))) 1963 (delete item (gdb-get-input-queue)))))))
1901 (gdb-enqueue-input 1964 (gdb-enqueue-input
1902 (list (concat "server disassemble " gdb-current-address "\n") 1965 (list (concat "server disassemble " gdb-current-address "\n")
@@ -1928,14 +1991,14 @@ BUFFER nil or omitted means use the current buffer."
1928 (let ((address (match-string 1))) 1991 (let ((address (match-string 1)))
1929 ;; remove leading 0s from output of info frame command. 1992 ;; remove leading 0s from output of info frame command.
1930 (if (string-match "^0+\\(.*\\)" address) 1993 (if (string-match "^0+\\(.*\\)" address)
1931 (setq gdb-current-address 1994 (setq gdb-current-address
1932 (concat "0x" (match-string 1 address))) 1995 (concat "0x" (match-string 1 address)))
1933 (setq gdb-current-address (concat "0x" address)))) 1996 (setq gdb-current-address (concat "0x" address))))
1934 (if (or (if (not (looking-at ".*(\\S-*:[0-9]*)")) 1997 (if (or (if (not (looking-at ".*(\\S-*:[0-9]*)"))
1935 (progn (setq gdb-view-source nil) t)) 1998 (progn (setq gdb-view-source nil) t))
1936 (eq gdb-selected-view 'assembler)) 1999 (eq gdb-selected-view 'assembler))
1937 (progn 2000 (progn
1938 (set-window-buffer 2001 (set-window-buffer
1939 gdb-source-window 2002 gdb-source-window
1940 (gdb-get-create-buffer 'gdb-assembler-buffer)) 2003 (gdb-get-create-buffer 'gdb-assembler-buffer))
1941 ;;update with new frame for machine code if necessary 2004 ;;update with new frame for machine code if necessary
diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el
index 159b276716d..b96e7f1a298 100644
--- a/lisp/net/ange-ftp.el
+++ b/lisp/net/ange-ftp.el
@@ -3434,7 +3434,7 @@ system TYPE.")
3434 (nreverse files))) 3434 (nreverse files)))
3435 (apply 'ange-ftp-real-directory-files directory full match v19-args))) 3435 (apply 'ange-ftp-real-directory-files directory full match v19-args)))
3436 3436
3437(defun ange-ftp-file-attributes (file) 3437(defun ange-ftp-file-attributes (file &optional id-format)
3438 (setq file (expand-file-name file)) 3438 (setq file (expand-file-name file))
3439 (let ((parsed (ange-ftp-ftp-name file))) 3439 (let ((parsed (ange-ftp-ftp-name file)))
3440 (if parsed 3440 (if parsed
@@ -3467,7 +3467,7 @@ system TYPE.")
3467 inode ;10 "inode number". 3467 inode ;10 "inode number".
3468 -1 ;11 device number [v19 only] 3468 -1 ;11 device number [v19 only]
3469 )))) 3469 ))))
3470 (ange-ftp-real-file-attributes file)))) 3470 (ange-ftp-real-file-attributes file id-format))))
3471 3471
3472(defun ange-ftp-file-newer-than-file-p (f1 f2) 3472(defun ange-ftp-file-newer-than-file-p (f1 f2)
3473 (let ((f1-parsed (ange-ftp-ftp-name f1)) 3473 (let ((f1-parsed (ange-ftp-ftp-name f1))
diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el
index 1d58bcd732c..48a007aef27 100644
--- a/lisp/progmodes/gud.el
+++ b/lisp/progmodes/gud.el
@@ -319,10 +319,10 @@ t means that there is no stack, and we are in display-file mode.")
319If the GUD BUFFER is not running a supported debugger, then turn 319If the GUD BUFFER is not running a supported debugger, then turn
320off the specialized speedbar mode." 320off the specialized speedbar mode."
321 (let ((minor-mode (with-current-buffer buffer gud-minor-mode))) 321 (let ((minor-mode (with-current-buffer buffer gud-minor-mode)))
322 (cond 322 (cond
323 ((eq minor-mode 'gdba) 323 ((eq minor-mode 'gdba)
324 (when (or gdb-var-changed 324 (when (or gdb-var-changed
325 (not (save-excursion 325 (not (save-excursion
326 (goto-char (point-min)) 326 (goto-char (point-min))
327 (let ((case-fold-search t)) 327 (let ((case-fold-search t))
328 (looking-at "Watch Expressions:"))))) 328 (looking-at "Watch Expressions:")))))
@@ -339,8 +339,8 @@ off the specialized speedbar mode."
339 (speedbar-make-tag-line 'bracket ?? nil nil 339 (speedbar-make-tag-line 'bracket ?? nil nil
340 (concat (car var) "\t" (nth 4 var)) 340 (concat (car var) "\t" (nth 4 var))
341 'gdb-edit-value 341 'gdb-edit-value
342 nil 342 nil
343 (if (and (nth 5 var) 343 (if (and (nth 5 var)
344 gdb-show-changed-values) 344 gdb-show-changed-values)
345 'font-lock-warning-face 345 'font-lock-warning-face
346 nil) depth) 346 nil) depth)
@@ -354,7 +354,7 @@ off the specialized speedbar mode."
354 nil nil depth))) 354 nil nil depth)))
355 (setq var-list (cdr var-list)))) 355 (setq var-list (cdr var-list))))
356 (setq gdb-var-changed nil))) 356 (setq gdb-var-changed nil)))
357 (t (if (and (save-excursion 357 (t (if (and (save-excursion
358 (goto-char (point-min)) 358 (goto-char (point-min))
359 (looking-at "Current Stack")) 359 (looking-at "Current Stack"))
360 (equal gud-last-last-frame gud-last-speedbar-stackframe)) 360 (equal gud-last-last-frame gud-last-speedbar-stackframe))
@@ -406,7 +406,7 @@ off the specialized speedbar mode."
406;; History of argument lists passed to gdb. 406;; History of argument lists passed to gdb.
407(defvar gud-gdb-history nil) 407(defvar gud-gdb-history nil)
408 408
409(defcustom gud-gdb-command-name "gdb --fullname" 409(defcustom gud-gdb-command-name "gdb --annotate=3"
410 "Default command to execute an executable under the GDB debugger." 410 "Default command to execute an executable under the GDB debugger."
411 :type 'string 411 :type 'string
412 :group 'gud) 412 :group 'gud)
@@ -447,6 +447,19 @@ off the specialized speedbar mode."
447 ;; Set the accumulator to the remaining text. 447 ;; Set the accumulator to the remaining text.
448 gud-marker-acc (substring gud-marker-acc (match-end 0)))) 448 gud-marker-acc (substring gud-marker-acc (match-end 0))))
449 449
450 (while (string-match "\n\032\032\\(.*\\)\n" gud-marker-acc)
451 (when (string-equal (match-string 1 gud-marker-acc) "prompt")
452 (require 'gdb-ui)
453 (gdb-prompt nil))
454 (setq
455 ;; Append any text before the marker to the output we're going
456 ;; to return - we don't include the marker in this text.
457 output (concat output
458 (substring gud-marker-acc 0 (match-beginning 0)))
459
460 ;; Set the accumulator to the remaining text.
461 gud-marker-acc (substring gud-marker-acc (match-end 0))))
462
450 ;; Does the remaining text look like it might end with the 463 ;; Does the remaining text look like it might end with the
451 ;; beginning of another marker? If it does, then keep it in 464 ;; beginning of another marker? If it does, then keep it in
452 ;; gud-marker-acc until we receive the rest of it. Since we 465 ;; gud-marker-acc until we receive the rest of it. Since we
@@ -492,6 +505,8 @@ off the specialized speedbar mode."
492 gud-minibuffer-local-map nil 505 gud-minibuffer-local-map nil
493 hist-sym))) 506 hist-sym)))
494 507
508(defvar gdb-first-pre-prompt t)
509
495;;;###autoload 510;;;###autoload
496(defun gdb (command-line) 511(defun gdb (command-line)
497 "Run gdb on program FILE in buffer *gud-FILE*. 512 "Run gdb on program FILE in buffer *gud-FILE*.
@@ -522,8 +537,8 @@ and source-file directory for your debugger."
522 (local-set-key "\C-i" 'gud-gdb-complete-command) 537 (local-set-key "\C-i" 'gud-gdb-complete-command)
523 (setq comint-prompt-regexp "^(.*gdb[+]?) *") 538 (setq comint-prompt-regexp "^(.*gdb[+]?) *")
524 (setq paragraph-start comint-prompt-regexp) 539 (setq paragraph-start comint-prompt-regexp)
525 (run-hooks 'gdb-mode-hook) 540 (setq gdb-first-pre-prompt t)
526 ) 541 (run-hooks 'gdb-mode-hook))
527 542
528;; One of the nice features of GDB is its impressive support for 543;; One of the nice features of GDB is its impressive support for
529;; context-sensitive command completion. We preserve that feature 544;; context-sensitive command completion. We preserve that feature