From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5728 invoked by alias); 18 Apr 2014 16:30:00 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 5717 invoked by uid 89); 18 Apr 2014 16:30:00 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 X-HELO: mail-pb0-f51.google.com Received: from mail-pb0-f51.google.com (HELO mail-pb0-f51.google.com) (209.85.160.51) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Fri, 18 Apr 2014 16:29:58 +0000 Received: by mail-pb0-f51.google.com with SMTP id uo5so1623132pbc.10 for ; Fri, 18 Apr 2014 09:29:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=zSQx+a8QuJX3JW15NmngUTK0hpTei2xveheXgW3OfCI=; b=h2uDpal3TA8QK/C7r/vMLjvm7dn8sBZF8AMiIAenTkLuCh8WOLJrv2azu4CVc39HdL EsH6T+VGb86VrFsr+C09ocBMbv5017uCdQFbkpllf8F6LClSfb5Uwg9RX3ZhboTCVC30 HtnG02gG8ycW+NJDeCmglLUjHuWiJXDdKafIi5iwo4KOEwmtw+Mc1z7ddJvhTtO6rDtA q0ayNxr48oSTfF2RyQJRTEWF15boBZY+3XIVw6w3fwnLW+8sO4cuCtjowBBhaElicYUY 73VeUkQAhMp/f3+/8ThROu3lJb5GAbjj8NMFZHuyM3Cva02ffmmGtab2Ym3eWWe47VRh oeRQ== X-Gm-Message-State: ALoCoQktShcG/kR+gUkD9+CmFlTDdZ0HE+gpX1w239H3j8y9d5aE2W9Cyn9qlAqxORGvJrlhnO+s X-Received: by 10.68.198.36 with SMTP id iz4mr23038870pbc.109.1397838596362; Fri, 18 Apr 2014 09:29:56 -0700 (PDT) Received: from linux (ip68-9-64-242.ri.ri.cox.net. [68.9.64.242]) by mx.google.com with ESMTPSA id my6sm60824528pbc.36.2014.04.18.09.29.55 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 18 Apr 2014 09:29:55 -0700 (PDT) Date: Fri, 18 Apr 2014 16:42:00 -0000 From: Bob Rossi To: Vladimir Prus Cc: Andrew Burgess , gdb@sourceware.org Subject: Re: MI async status output Message-ID: <20140418163002.GA29631@linux> References: <20140409210803.GA3166@linux> <5346B226.40209@cs.msu.su> <20140410201259.GA15060@linux> <5347BD84.5030200@broadcom.com> <20140412002538.GA27657@linux> <5350E049.9070705@codesourcery.com> <20140418104619.GA26892@linux> <53512470.8080305@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <53512470.8080305@codesourcery.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes X-SW-Source: 2014-04/txt/msg00061.txt.bz2 On Fri, Apr 18, 2014 at 05:11:12PM +0400, Vladimir Prus wrote: > On 18.04.2014 14:46, Bob Rossi wrote: > > >>whereas MI has grammar, the fact that actual output does not always match the > >>grammar is well known. This specific problem was not known to me. > >> > >>It is obviously possible to fix in a parser. It's also possible to fix in GDB, > >>but as usual the question of what existing frontends might depend on this behaviour. > > > >Thanks for the response. I'm writing a new grammar that will be open > >source that handles as many possible outputs that GDB outputs, for as > >many possible GDB versions. I'm writing unit and system tests to > >validate this effort. > > Is this a part of some larger effort? I'm interested in porting CGDB from annotations to MI. I actually started this project 10 years ago, boy time flies, https://www.sourceware.org/ml/gdb/2004-08/msg00373.html This time I plan on finishing the project. See below for more thoughts on larger effort. > >I'm taking notes every time i have to modify the parser to detail the > >reasons why. > > > >When I'm done, perhaps we can update GDB's manual with the new grammar > >that I constuct, considering the one in the manual is just plain wrong. > > That would be helpful; ideally we'd clearly mark, in the grammar, the > cases where actual GDB behaviour differs from desirable behaviour, so > that these can be eliminated if anybody starts MI3. Great, I'm working on the project here if anyone wants to pay attention, https://github.com/brasko/gdbwire At first, the goal of the project will be to provide a light weight GDB/MI parser written in C. I'm currently unit testing the grammar. After that, I'm going to look into making an API to GDB. See below. > Though quite possibly, MI3 should just accept and produce JSON. I think it would be good to have an honest discussion on this topic. It was really easy to write CGDB based on GDB annotations. The obvious problem was that the annotations interface provides very little information. So CGDB is very limited. In steps GDB/MI. - The GDB/MI grammar is wrong (fix it and you hit the semantic issues) - When GDB changes, how do the front ends handle the before and after? Problem: A 1 (GDB) to many (front end) relationship exists making it difficult to change or improve GDB. - How do front ends work with different versions of GDB? Problem: A 1 (front end) to many (GDB versions) relationship exists making it difficult for a front end to work well with any version of GDB. Front ends naturally suffer from a least common demoninator feature set. That is, only use the features available in most versions of GDB. The solution to these problems is pretty clear, lets give developers an API. Now front ends share the benefits of a common api, rather than every front end dealing uniquely with all these issues, which is unrealistic. Now GDB can change independent of the protocol. GDB can look at what features it is affecting in the API while developing it's internal features. It's a win win situation. The API doesn't have to be internal to GDB. It could be gdbwire, a layer that sits on top of GDB. That's the goal I'm pursuing in my spare time for CGDB. However, based on your comments about JSON, and the fact that the python api is the latest development in automating GDB, I'm not even sure how appropriate it is to write a front end on GDB using MI. Can anyone speak to the long term viability of this protocol? I'd hate to port CGDB to GDB/MI only to be told that it's been superseded by a new protocol. http://www.cygwin.com/ml/gdb/2003-02/msg00070.html Thanks, Bob Rossi