Subject: bug#9767: 24.0.90; gdb initialization on Cygwin

From: Ken Brown <[email-masked]>
Date: Sun, 16 Oct 2011 19:08:32 -0400

On 10/16/2011 12:02 PM, Ken Brown wrote:
> When I start a debugging session with M-x gdb, initialization doesn't
> appear to complete. I don't get the "(gdb)" prompt, and the mode line
> continues to say "initializing". If I press Return, I get the prompt
> and the mode line changes to "ready". Everything works fine after that.
> This seems Cygwin-specific; it doesn't happen on GNU/Linux.
>
> I've checked that all the strings that emacs sends to gdb during
> initialization (via gdb-input) do in fact get sent. And I've tried
> sending those same strings to gdb outside of emacs (except for
> "-inferior-tty-set..."), and nothing strange happened. In particular, I
> did have a "(gdb)" prompt at each stage.

Further info: It seems that initialization is actually completing, but 
for some reason the buffer is not being redisplayed.  To test this, I 
inserted (sit-for .1) at the end of gdb-update to force redisplay, and 
that solved the problem.  Unless someone who understands redisplay can 
figure out why redisplay isn't happening on Cygwin, I'm inclined to 
apply the following patch:

=== modified file 'lisp/progmodes/gdb-mi.el'
--- lisp/progmodes/gdb-mi.el    2011-10-06 16:11:38 +0000
+++ lisp/progmodes/gdb-mi.el    2011-10-16 23:04:28 +0000
@@ -1726,7 +1726,8 @@
      (gdb-force-mode-line-update
       (propertize "initializing..." 'face font-lock-variable-name-face))
      (gdb-init-1)
-    (setq gdb-first-prompt nil))
+    (setq gdb-first-prompt nil)
+    (if (eq system-type 'cygwin) (sit-for .1)))

    (gdb-get-main-selected-frame)
    ;; We may need to update gdb-threads-list so we can use

Would this be reasonable?

Ken