From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nick Roberts Newsgroups: gmane.emacs.devel Subject: Re: Minor gdb-ui patches to make it a bit more robust Date: Tue, 19 Feb 2008 11:12:40 +1300 Message-ID: <18362.728.368749.836476@kahikatea.snap.net.nz> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1203372793 20366 80.91.229.12 (18 Feb 2008 22:13:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 18 Feb 2008 22:13:13 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Feb 18 23:13:36 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JREEt-00062n-9p for ged-emacs-devel@m.gmane.org; Mon, 18 Feb 2008 23:13:31 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JREEO-00075y-KE for ged-emacs-devel@m.gmane.org; Mon, 18 Feb 2008 17:13:00 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JREEL-00075i-7L for emacs-devel@gnu.org; Mon, 18 Feb 2008 17:12:57 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JREEH-00074i-B8 for emacs-devel@gnu.org; Mon, 18 Feb 2008 17:12:56 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JREEH-00074f-6r for emacs-devel@gnu.org; Mon, 18 Feb 2008 17:12:53 -0500 Original-Received: from viper.snap.net.nz ([202.37.101.8]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JREEG-0003zF-KY for emacs-devel@gnu.org; Mon, 18 Feb 2008 17:12:53 -0500 Original-Received: from kahikatea.snap.net.nz (74.31.255.123.static.snap.net.nz [123.255.31.74]) by viper.snap.net.nz (Postfix) with ESMTP id C4E153DAE60; Tue, 19 Feb 2008 11:12:49 +1300 (NZDT) Original-Received: by kahikatea.snap.net.nz (Postfix, from userid 1000) id E935E8FC6D; Tue, 19 Feb 2008 11:12:40 +1300 (NZDT) In-Reply-To: X-Mailer: VM 7.19 under Emacs 22.1.90.3 X-detected-kernel: by monty-python.gnu.org: Linux 2.4-2.6 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:89526 Archived-At: > Here are 2 patches which help me deal with gdb-ui. > > The first 2 hunks reset gdb-output-sink as it should after starting > a new process. I think this is a plain bug fix, but I'll let > Nick decide. I don't know why you declare gdb-output-sink with a value of nil as it has no meaning but it's harmless. In practice, 've not found a need to reset gdb-output-sink but you presumably have. So I'm happy if you want to make these changes. > The second hunk make it fallback on the old gud-gdb code in case the > prompt appears before we get to receive the expected annotations. > I've been using M-x gdb RET with "gdb --fullname emacs" for ever and it > took me a while to understand why it suddenly stopped working properly: > the behavior is pretty nasty: you get all the expected GDB output but > your input isn't sent to the gdb process (because gdb-ui thinks that > GDB is still initializing) and completion just hangs (because it sends > a command which isn't passed on to the process and then waits for the > process to reply). Using the same startup function (M-x gdb) for graphical mode and text command mode ("fullname") has given backward compatiblity but caused a lot of grief. Previously (Emacs 22.1) M-x gdb assumed text command mode until it received annotations to put it in graphical mode. This led to error reports where users wanted graphical mode and had commands in their .gdbinit which started execution. My advice was to use M-x gdba. In EMACS_22_BASE, I switched things round so that M-x gdb assumed graphical mode until it received a fullname annotation to put it in text command mode. This solved the above problem. I also removed M-x gdba and added M-x gud-gdb. More recently, Robert Marshall made a bug report about start up with M-x gdb where he entered Gdb user commands before Emacs was ready. On the *trunk*, I've solved this by deferring the input rather than discarding it. I also made a couple of other related changes, one of which was setting comint-input-sender to gdb-send earlier. I think this change has caused the problem you are seeing. I've not made this change on EMACS_22_BASE, so I think M-x gdb RET with "gdb --fullname emacs" will STILL WORK there. On the trunk, I want to migrate away slightly from text command mode so my advice there is to use it via M-x gud-gdb now. I have a patch for gdb-ui.el which will mean that M-x gdb will only work in graphical mode and doc changes to reflect this which I propose to commit shortly. -- Nick http://www.inet.net.nz/~nickrob