This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Fix C `extern' shadowing in a local block


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]