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: [patch] Add support for imported declaration and correct search order


>>>>> "Sami" == Sami Wagiaalla <swagiaal@redhat.com> 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


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