This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] Add support for imported declaration and correct search order
- From: Tom Tromey <tromey at redhat dot com>
- To: Sami Wagiaalla <swagiaal at redhat dot com>
- Cc: GDB Patches <gdb-patches at sourceware dot org>
- Date: Thu, 25 Feb 2010 14:50:34 -0700
- Subject: Re: [patch] Add support for imported declaration and correct search order
- References: <4B86DA17.5040200@redhat.com>
- Reply-to: tromey at redhat dot com
>>>>> "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