This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v2 2/8] Search global block from basic_lookup_symbol_nonlocal
- From: "Christian Biesinger via gdb-patches" <gdb-patches at sourceware dot org>
- To: Tom Tromey <tromey at adacore dot com>
- Cc: gdb-patches <gdb-patches at sourceware dot org>, Andrew Burgess <andrew dot burgess at embecosm dot com>
- Date: Sat, 21 Sep 2019 13:31:30 +0900
- Subject: Re: [PATCH v2 2/8] Search global block from basic_lookup_symbol_nonlocal
- References: <20190920192017.15293-1-tromey@adacore.com> <20190920192017.15293-3-tromey@adacore.com>
- Reply-to: Christian Biesinger <cbiesinger at google dot com>
On Sat, Sep 21, 2019 at 4:20 AM Tom Tromey <tromey@adacore.com> wrote:
> From: Andrew Burgess <andrew.burgess@embecosm.com>
>
> This changes lookup_global_symbol to look in the global block
> of the passed-in block. If no block was passed in, it reverts to the
> previous behavior.
>
> This change is needed to ensure that 'FILENAME'::NAME lookups work
> properly. As debugging Pedro's test case showed, this was not working
> properly in the case where multiple identical names could be found
> (the one situation where this feature is truly needed :-).
This further extends the situations where lookup_global_symbols checks
a local scope first (currently only objfile) but lookup_static_symbol
doesn't. Is that really correct? I would think that
lookup_static_symbol is even more likely to need that check, since
static symbols are probably (?) more likely to share the same name. Is
my interpretation wrong?
Christian