[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/progmodes/gdb-ui.el
From: |
Nick Roberts |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/progmodes/gdb-ui.el |
Date: |
Mon, 22 Nov 2004 04:51:46 -0500 |
Index: emacs/lisp/progmodes/gdb-ui.el
diff -c emacs/lisp/progmodes/gdb-ui.el:1.30 emacs/lisp/progmodes/gdb-ui.el:1.31
*** emacs/lisp/progmodes/gdb-ui.el:1.30 Mon Nov 8 21:16:33 2004
--- emacs/lisp/progmodes/gdb-ui.el Mon Nov 22 09:44:23 2004
***************
*** 68,77 ****
(defvar gdb-var-changed nil "Non-nil means that gdb-var-list has changed.")
(defvar gdb-buffer-type nil)
(defvar gdb-overlay-arrow-position nil)
- (defvar gdb-variables '()
- "A list of variables that are local to the GUD buffer.")
(defvar gdb-server-prefix nil)
;;;###autoload
(defun gdba (command-line)
"Run gdb on program FILE in buffer *gud-FILE*.
--- 68,115 ----
(defvar gdb-var-changed nil "Non-nil means that gdb-var-list has changed.")
(defvar gdb-buffer-type nil)
(defvar gdb-overlay-arrow-position nil)
(defvar gdb-server-prefix nil)
+ (defvar gdb-buffer-type nil
+ "One of the symbols bound in `gdb-buffer-rules'.")
+
+ (defvar gdb-input-queue ()
+ "A list of gdb command objects.")
+
+ (defvar gdb-prompting nil
+ "True when gdb is idle with no pending input.")
+
+ (defvar gdb-output-sink 'user
+ "The disposition of the output of the current gdb command.
+ Possible values are these symbols:
+
+ `user' -- gdb output should be copied to the GUD buffer
+ for the user to see.
+
+ `inferior' -- gdb output should be copied to the inferior-io buffer
+
+ `pre-emacs' -- output should be ignored util the post-prompt
+ annotation is received. Then the output-sink
+ becomes:...
+ `emacs' -- output should be collected in the partial-output-buffer
+ 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 output until the prompt annotation is
+ received, then go to USER disposition.
+
+ gdba (gdb-ui.el) uses all five values, gdbmi (gdb-mi.el) only two
+ \(`user' and `emacs').")
+
+ (defvar gdb-current-item nil
+ "The most recent command item sent to gdb.")
+
+ (defvar gdb-pending-triggers '()
+ "A list of trigger functions that have run later than their output
+ handlers.")
+
+ ;; end of gdb variables
+
;;;###autoload
(defun gdba (command-line)
"Run gdb on program FILE in buffer *gud-FILE*.
***************
*** 197,203 ****
(setq gdb-output-sink 'user)
(setq gdb-server-prefix "server ")
;;
- (mapc 'make-local-variable gdb-variables)
(setq gdb-buffer-type 'gdba)
;;
(if gdb-use-inferior-io-buffer (gdb-clear-inferior-io))
--- 235,240 ----
***************
*** 412,457 ****
(if (string-match (concat token "\\.") (nth 1 var))
(setq gdb-var-list (delq var gdb-var-list))))
(setq gdb-var-changed t))))
-
- (defvar gdb-buffer-type nil
- "One of the symbols bound in `gdb-buffer-rules'.")
-
- (defvar gdb-input-queue ()
- "A list of gdb command objects.")
-
- (defvar gdb-prompting nil
- "True when gdb is idle with no pending input.")
-
- (defvar gdb-output-sink 'user
- "The disposition of the output of the current gdb command.
- Possible values are these symbols:
-
- `user' -- gdb output should be copied to the GUD buffer
- for the user to see.
-
- `inferior' -- gdb output should be copied to the inferior-io buffer
-
- `pre-emacs' -- output should be ignored util the post-prompt
- annotation is received. Then the output-sink
- becomes:...
- `emacs' -- output should be collected in the partial-output-buffer
- 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 output until the prompt annotation is
- received, then go to USER disposition.
-
- gdba (gdb-ui.el) uses all five values, gdbmi (gdb-mi.el) only two
- \(`user' and `emacs').")
-
- (defvar gdb-current-item nil
- "The most recent command item sent to gdb.")
-
- (defvar gdb-pending-triggers '()
- "A list of trigger functions that have run later than their output
- handlers.")
-
- ;; end of gdb variables
(defun gdb-get-target-string ()
(with-current-buffer gud-comint-buffer
--- 449,454 ----
***************
*** 644,649 ****
--- 641,666 ----
(let ((last (car (last queue))))
(unless (nbutlast queue) (setq gdb-input-queue '()))
last))))
+
+ (defun gdb-send-item (item)
+ (if gdb-enable-debug-log (push (cons 'send item) gdb-debug-log))
+ (setq gdb-current-item item)
+ (with-current-buffer gud-comint-buffer
+ (if (eq gud-minor-mode 'gdba)
+ (if (stringp item)
+ (progn
+ (setq gdb-output-sink 'user)
+ (process-send-string (get-buffer-process gud-comint-buffer) item))
+ (progn
+ (gdb-clear-partial-output)
+ (setq gdb-output-sink 'pre-emacs)
+ (process-send-string (get-buffer-process gud-comint-buffer)
+ (car item))))
+ ;; case: eq gud-minor-mode 'gdbmi
+ (gdb-clear-partial-output)
+ (setq gdb-output-sink 'emacs)
+ (process-send-string (get-buffer-process gud-comint-buffer)
+ (car item)))))
;;
;; output -- things gdb prints to emacs
***************
*** 688,693 ****
--- 705,717 ----
("stopped" gdb-stopped)
) "An assoc mapping annotation tags to functions which process them.")
+ (defun gdb-resync()
+ (setq gud-running nil)
+ (setq gdb-output-sink 'user)
+ (setq gdb-input-queue nil)
+ (setq gdb-pending-triggers nil)
+ (setq gdb-prompting t))
+
(defconst gdb-source-spec-regexp
"\\(.*\\):\\([0-9]*\\):[0-9]*:[a-z]*:\\(0x[a-f0-9]*\\)")
***************
*** 705,730 ****
;; stopped annotation
(if (eq gdb-output-sink 'inferior) (setq gdb-output-sink 'user)))
- (defun gdb-send-item (item)
- (if gdb-enable-debug-log (push (cons 'send item) gdb-debug-log))
- (setq gdb-current-item item)
- (with-current-buffer gud-comint-buffer
- (if (eq gud-minor-mode 'gdba)
- (if (stringp item)
- (progn
- (setq gdb-output-sink 'user)
- (process-send-string (get-buffer-process gud-comint-buffer) item))
- (progn
- (gdb-clear-partial-output)
- (setq gdb-output-sink 'pre-emacs)
- (process-send-string (get-buffer-process gud-comint-buffer)
- (car item))))
- ;; case: eq gud-minor-mode 'gdbmi
- (gdb-clear-partial-output)
- (setq gdb-output-sink 'emacs)
- (process-send-string (get-buffer-process gud-comint-buffer)
- (car item)))))
-
(defun gdb-pre-prompt (ignored)
"An annotation handler for `pre-prompt'.
This terminates the collection of output from a previous command if that
--- 729,734 ----
***************
*** 735,741 ****
((eq sink 'emacs)
(setq gdb-output-sink 'post-emacs))
(t
! (setq gdb-output-sink 'user)
(error "Phase error in gdb-pre-prompt (got %s)" sink)))))
(defun gdb-prompt (ignored)
--- 739,745 ----
((eq sink 'emacs)
(setq gdb-output-sink 'post-emacs))
(t
! (gdb-resync)
(error "Phase error in gdb-pre-prompt (got %s)" sink)))))
(defun gdb-prompt (ignored)
***************
*** 752,758 ****
(with-current-buffer (gdb-get-create-buffer 'gdb-partial-output-buffer)
(funcall handler))))
(t
! (setq gdb-output-sink 'user)
(error "Phase error in gdb-prompt (got %s)" sink))))
(let ((input (gdb-dequeue-input)))
(if input
--- 756,762 ----
(with-current-buffer (gdb-get-create-buffer 'gdb-partial-output-buffer)
(funcall handler))))
(t
! (gdb-resync)
(error "Phase error in gdb-prompt (got %s)" sink))))
(let ((input (gdb-dequeue-input)))
(if input
***************
*** 776,782 ****
(setq gud-running t)
(if gdb-use-inferior-io-buffer
(setq gdb-output-sink 'inferior))))
! (t (error "Unexpected `starting' annotation")))))
(defun gdb-stopping (ignored)
"An annotation handler for `exited' and other annotations.
--- 780,788 ----
(setq gud-running t)
(if gdb-use-inferior-io-buffer
(setq gdb-output-sink 'inferior))))
! (t
! (gdb-resync)
! (error "Unexpected `starting' annotation")))))
(defun gdb-stopping (ignored)
"An annotation handler for `exited' and other annotations.
***************
*** 787,793 ****
(cond
((eq sink 'inferior)
(setq gdb-output-sink 'user))
! (t (error "Unexpected stopping annotation"))))))
(defun gdb-frame-begin (ignored)
(let ((sink gdb-output-sink))
--- 793,801 ----
(cond
((eq sink 'inferior)
(setq gdb-output-sink 'user))
! (t
! (gdb-resync)
! (error "Unexpected stopping annotation"))))))
(defun gdb-frame-begin (ignored)
(let ((sink gdb-output-sink))
***************
*** 796,802 ****
(setq gdb-output-sink 'user))
((eq sink 'user) t)
((eq sink 'emacs) t)
! (t (error "Unexpected frame-begin annotation (%S)" sink)))))
(defun gdb-stopped (ignored)
"An annotation handler for `stopped'.
--- 804,812 ----
(setq gdb-output-sink 'user))
((eq sink 'user) t)
((eq sink 'emacs) t)
! (t
! (gdb-resync)
! (error "Unexpected frame-begin annotation (%S)" sink)))))
(defun gdb-stopped (ignored)
"An annotation handler for `stopped'.
***************
*** 808,814 ****
((eq sink 'inferior)
(setq gdb-output-sink 'user))
((eq sink 'user) t)
! (t (error "Unexpected stopped annotation")))))
(defun gdb-post-prompt (ignored)
"An annotation handler for `post-prompt'.
--- 818,826 ----
((eq sink 'inferior)
(setq gdb-output-sink 'user))
((eq sink 'user) t)
! (t
! (gdb-resync)
! (error "Unexpected stopped annotation")))))
(defun gdb-post-prompt (ignored)
"An annotation handler for `post-prompt'.
***************
*** 837,843 ****
((eq sink 'pre-emacs)
(setq gdb-output-sink 'emacs))
(t
! (setq gdb-output-sink 'user)
(error "Phase error in gdb-post-prompt (got %s)" sink)))))
(defun gud-gdba-marker-filter (string)
--- 849,855 ----
((eq sink 'pre-emacs)
(setq gdb-output-sink 'emacs))
(t
! (gdb-resync)
(error "Phase error in gdb-post-prompt (got %s)" sink)))))
(defun gud-gdba-marker-filter (string)
***************
*** 909,915 ****
((eq sink 'inferior)
(gdb-append-to-inferior-io new)
so-far)
! (t (error "Bogon output sink %S" sink)))))
(defun gdb-append-to-partial-output (string)
(with-current-buffer (gdb-get-create-buffer 'gdb-partial-output-buffer)
--- 921,929 ----
((eq sink 'inferior)
(gdb-append-to-inferior-io new)
so-far)
! (t
! (gdb-resync)
! (error "Bogon output sink %S" sink)))))
(defun gdb-append-to-partial-output (string)
(with-current-buffer (gdb-get-create-buffer 'gdb-partial-output-buffer)
- [Emacs-diffs] Changes to emacs/lisp/progmodes/gdb-ui.el, Nick Roberts, 2004/11/01
- [Emacs-diffs] Changes to emacs/lisp/progmodes/gdb-ui.el, Eli Zaretskii, 2004/11/06
- [Emacs-diffs] Changes to emacs/lisp/progmodes/gdb-ui.el, Nick Roberts, 2004/11/08
- [Emacs-diffs] Changes to emacs/lisp/progmodes/gdb-ui.el,
Nick Roberts <=
- [Emacs-diffs] Changes to emacs/lisp/progmodes/gdb-ui.el, Nick Roberts, 2004/11/22
- [Emacs-diffs] Changes to emacs/lisp/progmodes/gdb-ui.el, Nick Roberts, 2004/11/24
- [Emacs-diffs] Changes to emacs/lisp/progmodes/gdb-ui.el, Nick Roberts, 2004/11/24
- [Emacs-diffs] Changes to emacs/lisp/progmodes/gdb-ui.el, Nick Roberts, 2004/11/25
- [Emacs-diffs] Changes to emacs/lisp/progmodes/gdb-ui.el, Nick Roberts, 2004/11/26