From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31999 invoked by alias); 28 May 2009 13:32:22 -0000 Received: (qmail 31982 invoked by uid 22791); 28 May 2009 13:32:21 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from imr2.ericy.com (HELO imr2.ericy.com) (198.24.6.3) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 28 May 2009 13:32:13 +0000 Received: from eusrcmw750.eamcs.ericsson.se (eusrcmw750.exu.ericsson.se [138.85.77.50]) by imr2.ericy.com (8.13.1/8.13.1) with ESMTP id n4SDW7im014921; Thu, 28 May 2009 08:32:10 -0500 Received: from ecamlmw720.eamcs.ericsson.se ([142.133.1.72]) by eusrcmw750.eamcs.ericsson.se with Microsoft SMTPSVC(6.0.3790.1830); Thu, 28 May 2009 08:31:43 -0500 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable Subject: RE: GDB frontends, MI-speak and object notation Date: Thu, 28 May 2009 13:32:00 -0000 Message-ID: <6D19CA8D71C89C43A057926FE0D4ADAA077E6FF0@ecamlmw720.eamcs.ericsson.se> In-Reply-To: A<87d49tv3z2.fsf@sphinx.net.ru> References: A<87d49tv3z2.fsf@sphinx.net.ru> From: "Marc Khouzam" To: "Dmitry Dzhus" , X-IsSubscribed: yes 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 X-SW-Source: 2009-05/txt/msg00179.txt.bz2 =20 > I wonder how other front-end developers handle GDB/MI output messages. > In the code I'm working on, regular expressions are used to parse MI > messages and extract certain values from them. This is pretty > straightforward to write, but doesn't seem to fully use the > of MI-speak, and lacks the spirit of MI. I'm=20 > reviewing > means of mapping MI (which seems to be a subset of JSON with a few > cosmetic differences and exceptions) to object-like=20 > structures so I can > work with it on a higher level. Has anyone had similar ideas? Yes, in Eclipse we parse the MI output into a hierarchy of classes following the MI specification. I agree with you that using regular expression is loosing the value of MI. I suggest you write a small parser that would extract the hierarchical elements of the MI output and create a structure you can access after. I can point you to the java code of our parser if you'd like. Marc