comparison lisp/progmodes/gdb-ui.el @ 63653:ec766f32b118

(gdb-error): New variable. (gdb-error): New function. (gdb-annotation-rules): Act on error-begin and error annotations. (gdb-concat-output): Use font-lock-warning-face for errors.
author Nick Roberts <nickrob@snap.net.nz>
date Wed, 22 Jun 2005 08:45:01 +0000
parents 24c727190495
children 64e2bf63ca16
comparison
equal deleted inserted replaced
63652:cec122e2c385 63653:ec766f32b118
83 (defvar gdb-location-alist nil 83 (defvar gdb-location-alist nil
84 "Alist of breakpoint numbers and full filenames.") 84 "Alist of breakpoint numbers and full filenames.")
85 (defvar gdb-find-file-unhook nil) 85 (defvar gdb-find-file-unhook nil)
86 (defvar gdb-active-process nil "GUD tooltips display variable values when t, \ 86 (defvar gdb-active-process nil "GUD tooltips display variable values when t, \
87 and #define directives otherwise.") 87 and #define directives otherwise.")
88 (defvar gdb-error "Non-nil when GDB is reporting an error.")
88 (defvar gdb-macro-info nil 89 (defvar gdb-macro-info nil
89 "Non-nil if GDB knows that the inferior includes preprocessor macro info.") 90 "Non-nil if GDB knows that the inferior includes preprocessor macro info.")
90 91
91 (defvar gdb-buffer-type nil 92 (defvar gdb-buffer-type nil
92 "One of the symbols bound in `gdb-buffer-rules'.") 93 "One of the symbols bound in `gdb-buffer-rules'.")
357 gdb-output-sink 'user 358 gdb-output-sink 'user
358 gdb-server-prefix "server " 359 gdb-server-prefix "server "
359 gdb-flush-pending-output nil 360 gdb-flush-pending-output nil
360 gdb-location-alist nil 361 gdb-location-alist nil
361 gdb-find-file-unhook nil 362 gdb-find-file-unhook nil
363 gdb-error nil
362 gdb-macro-info nil) 364 gdb-macro-info nil)
363 ;; 365 ;;
364 (setq gdb-buffer-type 'gdba) 366 (setq gdb-buffer-type 'gdba)
365 ;; 367 ;;
366 (if gdb-use-inferior-io-buffer (gdb-clear-inferior-io)) 368 (if gdb-use-inferior-io-buffer (gdb-clear-inferior-io))
858 ("signal" gdb-stopping) 860 ("signal" gdb-stopping)
859 ("breakpoint" gdb-stopping) 861 ("breakpoint" gdb-stopping)
860 ("watchpoint" gdb-stopping) 862 ("watchpoint" gdb-stopping)
861 ("frame-begin" gdb-frame-begin) 863 ("frame-begin" gdb-frame-begin)
862 ("stopped" gdb-stopped) 864 ("stopped" gdb-stopped)
865 ("error-begin" gdb-error)
866 ("error" gdb-error)
863 ) "An assoc mapping annotation tags to functions which process them.") 867 ) "An assoc mapping annotation tags to functions which process them.")
864 868
865 (defun gdb-resync() 869 (defun gdb-resync()
866 (setq gdb-flush-pending-output t) 870 (setq gdb-flush-pending-output t)
867 (setq gud-running nil) 871 (setq gud-running nil)
986 (setq gdb-output-sink 'user)) 990 (setq gdb-output-sink 'user))
987 ((eq sink 'user) t) 991 ((eq sink 'user) t)
988 (t 992 (t
989 (gdb-resync) 993 (gdb-resync)
990 (error "Unexpected stopped annotation"))))) 994 (error "Unexpected stopped annotation")))))
995
996 (defun gdb-error (ignored)
997 (setq gdb-error (not gdb-error)))
991 998
992 (defun gdb-post-prompt (ignored) 999 (defun gdb-post-prompt (ignored)
993 "An annotation handler for `post-prompt'. 1000 "An annotation handler for `post-prompt'.
994 This begins the collection of output from the current command if that 1001 This begins the collection of output from the current command if that
995 happens to be appropriate." 1002 happens to be appropriate."
1081 (setq output (gdb-concat-output output gud-marker-acc)) 1088 (setq output (gdb-concat-output output gud-marker-acc))
1082 (setq gud-marker-acc ""))) 1089 (setq gud-marker-acc "")))
1083 output))) 1090 output)))
1084 1091
1085 (defun gdb-concat-output (so-far new) 1092 (defun gdb-concat-output (so-far new)
1093 (if gdb-error
1094 (put-text-property 0 (length new) 'face font-lock-warning-face new))
1086 (let ((sink gdb-output-sink)) 1095 (let ((sink gdb-output-sink))
1087 (cond 1096 (cond
1088 ((eq sink 'user) (concat so-far new)) 1097 ((eq sink 'user) (concat so-far new))
1089 ((or (eq sink 'pre-emacs) (eq sink 'post-emacs)) so-far) 1098 ((or (eq sink 'pre-emacs) (eq sink 'post-emacs)) so-far)
1090 ((eq sink 'emacs) 1099 ((eq sink 'emacs)