Lines Matching full:is
16 on the stack. In addition, the call frame information (CFI) is extended to
17 support the full generality of location descriptions. This is done in a manner
18 that is backwards compatible with DWARF 5. The extension involves changes to the
64 instructions are executed. This is termed single instruction multiple thread
74 For example, a GPU may have a per thread block address space that is implemented
85 there is a benefit to be able to factorize their calculation which requires all
86 location kinds to be supported uniformly, otherwise duplication is necessary.
96 DWARF is a standardized way to specify debug information. It describes source
98 It is either embedded directly in sections of the code object executables, or
115 In particular, there is great diversity in the way a source language entity
136 expression is evaluated in a context dictated by where it is used. The context
142 value or with the location of a base object that is available using the
153 The first example is for an operation expression associated with a DIE attribute
162 first location of the array descriptor is the runtime size of the array.
164 A possible expression to retrieve the dynamic size of the array is:
169 The expression is evaluated one operation at a time. Operations have operands
177 read. The read value is pushed on the stack. Each stack element is a value and
184 default generic type: it is an architecture specific integral encoding and byte
185 ordering, that is the size of the architecture's global memory address.
195 expression that is evaluated with a value result kind context is the top element
200 This example is for an operation expression associated with a DIE attribute that
212 A possible expression to specify the location of the variable is:
228 an expression that is evaluated with a location result kind context is the
233 The next example is for an operation expression associated with a DIE attribute
234 that provides the location of a source language variable that is allocated in a
242 A possible expression to specify the location of the variable is:
250 frame pointer global memory address onto the stack. The generic type is the size
263 that is evaluated has a location result kind context, and the location area is
265 value is implicitly popped from the stack, and treated as a global memory
266 address to create a global memory location description, which is placed in the
267 location area. The result of the expression is the location description in the
274 This example is for a source variable that is partly in a register, partly undefined, and partly in…
297 the location area is used to define the beginning of the part for the size
321 If there is no other location in the location area, but there is a value on
322 stack, the new part is a memory location description. The memory address used is
329 that is evaluated has a location result kind context, and the location area has
331 is implicitly converted to a complete composite location description. The result
332 of the expression is the location description in the location area.
370 > NOTE: Without loss of generality, DWARF 4 is used in this example as full
371 > support for DWARF 5 is not present in the versions of the tools used. No
377 The mechanism DWARF 5 provides for describing pointer-to-member use is
378 `DW_AT_use_location`, which is defined as encoding a location description which
382 That is, when a debug agent wishes to evaluate a pointer-to-member access
434 Note the location description for `DW_AT_use_location` is `DW_OP_plus`, which
437 implementation is `offsetof(s, m)` and the value of `&s::n` is `offsetof(s, n)`:
463 The richness of the existing DWARF 5 expression language is a reflection of the
471 such a way that the containing object is not in memory at all:
527 Symbol "x" is multi-location:
539 And so it is impossible to interpret `DW_OP_use_location` in this case:
543 Address requested for identifier "x" which is in register $rdi
548 description", as is described in [Type Entries](#type-entries).
556 > NOTE: Without loss of generality, DWARF 4 is used in this example as full
557 > support for DWARF 5 is not present in the versions of the tools used. No
564 subobject is `DW_AT_data_member_location`. This attribute is overloaded to
618 of the logical layout of class `B` is:
627 That is, the address of an object of class `B` is equivalent to the address for
629 the primary base class subobject of class `A` comes next, and there is no
634 base class. In this case, that table layout is:
643 That is, to find the `vbase_offset` for the `A`-in-`B` subobject the address
644 `vptr B` is offset by the statically determined value `-24`.
654 when there is no guarantee either or both have any address at all.
657 such a way that the derived object is not in memory at all:
707 Symbol "b" is multi-location:
720 And so it is impossible to interpret `DW_OP_data_member_location` in this case:
734 "address" with "location description", as is described in [A.5 Type Entries](#type-entries).
742 DWARF 5 is unable to describe variables in runtime indexed parts of registers.
743 This is required to describe a source variable that is located in a lane of a
753 There are no vector base types. This is required to describe vector registers.
755 There is no operation to create a memory location in a non-global address space.
763 Supporting them in a uniform manner for all location kinds is required to
771 solves the issues of heterogeneous devices. It presents how this is done in
772 a manner that is backwards compatible with DWARF 5.
781 Each kind of location description is conceptually a zero-based offset within a
782 piece of storage. The storage is a contiguous linear organization of a certain
783 number of bytes (see below for how this is extended to support bit sized
786 - For global memory, the storage is the linear stream of bytes of the
788 - For each separate architecture register, it is the linear stream of bytes of
790 - For an implicit, it is the linear stream of bytes of the value when
793 - For undefined, it is an infinitely sized linear stream where every byte is
795 - For composite, it is a linear stream of bytes defined by the composite's parts.
799 The DWARF expression stack is extended to allow each stack entry to either be a
802 Evaluation rules are defined to implicitly convert a stack element that is a
804 continue to have the same semantics. This reflects that a memory address is
807 For each place that allows a DWARF expression to be specified, it is defined if
808 the expression is to be evaluated as a value or a location description.
832 location description. Currently this is only possible as a piece of a composite
833 when the stack is empty.
860 for the register is the size of the vector register. The register location
868 the stack. In this case the source language variable is being spilled to lane 5
869 and each lane's component which is 32-bits (4 bytes), so the offset is 5*4=20.
873 The result of the expression evaluation is the location description on the top
877 names for each part of each vector register. However, this is not practical for
885 execution is mapped to a single lane of the GPU thread. Source language
895 If the source language variable is larger than the size of the vector register
903 has to occupy two vector registers. A composite location description is created
905 lane corresponds to the source language thread of execution that the user is
943 for the new part. It then pops the next stack element if it is an incomplete
948 In this case a register location description is added to a new incomplete
953 For backwards compatibility, if the stack is empty or the top stack element is
954 an incomplete composite, an undefined location description is used for the part.
955 If the top stack element is a generic base type value, then it is implicitly
962 DW_OP_piece is evaluated there is an incomplete composite on the stack. So the
963 VGPR1 register location description is added as a second part.
977 At the end of the expression, if the top stack element is an incomplete
978 composite location description, it is converted to a complete location
985 This example is the same as the previous one, except the first 2 bytes of the
1019 description on the stack. The storage of the implicit location description is
1050 memory is actually being accessed in an interleaved manner so that the locations
1057 is allocated at offset 0x10 in the current subprograms stack frame. The
1068 This is the register that holds the address of the current stack frame.
1073 defines the numbers it uses in DWARF. In this case, address space 1 is being
1079 number. Each address space is associated with a separate storage. A memory
1080 location description is pushed which refers to the address space's storage, with
1094 The source variable is at offset 0x10 in the stack frame. The DW_OP_offset
1102 contents. There is no operation to actually create a location description that
1103 references an address space. There is no way to include address space memory
1107 is now possible for parts of a composite to involve locations in different
1114 With the generalization of location descriptions on the stack, it is possible to
1117 computed value. This is generally useful for any source language that support
1122 arrays. It is also not generally composable as it must be the last part of an
1126 is allocated starting at bit 20 of a register. A similar expression could be
1128 address space, or if the offset is a runtime value.
1148 The ordering of bits within a byte, like byte ordering, is defined by the target
1168 is a problem for attributes that define DWARF expressions that require the
1169 location of some source language entity that is not allocated in byte aligned
1172 For example, the DWARF expression of the DW_AT_data_member_location attribute is
1186 execution. This is naturally done by composing the result of expressions for
1189 the nested control flow regions. The alternative is to make each control flow
1190 region have the complete expression which results in much larger DWARF and is
1224 lanes the PC would correspond to the source language line at which the lane is
1240 change the register value, then there is no need to save it back to memory.
1241 Effectively, during that range, the source variable is in both memory and a
1247 language entity is in different places at different PC locations. It can also
1248 express that a source language entity is in multiple places at the same time.
1251 is adequate as non-memory location descriptions can only be computed as the last
1284 A strength of DWARF is that it has generally sought to provide generalized
1295 > defined such that it is backwards compatible with DWARF Version 5.
1296 > Non-normative text is shown in <i>italics</i>. The section numbers generally
1311 > 2.5 and section 2.6. It is based on the text of the existing DWARF Version 5
1324 is evaluated, it may be specified whether a value or location description is
1327 If a result kind is specified, and the result of the evaluation does not match
1330 are performed if valid. Otherwise, the DWARF expression is ill-formed.
1333 result is an evaluation error.
1335 > NOTE: Decided to define the concept of an evaluation error. An alternative is
1343 > can be tested to determine if it is an undefined entity.
1348 If a DWARF expression is ill-formed, then the result is undefined.
1350 The following sections detail the rules for when a DWARF expression is
1360 A DWARF expression is evaluated in a context that can include a number of
1362 self consistent or the result of the evaluation is undefined. The context
1373 execution for which a user presented expression is currently being
1376 It is required for operations that are related to target architecture
1385 thread. It is identified by its address on the call stack. The address is
1387 is used to determine the CFA for the call frames of the current thread's
1390 It is required for operations that specify target architecture registers to
1396 Otherwise the result is undefined.
1398 If it is the currently executing call frame, then it is termed the top call
1406 The program location of the top call frame is the target architecture
1407 program counter for the current thread. The call frame information is used
1412 It is required for the evaluation of location list expressions to select
1413 amongst multiple program location ranges. It is required for operations that
1419 - If the current call frame is the top call frame, it must be the current
1421 - If the current call frame F is not the top call frame, it must be the
1424 - Otherwise the result is undefined.
1431 It is required for operations that reference debug information associated
1434 space address size if no current target architecture is specified.
1442 the `DW_OP_call*` operations is evaluated with the compilation unit that
1450 It is required for operations that specify target architecture specific
1459 - If the current frame is specified, then the current target architecture
1462 - If the current frame is specified and is the top frame, and if the current
1463 thread is specified, then the current target architecture must be the same
1466 - If the current compilation unit is specified, then the current target
1470 - If the current program location is specified, then the current target
1475 - If the current program location is specified, then the current target
1481 - Otherwise the result is undefined.
1487 It is required for the `DW_OP_push_object_address` operation.
1494 The result is undefined if the location description is invalid (see [2.5.3
1499 This is a list of values or location descriptions that will be pushed on the
1505 stack is empty.
1507 The result is undefined if any location descriptions are invalid (see [2.5.3
1510 If the evaluation requires a context element that is not specified, then the
1511 result of the evaluation is an error.
1523 The DWARF is ill-formed if all the `address_size` fields in the headers of all
1536 > would be used for the type of the value that is produced when the
1542 There is a distinguished base type termed the generic type, which is an integral
1546 <i>The generic type is the same as the unspecified type used for stack
1549 An integral type is a base type that has an encoding of `DW_ATE_signed`,
1554 > NOTE: It is unclear if `DW_ATE_address` is an integral type. GDB does not seem
1568 Information about the location of program objects is provided by location
1575 object starts. The position within the location storage is expressed as a bit
1578 A location storage is a linear stream of bits that can hold values. Each
1600 Indicates no value is available and therefore cannot be read or written.
1617 they can describe the location of an object as long as its lifetime is either
1628 DWARF expression is ill-formed if the object value held in each single location
1629 description's position within the associated location storage is not the same
1642 optimization. For example, a value that is only read may be promoted from memory
1645 region where the value is in a register, any change to the object value must be
1654 Updating a location description L by a bit offset B is defined as adding the
1655 value of B to the bit offset of each single location description SL of L. It is
1656 an evaluation error if the updated bit offset of any SL is less than 0 or
1660 location description. If such a location description is accessed, the storage it
1661 denotes is that associated with the context element values specified when the
1663 it is accessed.
1666 context: the location storage is for the specified register of that thread.
1668 thread context: the location storage is the memory associated with that
1672 the location description becomes invalid and accessing it is undefined.
1676 - <i>The thread context is required and execution causes the thread to
1678 - <i>The call frame context is required and further execution causes the call
1680 - <i>The program location is required and further execution of the thread
1685 - <i>The top call frame is used, the program location is used to select the
1692 component of the object. The final result is undefined if the object location
1702 avoid such problems is to recompute location descriptions associated with
1707 An operation expression is comprised of a stream of operations, each consisting
1708 of an opcode followed by zero or more operands. The number of operands is
1714 of a stack entry does not match the kind required by the operation and is not
1717 then the DWARF operation expression is ill-formed.
1723 error, or until one past the last operation of the stream is reached.
1725 The result of the evaluation is:
1728 expression that has an evaluation error, then the result is an evaluation
1731 - If the stack is empty, the result is a location description with one
1734 <i>This rule is for backwards compatibility with DWARF Version 5 which uses
1737 - If the top stack entry is a location description, or can be converted to one
1739 then the result is that, possibly converted, location description. Any other entries on the
1741 - Otherwise the DWARF expression is ill-formed.
1744 > as if the `DW_OP_implicit` operation is performed.
1747 - If the top stack entry is a value, or can be converted to one (see
1749 then the result is that, possibly converted, value. Any other entries on the stack are
1751 - Otherwise the DWARF expression is ill-formed.
1752 - If the current result kind is not specified, then:
1753 - If the stack is empty, the result is a location description with one
1756 <i>This rule is for backwards compatibility with DWARF Version 5 which uses
1759 > NOTE: This rule is consistent with the rule above for when a location
1760 > description is requested. However, GDB appears to report this as an error
1763 - Otherwise, the top stack entry is returned. Any other entries on the stack
1766 An operation expression is encoded as a byte block with some form of prefix that
1769 - as the value of a debugging information entry attribute that is encoded using
1785 If any stack entry accessed by a stack operation is an incomplete composite
1787 (#composite-location-description-operations)), then the DWARF expression is ill-formed.
1792 > NOTE: If it is desired to also make them work with incomplete composite
1794 > storage specified by the incomplete composite location description is also
1795 > replicated when a copy is pushed. This ensures that each copy of the
1810 I. A copy of the stack entry with index I is pushed onto the stack.
1816 <i>This is equivalent to a `DW_OP_pick 1` operation.</i>
1842 `DW_OP_nop` is a place holder. It has no effect on the DWARF stack entries.
1851 `DW_OP_skip` is an unconditional branch. Its single operand is a 2-byte
1852 signed integer constant. The 2-byte constant is the number of bytes of the
1856 If the updated position is at one past the end of the last operation, then
1857 the operation expression evaluation is complete.
1859 Otherwise, the DWARF expression is ill-formed if the updated operation
1860 position is not in the range of the first to last operation inclusive, or
1865 `DW_OP_bra` is a conditional branch. Its single operand is a 2-byte signed
1867 is not the constant 0, the 2-byte constant operand is the number of bytes of
1871 If the updated position is at one past the end of the last operation, then
1872 the operation expression evaluation is complete.
1874 Otherwise, the DWARF expression is ill-formed if the updated operation
1875 position is not in the range of the first to last operation inclusive, or
1883 `DW_OP_call2` and `DW_OP_call4`, have one operand that is, respectively, a
1888 `DW_OP_call_ref` has one operand that is a 4-byte unsigned value in the
1897 > file to another must be performed by the consumer. But given that DR is
1903 > In ELF the `.debug_info` section is in a non-`PT_LOAD` segment so standard
1919 `DW_OP_call_ref` is exactly like that for `DW_FORM_ref2`, `DW_FORM_ref4`,
1922 The call operation is evaluated by:
1924 - If D has a `DW_AT_location` attribute that is encoded as a `exprloc` that
1927 continues until one past the last operation of E is reached, at which
1930 current compilation unit is the one that contains D and the stack is the
1932 has been evaluated, the stack is therefore as it is left by the evaluation
1933 of the operations of E. Since E is evaluated on the same stack as the call
1942 - If D has a `DW_AT_location` attribute that is encoded as a `loclist` or
1943 `loclistsptr`, then the specified location list expression E is evaluated.
1944 The evaluation of E uses the current context, except the result kind is a
1945 location description, the compilation unit is the one that contains D, and
1946 the initial stack is empty. The location description result is pushed on
1955 > An alternative is to treat the case when D has a `DW_AT_location`
1956 > attribute that is encoded as a `loclist` or `loclistsptr`, and the
1961 > But this is not attractive as if the attribute is for a variable that
1965 > entry is to push just one location description on the stack. That
1983 > A solution to that is to have a distinct `DW_AT_proc` attribute for the
1985 > `DW_AT_location` attribute expression is always executed separately and
1987 > descriptions), and the `DW_AT_proc` attribute expression is always
1991 > `loclistproc`, and `loclistsptrproc` to indicate that the expression is
1992 > executed on the same stack. `exprproc` is the same encoding as
1994 > their non-`proc` counterparts, except the DWARF is ill-formed if the
1996 > default entry is required. These forms indicate explicitly that the
1998 > This is better than ad hoc special rules for `loclistproc` and
2009 > Another option is to limit the execution to be on the same stack only to
2010 > the evaluation of an expression E that is the value of a
2012 > information entry. The DWARF would be ill-formed if E is a location list
2014 > other cases the evaluation of an expression E that is the value of a
2016 > except the result kind is a location description, the compilation unit
2017 > is the one that contains D, and the initial stack is empty. The location
2018 > description result is pushed on the stack.
2020 - If D has a `DW_AT_const_value` attribute with a value V, then it is as if
2025 producer has optimized it to a constant. This is consistent with the
2034 - Otherwise, there is no effect and no changes are made to the stack.
2037 > `DW_OP_call*` is defined to have no effect. It is unclear that this is
2066 If V is larger than the generic type, then V is truncated to the generic type
2076 `DW_OP_const<N>u` operations have a single operand that is a 1, 2, 4, or
2082 `DW_OP_const<N>s` operations have a single operand that is a 1, 2, 4, or
2104 <i>The `DW_OP_constx` operation is provided for constants that require
2110 `DW_OP_const_type` has three operands. The first is an unsigned LEB128
2113 the type T of the constant value. The second is a 1-byte unsigned integral
2114 constant S. The third is a block of bytes B, with a length equal to S.
2116 TS is the bit size of the type T. The least significant TS bits of B are
2120 The DWARF is ill-formed if D is not a `DW_TAG_base_type` debugging
2122 (the byte size) and rounded up to a whole number is not equal to S.
2125 definition, it is encoded explicitly into the operation so that the
2131 > NOTE: This section is the same as DWARF Version 5 section 2.5.1.4.
2135 > NOTE: This section is the same as DWARF Version 5 section 2.5.1.6.
2146 `DW_OP_regval_type` has two operands. The first is an unsigned LEB128
2147 integer that represents a register number R. The second is an unsigned
2152 The operation is equivalent to performing `DW_OP_regx R; DW_OP_deref_type
2157 > conversion as the, possibly truncated, bit contents of the register is
2158 > simply interpreted as a value of T. If a conversion is wanted it can be
2168 > If T is a larger type than the register size, then the default GDB
2178 S is the bit size of the generic type divided by 8 (the byte size) and
2179 rounded up to a whole number. DR is the offset of a hypothetical debug
2183 The operation is equivalent to performing `DW_OP_deref_type S, DR`.
2190 TS is the smaller of the generic type bit size and S scaled by 8 (the byte
2191 size). If TS is smaller than the generic type bit size then T is an unsigned
2192 integral type of bit size TS, otherwise T is the generic type. DR is the
2196 > NOTE: Truncating the value when S is larger than the generic type matches
2201 The operation is equivalent to performing `DW_OP_deref_type S, DR`, except
2202 if T is not the generic type, the value V pushed is zero-extended to the
2207 `DW_OP_deref_type` has two operands. The first is a 1-byte unsigned integral
2208 constant S. The second is an unsigned LEB128 integer DR that represents the
2212 TS is the bit size of the type T.
2215 is encoded explicitly as the operand S so that the operation can be parsed
2218 > NOTE: It is unclear why the operand S is needed. Unlike
2219 > `DW_OP_const_type`, the size is not needed for parsing. Any evaluation
2225 A value V of TS bits is retrieved from the location storage LS specified by
2229 part that is a subcomponent of L, has more than one single location
2235 where N is limited to the size of PL.</i>
2237 V is pushed on the stack with the type T.
2239 > NOTE: This definition makes it an evaluation error if L is a register
2248 > `DW_OP_regval_type` is defined in terms of `DW_OP_regx`, which uses a 0
2253 The DWARF is ill-formed if D is not in the current compilation unit, D is
2255 (the byte size) and rounded up to a whole number is not equal to S.
2260 It is an evaluation error if any bit of the value is retrieved from the
2275 The address size S is defined as the address bit size of the target
2278 A is adjusted to S bits by zero extending if necessary, and then treating
2285 If AS is an address space that is specific to context elements, then LS
2288 <i>For example, if AS is for per thread storage then LS is the location
2289 storage for the current thread. Therefore, if L is accessed by an operation,
2290 the location storage selected when the location description was created is
2294 The DWARF expression is ill-formed if AS is not one of the values defined by
2297 The operation is equivalent to popping A and AS, pushing L, and then
2298 performing `DW_OP_deref`. The value V retrieved is left on the stack with
2313 The operation is equivalent to popping A and AS, pushing L, and then
2314 performing `DW_OP_deref_size S` . The zero-extended value V retrieved is
2319 `DW_OP_xderef_type` has two operands. The first is a 1-byte unsigned
2320 integral constant S. The second operand is an unsigned LEB128 integer DR
2331 The operation is equivalent to popping A and AS, pushing L, and then
2332 performing `DW_OP_deref_type DR` . The value V retrieved is left on the
2337 `DW_OP_entry_value` pushes the value of an expression that is evaluated in
2343 It has two operands. The first is an unsigned LEB128 integer S. The second
2344 is a block of bytes, with a length equal S, interpreted as a DWARF operation
2347 E is evaluated with the current context, except the result kind is
2348 unspecified, the call frame is the one that called the current frame, the
2349 program location is the call site in the calling frame, the object is
2350 unspecified, and the initial stack is empty. The calling frame information
2351 is obtained by virtually unwinding the current call frame using the call
2355 If the result of E is a location description L (see [2.5.4.4.4 Register
2358 operation executed by E is a `DW_OP_reg*` for register R with a target
2360 retrieved as if a `DW_OP_deref_type DR` operation was performed where DR is
2362 compilation unit for T. The resulting value V is pushed on the stack.
2367 > NOTE: It is unclear how this provides a more compact expression, as
2368 > `DW_OP_regval_type` could be used which is marginally larger.
2370 If the result of E is a value V, then V is pushed on the stack.
2372 Otherwise, the DWARF expression is ill-formed.
2374 <i>The `DW_OP_entry_value` operation is deprecated as its main usage is
2383 > NOTE: GDB only implements `DW_OP_entry_value` when E is exactly
2400 <i>This object may correspond to an independent variable that is part of a
2401 user presented expression that is being evaluated. The object location
2408 involving descriptors) that is analogous to the implicit push of the base
2416 > stack. The latter approach is more composable as access to the object may
2418 > stack requires the entire expression to be aware where on the stack it is.
2433 > The only attribute that specifies a current object is
2435 > this is being used. Or are there other attributes that need to state they
2442 <i>The undefined location storage represents a piece or all of an object that is
2444 Neither reading nor writing to the undefined location storage is meaningful.</i>
2447 There is no concept of the size of the undefined location storage, nor of a bit
2462 <i>It is target architecture defined how address space location storage maps to
2474 A memory location description that has a bit offset that is a multiple of 8 (the
2475 byte size) is defined to be a byte address memory location description. It has a
2476 memory byte address A that is equal to the bit offset divided by 8.
2478 A memory location description that does not have a bit offset that is a multiple
2479 of 8 (the byte size) is defined to be a bit field memory location description.
2481 address A equal to the bit offset minus B that is then divided by 8.
2483 The address space AS of a memory location description is defined to be the
2487 A location description that is comprised of one byte address memory location
2488 description SL is defined to be a memory byte address location description. It
2492 `DW_ASPACE_none` is defined as the target architecture default address space.
2494 If a stack entry is required to be a location description, but it is a value V
2495 with the generic type, then it is implicitly converted to a location description
2500 > NOTE: If it is wanted to allow any integral type value to be implicitly
2504 > > If a stack entry is required to be a location description, but is a value V
2505 > > with an integral type, then it is implicitly converted to a location
2507 > > V is less than the generic type size, then the value V is zero extended to
2514 > For example, GDB checks if V is an integral type. If it is not it gives an
2516 > hook function, then it is called. The target specific hook function can modify
2520 If a stack entry is required to be a location description, but it is an implicit
2521 pointer value IPV with the target architecture default address space, then it is
2526 If a stack entry is required to be a value, but it is a location description L
2528 address space with a bit offset B that is a multiple of 8, then it is implicitly
2542 <i>If the DWARF is part of a code object, then A may need to be relocated.
2545 at which the segment is loaded.</i>
2559 <i>If the DWARF is part of a code object, then A may need to be relocated.
2562 at which the segment is loaded.</i>
2570 on the stack. SL is the target architecture specific memory location
2573 The meaning of the thread-local storage address TA is defined by the
2577 expression is used.
2583 there is a single block of storage containing all thread-local variables
2586 accessed in its block using an identifier. This identifier is typically a
2608 information is present, then it already encodes such changes, and it is
2618 subprogram is obtained from the `DW_AT_frame_base` attribute of the debugger
2622 The location description L is updated by bit offset B scaled by 8 (the byte
2634 The address space identifier AS is defined as the one corresponding to the
2637 The address size S is defined as the address bit size of the target
2641 `DW_OP_regval_type R, DR` operation was performed where DR is the offset of
2643 an unsigned integral base type of size S bits. B is added and the least
2653 `DW_OP_bregx` has two operands. The first is an unsigned LEB128 integer that
2654 represents a register number R. The second is a signed LEB128 integer that
2657 The action is the same as for `DW_OP_breg<N>`, except that R is used as the
2658 register number and B is used as the byte displacement.
2664 There is a register location storage that corresponds to each of the target
2679 The operation is equivalent to performing `DW_OP_regx R`.
2686 If the current call frame is the top call frame, it pushes a location
2691 If the current call frame is not the top call frame, call frame information
2692 (see [6.4 Call Frame Information](#call-frame-information)) is used to
2695 location description L is pushed.
2697 <i>Note that if call frame information is used, the resulting location
2701 may defer evaluation until L is accessed by an operation. If evaluation is
2703 recorded context is used to evaluate the call frame information, not the
2707 register, it is necessary to use `DW_OP_regval_type`, use one of the
2726 `DW_OP_implicit_value` has two operands. The first is an unsigned LEB128
2727 integer that represents a byte size S. The second is a block of bytes with a
2730 An implicit location storage LS is created with the literal value V and a
2740 An implicit location storage LS is created with the literal value V using
2747 exist in memory, but its value is nonetheless known. In this form, the
2765 <i>`DW_OP_implicit_pointer` specifies an object is a pointer to the target
2774 `DW_OP_implicit_pointer` has two operands. The first operand is a 4-byte
2778 that contains the current compilation unit. The second operand is a signed
2783 <i>The first operand interpretation is exactly like that for
2786 The address space identifier AS is defined as the one corresponding to the
2789 The address size S is defined as the address bit size of the target
2792 An implicit location storage LS is created with the debugging information
2798 It is an evaluation error if a `DW_OP_deref*` operation pops a location
2800 an implicit location storage that is the same as LS, unless both the
2804 refers to an implicit location storage that is the same as LS.
2816 `DW_OP_deref*` operation is an implicit pointer value IPV with a target
2818 D, and a base type of T. If AS is the target architecture default address
2819 space, then T is the generic type. Otherwise, T is a target architecture
2822 If IPV is either implicitly converted to a location description (only done
2823 if AS is the target architecture default address space), then the resulting
2824 location description RL is:
2827 `DW_AT_location` attribute is evaluated with the current context, except
2828 that the result kind is a location description, the compilation unit is
2829 the one that contains D, the object is unspecified, and the initial stack
2830 is empty. RL is the expression result.
2832 <i>Note that E is evaluated with the context of the expression accessing
2837 storage RLS is created from the `DW_AT_const_value` attribute's value with
2843 > is deprecated and instead `DW_AT_location` is used with an implicit
2846 - Otherwise, it is an evaluation error.
2848 The location description RL is updated by bit offset B scaled by 8 (the byte
2851 If a `DW_OP_stack_value` operation pops a value that is the same as IPV,
2852 then it pushes a location description that is the same as L.
2854 It is an evaluation error if LS or IPV is accessed in any other manner.
2861 <i>Typically a `DW_OP_implicit_pointer` operation is used in a DWARF expression
2864 information entry referenced by the `DW_OP_implicit_pointer` operation is
2889 that indicates that part is located in more than one place. The bits of each
2892 within the size of LS or the DWARF expression is ill-formed.
2897 storage is the sum of the size of its parts. The DWARF expression is ill-formed
2898 if the size of the contiguous location storage is larger than the size of the
2908 incrementally created. Each part is created by a separate operation. There may
2918 that is incomplete is termed an incomplete composite location description. A
2920 is complete is termed a complete composite location description.
2922 If the top stack entry is a location description that has one incomplete
2924 has completed, SL is converted to a complete composite location description.
2927 operation expression that is evaluated on the same stack by the `DW_OP_call*`
2932 If a stack entry is required to be a location description L, but L has an
2933 incomplete composite location description, then the DWARF expression is
2934 ill-formed. The exception is for the operations involved in incrementally
2950 The action is based on the context:
2952 - If the stack is empty, then a location description L comprised of one
2953 incomplete composite location description SL is pushed on the stack.
2955 An incomplete composite location storage LS is created with a single part
2957 8 (the byte size). PL is comprised of one undefined location description
2962 - Otherwise, if the top stack entry is a location description L comprised of
2964 composite location storage LS that SL specifies is updated to append a new
2966 scaled by 8 (the byte size). PL is comprised of one undefined location
2967 description PSL. L is left on the stack.
2968 - Otherwise, if the top stack entry is a location description or can be
2969 converted to one, then it is popped and treated as a part location
2972 - If the top stack entry (after popping PL) is a location description L
2974 incomplete composite location storage LS that SL specifies is updated to
2976 bit size of S scaled by 8 (the byte size). L is left on the stack.
2978 incomplete composite location description SL is pushed on
2981 An incomplete composite location storage LS is created with a single
2987 - Otherwise, the DWARF expression is ill-formed
2991 provides a way of describing where a part of a variable is located.</i>
3003 > compatibility with DWARF Version 5 is likely a stronger consideration.
3007 `DW_OP_bit_piece` has two operands. The first is an unsigned LEB128 integer
3008 that represents the part bit size S. The second is an unsigned LEB128
3011 The action is the same as for `DW_OP_piece`, except that any part created
3012 has the bit size S, and the location description PL of any created part is
3015 <i>`DW_OP_bit_piece` is used instead of `DW_OP_piece` when the piece to be
3016 assembled is not byte-sized or is not at the start of the part location
3028 location is being described has these requirements.</i>
3031 location list entry is one of the following kinds:
3036 evaluates to the location description of an object that is valid over a
3037 lifetime bounded by a starting and ending address. The starting address is
3038 the lowest address of the address range over which the location is valid.
3039 The ending address is the address of the first location past the highest
3042 The location list entry matches when the current program location is within
3051 evaluates to the location description of an object that is valid when no
3054 The location list entry matches when the current program location is not
3062 bounded location description entry is the address specified by the closest
3063 preceding base address entry in the same location list. If there is no
3068 In the case of a compilation unit where all of the machine code is contained
3069 in a single contiguous section, no base address entry is needed.
3081 collectively cover the entire range over which the object in question is
3082 defined, and there is no following default location description entry, it is
3083 assumed that the object is not available for the portion of the range that is
3086 The result of the evaluation of a DWARF location list expression is:
3088 - If the current program location is not specified, then it is an evaluation
3092 > considered a match if there is no program location? If there are non-default
3093 > entries then it seems it has to be an evaluation error when there is no
3095 > location which is not known.
3097 - If there are no matching location list entries, then the result is a location
3099 - Otherwise, the operation expression E of each matching location list entry is
3100 evaluated with the current context, except that the result kind is a location
3101 description, the object is unspecified, and the initial stack is empty. The
3102 location list entry result is the location description returned by the
3105 The result is a location description that is comprised of the union of the
3110 information entry attribute that is encoded using class `loclist` or
3127 > NOTE: The rest of this section is the same as DWARF Version 5 section 2.6.2.
3141 value is a DWARF expression E.
3143 The result of the attribute is obtained by evaluating E with a context that
3147 the user is focused, if any. The result of the evaluation is the location
3149 frame's subprogram or entry point is stored.
3151 The DWARF is ill-formed if L is not comprised of one memory location
3154 > NOTE: It is unclear why `DW_TAG_inlined_subroutine` has a
3161 have a `DW_AT_frame_base` attribute, whose value is a DWARF expression E.
3163 The result of the attribute is obtained by evaluating E with a context that
3167 the user is focused, if any.
3169 The DWARF is ill-formed if E contains a `DW_OP_fbreg` operation, or the
3170 resulting location description L is not comprised of one single location
3173 If SL is a register location description for register R, then L is replaced
3186 Otherwise, the DWARF is ill-formed if SL is not a memory location
3189 The resulting L is the <i>frame base</i> for the subprogram or entry point.
3195 is lexically nested, it may have a `DW_AT_static_link` attribute, whose
3196 value is a DWARF expression E.
3198 The result of the attribute is obtained by evaluating E with a context that
3202 the user is focused, if any. The result of the evaluation is the location
3208 The DWARF is ill-formed if L is is not comprised of one memory location
3216 `DW_AT_call_value` attribute, whose value is a DWARF operation expression
3219 The result of the `DW_AT_call_value` attribute is obtained by evaluating
3223 which the user is focused, if any. The resulting value V<sub>1</sub> is the
3229 `DW_AT_call_data_location` attribute whose value is a DWARF operation expression
3230 E<sub>2</sub>, and a `DW_AT_call_data_value` attribute whose value is a DWARF
3233 The value of the `DW_AT_call_data_location` attribute is obtained by evaluating
3237 execution upon which the user is focused, if any. The resulting location
3238 description L<sub>2</sub> is the location where the referenced parameter lives
3248 The value of the `DW_AT_call_data_value` attribute is obtained by evaluating
3252 which the user is focused, if any. The resulting value V<sub>3</sub> is the
3255 The result of these attributes is undefined if the current call frame is not for
3257 entry or the current program location is not for the call site containing the
3264 the user is focused corresponds to the call site needed to evaluate the
3267 If it is not possible to avoid the expressions of these attributes from
3272 <i>The reason for the restriction is that the parameter may need to be accessed
3282 > NOTE: This section is the same as DWARF Version 5 section 3.5.
3296 *The tag `DW_TAG_constant` is used for languages that have true named constants.*
3301 1. A `DW_AT_location` attribute, whose value is a DWARF expression E that
3304 The result of the attribute is obtained by evaluating E with a context that
3308 the user is focused, if any. The result of the evaluation is the location
3315 > a `DW_AT_location` attribute as that is now described in the operations.
3337 > the location description of any variable regardless of how it is
3342 A common block entry also has a DW_AT_location attribute whose value is a DWARF
3344 result of the attribute is obtained by evaluating E with a context that has a
3347 corresponding to the source language thread of execution upon which the user is
3348 focused, if any. The result of the evaluation is the location description of the
3364 1. If the attribute is an integer constant B, it provides the offset in
3367 The result of the attribute is obtained by updating the bit offset of
3369 scaled by 8 (the byte size). The result is the location description of
3372 <i>If the beginning of the containing entity is not byte aligned, then
3376 2. Otherwise, the attribute must be a DWARF expression E which is evaluated
3381 source language thread of execution upon which the user is focused, if
3382 any. The result of the evaluation is the location description of the
3393 attribute whose value is a DWARF expression E.
3395 The result of the attribute is obtained by evaluating E with a context that
3400 is focused, if any. The result of the evaluation is the location description
3407 `DW_AT_use_location` attribute whose value is a DWARF expression E. It is used
3412 class, structure, or union is common to any instance of that class, structure,
3413 or union and to any instance of the pointer to member type. The method is thus
3417 The `DW_AT_use_location` DWARF expression is used in conjunction with the
3421 The result of the attribute is obtained by evaluating E with a context that has
3425 user is focused, if any. The first stack entry is the value of the pointer to
3426 member object itself. The second stack entry is the location description of the
3428 whose location is being calculated. The result of the evaluation is the location
3438 representation. Its value is a DWARF operation expression E which computes the
3439 location description of the data for an object. When this attribute is omitted,
3440 the location description of the data is the same as the location description of
3443 The result of the attribute is obtained by evaluating E with a context that has
3444 a result kind of a location description, an object that is the location
3447 language thread of execution upon which the user is focused, if any. The result
3448 of the evaluation is the location description of the base of the member entry.
3462 > It seems odd this attribute is not the same as `DW_AT_data_member_location` in
3474 > NOTE: This section is the same as DWARF Version 5 section 6.2.
3489 frame. The previous value of this register is the undefined location
3493 <i>By convention, the register is not preserved by a callee.</i>
3499 If the current frame is the top frame, then the previous value of this
3500 register is the location description L that specifies one register location
3504 If the current frame is not the top frame, then the previous value of this
3505 register is the location description obtained using the call frame
3509 <i>By convention, the register is preserved by the callee, but the callee
3514 N is a signed byte offset. The previous value of this register is saved at
3515 the location description L. Where L is the location description of the
3522 N is a signed byte offset. The previous value of this register is the memory
3523 byte address of the location description L. Where L is the location
3528 The DWARF is ill-formed if the CFA location description is not a memory byte
3532 <i>Since the CFA location description is required to be a memory byte
3534 memory byte address location description since it is offsetting the CFA
3541 > issue of conversion as the bit contents of the register is simply
3555 The previous value of this register is the location description obtained
3559 The DWARF is ill-formed if the size of this register does not match the size
3560 of register R or if there is a cyclic dependency in the call frame
3563 > NOTE: Should this also allow R to be larger than this register? If so is
3564 > the value stored in the low order bits and it is undefined what is stored
3569 The previous value of this register is located at the location description
3573 E is evaluated with the current context, except the result kind is a
3574 location description, the compilation unit is unspecified, the object is
3581 The previous value of this register is located at the implicit location
3586 E is evaluated with the current context, except the result kind is a value,
3587 the compilation unit is unspecified, the object is unspecified, and an
3591 The DWARF is ill-formed if the resulting value type size does not match the
3595 > produce values up to the size of the generic type. This is due to not
3603 The rule is defined externally to this specification by the augmenter.
3605 A Common Information Entry (CIE) holds information that is shared among many
3606 Frame Description Entries (FDE). There is at least one CIE in every non-empty
3618 A constant that is used to distinguish CIEs from FDEs.
3620 In the 32-bit DWARF format, the value of the CIE id in the CIE header is
3621 0xffffffff; in the 64-bit DWARF format, the value is 0xffffffffffffffff.
3625 A version number. This number is specific to the call frame information and
3626 is independent of the DWARF version number.
3628 The value of the CIE version number is 4.
3637 that is unexpected, then only the following fields can be read:
3642 If there is no augmentation, this value is a zero byte.
3644 <i>The augmentation string allows users to indicate that there is additional
3646 is needed to virtually unwind a stack frame. For example, this might be
3650 <i>Because the `.debug_frame` section is useful independently of any
3667 A constant that is factored out of all advance location instructions (see
3669 resulting value is `(operand * code_alignment_factor)`.
3673 A constant that is factored out of certain offset instructions (see [6.4.2.2
3676 resulting value is `(operand * data_alignment_factor)`.
3684 The value of the return address register is used to determine the program
3685 location of the caller frame. The program location of the top frame is the
3694 instructions is the undefined rule. However, an ABI authoring body or a
3715 is associated with this FDE.
3720 segment_selector_size field of this FDE's CIE is non-zero, the initial
3721 location is preceded by a segment selector of the given length.
3749 - `DW_OP_push_object_address` is not allowed because there is no object context
3768 The required action is to define the current CFA rule to be equivalent to
3776 displacement B. The required action is to define the current CFA rule to be
3780 <i>The action is the same as `DW_CFA_def_cfa`, except that the second
3781 operand is signed and factored.</i>
3786 operand representing a register number R. The required action is to define
3788 operation expression `DW_OP_bregx R, B` as a location description. B is the
3792 `DW_CFA_def_cfa_expression` instruction, then the DWARF is ill-formed.
3798 action is to define the current CFA rule to be equivalent to the result of
3800 description. R is the old CFA register number.
3803 `DW_CFA_def_cfa_expression` instruction, then the DWARF is ill-formed.
3808 representing a factored byte displacement B. The required action is to
3811 location description. R is the old CFA register number.
3814 `DW_CFA_def_cfa_expression` instruction, then the DWARF is ill-formed.
3816 <i>The action is the same as `DW_CFA_def_cfa_offset`, except that the
3817 operand is signed and factored.</i>
3823 The required action is to define the current CFA rule to be equivalent to
3825 is a location description, the compilation unit is unspecified, the object
3826 is unspecified, and an empty initial stack.
3831 The DWARF is ill-formed if the result of evaluating E is not a memory byte
3839 that represents a register number R. The required action is to set the rule
3845 that represents a register number R. The required action is to set the rule
3852 factored displacement B. The required action is to change the rule for the
3856 > NOTE: Seems this should be named `DW_CFA_offset_uf` since the offset is
3863 instruction is identical to `DW_CFA_offset`, except for the encoding and
3867 > displacement is unsigned factored.
3873 displacement B. This instruction is identical to `DW_CFA_offset_extended`,
3874 except that B is signed.
3880 action is to change the rule for the register indicated by R to be a
3884 displacement is unsigned factored.
3890 displacement B. This instruction is identical to `DW_CFA_val_offset`, except
3891 that B is signed.
3896 representing register numbers R1 and R2 respectively. The required action is
3904 representing a DWARF operation expression E. The required action is to
3908 <i>That is, E computes the location description where the register value can
3918 representing a DWARF operation expression E. The required action is to
3922 <i>That is, E computes the value of register R.</i>
3927 If the result of evaluating E is not a value with a base type size that
3928 matches the register size, then the DWARF is ill-formed.
3933 opcode) that represents a register number R. The required action is to
3940 operand that represents a register number R. This instruction is identical
3999 A reference to the DWARF standard is provided.
4001 A formatted version of this extension is available on the LLVM site. It includes