This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] add domain arg to cp_lookup_nested_symbol_1
- From: Doug Evans <dje at google dot com>
- To: gdb-patches <gdb-patches at sourceware dot org>
- Date: Wed, 27 May 2015 12:21:26 -0700
- Subject: Re: [PATCH] add domain arg to cp_lookup_nested_symbol_1
- Authentication-results: sourceware.org; auth=none
- References: <bcaec548631e09ca4b051660a4a4 at google dot com>
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.