Subject: Re: bug#10285: 23.3; Gud hangs terminal when not running gdb --annotate=3

From: Stefan Monnier <[email-masked]>
Date: Mon, 12 Dec 2011 16:40:39 -0500

> Ever since upgrading to emacs23 I have been unable to run gdb with sudo
> under emacs gud mode ( it never gets my password ).  I have recently studied
> the issue in depth and found that the problem is more broad than sudo.
> When starting gud mode with M-x gdb, it prompts you for what to run, and if
> you don't run gdb --annotate=3, then gud mode hangs and nothing you type is
> sent to the inferior process.  It seems --annotate=3 generates some magic
> output that gud mode is waiting on and until it sees it, will not forward
> anything you type to the inferior process.

Indeed.  This has more or less always been the case to some extent, but
the gdb-ui code in Emacs-23 made it worse.  Emacs-24 replaced that code
with gdb-mi (which uses --ui=mi instead of --annotate=3) which suffers
from the same problem, but we've added a check that signals an error to
the user pointing out the source of the problem, instead of just
hanging silently.

Could you check the Emacs-24 pretest to see if it addresses the problem?
Presumably now that you know you need to add the magic argument, you are
able to fix the command to make your gdb+sudo case work, right?

        Stefan