From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3048 invoked by alias); 21 Feb 2003 01:45:06 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 2946 invoked from network); 21 Feb 2003 01:45:06 -0000 Received: from unknown (HELO localhost.redhat.com) (172.16.49.200) by 172.16.49.205 with SMTP; 21 Feb 2003 01:45:06 -0000 Received: from redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 3F5552EF9; Thu, 20 Feb 2003 20:49:47 -0500 (EST) Message-ID: <3E5585BA.6050409@redhat.com> Date: Fri, 21 Feb 2003 01:45:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD i386; en-US; rv:1.0.2) Gecko/20030217 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Nick Roberts Cc: gdb@sources.redhat.com Subject: Re: GDB/MI References: <15957.32294.506214.978988@nick.uklinux.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2003-02/txt/msg00456.txt.bz2 > The debugger mode that uses GDB/MI which I am trying to write for Emacs uses a > queue but I can't get it initialised properly. This is why: > > If I start with gdb -interp=mi mytest, I get > > ~"GNU gdb 2003-02-04-cvs\n" > ~"Copyright 2003 Free Software Foundation, Inc.\n" > ~"GDB is free software, covered by the GNU General Public License, and you are\n" > ~"welcome to change it and/or distribute copies of it under certain conditions.\n" > ~"Type \"show copying\" to see the conditions.\n" > ~"There is absolutely no warranty for GDB. Type \"show warranty\" for details.\n" > ~"This GDB was configured as \"i586-pc-linux-gnu\"..." > ~"\n" > (gdb) The prompt: "(gdb)\n" indicates that GDB is ready for input. That prompt terminates every transaction. It is independant of the console GDB prompt: (gdb) -interpreter-exec console set prompt foo &"Argument required (expression to compute).\n" ^error,msg="Argument required (expression to compute)." (gdb) -interpreter-exec console "set prompt foo" ^done (gdb) -interpreter-exec console "show prompt" ~"Gdb's prompt is \"foo\".\n" ^done (gdb) There is a `bug' here - GDB should generate a `=prompt-changed' event. Andrew > ^Z^Zpre-prompt > (gdb) > ^Z^Zprompt > > and the prompt annotation tells Emacs that GDB is ready for input. Since Emacs' > interaction is asynchronous, the timing is wrong if I assume GDB is ready for > input immediately after its invocation. I think the initial output should be: > > ~"GNU gdb 2003-02-04-cvs\n" > ~"Copyright 2003 Free Software Foundation, Inc.\n" > ~"GDB is free software, covered by the GNU General Public License, and you are\n" > ~"welcome to change it and/or distribute copies of it under certain conditions.\n" > ~"Type \"show copying\" to see the conditions.\n" > ~"There is absolutely no warranty for GDB. Type \"show warranty\" for details.\n" > ~"This GDB was configured as \"i586-pc-linux-gnu\"..." > ~"\n" > ^done > (gdb) > > i.e GDB should notify its status with the ^done record. > > I could look for the prompt (gdb) for notification and I imagine this is what > gvd does but the idea presumably is to have a machine interface and not rely > on output intended for the (human) user. For example this could be defeated > with `set prompt'. > > I will file a bug report if someone agrees with my analysis. > > Nick > > Incidently, the string (gdb) that is output here is not the prompt but an > imposter as I get: > > -gdb-set prompt (hec) > ^done > (gdb) > -gdb-show prompt > ^done,value="(hec)" > (gdb) >