From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20556 invoked by alias); 7 Oct 2010 04:18:35 -0000 Received: (qmail 20547 invoked by uid 22791); 7 Oct 2010 04:18:33 -0000 X-SWARE-Spam-Status: No, hits=-0.3 required=5.0 tests=AWL,BAYES_00,KAM_STOCKGEN,SPF_SOFTFAIL X-Spam-Check-By: sourceware.org Received: from syracuse.mckusick.com (HELO syracuse.mckusick.com) (64.81.247.46) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 07 Oct 2010 04:18:29 +0000 Received: from syracuse.mckusick.com (localhost [127.0.0.1]) by syracuse.mckusick.com (8.14.3/8.14.3/Debian-9.1ubuntu1) with ESMTP id o974IEia001956; Wed, 6 Oct 2010 21:18:14 -0700 Received: (from hilfingr@localhost) by syracuse.mckusick.com (8.14.3/8.14.3/Submit) id o974IE1I001954; Wed, 6 Oct 2010 21:18:14 -0700 Subject: Re: [RFA] Rework symbol searches to move Ada-specific stuff to ada-lang.c. From: Paul Hilfinger Reply-To: Hilfinger@adacore.com To: Joel Brobecker Cc: Paul Hilfinger , gdb-patches@sourceware.org In-Reply-To: <20101006231525.GA12651@adacore.com> References: <201010050842.o958gDNO002818@syracuse.mckusick.com> <20101006231525.GA12651@adacore.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Date: Thu, 07 Oct 2010 04:18:00 -0000 Message-ID: <1286425093.1821.6.camel@syracuse.mckusick.com> Mime-Version: 1.0 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: 2010-10/txt/msg00113.txt.bz2 On Wed, 2010-10-06 at 16:15 -0700, Joel Brobecker wrote: > > (ada_match_name): Rename to match_name (we should avoid prefixing s= tatic > > symbols with "ada_"). >=20 > I don't oppose this change, but I really don't understand why that's > something we should avoid. If it's something Ada-specific, why not > saying so in the function name? >=20 I'm trying to be consistent. For most other static (file scope)=20 definitions, we have avoided to unnecessary prefix. In a better language (:->), we'd be writing ada.foo to access exported symbols=20 from outside the Ada module, and just foo to access symbols defined in the module.=20=20 > > +/* A callback for add_matching_symbols that adds SYM, found in BLOCK, > > + to a list of symbols. DATA0 is a pointer to a struct match_data * > > + containing the obstack that collects the symbol list, the file that= SYM > > + must come from, a flag indicating whether a non-argument symbol has > > + been found in the current block, and the last argument symbol > > + passed in SYM within the current block (if any). When SYM is null, > > + marking the end of a block, the argument symbol is added if no > > + other has been found. */ > > +static int > > +aux_add_nonlocal_symbols (struct block *block, struct symbol *sym, voi= d *data0) >=20 > A formatting nit: Doug would like us to add an empty line after the > comment that documents a function... So I hear. > > +/* Compare STRING1 to STRING2, with results as for strcmp. > > + Compatible with strcmp_iw in that strcmp_iw (STRING1, STRING2) <=3D= 0 > > + implies compare_names (STRING1, STRING2) (they may differ as to > > + what symbols compare equal). */ > > +static int > > +compare_names (const char *string1, const char *string2) >=20 > Same here. >=20 > > +/* Returns 0 iff symbol name SYM_NAME matches SEARCH_NAME, apart from > > + informational suffix. */ > > static int > > full_match (const char* sym_name, const char* search_name) >=20 > Same here. >=20 Thanks for your comments. Paul