all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Nick Roberts <nickrob@snap.net.nz>
To: Pierre-Louis Escouflaire <esf@cfmu.eurocontrol.int>
Cc: bug-gnu-emacs@gnu.org
Subject: Re: gud-mode --annotate=3 and synchronization problems
Date: Sun, 2 Sep 2007 15:26:36 +1200	[thread overview]
Message-ID: <18138.11628.322522.847574@kahikatea.snap.net.nz> (raw)
In-Reply-To: <200708301558.l7UFw7nB027463@carp.cfmu.corp.eurocontrol.int>

 > 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.

  parent reply	other threads:[~2007-09-02  3:26 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-30 15:58 gud-mode --annotate=3 and synchronization problems Pierre-Louis Escouflaire
2007-08-31  5:18 ` Nick Roberts
2007-09-01  4:06   ` Richard Stallman
2007-09-02  3:26 ` Nick Roberts [this message]
  -- strict thread matches above, loose matches on Subject: below --
2007-09-04 11:47 Pierre-Louis Escouflaire
2007-09-05  5:20 ` Nick Roberts
2007-09-05 15:53   ` Pierre-Louis Escouflaire
2007-09-06  7:08     ` Nick Roberts

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=18138.11628.322522.847574@kahikatea.snap.net.nz \
    --to=nickrob@snap.net.nz \
    --cc=bug-gnu-emacs@gnu.org \
    --cc=esf@cfmu.eurocontrol.int \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.