From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13660 invoked by alias); 25 Feb 2010 21:50:42 -0000 Received: (qmail 13642 invoked by uid 22791); 25 Feb 2010 21:50:42 -0000 X-SWARE-Spam-Status: No, hits=-6.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 25 Feb 2010 21:50:38 +0000 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o1PLoauS031393 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 25 Feb 2010 16:50:36 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o1PLoaVV009082; Thu, 25 Feb 2010 16:50:36 -0500 Received: from opsy.redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id o1PLoYFe021895; Thu, 25 Feb 2010 16:50:35 -0500 Received: by opsy.redhat.com (Postfix, from userid 500) id 87BAA37998C; Thu, 25 Feb 2010 14:50:34 -0700 (MST) From: Tom Tromey To: Sami Wagiaalla Cc: GDB Patches Subject: Re: [patch] Add support for imported declaration and correct search order References: <4B86DA17.5040200@redhat.com> Reply-To: tromey@redhat.com Date: Thu, 25 Feb 2010 21:50:00 -0000 In-Reply-To: <4B86DA17.5040200@redhat.com> (Sami Wagiaalla's message of "Thu, 25 Feb 2010 15:14:15 -0500") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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: 2010-02/txt/msg00640.txt.bz2 >>>>> "Sami" == Sami Wagiaalla writes: Sami> + if (declaration != NULL) Sami> + retval->declaration = savestring (declaration, strlen (declaration)); ... time to work on that memory leak bug :-) Sami> + and Y will be considered. If SEARCH_PARENTS is false only the Sami> import of Y Sami> is considered. */ Thanks for adding that space :) Sami> -static struct symbol * Sami> +struct symbol * Sami> cp_lookup_symbol_imports (const char *scope, Sami> const char *name, Sami> const char *linkage_name, Sami> const struct block *block, Sami> const domain_enum domain, Sami> + const int declaration_only, Sami> const int search_parents) The header comment should describe the new parameter. Sami> + if ( sym != NULL) Extra space. Sami> + canonical_name = (char *) imported_name_prefix; This cast is avoidable by introducing a new temporary for the alloca result. So, please change that. Sami> + if (language == language_cplus ) Extra space. Sami> + { Sami> + sym = cp_lookup_symbol_imports (scope, name, linkage_name, Sami> block, domain, 1, 1); This looks like it wraps. I'm a little wary of changing lookup_symbol_aux_local to have c++-specific code in it. I suppose it isn't *too* bad in that we can replace it with a language method if we really need to. Tom