changeset 61114:e1f821140a5a

(gdb): (Re)-initialise gud-filter-pending-text. (gud-filter-pending-text): Move in front of gdb. (gud-overlay-arrow-position): New variable. (gud-sentinel, gud-display-line): Use it in place of overlay-arrow-position.
author Nick Roberts <nickrob@snap.net.nz>
date Tue, 29 Mar 2005 20:59:42 +0000
parents b05fcd53a916
children dcdebd4bb525
files lisp/progmodes/gud.el
diffstat 1 files changed, 13 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/progmodes/gud.el	Tue Mar 29 20:59:01 2005 +0000
+++ b/lisp/progmodes/gud.el	Tue Mar 29 20:59:42 2005 +0000
@@ -531,6 +531,9 @@
 
 (defvar gdb-first-prompt t)
 
+(defvar gud-filter-pending-text nil
+  "Non-nil means this is text that has been saved for later in `gud-filter'.")
+
 ;;;###autoload
 (defun gdb (command-line)
   "Run gdb on program FILE in buffer *gud-FILE*.
@@ -562,6 +565,7 @@
   (setq comint-prompt-regexp "^(.*gdb[+]?) *")
   (setq paragraph-start comint-prompt-regexp)
   (setq gdb-first-prompt t)
+  (setq gud-filter-pending-text nil)
   (run-hooks 'gdb-mode-hook))
 
 ;; One of the nice features of GDB is its impressive support for
@@ -2445,9 +2449,6 @@
   "Non-nil means don't process anything from the debugger right now.
 It is saved for when this flag is not set.")
 
-(defvar gud-filter-pending-text nil
-  "Non-nil means this is text that has been saved for later in `gud-filter'.")
-
 ;; These functions are responsible for inserting output from your debugger
 ;; into the buffer.  The hard work is done by the method that is
 ;; the value of gud-marker-filter.
@@ -2516,19 +2517,22 @@
 	      (gud-filter proc ""))))))
 
 (defvar gud-minor-mode-type nil)
+(defvar gud-overlay-arrow-position nil)
+(put 'gud-overlay-arrow-position 'overlay-arrow-string "=>")
+(add-to-list 'overlay-arrow-variable-list 'gud-overlay-arrow-position)
 
 (defun gud-sentinel (proc msg)
   (cond ((null (buffer-name (process-buffer proc)))
 	 ;; buffer killed
 	 ;; Stop displaying an arrow in a source file.
-	 (setq overlay-arrow-position nil)
+	 (setq gud-overlay-arrow-position nil)
 	 (set-process-buffer proc nil)
 	 (if (memq gud-minor-mode-type '(gdbmi gdba))
 	     (gdb-reset)
 	   (gud-reset)))
 	((memq (process-status proc) '(signal exit))
 	 ;; Stop displaying an arrow in a source file.
-	 (setq overlay-arrow-position nil)
+	 (setq gud-overlay-arrow-position nil)
 	 (with-current-buffer gud-comint-buffer
 	   (if (memq gud-minor-mode-type '(gdbmi gdba))
 	       (gdb-reset)
@@ -2611,13 +2615,13 @@
 	      (goto-line line)
 	      (setq pos (point))
 	      (setq overlay-arrow-string "=>")
-	      (or overlay-arrow-position
-		  (setq overlay-arrow-position (make-marker)))
-	      (set-marker overlay-arrow-position (point) (current-buffer)))
+	      (or gud-overlay-arrow-position
+		  (setq gud-overlay-arrow-position (make-marker)))
+	      (set-marker gud-overlay-arrow-position (point) (current-buffer)))
 	    (cond ((or (< pos (point-min)) (> pos (point-max)))
 		   (widen)
 		   (goto-char pos))))
-	  (if window (set-window-point window overlay-arrow-position))))))
+	  (if window (set-window-point window gud-overlay-arrow-position))))))
 
 ;; The gud-call function must do the right thing whether its invoking
 ;; keystroke is from the GUD buffer itself (via major-mode binding)