emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/gdb-ui.el


From: Nick Roberts
Subject: [Emacs-diffs] Changes to emacs/lisp/gdb-ui.el
Date: Thu, 04 Sep 2003 18:34:47 -0400

Index: emacs/lisp/gdb-ui.el
diff -c emacs/lisp/gdb-ui.el:1.42 emacs/lisp/gdb-ui.el:1.43
*** emacs/lisp/gdb-ui.el:1.42   Mon Sep  1 11:45:12 2003
--- emacs/lisp/gdb-ui.el        Thu Sep  4 18:34:47 2003
***************
*** 199,208 ****
        (gud-call (concat "server ptype " expr)))
      (goto-char (- (point-max) 1))
      (if (equal (char-before) (string-to-char "\*"))
!       (gdb-enqueue-input
!        (list (concat "display* " expr "\n") 'ignore))
!       (gdb-enqueue-input
!        (list (concat "display " expr "\n") 'ignore)))))
  
  ; this would messy because these bindings don't work with M-x gdb
  ; (define-key global-map "\C-x\C-a\C-a" 'gud-display)
--- 199,206 ----
        (gud-call (concat "server ptype " expr)))
      (goto-char (- (point-max) 1))
      (if (equal (char-before) (string-to-char "\*"))
!       (gud-call (concat "display* " expr))
!       (gud-call (concat "display " expr)))))
  
  ; this would messy because these bindings don't work with M-x gdb
  ; (define-key global-map "\C-x\C-a\C-a" 'gud-display)
***************
*** 239,248 ****
    "A string of characters from gdb that have not yet been processed.")
  
  (def-gdb-var input-queue ()
!   "A list of high priority gdb command objects.")
! 
! (def-gdb-var idle-input-queue ()
!   "A list of low priority gdb command objects.")
  
  (def-gdb-var prompting nil
    "True when gdb is idle with no pending input.")
--- 237,243 ----
    "A string of characters from gdb that have not yet been processed.")
  
  (def-gdb-var input-queue ()
!   "A list of gdb command objects.")
  
  (def-gdb-var prompting nil
    "True when gdb is idle with no pending input.")
***************
*** 432,440 ****
  
  ;; INPUT: things sent to gdb
  ;;
- ;; There is a high and low priority input queue.  Low priority input is sent
- ;; only when the high priority queue is idle.
- ;;
  ;; The queues are lists.  Each element is either a string (indicating user or
  ;; user-like input) or a list of the form:
  ;;
--- 427,432 ----
***************
*** 453,464 ****
    (gdb-enqueue-input (concat string "\n")))
  
  ;; Note: Stuff enqueued here will be sent to the next prompt, even if it
! ;; is a query, or other non-top-level prompt.  To guarantee stuff will get
! ;; sent to the top-level prompt, currently it must be put in the idle queue.
! ;;                             ^^^^^^^^^
! ;; [This should encourage gdb extensions that invoke gdb commands to let
! ;;  the user go first; it is not a bug.     -t]
! ;;
  
  (defun gdb-enqueue-input (item)
    (if (gdb-get-prompting)
--- 445,451 ----
    (gdb-enqueue-input (concat string "\n")))
  
  ;; Note: Stuff enqueued here will be sent to the next prompt, even if it
! ;; is a query, or other non-top-level prompt. 
  
  (defun gdb-enqueue-input (item)
    (if (gdb-get-prompting)
***************
*** 477,500 ****
               answer)
           (gdb-take-last-elt queue)))))
  
