DWARF Standard


220706.1 Cary Coutant Default Locations for Pieces of a Composite Location Description Enhancement Open Cary Coutant

Section, pg 39
Default Locations for Pieces of a Composite Location Description


With the addition of default location descriptions in location lists in
DWARF 5, it is possible to provide a default location for a variable
that describes where it exists in memory for most of its lifetime,
excluding those ranges of code where it may have been promoted to a
register (for example).

For composite location descriptions, however, consider a scenario where
one piece of a variable (say, a field of a structure) is promoted to a
register in a range of code, while the remainder of that variable
remains in its default location. We have no way of describing this
scenario without repeating the default location description of each
piece that has not been promoted.

This proposal adds a simple way of indicating that a particular piece of
a composite location description should defer to the default location
description for that piece.

Proposed Changes to the DWARF Specification

In Section (Simple Location Descriptions), pages 39-41, add the
following: Default Location Descriptions

    A default location description represents a piece of an object whose
    location is given by the default location description in a location
    list (see Section 2.6.2). It may be used in a composite location
    description that is part of a location list entry, to describe a
    piece or pieces of an object that remain in the default location
    even when another piece or pieces have a different location for a
    particular address range. It consists of the single opcode

In Section 7.7.1 (DWARF Expressions), Table 7.9, beginning on Page 223,
add a row:

    Operation              Code       No. of Operands    Notes
    ---------              ----       ---------------    -----
    DW_OP_default_location TBA        0

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2007-2022 by DWARF Standards Committee.