[PATCH] add domain arg to cp_lookup_nested_symbol_1

Doug Evans dje@google.com
Wed May 27 19:21:00 GMT 2015


On Mon, May 18, 2015 at 1:00 PM, Doug Evans <dje@google.com> wrote:
> Hi.
>
> This patch is a cleanup of one bit of cp-namespace.c that I've wanted
> to make, but didn't have the impetus until now.
>
> This isn't something I introduced.
> E.g., in 7.6.2 cp-namespace.c:lookup_symbol_file calls
> cp_lookup_nested_symbol, ignoring the requested domain of its caller.
>
> The "domain" of a symbol is an integral part of symbol lookup
> (e.g., in C do I look up "foo" as a plain variable or as a struct?).
> In c++ the waters are a bit muddy because "class c" in STRUCT_DOMAIN
> also creates symbol "c" in VAR_DOMAIN.
> The calls to cp_lookup_nested_symbol_1 were ignoring the incoming
> domain and hardcoding a lookup in VAR_DOMAIN.
> It may be ok to get away with this, at least most of the time,
> but it can create confusion.
>
> Regression tested on amd64-linux.
>
> 2015-05-18  Doug Evans  <dje@google.com>
>
>         * cp-namespace.c (cp_lookup_nested_symbol): New arg "domain".
>         All callers updated.
>         (cp_lookup_nested_symbol_1, find_symbol_in_baseclass): Ditto.
>         * cp-support.h (cp_lookup_nested_symbol): Update.

Committed.



More information about the Gdb-patches mailing list