- (defun gdb-enqueue-idle-input (item)
-   (if (and (gdb-get-prompting)
-          (not (gdb-get-input-queue)))
-       (progn
-       (gdb-send-item item)
-       (gdb-set-prompting nil))
-     (gdb-set-idle-input-queue
-      (cons item (gdb-get-idle-input-queue)))))
- 
- (defun gdb-dequeue-idle-input ()
-   (let ((queue (gdb-get-idle-input-queue)))
-     (and queue
-        (if (not (cdr queue))
-            (let ((answer (car queue)))
-              (gdb-set-idle-input-queue '())
-              answer)
-          (gdb-take-last-elt queue)))))
- 
  ;; Don't use this in general.
  (defun gdb-take-last-elt (l)
    (if (cdr (cdr l))
--- 464,469 ----
***************
*** 609,630 ****
       (t
        (gdb-set-output-sink 'user)
        (error "Phase error in gdb-prompt (got %s)" sink))))
!   (let ((highest (gdb-dequeue-input)))
!     (if highest
!       (gdb-send-item highest)
!       (let ((lowest (gdb-dequeue-idle-input)))
!       (if lowest
!           (gdb-send-item lowest)
!         (progn
!           (gdb-set-prompting t)
!           (gud-display-frame)))))))
  
  (defun gdb-subprompt (ignored)
    "An annotation handler for non-top-level prompts."
!   (let ((highest (gdb-dequeue-input)))
!     (if highest
!       (gdb-send-item highest)
!       (gdb-set-prompting t))))
  
  (defun gdb-starting (ignored)
    "An annotation handler for `starting'.  This says that I/O for the
--- 578,593 ----
       (t
        (gdb-set-output-sink 'user)
        (error "Phase error in gdb-prompt (got %s)" sink))))
!   (let ((input (gdb-dequeue-input)))
!     (if input
!       (gdb-send-item input)
!       (progn
!       (gdb-set-prompting t)
!       (gud-display-frame)))))
  
  (defun gdb-subprompt (ignored)
    "An annotation handler for non-top-level prompts."
!   (gdb-set-prompting t))
  
  (defun gdb-starting (ignored)
    "An annotation handler for `starting'.  This says that I/O for the
***************
*** 1176,1190 ****
  ;; command might have changed, and we have to be able to run the command
  ;; behind the user's back.
  ;;
! ;; The idle input queue and the output phasing associated with the variable
! ;; gdb-output-sink help us to run commands behind the user's back.
  ;;
  ;; Below is the code for specificly managing buffers of output from one
  ;; command.
  ;;
  
  ;; The trigger function is suitable for use in the assoc GDB-ANNOTATION-RULES
! ;; It adds an idle input for the command we are tracking.  It should be the
  ;; annotation rule binding of whatever gdb sends to tell us this command
  ;; might have changed it's output.
  ;;
--- 1139,1153 ----
  ;; command might have changed, and we have to be able to run the command
  ;; behind the user's back.
  ;;
! ;; The output phasing associated with the variable gdb-output-sink
! ;; help us to run commands behind the user's back.
  ;;
  ;; Below is the code for specificly managing buffers of output from one
  ;; command.
  ;;
  
  ;; The trigger function is suitable for use in the assoc GDB-ANNOTATION-RULES
! ;; It adds an input for the command we are tracking.  It should be the
  ;; annotation rule binding of whatever gdb sends to tell us this command
  ;; might have changed it's output.
  ;;
***************
*** 1199,1205 ****
              (not (member ',name
                           (gdb-get-pending-triggers))))
         (progn
!          (gdb-enqueue-idle-input
            (list ,gdb-command ',output-handler))
           (gdb-set-pending-triggers
            (cons ',name
--- 1162,1168 ----
              (not (member ',name
                           (gdb-get-pending-triggers))))
         (progn
!          (gdb-enqueue-input
            (list ,gdb-command ',output-handler))
           (gdb-set-pending-triggers
            (cons ',name
***************
*** 2376,2387 ****
          (progn
            ;; take previous disassemble command off the queue
            (with-current-buffer gud-comint-buffer
!             (let ((queue (gdb-get-idle-input-queue)) (item))
                (dolist (item queue)
                  (if (equal (cdr item) '(gdb-assembler-handler))
!                     (gdb-set-idle-input-queue 
!                      (delete item (gdb-get-idle-input-queue)))))))
!           (gdb-enqueue-idle-input
             (list (concat "server disassemble " gdb-current-address "\n")
                   'gdb-assembler-handler))
            (gdb-set-pending-triggers
--- 2339,2350 ----
          (progn
            ;; take previous disassemble command off the queue
            (with-current-buffer gud-comint-buffer
!             (let ((queue (gdb-get-input-queue)) (item))
                (dolist (item queue)
                  (if (equal (cdr item) '(gdb-assembler-handler))
!                     (gdb-set-input-queue 
!                      (delete item (gdb-get-input-queue)))))))
!           (gdb-enqueue-input
             (list (concat "server disassemble " gdb-current-address "\n")
                   'gdb-assembler-handler))
            (gdb-set-pending-triggers
***************
*** 2393,2399 ****
  (defun gdb-get-current-frame ()
    (if (not (member 'gdb-get-current-frame (gdb-get-pending-triggers)))
        (progn
!       (gdb-enqueue-idle-input
         (list (concat "server info frame\n") 'gdb-frame-handler))
        (gdb-set-pending-triggers
         (cons 'gdb-get-current-frame
--- 2356,2362 ----
  (defun gdb-get-current-frame ()
    (if (not (member 'gdb-get-current-frame (gdb-get-pending-triggers)))
        (progn
!       (gdb-enqueue-input
         (list (concat "server info frame\n") 'gdb-frame-handler))
        (gdb-set-pending-triggers
         (cons 'gdb-get-current-frame




reply via email to

[Prev in Thread] Current Thread [Next in Thread]