emacs-devel
[Top][All Lists]
Advanced

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

Re: 23.0.60; gdb not running the program first time around


From: Nick Roberts
Subject: Re: 23.0.60; gdb not running the program first time around
Date: Fri, 15 Feb 2008 12:01:22 +1300 (NZDT)

 > I've just managed to replicate this behaviour when starting with -Q
 > I think it happens when I type 'run' - at the prompt (already there in 
 > the buffer) - when the status line still says [initializing], so it 
 > changes to [ready] at around the same time as I press 'enter'
 > ipsa-so is a fairly large file (c 90MB) and it takes around 2 sec from 
 > entering the 'gdb --annotate...' line to get to gdb showing [ready],  
 > I've just tried to do the same thing with the emacs  binary and that 
 > starts up far too fast to get the same problem!

OK, I can see this now.  Emacs just discards the input if it's not ready, so
you don't need to do "C-c C-c" but just re-enter your input, e.g, run.
It doesn't look right, however, and I can see how it causes confusion.

Can you please try the patch below which also fixes a couple of other minor
problems at startup.  Instead of discarding the input, it should now just defer
it.  It would be helpful if you could gorilla test it and report any problems
you see as I would like to add these changes to EMACS_22_BASE for the imminent
release of Emacs 22.2

Thanks for the report.

-- 
Nick                                           http://www.inet.net.nz/~nickrob

*** gdb-ui.el   15 Feb 2008 07:50:31 +1300      1.220
--- gdb-ui.el   15 Feb 2008 11:54:10 +1300      
*************** Emacs can't find.")
*** 137,142 ****
--- 137,144 ----
    "Non-nil when GDB generates frame-begin annotation.")
  (defvar gdb-printing t)
  (defvar gdb-parent-bptno-enabled nil)
+ (defvar gdb-ready nil)
+ (defvar gdb-early-user-input nil)
  
  (defvar gdb-buffer-type nil
    "One of the symbols bound in `gdb-buffer-rules'.")
*************** session."
*** 284,289 ****
--- 286,292 ----
  
    (gud-common-init command-line nil 'gud-gdba-marker-filter)
    (set (make-local-variable 'gud-minor-mode) 'gdba)
+   (setq comint-input-sender 'gdb-send)
  
    (gud-def gud-break  "break %f:%l"  "\C-b" "Set breakpoint at current line.")
    (gud-def gud-tbreak "tbreak %f:%l" "\C-t"
*************** session."
*** 317,322 ****
--- 320,327 ----
    (setq gdb-first-prompt t)
    (setq gud-running nil)
    (setq gdb-ready nil)
+   (setq gdb-flush-pending-output nil)
+   (setq gdb-early-user-input nil)
    (setq gud-filter-pending-text nil)
    (run-hooks 'gdb-mode-hook))
  
*************** otherwise do not."
*** 574,581 ****
    (define-key gud-minor-mode-map [left-margin C-mouse-3]
      'gdb-mouse-jump)
  
-   (setq comint-input-sender 'gdb-send)
- 
    ;; (re-)initialize
    (setq gdb-pc-address (if gdb-show-main "main" nil))
    (setq gdb-previous-frame-address nil
--- 579,584 ----
*************** otherwise do not."
*** 593,599 ****
        gdb-pending-triggers nil
        gdb-output-sink 'user
        gdb-server-prefix "server "
-       gdb-flush-pending-output nil
        gdb-location-alist nil
        gdb-source-file-list nil
        gdb-error nil
--- 596,601 ----
*************** The key should be one of the cars in `gd
*** 1194,1214 ****
  (defun gdb-send (proc string)
    "A comint send filter for gdb.
  This filter may simply queue input for a later time."
!   (when gdb-ready
!       (with-current-buffer gud-comint-buffer
!       (let ((inhibit-read-only t))
!         (remove-text-properties (point-min) (point-max) '(face))))
!       (if gud-running
!         (progn
!           (let ((item (concat string "\n")))
!             (if gdb-enable-debug (push (cons 'send item) gdb-debug-log))
!             (process-send-string proc item)))
!       (if (string-match "\\\\\\'" string)
!           (setq gdb-continuation (concat gdb-continuation string "\n"))
!         (let ((item (concat gdb-continuation string
!                             (if (not comint-input-sender-no-newline) "\n"))))
!           (gdb-enqueue-input item)
!           (setq gdb-continuation nil))))))
  
  ;; Note: Stuff enqueued here will be sent to the next prompt, even if it
  ;; is a query, or other non-top-level prompt.
--- 1196,1219 ----
  (defun gdb-send (proc string)
    "A comint send filter for gdb.
  This filter may simply queue input for a later time."
!   (if gdb-ready
!       (progn
!       (with-current-buffer gud-comint-buffer
!         (let ((inhibit-read-only t))
!           (remove-text-properties (point-min) (point-max) '(face))))
!       (if gud-running
!           (progn
!             (let ((item (concat string "\n")))
!               (if gdb-enable-debug (push (cons 'send item) gdb-debug-log))
!               (process-send-string proc item)))
!         (if (string-match "\\\\\\'" string)
!             (setq gdb-continuation (concat gdb-continuation string "\n"))
!           (let ((item (concat
!                        gdb-continuation string
!                        (if (not comint-input-sender-no-newline) "\n"))))
!             (gdb-enqueue-input item)
!             (setq gdb-continuation nil)))))
!     (push (concat string "\n")  gdb-early-user-input)))
  
  ;; Note: Stuff enqueued here will be sent to the next prompt, even if it
  ;; is a query, or other non-top-level prompt.
*************** This sends the next command (if any) to 
*** 1362,1368 ****
        (gdb-send-item input)
        (progn
        (setq gdb-prompting t)
!       (gud-display-frame)))))
  
  (defun gdb-subprompt (ignored)
    "An annotation handler for non-top-level prompts."
--- 1367,1377 ----
        (gdb-send-item input)
        (progn
        (setq gdb-prompting t)
!       (gud-display-frame)
!       (setq gdb-early-user-input (nreverse gdb-early-user-input))
!       (while gdb-early-user-input
!           (gdb-enqueue-input (car gdb-early-user-input))
!           (setq gdb-early-user-input (cdr gdb-early-user-input)))))))
  
  (defun gdb-subprompt (ignored)
    "An annotation handler for non-top-level prompts."








reply via email to

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