From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25238 invoked by alias); 17 Feb 2006 14:26:32 -0000 Received: (qmail 25227 invoked by uid 22791); 17 Feb 2006 14:26:31 -0000 X-Spam-Check-By: sourceware.org Received: from eastrmmtao06.cox.net (HELO eastrmmtao06.cox.net) (68.230.240.33) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 17 Feb 2006 14:26:30 +0000 Received: from localhost.localdomain ([68.9.66.48]) by eastrmmtao06.cox.net (InterMail vM.6.01.05.02 201-2131-123-102-20050715) with ESMTP id <20060217142629.QFJM9108.eastrmmtao06.cox.net@localhost.localdomain>; Fri, 17 Feb 2006 09:26:29 -0500 Received: from bob by localhost.localdomain with local (Exim 4.52) id 1FA6Z2-0003rI-U2; Fri, 17 Feb 2006 09:26:28 -0500 Date: Fri, 17 Feb 2006 14:36:00 -0000 From: Bob Rossi To: Vladimir Prus Cc: Eli Zaretskii , gdb@sources.redhat.com Subject: Re: MI: type prefixes for values Message-ID: <20060217142628.GE27226@brasko.net> Mail-Followup-To: Vladimir Prus , Eli Zaretskii , gdb@sources.redhat.com References: <200602171658.23427.ghost@cs.msu.su> <200602171724.03824.ghost@cs.msu.su> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200602171724.03824.ghost@cs.msu.su> User-Agent: Mutt/1.5.9i Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-02/txt/msg00181.txt.bz2 > > > - The parsing of that value will have to be done by ad-hoc code, which is > > > contrary to MI-goal of being easily parsable. > > > > Why ad-hoc? if you have {}, parse it, if not, don't. Why is this > > simple rule hard for a parser? > > Here's the relevant part from KDevelop: > > if (*start == '{') > { > // Gdb uses '{' in two cases: > // - composites (arrays and structures) > // - pointers to functions. In this case type is > // enclosed in "{}". Not sure why it's so, as > // when printing pointer, type is in parenthesis. > if (type == typePointer) > { > // Looks like type in braces at the beginning. Strip it. > start = skipDelim(start, '{', '}'); > } > else > { > // Looks like composite, strip the braces and return. > return QCString(start+1, end - start -1); > } Hi Volodya, I have to say, this looks like a problem with the way you parse the output of GDB. There should be no "stripping". If you parse it into a data structure, you simply walk that structure and get the info you want. Bob Rossi