This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] Rework symbol searches to move Ada-specific stuff to ada-lang.c.
- From: Paul Hilfinger <HIlfinger at cs dot berkeley dot edu>
- To: Joel Brobecker <brobecker at adacore dot com>
- Cc: Paul Hilfinger <hilfingr at syracuse dot mckusick dot com>, gdb-patches at sourceware dot org
- Date: Wed, 06 Oct 2010 21:18:13 -0700
- Subject: Re: [RFA] Rework symbol searches to move Ada-specific stuff to ada-lang.c.
- References: <201010050842.o958gDNO002818@syracuse.mckusick.com> <20101006231525.GA12651@adacore.com>
- Reply-to: Hilfinger at adacore dot com
On Wed, 2010-10-06 at 16:15 -0700, Joel Brobecker wrote:
> > (ada_match_name): Rename to match_name (we should avoid prefixing static
> > symbols with "ada_").
>
> 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?
>
I'm trying to be consistent. For most other static (file scope)
definitions, we have avoided to unnecessary prefix. In a better
language (:->), we'd be writing ada.foo to access exported symbols
from outside the Ada module, and just foo to access symbols defined
in the module.
> > +/* 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, void *data0)
>
> 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) <= 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)
>
> Same here.
>
> > +/* 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)
>
> Same here.
>
Thanks for your comments.
Paul