[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: gud-mode --annotate=3 and synchronization problems
From: |
Nick Roberts |
Subject: |
Re: gud-mode --annotate=3 and synchronization problems |
Date: |
Sun, 2 Sep 2007 15:26:36 +1200 |
> Typing commands before gdb is ready makes gud-mode confused.
I've looked at this more carefully now. Does the patch below fix it if you use
M-x gdba? (As a general note, if you want to use GDB in graphical mode it's
better to use M-x gdba than M-x gdb)
> Also note the command being repeated on quit using Ctrl-D (^D).
I thought we had solved this problem. Can you be more specific? Does it
still happen with M-x gdba
> We also noticed some other synchronization problems.
> We are currently trying to reproduce them.
Please post them here when possible.
--
Nick http://www.inet.net.nz/~nickrob
*** gud.el 13 Aug 2007 20:51:56 +1200 1.129.2.6
--- gud.el 02 Sep 2007 15:20:41 +1200
*************** If SOFT is non-nil, returns nil if the s
*** 104,109 ****
--- 104,111 ----
"Non-nil if debugged program is running.
Used to grey out relevant toolbar icons.")
+ (defvar gdb-ready nil)
+
;; Use existing Info buffer, if possible.
(defun gud-goto-info ()
"Go to relevant Emacs info node."
*************** session."
*** 764,769 ****
--- 766,772 ----
(setq comint-prompt-regexp "^(.*gdb[+]?) *")
(setq paragraph-start comint-prompt-regexp)
(setq gdb-first-prompt t)
+ (setq gdb-ready nil)
(setq gud-filter-pending-text nil)
(run-hooks 'gdb-mode-hook))
*** gdb-ui.el 13 Aug 2007 20:51:56 +1200 1.206.2.4
--- gdb-ui.el 02 Sep 2007 15:23:48 +1200
*************** detailed description of this mode.
*** 270,275 ****
--- 270,279 ----
;;
(interactive (list (gud-query-cmdline 'gdba)))
;;
+ ;; Do this early in case user enters commands before GDB is ready.
+ (setq comint-input-sender 'gdb-send)
+ (setq gdb-ready nil)
+
;; Let's start with a basic gud-gdb buffer and then modify it a bit.
(gdb command-line)
(gdb-init-1))
*************** The key should be one of the cars in `gd
*** 1124,1143 ****
(defun gdb-send (proc string)
"A comint send filter for gdb.
This filter may simply queue input for a later time."
! (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.
--- 1128,1148 ----
(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.
*************** buffers."
*** 2996,3002 ****
(gdb-get-buffer-create 'gdb-breakpoints-buffer)
(if gdb-show-main
(let ((pop-up-windows t))
! (display-buffer (gud-find-file gdb-main-file))))))
(defun gdb-get-location (bptno line flag)
"Find the directory containing the relevant source file.
--- 3001,3008 ----
(gdb-get-buffer-create 'gdb-breakpoints-buffer)
(if gdb-show-main
(let ((pop-up-windows t))
! (display-buffer (gud-find-file gdb-main-file)))))
! (setq gdb-ready t))
(defun gdb-get-location (bptno line flag)
"Find the directory containing the relevant source file.