This is the mail archive of the mailing list for the GDB project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA] Rework symbol searches to move Ada-specific stuff to ada-lang.c.

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 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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]