This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] Fix C `extern' shadowing in a local block
- From: Daniel Jacobowitz <drow at false dot org>
- To: Joel Brobecker <brobecker at adacore dot com>
- Cc: Jan Kratochvil <jan dot kratochvil at redhat dot com>, gdb-patches at sourceware dot org
- Date: Thu, 2 Apr 2009 15:06:39 -0400
- Subject: Re: [patch] Fix C `extern' shadowing in a local block
- References: <20090326212128.GA32657@host0.dyn.jankratochvil.net> <20090402185413.GC9017@adacore.com>
On Thu, Apr 02, 2009 at 11:54:13AM -0700, Joel Brobecker wrote:
> This part makes me uncomfortable. I am afraid that doing so would be
> misinterpreting the meaning of DW_AT_external.
I think that this is what DW_AT_external means: the declaration
represents an externally visible variable.
> Also, I would mean
> that we are treating this attribute differently depending on whether
> we have a location attribute or not.
This bothers me too, but I think it's OK. A local scope definition of
an external variable with a location is an odd concept, and until I
see an example that produces one, I have no idea what we should do
with it. The only one I can think of would be a declaration (not
definition) with location:
DW_TAG_variable
DW_AT_name: bar
DW_AT_external: 1
DW_AT_declaration: 1
DW_AT_location: &bar
But I don't think anyone produces that.
I took a look at our LOC_UNRESOLVED handling; I don't think it's quite
wise, since it ignores the full symbol table, but in practice that's
fine for unstripped binaries.
--
Daniel Jacobowitz
CodeSourcery