From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15795 invoked by alias); 1 May 2008 19:25:57 -0000 Received: (qmail 15787 invoked by uid 22791); 1 May 2008 19:25:57 -0000 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 01 May 2008 19:25:37 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id 05B0A983D6; Thu, 1 May 2008 19:25:33 +0000 (GMT) Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55]) by nan.false.org (Postfix) with ESMTP id DC1C998366; Thu, 1 May 2008 19:25:32 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.69) (envelope-from ) id 1JrePM-0006rs-6t; Thu, 01 May 2008 15:25:32 -0400 Date: Thu, 01 May 2008 19:25:00 -0000 From: Daniel Jacobowitz To: Aleksandar Ristovski Cc: gdb-patches@sourceware.org Subject: Re: [rfc] get rid of redundant data in c++ and java Message-ID: <20080501192532.GG22218@caradoc.them.org> Mail-Followup-To: Aleksandar Ristovski , gdb-patches@sourceware.org References: <47AD383E.7000205@qnx.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <47AD383E.7000205@qnx.com> User-Agent: Mutt/1.5.17 (2007-12-11) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-05/txt/msg00026.txt.bz2 On Sat, Feb 09, 2008 at 12:21:02AM -0500, Aleksandar Ristovski wrote: > Hello, > > Currently we synthesize typedef info for java and c++ (and ada, but I am > not familiar with that language) for any symbol with STRUCT_DOMAIN domain. > This can add up to a lot of redundant data. For partial symbols, we > generate two identical names for the same symbol, once as struct second as > typedef. The same happens with symbols, except we do not duplicate symbol > name, but we do allocate another symbol struture. > > Instead of generating redundant data for symbols with STRUCT_DOMAIN domain > in java and c++ languages, treat STRUCT_DOMAIN as equal to VAR_DOMAIN for > these two languages when looking up symbols. Sorry for taking so long to look at this. It's a great idea and the patch seems correct to me. Just some cosmetic issues, and then it can go in. > - if (cu->language == language_cplus > - || cu->language == language_java > - || cu->language == language_ada) > + if (cu->language == language_ada) > { > - /* For C++ and Java, these implicitly act as typedefs as well. */ > + /* FIXME: Check if Ada really > + needs to implicitly set typedef. */ If this works for C++ and Java, it will work for Ada too. If you can't test Ada, please post a final version of the patch and ask Joel to run tests for you - I'm sure he won't mind getting all that memory back for Ada too. > - > - /* The semantics of C++ state that "struct foo { ... }" also > - defines a typedef for "foo". A Java class declaration also > - defines a typedef for the class. Synthesize a typedef symbol > - so that "ptype foo" works as expected. */ > + Since we still need to set the typedef name here, leave the first two sentences of the comment. > + if (symbol_language == language_cplus > + || symbol_language == language_java) Only need one space there. -- Daniel Jacobowitz CodeSourcery