From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 965 invoked by alias); 17 Feb 2006 14:43:56 -0000 Received: (qmail 956 invoked by uid 22791); 17 Feb 2006 14:43:55 -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:43:53 +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 <20060217144353.QPIG9108.eastrmmtao06.cox.net@localhost.localdomain>; Fri, 17 Feb 2006 09:43:53 -0500 Received: from bob by localhost.localdomain with local (Exim 4.52) id 1FA6ps-0003vg-UP; Fri, 17 Feb 2006 09:43:52 -0500 Date: Fri, 17 Feb 2006 14:51:00 -0000 From: Bob Rossi To: Vladimir Prus Cc: Eli Zaretskii , gdb@sources.redhat.com Subject: Re: MI: type prefixes for values Message-ID: <20060217144352.GA14873@brasko.net> Mail-Followup-To: Vladimir Prus , Eli Zaretskii , gdb@sources.redhat.com References: <200602171724.03824.ghost@cs.msu.su> <20060217142628.GE27226@brasko.net> <200602171735.14783.ghost@cs.msu.su> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200602171735.14783.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/msg00183.txt.bz2 On Fri, Feb 17, 2006 at 05:35:13PM +0300, Vladimir Prus wrote: > On Friday 17 February 2006 17:26, Bob Rossi wrote: > > > > 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 Bob, > > > 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. > > I'm afraid I don't get you. If I'm given literal string > "{int (*)(int)} 0x12345678" by gdb, and I want to display it without "{}", > then I surely have to remove the "{}" part, no? OK, I misunderstood what you were doing there. Sorry. I have a personal opinion that the FE is not capable of modifing data that GDB is passing to it for display purposes. GDB is not bound to having {int (*)(int)}, and it could certainly change to [int (*)(int)] in the next release. (I know it won't, but the point stands). Any manipulation or parsing you do of the data that GDB passes back, IMO, is on your hands. This is *as bad* as parsing the CLI output. I would fully support the effort to have GDB give smaller chunks of information, so that FE's can build on what it's given. Bob Rossi