This is the mail archive of the
dwarf2@corp.sgi.com
mailing list for the dwarf2 project.
Re: location lists
- To: David B Anderson <davea at quasar dot engr dot sgi dot com>, Michael Eager <eager at eagercon dot com>
- Subject: Re: location lists
- From: David B Anderson <davea at quasar dot engr dot sgi dot com>
- Date: Fri, 9 Mar 2001 10:20:36 -0800 (PST)
- Cc: dwarf2 <dwarf2 at corp dot sgi dot com>, todd dot allen at ccur dot com
- References: <200103081550.f28Fo8302279@toad.ccur.com> <200103082242.OAA67657@quasar.engr.sgi.com>
- Reply-To: David B Anderson <davea at quasar dot engr dot sgi dot com>
davea@sgi.com wrote:
> But section 4.1 (draft 5 page 53) says non-defining declarations
> are not allowed to have a location attribute (bullet 3.).
> (the words are just a tiny bit soft, but that's how I read it).
Michael Eager wrote
|Let's say you have the following code in A.c:
|
| extern int i;
|
| foo ()
| {
| for (i=0; i < 100; i++) {
| ...
| }
| }
|
|If the compiler moves i into a register, I would hope that
|there would be some way to describe its lifetime. Is
|"extern int i" a defining declaration? Only the linker
|knows for sure.
I would hope so too.
|Section 4.1 does prohibit location expressions for
|non-defining declarations. But see section 2.12 which
|mentions that a debugger might need a DIE for a non-defining
|declaration to be able to evaluate an expression. Seems
|like this might be one case where this might apply.
But 2.12 does not give the compiler permission
to put a location on the DIE!
I cannot quite see how 2.12 has any effect unless
the DIE contains a location or ???.
|If there is a defining declaration for "int i = 0;" in B.c,
|then a location expression with the declaration couldn't
|describe that it was in a register in a A.c.
Well, yes, that is a problem!
|I'm not sure exactly why section 4.1 contains the prohibition.
|I think it had something to do with prototypes.
I don't recall why.
I think we're agreed the prohibition is silly and
should be removed, right?.
Regards,
David B. Anderson davea@sgi.com danderson@acm.org http://reality.sgi.com/davea/