[Dwarf-Discuss] Default Location List Entry Issue 130121.1

Robinson, Paul Paul_Robinson at playstation.sony.com
Thu Apr 3 06:46:55 PDT 2014


> > A default location list entry (as proposed in 130121.1) gives the
> location
> > of an object for address values which are not otherwise specified in
> the
> > location list.
> 
> Maybe an example of this would be helpful too. I am under the (wrong)
> impression that a default location list entry would be used to describe
> "static objects". But the use case is probably different than I imagine.

Consider a subprogram with a local stack-allocated variable.  In the
simple case, a simple location description gives that location, and
of course it's valid for the address-range of the containing subprogram.

The compiler might optimize this variable into a register for part of
the subprogram, a different register for a different part of the
subprogram, and leave it on the stack otherwise.  This can be described
by a set of normal location list entries for the ranges where the
variable is in a register, and a default location entry for the entire
range of the subprogram, giving the stack location.  Of course the 
compiler *could* emit many individual entries with the stack location,
filling in the gaps, but the default location entry is more compact.

In any case, the locations for the local variable are valid only for
the address range of the containing subprogram.  Well, technically
only for the address range that has a valid stack frame.

--paulr





More information about the Dwarf-Discuss mailing list