This is the mail archive of the gdb-patches@sourceware.org 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:51 -0600, Tom Tromey wrote:
> >>>>> "Paul" == Paul Hilfinger <hilfingr@syracuse.mckusick.com> writes:
> 

> Paul> +dw2_map_matching_symbols (const char* name, domain_enum namespace,
> 
> "const char *name"
> 

OK.


> Paul>  /* Lookup a partial symbol.  */
> Paul> +static struct partial_symbol *match_partial_symbol (struct partial_symtab *,
> Paul> +						    int,
> Paul> +						    const char *, domain_enum,
> Paul> +						    int (*) (const char *,
> Paul> +							     const char *),
> Paul> +						    int (*) (const char *,
> Paul> +							     const char *));
> Paul> +
> Paul> +
> Paul>  static struct partial_symbol *lookup_partial_symbol (struct partial_symtab *,
> 
> This insertion separates a comment from the declaration it comments.
> 
> I think it is fine to just remove that comment, though.  It doesn't
> really add anything.
> 

OK


> Paul> +/* Look in PST for a symbol in DOMAIN whose name matches NAME.  Search
> Paul> +   the global block of PST if GLOBAL, and otherwise the static block.
> Paul> +   MATCH is the comparison operation that returns true iff MATCH (s,
> Paul> +   NAME), where s is a SYMBOL_SEARCH_NAME.  If ORDERED_COMPARE is
> Paul> +   non-null, the symbols in the block are assumed to be ordered
> Paul> +   according to it (allowing binary search).  It must be compatible
> Paul> +   with MATCH.  Returns the symbol, if found, and otherwise NULL.  */
> Paul> +static struct partial_symbol *
> Paul> +match_partial_symbol (struct partial_symtab *pst, int global,
> 
> We've recently started trying to enforce the rule about having a blank
> line between a function comment and the start of the function
> definition.

OK.


> Paul> +	    return (*top);
> 
> A few places have parens here, but they aren't needed.
> Just write "return *top;".

OK (BTW: That line was copied from the original).

> 
> Paul> +  /* Find global or static symbols in all tables that are in NAMESPACE 
> Paul> +     and for which MATCH (symbol name, NAME) == 0, passing each to 
> Paul> +     CALLBACK, reading in partial symbol symbol tables as needed.  Look
> Paul> +     through global symbols if GLOBAL and otherwise static symbols.  
> Paul> +     Passes NAME, NAMESPACE, and DATA to CALLBACK with each symbol
> Paul> +     found.  After each block is processed, passes NULL to CALLBACK.
> Paul> +     MATCH must be weaker than strcmp_iw in the sense that
> Paul> +     strcmp_iw(x,y) == 0 --> MATCH(x,y) == 0.  ORDERED_COMPARE, if
> Paul> +     non-null, must be an ordering relation compatible with strcmp_iw
> Paul> +     in the sense that  
> Paul> +            strcmp(x,y) == 0 --> ORDERED_COMPARE(x,y) == 0 
> Paul> +     and 
> Paul> +            strcmp(x,y) <= 0 --> ORDERED_COMPARE(x,y) <= 0
> Paul> +     (allowing strcmp(x,y) < 0 while ORDERED_COMPARE(x, y) == 0). 
> Paul> +     CALLBACK returns 0 to indicate that the scan should continue, or
> Paul> +     non-zero to indicate that the scan should be terminated.  */
> 
> Thanks for being so thorough in this comment.

You're welcome.

Paul


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