From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29096 invoked by alias); 17 Feb 2006 14:36:00 -0000 Received: (qmail 29082 invoked by uid 22791); 17 Feb 2006 14:35:57 -0000 X-Spam-Check-By: sourceware.org Received: from zigzag.lvk.cs.msu.su (HELO zigzag.lvk.cs.msu.su) (158.250.17.23) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 17 Feb 2006 14:35:56 +0000 Received: from Debian-exim by zigzag.lvk.cs.msu.su with spam-scanned (Exim 4.50) id 1FA6i4-0007LD-HI for gdb@sources.redhat.com; Fri, 17 Feb 2006 17:35:53 +0300 Received: from zigzag.lvk.cs.msu.su ([158.250.17.23]) by zigzag.lvk.cs.msu.su with esmtp (Exim 4.50) id 1FA6hX-0007F7-3h; Fri, 17 Feb 2006 17:35:15 +0300 From: Vladimir Prus To: Bob Rossi Subject: Re: MI: type prefixes for values Date: Fri, 17 Feb 2006 14:43:00 -0000 User-Agent: KMail/1.7.2 Cc: Eli Zaretskii , gdb@sources.redhat.com References: <200602171724.03824.ghost@cs.msu.su> <20060217142628.GE27226@brasko.net> In-Reply-To: <20060217142628.GE27226@brasko.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200602171735.14783.ghost@cs.msu.su> 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/msg00182.txt.bz2 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? Or you wanted to say I should use variable objects and traverse the tree structure they have? If so, can you expand on this? Thanks, Volodya