From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nick Roberts Newsgroups: gmane.emacs.bugs Subject: Re: gud-mode --annotate=3 and synchronization problems Date: Sun, 2 Sep 2007 15:26:36 +1200 Message-ID: <18138.11628.322522.847574@kahikatea.snap.net.nz> References: <200708301558.l7UFw7nB027463@carp.cfmu.corp.eurocontrol.int> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1188703622 20315 80.91.229.12 (2 Sep 2007 03:27:02 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 2 Sep 2007 03:27:02 +0000 (UTC) Cc: bug-gnu-emacs@gnu.org To: Pierre-Louis Escouflaire Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Sep 02 05:26:59 2007 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IRg6v-00068i-2i for geb-bug-gnu-emacs@m.gmane.org; Sun, 02 Sep 2007 05:26:53 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IRg6u-0002RW-7E for geb-bug-gnu-emacs@m.gmane.org; Sat, 01 Sep 2007 23:26:52 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IRg6q-0002Pi-W0 for bug-gnu-emacs@gnu.org; Sat, 01 Sep 2007 23:26:49 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IRg6m-0002Lb-Se for bug-gnu-emacs@gnu.org; Sat, 01 Sep 2007 23:26:47 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IRg6m-0002LF-LZ for bug-gnu-emacs@gnu.org; Sat, 01 Sep 2007 23:26:44 -0400 Original-Received: from viper.snap.net.nz ([202.37.101.8]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IRg6l-0003BQ-Pr for bug-gnu-emacs@gnu.org; Sat, 01 Sep 2007 23:26:44 -0400 Original-Received: from kahikatea.snap.net.nz (254.63.255.123.dynamic.snap.net.nz [123.255.63.254]) by viper.snap.net.nz (Postfix) with ESMTP id 8A0813D9DED; Sun, 2 Sep 2007 15:26:40 +1200 (NZST) Original-Received: by kahikatea.snap.net.nz (Postfix, from userid 1000) id 857AF8FC6D; Sun, 2 Sep 2007 15:26:37 +1200 (NZST) In-Reply-To: <200708301558.l7UFw7nB027463@carp.cfmu.corp.eurocontrol.int> X-Mailer: VM 7.19 under Emacs 22.1.50.8 X-Detected-Kernel: Linux 2.4-2.6 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:16479 Archived-At: > 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.