From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?utf-8?Q?Llu=C3=ADs?= Newsgroups: gmane.emacs.devel Subject: Re: Gdb in emacs 24 Date: Thu, 20 Oct 2011 18:11:11 +0200 Message-ID: <87aa8vbq3k.fsf@ginnungagap.bsc.es> References: <87k481gma9.fsf@ginnungagap.bsc.es> <87lisgizf8.fsf@ginnungagap.bsc.es> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1319127103 25005 80.91.229.12 (20 Oct 2011 16:11:43 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 20 Oct 2011 16:11:43 +0000 (UTC) Cc: Tom Tromey , David Reitter , "emacs-devel@gnu.org devel" To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Oct 20 18:11:39 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RGvDW-00028d-UR for ged-emacs-devel@m.gmane.org; Thu, 20 Oct 2011 18:11:39 +0200 Original-Received: from localhost ([::1]:32830 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RGvDW-0003Ml-Ar for ged-emacs-devel@m.gmane.org; Thu, 20 Oct 2011 12:11:38 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:52870) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RGvDT-0003MT-Tc for emacs-devel@gnu.org; Thu, 20 Oct 2011 12:11:36 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RGvDK-0001hz-CV for emacs-devel@gnu.org; Thu, 20 Oct 2011 12:11:35 -0400 Original-Received: from mailout-de.gmx.net ([213.165.64.23]:56141) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1RGvDK-0001hC-0v for emacs-devel@gnu.org; Thu, 20 Oct 2011 12:11:26 -0400 Original-Received: (qmail invoked by alias); 20 Oct 2011 16:11:13 -0000 Original-Received: from unknown (EHLO localhost) [84.88.53.92] by mail.gmx.net (mp071) with SMTP; 20 Oct 2011 18:11:13 +0200 X-Authenticated: #12333383 X-Provags-ID: V01U2FsdGVkX19sf+crNGNsq5z+fmmwNXig+W5e1qpuu+Lktpglrd EocgFxGobVK7UY In-Reply-To: (Stefan Monnier's message of "Wed, 19 Oct 2011 17:22:26 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) X-Y-GMX-Trusted: 0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 213.165.64.23 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:145366 Archived-At: Stefan Monnier writes: >>>> Pretty much any MI command will do that, e.g., "-list-features". >>> Then could someone patch gdb-mi.el to use this as a test and send >>> a clear error message to the user about the need for "-i=mi"? >>> I think it's too late to use "interpreter exec" for 24.1, but such >>> a test would at least address some of the bug reports I've seen where >>> users had used "--annotate=3". >> As I said, if the use of annotate is the only problem, it can be disabled with a >> simple gdb command just after gdb-mi.el starts gdb: >> set annotate 0 >> This trivial change should address all the bugs you referred to. > I don't think so: those users had "--annotate=3" *instead* of "-i=mi", > so setting annotation to 0 would probably not help much, since M-x gdb > would still hang, waiting for the MI-style answers which gdb wouldn't give. >> Then the check you say is just to cover the case of the user starting gdb with >> "-i=tui", which will probably never happen. > No it's also to cover the case where "-i=mi" is missing. Right, both were assuming the use of the "interpreter-exec" command. I've been looking into it, and just starting gdb should be enough to know if we're under GDB/MI. The possible cases I've looked into are: * console * console + annotate * mi * tui GDB/MI gives us a unique greeting format: =thread-group-added,id="i1" ~"GNU gdb (GDB) 7.3-debian\n" .... (gdb) What I've done is use a new gud marker filter during initialization (gud-common-init) to establish whether the correct interpreter is being used. After that check, the original filter (gud-gdbmi-marker-filter) is used. The problem is that my poor elisp knowledge isn't enough to find a way to communicate the result back into the main emacs process (as the filter seems to be running on a separate process, I'm unable to simply set a variable to tell whether the test is ok). Any hints on how to communicate the result back to the 'gdb' function? Lluis -- "And it's much the same thing with knowledge, for whenever you learn something new, the whole world becomes that much richer." -- The Princess of Pure Reason, as told by Norton Juster in The Phantom Tollbooth