Professional Documents
Culture Documents
Version 4
Trademarks:
Intel386 is a trademark of Intel Corporation.
Java is a trademark of Sun Microsystems, Inc.
All other trademarks found herein are property of their respective owners.
INTRODUCTION
Table of Contents
DWARF DEBUGGING INFORMATION FORMAT VERSION 4 ...................................................................... I
1
INTRODUCTION..............................................................................................................................................1
1.1 PURPOSE AND SCOPE ...........................................................................................................................................1
1.2 OVERVIEW ...........................................................................................................................................................1
1.3 VENDOR EXTENSIBILITY......................................................................................................................................2
1.4 CHANGES FROM VERSION 3 TO VERSION 4..........................................................................................................3
1.5 CHANGES FROM VERSION 2 TO VERSION 3..........................................................................................................4
1.6 CHANGES FROM VERSION 1 TO VERSION 2..........................................................................................................5
Page iii
Page iv
Page v
Page vi
E.2
E.2.1
E.2.2
E.3
E.3.1
E.3.2
E.3.3
E.3.4
E.3.5
Page vii
Page viii
List of Figures
FIGURE 1. TAG NAMES ...................................................................................................................................................8
FIGURE 2. ATTRIBUTE NAMES ......................................................................................................................................14
FIGURE 3. CLASSES OF ATTRIBUTE VALUE ...................................................................................................................15
FIGURE 4. ACCESSIBILITY CODES .................................................................................................................................32
FIGURE 5. VISIBILITY CODES ........................................................................................................................................33
FIGURE 6. VIRTUALITY CODES .....................................................................................................................................33
FIGURE 7. EXAMPLE ADDRESS CLASS CODES ................................................................................................................35
FIGURE 8. LANGUAGE NAMES ......................................................................................................................................45
FIGURE 9. IDENTIFIER CASE CODES ..............................................................................................................................46
FIGURE 10. CALLING CONVENTION CODES ...................................................................................................................54
FIGURE 11. INLINE CODES ............................................................................................................................................59
FIGURE 12. ENDIANITY ATTRIBUTE VALUES .................................................................................................................72
FIGURE 13. ENCODING ATTRIBUTE VALUES..................................................................................................................77
FIGURE 14. DECIMAL SIGN ATTRIBUTE VALUES ...........................................................................................................80
FIGURE 15. TYPE MODIFIER TAGS .................................................................................................................................82
FIGURE 16. ARRAY ORDERING .....................................................................................................................................83
FIGURE 17. DISCRIMINANT DESCRIPTOR VALUES .........................................................................................................95
FIGURE 18. TAG ENCODINGS ......................................................................................................................................154
FIGURE 19. CHILD DETERMINATION ENCODINGS ........................................................................................................154
FIGURE 20. ATTRIBUTE ENCODINGS ...........................................................................................................................159
FIGURE 21. ATTRIBUTE FORM ENCODINGS .................................................................................................................161
FIGURE 22. EXAMPLES OF UNSIGNED LEB128 ENCODINGS ........................................................................................162
FIGURE 23. EXAMPLES OF SIGNED LEB128 ENCODINGS ............................................................................................163
FIGURE 24. DWARF OPERATION ENCODINGS ............................................................................................................167
FIGURE 25. BASE TYPE ENCODING VALUES ................................................................................................................169
FIGURE 26. DECIMAL SIGN ENCODINGS ......................................................................................................................169
FIGURE 27. ENDIANITY ENCODINGS ...........................................................................................................................170
FIGURE 28. ACCESSIBILITY ENCODINGS .....................................................................................................................170
FIGURE 29. VISIBILITY ENCODINGS ............................................................................................................................171
FIGURE 30. VIRTUALITY ENCODINGS .........................................................................................................................171
FIGURE 31. LANGUAGE ENCODINGS ...........................................................................................................................173
FIGURE 32. IDENTIFIER CASE ENCODINGS...................................................................................................................174
FIGURE 33. CALLING CONVENTION ENCODINGS .........................................................................................................174
FIGURE 34. INLINE ENCODINGS ..................................................................................................................................175
FIGURE 35. ORDERING ENCODINGS ............................................................................................................................175
FIGURE 36. DISCRIMINANT DESCRIPTOR ENCODINGS .................................................................................................176
FIGURE 37. LINE NUMBER STANDARD OPCODE ENCODINGS .....................................................................................179
FIGURE 38. LINE NUMBER EXTENDED OPCODE ENCODINGS ......................................................................................179
FIGURE 39. MACINFO TYPE ENCODINGS ....................................................................................................................180
FIGURE 40. CALL FRAME INSTRUCTION ENCODINGS ...................................................................................................182
FIGURE 41. INTEGER REPRESENTATION NAMES .........................................................................................................184
FIGURE 42. ATTRIBUTES BY TAG VALUE ..................................................................................................................211
FIGURE 43. DEBUG SECTION RELATIONSHIPS .............................................................................................................214
FIGURE 44. ALGORITHM TO ENCODE AN UNSIGNED INTEGER .....................................................................................217
FIGURE 45. ALGORITHM TO ENCODE A SIGNED INTEGER ............................................................................................217
FIGURE 46. ALGORITHM TO DECODE AN UNSIGNED LEB128 NUMBER .......................................................................218
Page ix
Page x
Page xi
Page xii
FOREWORD
The DWARF Debugging Information Format Committee was originally organized in 1988 as the
Programming Languages Special Interest Group (PLSIG) of Unix International, Inc., a trade
group organized to promote Unix System V Release 4 (SVR4).
PLSIG drafted a standard for DWARF Version 1, compatible with the DWARF debugging
format used at the time by SVR4 compilers and debuggers from AT&T. This was published as
Revision 1.1.0 on October 6, 1992. PLSIG also designed the DWARF Version 2
format, which followed the same general philosophy as Version 1, but with significant new
functionality and a more compact, though incompatible, encoding. An industry review draft of
DWARF Version 2 was published as Revision 2.0.0 on July 27, 1993.
Unix International dissolved shortly after the draft of Version 2 was released; no industry
comments were received or addressed, and no final standard was released. The committee
mailing list was hosted by OpenGroup (formerly XOpen).
The Committee reorganized in October, 1999, and met for the next several years to address
issues that had been noted with DWARF Version 2 as well as to add a number of new features.
In mid-2003, the Committee became a workgroup under the Free Standards Group (FSG), a
industry consortium chartered to promote open standards. DWARF Version 3 was published on
December 20, 2005, following industry review and comment.
The DWARF Committee withdrew from the Free Standards Group in February, 2007, when FSG
merged with the Open Source Development Labs to form The Linux Foundation, more narrowly
focused on promoting Linux. The DWARF Committee has been independent since that time.
It is the intention of the DWARF Committee that migrating from DWARF Version 2 or Version
3 to later versions should be straightforward and easily accomplished. Almost all DWARF
Version 2 and Version 3 constructs have been retained unchanged in DWARF Version 4.
The DWARF Debugging Information Format Committee is open to compiler and debugger
developers who have experience with source language debugging and debugging formats, and
have an interest in promoting or extending the DWARF debugging format.
Page xiii
Concurrent Computer
Intel
CodeSourcery
IBM
Google
TotalView
Eager Consulting
IBM
Hewlett-Packard
ARM
Hewlett-Packard
IBM
Apple
Intel
Hewlett-Packard
Sun Microsystems
Hewlett-Packard
TotalView
IBM
For further information about DWARF or the DWARF Committee, see http://www.dwarfstd.org.
This document is intended to be usable in online as well as traditional paper forms. In the online
form, blue text is used to indicate hyperlinks which facilitate moving around in the document in
a manner like that typically found in web browsers. Most hyperlinks link to the definition of a
term or construct, or to a cited Section or Figure. However, attributes in particular are often used
in more than one way or context so that there is no single definition; for attributes, hyperlinks
link to the introductory list of all attributes which in turn contains hyperlinks for the multiple
usages. The Table of Contents also provides hyperlinks to the respective sections.
In the traditional paper form, the appearance of the hyperlinks on a page of paper does not
distract the eye because the blue hyperlinks are typically imaged by black and white printers in a
manner nearly indistinguishable from other text. (Hyperlinks are not underlined for this same
reason.) Page numbers, a Table of Contents, a List of Figures and an Index are included in both
online and paper forms.
Page xiv
1 INTRODUCTION
This document defines a format for describing programs to facilitate user source level
debugging. This description can be generated by compilers, assemblers and linkage editors. It
can be used by debuggers and other tools. The debugging information format does not favor the
design of any compiler or debugger. Instead, the goal is to create a method of communicating an
accurate picture of the source program to any debugger in a form that is extensible to different
languages while retaining compatibility.
The design of the debugging information format is open-ended, allowing for the addition of new
debugging information to accommodate new languages or debugger capabilities while remaining
compatible with other languages or different debuggers.
1.2 Overview
There are two major pieces to the description of the DWARF format in this document. The first
piece is the informational content of the debugging entries. The second piece is the way the
debugging information is encoded and represented in an object file.
Page 1
Page 2
Page 3
Page 4
Page 5
Page 6
2 GENERAL DESCRIPTION
2.1 The Debugging Information Entry (DIE)
DWARF uses a series of debugging information entries (DIEs) to define a low-level
representation of a source program. Each debugging information entry consists of an identifying
tag and a series of attributes. An entry, or group of entries together, provide a description of a
corresponding entity in the source program. The tag specifies the class to which an entry belongs
and the attributes define the specific characteristics of the entry.
The set of tag names is listed in Figure 1. The debugging information entries they identify are
described in Sections 3, 4 and 5.
The debugging information entry descriptions in Sections 3, 4 and 5 generally include mention of
most, but not necessarily all, of the attributes that are normally or possibly used with the entry.
Some attributes, whose applicability tends to be pervasive and invariant across many kinds of
debugging information entries, are described in this section and not necessarily mentioned in all
contexts where they may be appropriate. Examples include DW_AT_artificial, the declaration
coordinates, and DW_AT_description, among others.
The debugging information entries are contained in the .debug_info and .debug_types
sections of an object file.
Page 7
DW_TAG_access_declaration
DW_TAG_namespace
DW_TAG_array_type
DW_TAG_packed_type
DW_TAG_base_type
DW_TAG_partial_unit
DW_TAG_catch_block
DW_TAG_pointer_type
DW_TAG_class_type
DW_TAG_ptr_to_member_type
DW_TAG_common_block
DW_TAG_reference_type
DW_TAG_common_inclusion
DW_TAG_restrict_type
DW_TAG_compile_unit
DW_TAG_rvalue_reference_type
DW_TAG_condition
DW_TAG_set_type
DW_TAG_const_type
DW_TAG_shared_type
DW_TAG_constant
DW_TAG_string_type
DW_TAG_dwarf_procedure
DW_TAG_structure_type
DW_TAG_entry_point
DW_TAG_subprogram
DW_TAG_enumeration_type
DW_TAG_subrange_type
DW_TAG_enumerator
DW_TAG_subroutine_type
DW_TAG_file_type
DW_TAG_template_alias
DW_TAG_formal_parameter
DW_TAG_template_type_parameter
DW_TAG_friend
DW_TAG_template_value_parameter
DW_TAG_imported_declaration
DW_TAG_thrown_type
DW_TAG_imported_module
DW_TAG_try_block
DW_TAG_imported_unit
DW_TAG_typedef
DW_TAG_inheritance
DW_TAG_type_unit
DW_TAG_inlined_subroutine
DW_TAG_union_type
DW_TAG_interface_type
DW_TAG_unspecified_parameters
DW_TAG_label
DW_TAG_unspecified_type
DW_TAG_lexical_block
DW_TAG_variable
DW_TAG_member
DW_TAG_variant
DW_TAG_module
DW_TAG_variant_part
DW_TAG_namelist
DW_TAG_volatile_type
DW_TAG_namelist_item
DW_TAG_with_stmt
Page 8
Identifies or Specifies
DW_AT_abstract_origin
DW_AT_accessibility
DW_AT_address_class
DW_AT_allocated
DW_AT_artificial
DW_AT_associated
DW_AT_base_types
DW_AT_binary_scale
DW_AT_bit_offset
DW_AT_bit_size
DW_AT_bit_stride
DW_AT_byte_size
DW_AT_byte_stride
DW_AT_call_column
DW_AT_call_file
Page 9
Attribute
Identifies or Specifies
DW_AT_call_line
DW_AT_calling_convention
DW_AT_common_reference
DW_AT_comp_dir
Compilation directory
DW_AT_const_value
Constant object
Enumeration literal value
Template value parameter
DW_AT_const_expr
DW_AT_containing_type
DW_AT_count
DW_AT_data_bit_offset
DW_AT_data_location
DW_AT_data_member_location
DW_AT_decimal_scale
DW_AT_decimal_sign
DW_AT_decl_column
DW_AT_decl_file
DW_AT_decl_line
DW_AT_declaration
DW_AT_default_value
DW_AT_description
Page 10
Attribute
Identifies or Specifies
DW_AT_digit_count
DW_AT_discr
DW_AT_discr_list
DW_AT_discr_value
Discriminant value
DW_AT_elemental
DW_AT_encoding
DW_AT_endianity
Endianity of data
DW_AT_entry_pc
DW_AT_enum_class
DW_AT_explicit
DW_AT_extension
DW_AT_external
External subroutine
External variable
DW_AT_frame_base
DW_AT_friend
Friend relationship
DW_AT_high_pc
DW_AT_identifier_case
DW_AT_import
Imported declaration
Imported unit
Namespace alias
Namespace using declaration
Namespace using directive
Page 11
Attribute
Identifies or Specifies
DW_AT_inline
Abstract instance
Inlined subroutine
DW_AT_is_optional
Optional parameter
DW_AT_language
Programming language
DW_AT_linkage_name
DW_AT_location
DW_AT_low_pc
DW_AT_lower_bound
DW_AT_macro_info
DW_AT_main_subprogram
DW_AT_mutable
DW_AT_name
Name of declaration
Path name of compilation source
DW_AT_namelist_item
Namelist item
DW_AT_object_pointer
DW_AT_ordering
DW_AT_picture_string
DW_AT_priority
Module priority
DW_AT_producer
Compiler identification
DW_AT_prototyped
Subroutine prototype
DW_AT_pure
DW_AT_ranges
Page 12
Attribute
Identifies or Specifies
DW_AT_recursive
DW_AT_return_addr
DW_AT_segment
Addressing information
DW_AT_sibling
DW_AT_small
DW_AT_signature
Type signature
DW_AT_specification
DW_AT_start_scope
Object declaration
Type declaration
DW_AT_static_link
DW_AT_stmt_list
DW_AT_string_length
DW_AT_threads_scaled
DW_AT_trampoline
Target subroutine
DW_AT_type
Type of declaration
Type of subroutine return
DW_AT_upper_bound
DW_AT_use_location
DW_AT_use_UTF8
DW_AT_variable_parameter
DW_AT_virtuality
Virtuality indication
Virtuality of base class
Virtuality of function
Page 13
Attribute
Identifies or Specifies
DW_AT_visibility
Visibility of declaration
DW_AT_vtable_elem_location
Page 14
Attribute
Class
address
block
constant
One, two, four or eight bytes of uninterpreted data, or data encoded in the variable
length format known as LEB128 (see Section 7.6.).
Most constant values are integers of one kind or another (codes, offsets, counts,
and so on); these are sometimes called integer constants for emphasis.
exprloc
flag
lineptr
Refers to a location in the DWARF section that holds line number information.
loclistptr
Refers to a location in the DWARF section that holds location lists, which
describe objects whose location can change during their lifetime.
macptr
rangelistptr
reference
Refers to one of the debugging information entries that describe the program.
There are three types of reference. The first is an offset relative to the beginning
of the compilation unit in which the reference occurs and must refer to an entry
within that same compilation unit. The second type of reference is the offset of a
debugging information entry in any compilation unit, including one different from
the unit containing the reference. The third type of reference is an indirect
reference to a type definition using a 64-bit signature for that type.
string
Page 15
Page 16
The following operations all push a value onto the DWARF stack. If the value of a constant in
one of these operations is larger than can be stored in a single stack element, the value is
truncated to the element size and the low-order bits are pushed on the stack.
1. DW_OP_lit0, DW_OP_lit1, ..., DW_OP_lit31
The DW_OP_litn operations encode the unsigned literal values from 0 through 31, inclusive.
2. DW_OP_addr
The DW_OP_addr operation has a single operand that encodes a machine address and whose
size is the size of an address on the target machine.
3. DW_OP_const1u, DW_OP_const2u, DW_OP_const4u, DW_OP_const8u
The single operand of a DW_OP_constnu operation provides a 1, 2, 4, or 8-byte unsigned
integer constant, respectively.
Page 17
The following operations push a value onto the stack that is the result of adding the contents of a
register to a given signed offset.
1. DW_OP_fbreg
The DW_OP_fbreg operation provides a signed LEB128 offset from the address specified by
the location description in the DW_AT_frame_base attribute of the current function. (This is
typically a stack pointer register plus or minus some offset. On more sophisticated systems
it might be a location list that adjusts the offset according to changes in the stack pointer as
the PC changes.)
2. DW_OP_breg0, DW_OP_breg1, ..., DW_OP_breg31
The single operand of the DW_OP_bregn operations provides a signed LEB128 offset from
the specified register.
3. DW_OP_bregx
The DW_OP_bregx operation has two operands: a register which is specified by an unsigned
LEB128 number, followed by a signed LEB128 offset.
2.5.1.3 Stack Operations
The following operations manipulate the DWARF stack. Operations that index the stack assume
that the top of the stack (most recently added entry) has index 0.
1. DW_OP_dup
The DW_OP_dup operation duplicates the value at the top of the stack.
2. DW_OP_drop
The DW_OP_drop operation pops the value at the top of the stack.
Page 18
Page 19
Page 20
The following provide arithmetic and logical operations. Except as otherwise specified, the
arithmetic operations perfom addressing arithmetic, that is, unsigned arithmetic that is performed
modulo one plus the largest representable address (for example, 0x100000000 when the size of
an address is 32 bits). Such operations do not cause an exception on overflow.
1. DW_OP_abs
The DW_OP_abs operation pops the top stack entry, interprets it as a signed value and
pushes its absolute value. If the absolute value cannot be represented, the result is undefined.
2. DW_OP_and
The DW_OP_and operation pops the top two stack values, performs a bitwise and operation
on the two, and pushes the result.
3. DW_OP_div
The DW_OP_div operation pops the top two stack values, divides the former second entry by
the former top of the stack using signed division, and pushes the result.
4. DW_OP_minus
The DW_OP_minus operation pops the top two stack values, subtracts the former top of the
stack from the former second entry, and pushes the result.
5. DW_OP_mod
The DW_OP_mod operation pops the top two stack values and pushes the result of the
calculation: former second stack entry modulo the former top of the stack.
6. DW_OP_mul
The DW_OP_mul operation pops the top two stack entries, multiplies them together, and
pushes the result.
Page 21
Page 22
The following operations provide simple control of the flow of a DWARF expression.
1. DW_OP_le, DW_OP_ge, DW_OP_eq, DW_OP_lt, DW_OP_gt, DW_OP_ne
The six relational operators each:
pop the top two stack values,
compare the operands:
<former second entry> <relational operator> <former top entry>
push the constant value 1 onto the stack if the result of the operation is true or the
constant value 0 if the result of the operation is false.
Comparisons are performed as signed operations. The six operators are DW_OP_le (less than
or equal to), DW_OP_ge (greater than or equal to), DW_OP_eq (equal to), DW_OP_lt (less
than), DW_OP_gt (greater than) and DW_OP_ne (not equal to).
2. DW_OP_skip
DW_OP_skip is an unconditional branch. Its single operand is a 2-byte signed integer
constant. The 2-byte constant is the number of bytes of the DWARF expression to skip
forward or backward from the current operation, beginning after the 2-byte constant.
3. DW_OP_bra
DW_OP_bra is a conditional branch. Its single operand is a 2-byte signed integer constant.
This operation pops the top of stack. If the value popped is not the constant 0, the 2-byte
constant operand is the number of bytes of the DWARF expression to skip forward or
backward from the current operation, beginning after the 2-byte constant.
Page 23
Page 24
Operation
After
0
1
2
17
29
1000
DW_OP_dup
0
1
2
3
17
17
29
1000
0
1
2
17
29
1000
DW_OP_drop
0
1
29
1000
0
1
2
17
29
1000
DW_OP_pick 2
0
1
2
3
1000
17
29
1000
0
1
2
17
29
1000
DW_OP_over
0
1
2
3
29
17
29
1000
0
1
2
17
29
1000
DW_OP_swap
0
1
2
29
17
1000
0
1
2
17
29
1000
DW_OP_rot
0
1
2
29
1000
17
Page 25
A simple location description consists of one contiguous piece or all of an object or value.
Page 26
A memory location description consists of a non-empty DWARF expression (see Section 2.5),
whose value is the address of a piece or all of an object or other entity in memory.
2.6.1.1.2
A register location description consists of a register name operation, which represents a piece or
all of an object located in a given register.
Register location descriptions describe an object (or a piece of an object) that resides in a
register, while the opcodes listed in Section 2.5.1.2 ("Register Based Addressing") are used to
describe an object (or a piece of an object) that is located in memory at an address that is
contained in a register (possibly offset by some constant). A register location description must
stand alone as the entire description of an object or a piece of an object.
The following DWARF operations can be used to name a register.
Note that the register number represents a DWARF specific mapping of numbers onto the actual
registers of a given architecture. The mapping should be chosen to gain optimal density and
should be shared by all users of a given architecture. It is recommended that this mapping be
defined by the ABI authoring committee for each architecture.
1. DW_OP_reg0, DW_OP_reg1, ..., DW_OP_reg31
The DW_OP_regn operations encode the names of up to 32 registers, numbered from 0
through 31, inclusive. The object addressed is in register n.
2. DW_OP_regx
The DW_OP_regx operation has a single unsigned LEB128 literal operand that encodes the
name of a register.
These operations name a register location. To fetch the contents of a register, it is necessary to
use one of the register based addressing operations, such as DW_OP_bregx (see Section
2.5.1.2).
2.6.1.1.3
An implicit location description represents a piece or all of an object which has no actual
location but whose contents are nonetheless either known or known to be undefined.
Page 27
A composite location description describes an object or value which may be contained in part of
a register or stored in more than one location. Each piece is described by a composition
operation, which does not compute a value nor store any result on the DWARF stack. There may
be one or more composition operations in a single composite location description. A series of
such operations describes the parts of a value in memory address order.
Each composition operation is immediately preceded by a simple location description which
describes the location where part of the resultant value is contained.
1. DW_OP_piece
The DW_OP_piece operation takes a single operand, which is an unsigned LEB128 number.
The number describes the size in bytes of the piece of the object referenced by the preceding
simple location description. If the piece is located in a register, but does not occupy the entire
register, the placement of the piece within that register is defined by the ABI.
Many compilers store a single variable in sets of registers, or store a variable partially in
memory and partially in registers. DW_OP_piece provides a way of describing how large a
part of a variable a particular DWARF location description refers to.
Page 28
Here are some examples of how DWARF operations are used to form location descriptions:
DW_OP_reg3
The value is in register 3.
DW_OP_regx 54
The value is in register 54.
DW_OP_addr 0x80d0045c
The value of a static variable is at machine address 0x80d0045c.
DW_OP_breg11 44
Add 44 to the value in register 11 to get the address of an automatic
variable instance.
DW_OP_fbreg -50
Given a DW_AT_frame_base value of DW_OP_breg31 64, this example
computes the address of a local variable that is -50 bytes from a
logical frame pointer that is computed by adding 64 to the current
stack pointer (register 31).
DW_OP_bregx 54 32 DW_OP_deref
A call-by-reference parameter whose address is in the word 32 bytes
from where register 54 points.
Page 29
Page 30
A location list entry (but not a base address selection or end of list entry) whose beginning
and ending addresses are equal has no effect because the size of the range covered by such
an entry is zero.
3. A single location description describing the location of the object over the range specified by
the beginning and end addresses.
The applicable base address of a location list entry is determined by the closest preceding base
address selection entry (see below) in the same location list. If there is no such selection entry,
then the applicable base address defaults to the base address of the compilation unit (see
Section 3.1.1).
In the case of a compilation unit where all of the machine code is contained in a single
contiguous section, no base address selection entry is needed.
Address ranges may overlap. When they do, they describe a situation in which an object exists
simultaneously in more than one place. If all of the address ranges in a given location list do not
collectively cover the entire range over which the object in question is defined, it is assumed that
the object is not available for the portion of the range that is not covered.
A base address selection entry consists of:
1. The value of the largest representable address offset (for example, 0xffffffff when the size of
an address is 32 bits).
2. An address, which defines the appropriate base address for use in interpreting the beginning
and ending address offsets of subsequent entries of the location list.
A base address selection entry affects only the list in which it is contained.
The end of any given location list is marked by an end of list entry, which consists of a 0 for the
beginning address offset and a 0 for the ending address offset. A location list containing only an
end of list entry describes an object that exists in the source code but not in the executable
program.
Neither a base address selection entry nor an end of list entry includes a location description.
A base address selection entry and an end of list entry for a location list are identical to a base
address selection entry and end of list entry, respectively, for a range list (see Section 2.17.3) in
interpretation and representation.
Page 31
Page 32
Page 33
Page 34
Value
DW_ADDR_none
DW_ADDR_near16
DW_ADDR_far16
DW_ADDR_huge16
DW_ADDR_near32
DW_ADDR_far32
0
1
2
3
4
5
Meaning
no class specified
16-bit offset, no segment
16-bit offset, 16-bit segment
16-bit offset, 16-bit segment
32-bit offset, no segment
32-bit offset, 16-bit segment
C scoping rules require that the value of the variable x passed to the function g is the value of the
global variable x rather than of the local version.
2.13.1 Non-Defining Declarations
A debugging information entry that represents a non-defining or otherwise incomplete
declaration of a program entity has a DW_AT_declaration attribute, which is a flag.
Page 35
Page 36
Page 37
Page 38
Page 39
Page 40
Page 41
Page 42
Page 43
Page 44
Meaning
DW_LANG_Ada83
ISO Ada:1983
DW_LANG_Ada95
ISO Ada:1995
DW_LANG_C
DW_LANG_C89
ISO C:1989
DW_LANG_C99
ISO C:1999
DW_LANG_C_plus_plus
ISO C++:1998
DW_LANG_Cobol74
ISO Cobol:1974
DW_LANG_Cobol85
ISO Cobol:1985
DW_LANG_D
DW_LANG_Fortran77
ISO FORTRAN 77
DW_LANG_Fortran90
ISO Fortran 90
Language Name
Meaning
DW_LANG_Fortran95
ISO Fortran 95
DW_LANG_Java
Java
DW_LANG_Modula2
ISO Modula-2:1996
DW_LANG_ObjC
Objective C
ISO Pascal:1983
DW_LANG_PLI
ANSI PL/I:1976
DW_LANG_Python
Python
DW_LANG_UPC
Unified Parallel C
Page 45
Page 47
Page 48
Page 49
Page 50
Page 51
the imported declaration entry for Q within module C refers directly to the variable declaration
entry for A in module A because there is no explicit representation for X in module B.
A similar situation arises for a C++ using declaration that imports an entity in terms of a
namespace alias. See Appendix D.3 for an example.
Page 52
A subroutine or function.
DW_TAG_inlined_subroutine
DW_TAG_entry_point
Page 53
Page 54
Page 55
Page 56
Page 57
Page 58
Name
Meaning
DW_INL_not_inlined
DW_INL_inlined
DW_INL_declared_not_inlined
DW_INL_declared_inlined
In C++, a function or a constructor declared with constexpr is implicitly declared inline. The
abstract inline instance (see below) is represented by a debugging information entry with the tag
DW_TAG_subprogram. Such an entry has a DW_AT_inline attribute whose value is
DW_INL_inlined.
3.3.8.1 Abstract Instances
Any debugging information entry that is owned (either directly or indirectly) by a debugging
information entry that contains the DW_AT_inline attribute is referred to as an abstract instance
entry. Any subroutine entry that contains a DW_AT_inline attribute whose value is other than
DW_INL_not_inlined is known as an abstract instance root. Any set of abstract instance
entries that are all children (either directly or indirectly) of some abstract instance root, together
with the root itself, is known as an abstract instance tree. However, in the case where an
abstract instance tree is nested within another abstract instance tree, the entries in the nested
abstract instance tree are not considered to be entries in the outer abstract instance tree.
Each abstract instance root is either part of a larger tree (which gives a context for the root) or
uses DW_AT_specification to refer to the declaration in context.
For example, in C++ the context might be a namespace declaration or a class declaration.
Abstract instance trees are defined so that no entry is part of more than one abstract instance
tree. This simplifies the following descriptions.
A debugging information entry that is a member of an abstract instance tree should not contain
any attributes which describe aspects of the subroutine which vary between distinct inlined
expansions or distinct out-of-line expansions. For example, the DW_AT_low_pc,
Page 59
Each inline expansion of a subroutine is represented by a debugging information entry with the
tag DW_TAG_inlined_subroutine. Each such entry should be a direct child of the entry that
represents the scope within which the inlining occurs.
Each inlined subroutine entry may have either a DW_AT_low_pc and DW_AT_high_pc pair of
attributes or a DW_AT_ranges attribute whose values encode the contiguous or non-contiguous
address ranges, respectively, of the machine instructions generated for the inlined subroutine (see
Section 2.17). An inlined subroutine entry may also contain a DW_AT_entry_pc attribute,
representing the first executable instruction of the inline expansion (see Section 2.18).
An inlined subroutine entry may also have DW_AT_call_file, DW_AT_call_line and
DW_AT_call_column attributes, each of whose value is an integer constant. These attributes
represent the source file, source line number, and source column number, respectively, of the
first character of the statement or expression that caused the inline expansion. The call file, call
line, and call column attributes are interpreted in the same way as the declaration file, declaration
line, and declaration column attributes, respectively (see Section 2.14).
The call file, call line and call column coordinates do not describe the coordinates of the
subroutine declaration that was inlined, rather they describe the coordinates of the call.
An inlined subroutine entry may have a DW_AT_const_expr attribute, which is a flag whose
presence indicates that the subroutine has been evaluated as a compile-time constant. Such an
entry may also have a DW_AT_const_value attribute, whose value may be of any form that is
appropriate for the representation of the subroutine's return value. The value of this attribute is
the actual return value of the subroutine, represented as it would be on the target architecture.
Page 60
Page 61
Under some conditions, compilers may need to generate concrete executable instances of inlined
subroutines other than at points where those subroutines are actually called. Such concrete
instances of inlined subroutines are referred to as concrete out-of-line instances.
In C++, for example, taking the address of a function declared to be inline can necessitate the
generation of a concrete out-of-line instance of the given function.
Page 62
Some languages and compilers may permit the logical nesting of a subroutine within another
subroutine, and may permit either the outer or the nested subroutine, or both, to be inlined.
For a non-inlined subroutine nested within an inlined subroutine, the nested subroutine is
described normally in both the abstract and concrete inlined instance trees for the outer
subroutine. All rules pertaining to the abstract and concrete instance trees for the outer
subroutine apply also to the abstract and concrete instance entries for the nested subroutine.
For an inlined subroutine nested within another inlined subroutine, the following rules apply to
their abstract and concrete instance trees:
1. The abstract instance tree for the nested subroutine is described within the abstract
instance tree for the outer subroutine according to the rules in Section 3.3.8.1, and
without regard to the fact that it is within an outer abstract instance tree.
2. Any abstract instance tree for a nested subroutine is always omitted within the concrete
instance tree for an outer subroutine.
3. A concrete instance tree for a nested subroutine is always omitted within the abstract
instance tree for an outer subroutine.
Page 63
Page 64
Page 65
Page 66
Page 67
Page 68
Page 69
Page 70
C scoping rules require that the value of the variable x assigned to the variable f in the
initialization sequence is the value of the global variable x, rather than the local x, because
the scope of the local variable x only starts after the full declarator for the local x.
Page 71
Meaning
Big-endian encoding
DW_END_little
Little-endian encoding
Figure 12. Endianity attribute values
These represent the default encoding formats as defined by the target architectures ABI or
processor definition. The exact definition of these formats may differ in subtle ways for
different architectures.
13. A DW_AT_const_expr attribute, which is a flag, if a variable entry represents a C++ object
declared with the constexpr specifier. This attributes indicates that the variable can be
evaluated as a compile-time constant.
In C++, a variable declared with constexpr is implicitly const. Such a variable has a
DW_AT_type attribute whose value is a reference to a debugging information entry
describing a const qualified type.
14. A DW_AT_linkage_name attribute for a variable or constant entry as described in Section
2.22.
Page 72
Page 73
Page 74
5 TYPE ENTRIES
This section presents the debugging information entries that describe program types: base types,
modified types and user-defined types.
If the scope of the declaration of a named type begins after the low pc value for the scope most
closely enclosing the declaration, the declaration may have a DW_AT_start_scope attribute as
described for objects in Section 4.1.
Page 75
Page 76
Name
Meaning
DW_ATE_address
DW_ATE_boolean
true or false
DW_ATE_complex_float
DW_ATE_float
DW_ATE_signed_char
signed character
DW_ATE_unsigned
DW_ATE_unsigned_char
unsigned character
numeric string
DW_ATE_edited
edited string
DW_ATE_signed_fixed
DW_ATE_UTF
Unicode character
Page 77
Page 78
Page 79
Name
DW_DS_unsigned
Meaning
Unsigned
DW_DS_trailing_separate
Page 80
Tag
Meaning
DW_TAG_const_type
DW_TAG_packed_type
DW_TAG_pointer_type
DW_TAG_reference_type
DW_TAG_restrict_type
DW_TAG_rvalue_reference_type
DW_TAG_shared_type
DW_TAG_volatile_type
Page 81
Page 82
Page 83
Page 84
Page 85
The two different structs can be described in different compilation units to facilitate DWARF
space compression (see Appendix E.1).
5.5.2 Interface Type Entries
The Java language defines "interface" types. An interface in Java is similar to a C++ or Java
class with only abstract methods and constant data members.
Interface types are represented by debugging information entries with the tag
DW_TAG_interface_type.
An interface type entry has a DW_AT_name attribute, whose value is a null-terminated string
containing the type name as it appears in the source program.
The members of an interface are represented by debugging information entries that are owned by
the interface type entry and that appear in the same order as the corresponding declarations in the
source program.
5.5.3 Derived or Extended Structs, Classes and Interfaces
In C++, a class (or struct) may be "derived from" or be a "subclass of" another class. In Java,
an interface may "extend" one or more other interfaces, and a class may "extend" another class
and/or "implement" one or more interfaces. All of these relationships may be described using the
following. Note that in Java, the distinction between extends and implements is implied by the
entities at the two ends of the relationship.
A class type or interface type entry that describes a derived, extended or implementing class or
interface owns debugging information entries describing each of the classes or interfaces it is
derived from, extending or implementing, respectively, ordered as they were in the source
program. Each such entry has the tag DW_TAG_inheritance.
An inheritance entry has a DW_AT_type attribute whose value is a reference to the debugging
information entry describing the class or interface from which the parent class or structure of the
inheritance entry is derived, extended or implementing.
An inheritance entry for a class that derives from or extends another class or struct also has a
DW_AT_data_member_location attribute, whose value describes the location of the beginning
Page 86
Page 87
The following diagrams show the structure layout and data bit offsets for example big- and littleendian architectures, respectively. Both diagrams show a structure that begins at address A and
whose size is four bytes. Also, high order bits are to the left and low order bits are to the right.
Page 89
A + 2
A + 3
A + 3
A + 2
A + 1
Note that data member bit offsets in this example are the same for both big- and little-endian
architectures even though the fields are allocated in different directions (high-order to low-order
versus low-order to high-order); the bit naming conventions for memory and/or registers of the
target architecture may or may not make this seem natural.
For a more extensive example showing nested and packed records and arrays, see Appendix
D.2.3.
Attribute DW_AT_data_bit_offset is new in DWARF Version 4 and is also used for base types
(see Section 5.1). It replaces the attributes DW_AT_bit_offset and DW_AT_byte_size when used
to identify the beginning of bit field data members as defined in DWARF V3 and earlier. The
earlier attributes are defined in a manner suitable for bit field members on big-endian
architectures but which is either awkward or incomplete for use on little-endian architectures.
(DW_AT_byte_size also has other uses that are not affected by this change.)
Page 90
Page 91
Page 92
Page 93
Page 94
DW_DSC_label
DW_DSC_range
Figure 17. Discriminant descriptor values
If a variant entry has neither a DW_AT_discr_value attribute nor a DW_AT_discr_list attribute,
or if it has a DW_AT_discr_list attribute with 0 size, the variant is a default variant.
The components selected by a particular variant are represented by debugging information
entries owned by the corresponding variant entry and appear in the same order as the
corresponding declarations in the source program.
Page 95
Page 96
Page 97
Page 98
The subrange entry may have the attributes DW_AT_lower_bound and DW_AT_upper_bound
to specify, respectively, the lower and upper bound values of the subrange. The
DW_AT_upper_bound attribute may be replaced by a DW_AT_count attribute, whose value
describes the number of elements in the subrange rather than the value of the last element. The
value of each of these attributes is determined as described in Section 2.19.
If the lower bound value is missing, the value is assumed to be a language-dependent default
constant. The default lower bound is 0 for C, C++, D, Java, Objective C, Objective C++, Python,
and UPC. The default lower bound is 1 for Ada, COBOL, Fortran, Modula-2, Pascal and PL/I.
No other default lower bound values are currently defined.
If the upper bound and count are missing, then the upper bound value is unknown.
Page 99
Page 100
Page 101
Page 102
Page 103
Page 104
Page 105
Page 106
Page 107
Page 108
line number program A series of byte-coded line number information instructions representing
one compilation unit.
basic block
sequence
Page 109
op_index
file
line
column
is_stmt
basic_block
end_sequence
A boolean indicating that the current address is that of the first byte after
the end of a sequence of target machine instructions. end_sequence
terminates a sequence of lines; therefore other information in the same
row is not meaningful.
prologue_end
A boolean indicating that the current address is one (of possibly many)
where execution should be suspended for an entry breakpoint of a
function.
epilogue_begin
A boolean indicating that the current address is one (of possibly many)
where execution should be suspended for an exit breakpoint of a function.
Page 110
isa
discriminator
At the beginning of each sequence within a line number program, the state of the registers is:
address
op_index
file
line
column
is_stmt
basic_block
end_sequence
prologue_end
epilogue_begin
isa
discriminator
0
0
1
1
0
false
false
false
false
0
0
The isa value 0 specifies that the instruction set is the architecturally determined default
instruction set. This may be fixed by the ABI, or it may be specified by other means, for example,
by the object file description.
6.2.3 Line Number Program Instructions
The state machine instructions in a line number program belong to one of three categories:
special opcodes
standard opcodes
These have a ubyte opcode field which may be followed by zero or more
LEB128 operands (except for DW_LNS_fixed_advance_pc, see below).
The opcode implies the number of operands and their meanings, but the
line number program header also specifies the number of operands for
each standard opcode.
Page 111
These have a multiple byte format. The first byte is zero; the next bytes
are an unsigned LEB128 integer giving the number of bytes in the
instruction itself (does not include the first zero byte or the size). The
remaining bytes are the instruction itself (which begins with a ubyte
extended opcode).
Page 112
Page 113
Page 114
Page 115
Each ubyte special opcode has the following effect on the state machine:
1. Add a signed integer to the line register.
2. Modify the operation pointer by incrementing the address and op_index registers as
described below.
3. Append a row to the matrix using the current values of the state machine registers.
4. Set the basic_block register to false.
5. Set the prologue_end register to false.
6. Set the epilogue_begin register to false.
7. Set the discriminator register to 0.
All of the special opcodes do those same seven things; they differ from one another only in what
values they add to the line, address and op_index registers.
Instead of assigning a fixed meaning to each special opcode, the line number program uses
several parameters in the header to configure the instruction set. There are two reasons for this.
First, although the opcode space available for special opcodes now ranges from 13 through 255,
the lower bound may increase if one adds new standard opcodes. Thus, the opcode_base field of
the line number program header gives the value of the first special opcode. Second, the best
choice of special-opcode meanings depends on the target architecture. For example, for a RISC
machine where the compiler-generated code interleaves instructions from different lines to
schedule the pipeline, it is important to be able to add a negative value to the line register to
express the fact that a later instruction may have been emitted for an earlier source line. For a
machine where pipeline scheduling never occurs, it is advantageous to trade away the ability to
decrease the line register (a standard opcode provides an alternate way to decrease the line
number) in return for the ability to add larger positive values to the address register. To permit
this variety of strategies, the line number program header defines a line_base field that
specifies the minimum value which a special opcode can add to the line register and a
line_range field that defines the range of values it can add to the line register.
Page 116
If the resulting opcode is greater than 255, a standard opcode must be used instead.
When maximum_operations_per_instruction is 1, the operation advance is simply the
address increment divided by the minimum_instruction_length.
To decode a special opcode, subtract the opcode_base from the opcode itself to give the
adjusted opcode. The operation advance is the result of the adjusted opcode divided by the
line_range. The new address and op_index values are given by
adjusted opcode = opcode opcode_base
operation advance = adjusted opcode / line_range
new address =
address +
minimum_instruction_length *
((op_index + operation advance)/maximum_operations_per_instruction)
new op_index =
(op_index + operation advance) % maximum_operations_per_instruction
Page 117
Operation
Advance
--------0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Line advance
\
\ -3 -2 -1
0
1
2
3
4
5
6
7
8
----------------------------------------------13 14 15 16 17 18 19 20 21 22 23 24
25 26 27 28 29 30 31 32 33 34 35 36
37 38 39 40 41 42 43 44 45 46 47 48
49 50 51 52 53 54 55 56 57 58 59 60
61 62 63 64 65 66 67 68 69 70 71 72
73 74 75 76 77 78 79 80 81 82 83 84
85 86 87 88 89 90 91 92 93 94 95 96
97 98 99 100 101 102 103 104 105 106 107 108
109 110 111 112 113 114 115 116 117 118 119 120
121 122 123 124 125 126 127 128 129 130 131 132
133 134 135 136 137 138 139 140 141 142 143 144
145 146 147 148 149 150 151 152 153 154 155 156
157 158 159 160 161 162 163 164 165 166 167 168
169 170 171 172 173 174 175 176 177 178 179 180
181 182 183 184 185 186 187 188 189 190 191 192
193 194 195 196 197 198 199 200 201 202 203 204
205 206 207 208 209 210 211 212 213 214 215 216
217 218 219 220 221 222 223 224 225 226 227 228
229 230 231 232 233 234 235 236 237 238 239 240
241 242 243 244 245 246 247 248 249 250 251 252
253 254 255
Page 118
The standard opcodes, their applicable operands and the actions performed by these opcodes are
as follows:
1. DW_LNS_copy
The DW_LNS_copy opcode takes no operands. It appends a row to the matrix using the
current values of the state machine registers. Then it sets the discriminator register to 0,
and sets the basic_block, prologue_end and epilogue_begin registers to false.
2. DW_LNS_advance_pc
The DW_LNS_advance_pc opcode takes a single unsigned LEB128 operand as the operation
advance and modifies the address and op_index registers as specified in Section 6.2.5.1.
3. DW_LNS_advance_line
The DW_LNS_advance_line opcode takes a single signed LEB128 operand and adds that
value to the line register of the state machine.
4. DW_LNS_set_file
The DW_LNS_set_file opcode takes a single unsigned LEB128 operand and stores it in the
file register of the state machine.
5. DW_LNS_set_column
The DW_LNS_set_column opcode takes a single unsigned LEB128 operand and stores it in
the column register of the state machine.
6. DW_LNS_negate_stmt
The DW_LNS_negate_stmt opcode takes no operands. It sets the is_stmt register of the
state machine to the logical negation of its current value.
7. DW_LNS_set_basic_block
The DW_LNS_set_basic_block opcode takes no operands. It sets the basic_block register
of the state machine to true.
Page 119
Page 120
Page 121
Page 122
A macro definition.
DW_MACINFO_undef
A macro undefinition.
DW_MACINFO_start_file
DW_MACINFO_end_file
DW_MACINFO_vendor_ext
All DW_MACINFO_define and DW_MACINFO_undef entries have two operands. The first
operand encodes the line number of the source line on which the relevant defining or undefining
macro directives appeared.
The second operand consists of a null-terminated character string. In the case of a
DW_MACINFO_undef entry, the value of this string will be simply the name of the preprocessor symbol that was undefined at the indicated source line.
Page 123
Each DW_MACINFO_start_file entry also has two operands. The first operand encodes the line
number of the source line on which the inclusion macro directive occurred.
The second operand encodes a source file name index. This index corresponds to a file number
in the line number information table for the relevant compilation unit. This index indicates
(indirectly) the name of the file that is being included by the inclusion directive on the indicated
source line.
6.3.1.3 End File Entries
A DW_MACINFO_end_file entry has no operands. The presence of the entry marks the end of
the current source file inclusion.
6.3.1.4 Vendor Extension Entries
A DW_MACINFO_vendor_ext entry has two operands. The first is a constant. The second is a
null-terminated character string. The meaning and/or significance of these operands is
intentionally left undefined by this specification.
A consumer must be able to totally ignore all DW_MACINFO_vendor_ext entries that it does not
understand (see Section 7.1).
Page 124
Page 125
Page 126
The first column indicates an address for every location that contains code in a program. (In
shared objects, this is an object-relative offset.) The remaining columns contain virtual
unwinding rules that are associated with the indicated location.
The CFA column defines the rule which computes the Canonical Frame Address value; it may be
either a register and a signed offset that are added together, or a DWARF expression that is
evaluated.
Page 127
A register that has this rule has no recoverable value in the previous frame.
(By convention, it is not preserved by a callee.)
same value
This register has not been modified from the previous frame. (By convention,
it is preserved by the callee, but the callee has not modified it.)
offset(N)
The previous value of this register is saved at the address CFA+N where CFA
is the current CFA value and N is a signed offset.
val_offset(N)
The previous value of this register is the value CFA+N where CFA is the
current CFA value and N is a signed offset.
register(R)
expression(E)
val_expression(E) The previous value of this register is the value produced by executing the
DWARF expression E.
architectural
This table would be extremely large if actually constructed as described. Most of the entries at
any point in the table are identical to the ones above them. The whole table can be represented
quite compactly by recording just the differences starting at the beginning address of each
subroutine in the program.
The virtual unwind information is encoded in a self-contained section called .debug_frame.
Entries in a .debug_frame section are aligned on a multiple of the address size relative to the
start of the section and come in two forms: a Common Information Entry (CIE) and a Frame
Description Entry (FDE).
If the range of code addresses for a function is not contiguous, there may be multiple CIEs and
FDEs corresponding to the parts of that function.
Page 128
The size of a target address in this CIE and any FDEs that use it, in bytes. If a compilation
unit exists for this frame, its address size must match the address size here.
6. segment_size (ubyte)
Page 129
Page 130
Page 131
1. DW_CFA_set_loc
The DW_CFA_set_loc instruction takes a single operand that represents a target address. The
required action is to create a new table row using the specified address as the location. All
other values in the new row are initially identical to the current row. The new location value
is always greater than the current one. If the segment_size field of this FDE's CIE is nonzero, the initial location is preceded by a segment selector of the given length.
2. DW_CFA_advance_loc
The DW_CFA_advance instruction takes a single operand (encoded with the opcode) that
represents a constant delta. The required action is to create a new table row with a location
value that is computed by taking the current entrys location value and adding the value of
delta * code_alignment_factor. All other values in the new row are initially identical
to the current row.
3. DW_CFA_advance_loc1
The DW_CFA_advance_loc1 instruction takes a single ubyte operand that represents a
constant delta. This instruction is identical to DW_CFA_advance_loc except for the encoding
and size of the delta operand.
4. DW_CFA_advance_loc2
The DW_CFA_advance_loc2 instruction takes a single uhalf operand that represents a
constant delta. This instruction is identical to DW_CFA_advance_loc except for the encoding
and size of the delta operand.
5. DW_CFA_advance_loc4
The DW_CFA_advance_loc4 instruction takes a single uword operand that represents a
constant delta. This instruction is identical to DW_CFA_advance_loc except for the encoding
and size of the delta operand.
6.4.2.2 CFA Definition Instructions
1. DW_CFA_def_cfa
The DW_CFA_def_cfa instruction takes two unsigned LEB128 operands representing a
register number and a (non-factored) offset. The required action is to define the current CFA
rule to use the provided register and offset.
Page 132
Page 133
1. DW_CFA_undefined
The DW_CFA_undefined instruction takes a single unsigned LEB128 operand that
represents a register number. The required action is to set the rule for the specified register to
undefined.
2. DW_CFA_same_value
The DW_CFA_same_value instruction takes a single unsigned LEB128 operand that
represents a register number. The required action is to set the rule for the specified register to
same value.
3. DW_CFA_offset
The DW_CFA_offset instruction takes two operands: a register number (encoded with the
opcode) and an unsigned LEB128 constant representing a factored offset. The required action
is to change the rule for the register indicated by the register number to be an offset(N) rule
where the value of N is factored offset * data_alignment_factor.
4. DW_CFA_offset_extended
The DW_CFA_offset_extended instruction takes two unsigned LEB128 operands
representing a register number and a factored offset. This instruction is identical to
DW_CFA_offset except for the encoding and size of the register operand.
5. DW_CFA_offset_extended_sf
The DW_CFA_offset_extended_sf instruction takes two operands: an unsigned LEB128
value representing a register number and a signed LEB128 factored offset. This instruction is
identical to DW_CFA_offset_extended except that the second operand is signed and
factored. The resulting offset is factored_offset * data_alignment_factor.
6. DW_CFA_val_offset
The DW_CFA_val_offset instruction takes two unsigned LEB128 operands representing a
register number and a factored offset. The required action is to change the rule for the
register indicated by the register number to be a val_offset(N) rule where the value of N is
factored_offset * data_alignment_factor.
Page 134
Page 135
The next two instructions provide the ability to stack and retrieve complete register states. They
may be useful, for example, for a compiler that moves epilogue code into the body of a function.
1. DW_CFA_remember_state
The DW_CFA_remember_state instruction takes no operands. The required action is to push
the set of rules for every register onto an implicit stack.
2. DW_CFA_restore_state
The DW_CFA_restore_state instruction takes no operands. The required action is to pop the
set of rules off the implicit stack and place them in the current row.
6.4.2.5 Padding Instruction
1. DW_CFA_nop
The DW_CFA_nop instruction has no operands and no required actions. It is used as padding
to make a CIE or FDE an appropriate size.
6.4.3 Call Frame Instruction Usage
To determine the virtual unwind rule set for a given location (L1), one searches through the FDE
headers looking at the initial_location and address_range values to see if L1 is contained
in the FDE. If so, then:
1. Initialize a register set by reading the initial_instructions field of the associated CIE.
2. Read and process the FDEs instruction sequence until a DW_CFA_advance_loc,
DW_CFA_set_loc, or the end of the instruction stream is encountered.
Page 136
Page 137
Page 138
7 DATA REPRESENTATION
This section describes the binary representation of the debugging information entry itself, of the
attribute types and of other fundamental elements described above.
Page 139
Page 140
Name
.debug_aranges
.debug_frame/CIE
.debug_frame/FDE
.debug_info
.debug_line
.debug_pubnames
debug_info_offset
CIE_id
CIE_pointer
debug_abbrev_offset
header_length
debug_info_offset
debug_info_length
.debug_pubtypes
debug_info_offset
debug_info_length
.debug_types
debug_abbrev_offset
type_offset
Role
offset in .debug_info
CIE distinguished value
offset in .debug_frame
offset in .debug_abbrev
length of header itself
offset in .debug_info
length of .debug_info
contribution
offset in .debug_info
length of .debug_info
contribution
offset in .debug_abbrev
offset in .debug_types
The CIE_id field in a CIE structure must be 64 bits because it overlays the CIE_pointer
in a FDE structure; this implicit union must be accessed to distinguish whether a CIE or
FDE is present, consequently, these two fields must exactly overlay each other (both
offset and size).
Page 141
Role
DW_FORM_ref_addr
DW_FORM_sec_offset
DW_FORM_strp
DW_OP_call_ref
offset in .debug_info
offset in a section other than .debug_info or .debug_str
offset in .debug_str
offset in .debug_info
4. Within the body of the .debug_pubnames and .debug_pubtypes sections, the representation
of the first field of each tuple (which represents an offset in the .debug_info section)
depends on the DWARF format as follows: in the 32-bit DWARF format, this field is a 32bit unsigned integer; in the 64-bit DWARF format, it is a 64-bit unsigned integer.
The 32-bit and 64-bit DWARF format conventions must not be intermixed within a single
compilation unit.
Attribute values and section header fields that represent addresses in the target program are not
affected by these rules.
A DWARF consumer that supports the 64-bit DWARF format must support executables in
which some compilation units use the 32-bit format and others use the 64-bit format provided
that the combination links correctly (that is, provided that there are no link-time errors due to
truncation or overflow). (An implementation is not required to guarantee detection and reporting
of all such errors.)
It is expected that DWARF producing compilers will not use the 64-bit format by default. In most
cases, the division of even very large applications into a number of executable and shared
objects will suffice to assure that the DWARF sections within each individual linked object are
less than 4 GBytes in size. However, for those cases where needed, the 64-bit format allows the
unusual case to be handled as well. Even in this case, it is expected that only application
supplied objects will need to be compiled using the 64-bit format; separate 32-bit format
versions of system supplied shared executable libraries can still be used.
Page 142
The header for the series of debugging information entries contributed by a single normal or
partial compilation unit, within the .debug_info section, consists of the following information:
1. unit_length (initial length)
A 4-byte or 12-byte unsigned integer representing the length of the .debug_info
contribution for that compilation unit, not including the length field itself. In the 32-bit
DWARF format, this is a 4-byte unsigned integer (which must be less than 0xfffffff0); in
the 64-bit DWARF format, this consists of the 4-byte value 0xffffffff followed by an 8byte unsigned integer that gives the actual length (see Section 7.4).
2. version (uhalf)
A 2-byte unsigned integer representing the version of the DWARF information for the
compilation unit (see Appendix F). The value in this field is 4.
Page 143
The header for the series of debugging information entries contributing to the description of a
type that has been placed in its own type unit, within the .debug_types section, consists of the
following information:
1. unit_length (initial length)
A 4-byte or 12-byte unsigned integer representing the length of the .debug_types
contribution for that compilation unit, not including the length field itself. In the 32-bit
DWARF format, this is a 4-byte unsigned integer (which must be less than 0xfffffff0); in
the 64-bit DWARF format, this consists of the 4-byte value 0xffffffff followed by an 8byte unsigned integer that gives the actual length (see Section 7.4).
2. version (uhalf)
A 2-byte unsigned integer representing the version of the DWARF information for the
compilation unit (see Appendix F). The value in this field is 4.
3. debug_abbrev_offset (section offset)
A 4-byte or 8-byte unsigned offset into the .debug_abbrev section. This offset associates the
compilation unit with a particular set of debugging information entry abbreviations. In the
32-bit DWARF format, this is a 4-byte unsigned length; in the 64-bit DWARF format, this is
an 8-byte unsigned length (see Section 7.4).
4. address_size (ubyte)
A 1-byte unsigned integer representing the size in bytes of an address on the target
architecture. If the system uses segmented addressing, this value represents the size of the
offset portion of an address.
Page 144
Page 145
Page 146
Page 147
Page 148
Page 149
Page 150
Value
DW_TAG_array_type
0x01
DW_TAG_class_type
0x02
DW_TAG_entry_point
0x03
DW_TAG_enumeration_type
0x04
DW_TAG_formal_parameter
0x05
DW_TAG_imported_declaration
0x08
DW_TAG_label
0x0a
DW_TAG_lexical_block
0x0b
DW_TAG_member
0x0d
DW_TAG_pointer_type
0x0f
DW_TAG_reference_type
0x10
DW_TAG_compile_unit
0x11
DW_TAG_string_type
0x12
DW_TAG_structure_type
0x13
DW_TAG_subroutine_type
0x15
DW_TAG_typedef
0x16
Page 151
Tag name
Page 152
Value
DW_TAG_union_type
0x17
DW_TAG_unspecified_parameters
0x18
DW_TAG_variant
0x19
DW_TAG_common_block
0x1a
DW_TAG_common_inclusion
0x1b
DW_TAG_inheritance
0x1c
DW_TAG_inlined_subroutine
0x1d
DW_TAG_module
0x1e
DW_TAG_ptr_to_member_type
0x1f
DW_TAG_set_type
0x20
DW_TAG_subrange_type
0x21
DW_TAG_with_stmt
0x22
DW_TAG_access_declaration
0x23
DW_TAG_base_type
0x24
DW_TAG_catch_block
0x25
DW_TAG_const_type
0x26
DW_TAG_constant
0x27
DW_TAG_enumerator
0x28
DW_TAG_file_type
0x29
DW_TAG_friend
0x2a
Tag name
Value
DW_TAG_namelist
0x2b
DW_TAG_namelist_item
0x2c
DW_TAG_packed_type
0x2d
DW_TAG_subprogram
0x2e
DW_TAG_template_type_parameter
0x2f
DW_TAG_template_value_parameter
0x30
DW_TAG_thrown_type
0x31
DW_TAG_try_block
0x32
DW_TAG_variant_part
0x33
DW_TAG_variable
0x34
DW_TAG_volatile_type
0x35
DW_TAG_dwarf_procedure
0x36
DW_TAG_restrict_type
0x37
DW_TAG_interface_type
0x38
DW_TAG_namespace
0x39
DW_TAG_imported_module
0x3a
DW_TAG_unspecified_type
0x3b
DW_TAG_partial_unit
0x3c
DW_TAG_imported_unit
0x3d
DW_TAG_condition
0x3f
Page 153
Tag name
Value
DW_TAG_shared_type
0x40
DW_TAG_type_unit
0x41
DW_TAG_rvalue_reference_type
0x42
DW_TAG_template_alias
0x43
DW_TAG_lo_user
0x4080
DW_TAG_hi_user
0xffff
Value
DW_CHILDREN_no
0x00
DW_CHILDREN_yes
0x01
Page 154
Value
Classes
DW_AT_sibling
0x01
reference
DW_AT_location
0x02
exprloc, loclistptr
DW_AT_name
0x03
string
DW_AT_ordering
0x09
constant
DW_AT_byte_size
0x0b
DW_AT_bit_offset
0x0c
DW_AT_bit_size
0x0d
DW_AT_stmt_list
0x10
lineptr
DW_AT_low_pc
0x11
address
DW_AT_high_pc
0x12
address, constant
DW_AT_language
0x13
constant
DW_AT_discr
0x15
reference
DW_AT_discr_value
0x16
constant
DW_AT_visibility
0x17
constant
DW_AT_import
0x18
reference
DW_AT_string_length
0x19
exprloc, loclistptr
DW_AT_common_reference
0x1a
reference
DW_AT_comp_dir
0x1b
string
DW_AT_const_value
0x1c
Page 155
Attribute name
Page 156
Value
Classes
DW_AT_containing_type
0x1d
reference
DW_AT_default_value
0x1e
reference
DW_AT_inline
0x20
constant
DW_AT_is_optional
0x21
flag
DW_AT_lower_bound
0x22
DW_AT_producer
0x25
string
DW_AT_prototyped
0x27
flag
DW_AT_return_addr
0x2a
exprloc, loclistptr
DW_AT_start_scope
0x2c
Constant, rangelistptr
DW_AT_bit_stride
0x2e
DW_AT_upper_bound
0x2f
DW_AT_abstract_origin
0x31
reference
DW_AT_accessibility
0x32
constant
DW_AT_address_class
0x33
constant
DW_AT_artificial
0x34
flag
DW_AT_base_types
0x35
reference
DW_AT_calling_convention
0x36
constant
DW_AT_count
0x37
DW_AT_data_member_location
0x38
DW_AT_decl_column
0x39
constant
Attribute name
Value
Classes
DW_AT_decl_file
0x3a
constant
DW_AT_decl_line
0x3b
constant
DW_AT_declaration
0x3c
flag
DW_AT_discr_list
0x3d
block
DW_AT_encoding
0x3e
constant
DW_AT_external
0x3f
flag
DW_AT_frame_base
0x40
exprloc, loclistptr
DW_AT_friend
0x41
reference
DW_AT_identifier_case
0x42
constant
DW_AT_macro_info
0x43
macptr
DW_AT_namelist_item
0x44
reference
DW_AT_priority
0x45
reference
DW_AT_segment
0x46
exprloc, loclistptr
DW_AT_specification
0x47
reference
DW_AT_static_link
0x48
exprloc, loclistptr
DW_AT_type
0x49
reference
DW_AT_use_location
0x4a
exprloc, loclistptr
DW_AT_variable_parameter
0x4b
flag
DW_AT_virtuality
0x4c
constant
DW_AT_vtable_elem_location
0x4d
exprloc, loclistptr
Page 157
Attribute name
Page 158
Value
Classes
DW_AT_allocated
0x4e
DW_AT_associated
0x4f
DW_AT_data_location
0x50
exprloc
DW_AT_byte_stride
0x51
DW_AT_entry_pc
0x52
address
DW_AT_use_UTF8
0x53
flag
DW_AT_extension
0x54
reference
DW_AT_ranges
0x55
rangelistptr
DW_AT_trampoline
0x56
DW_AT_call_column
0x57
constant
DW_AT_call_file
0x58
constant
DW_AT_call_line
0x59
constant
DW_AT_description
0x5a
string
DW_AT_binary_scale
0x5b
constant
DW_AT_decimal_scale
0x5c
constant
DW_AT_small
0x5d
reference
DW_AT_decimal_sign
0x5e
constant
DW_AT_digit_count
0x5f
constant
DW_AT_picture_string
0x60
string
DW_AT_mutable
0x61
flag
Attribute name
Value
Classes
DW_AT_threads_scaled
0x62
flag
DW_AT_explicit
0x63
flag
DW_AT_object_pointer
0x64
reference
DW_AT_endianity
0x65
constant
DW_AT_elemental
0x66
flag
DW_AT_pure
0x67
flag
DW_AT_recursive
0x68
flag
DW_AT_signature
0x69
reference
DW_AT_main_subprogram
0x6a
flag
DW_AT_data_bit_offset
0x6b
constant
DW_AT_const_expr
0x6c
flag
DW_AT_enum_class
0x6d
flag
DW_AT_linkage_name
0x6e
string
DW_AT_lo_user
0x2000 ---
DW_AT_hi_user
0x3fff
---
Page 159
Form name
Page 160
Value
DW_FORM_addr
0x01 address
DW_FORM_block2
0x03 block
DW_FORM_block4
0x04 block
DW_FORM_data2
0x05 constant
DW_FORM_data4
0x06 constant
DW_FORM_data8
0x07 constant
DW_FORM_string
0x08 string
DW_FORM_block
0x09 block
DW_FORM_block1
0x0a block
DW_FORM_data1
0x0b constant
DW_FORM_flag
0x0c flag
DW_FORM_sdata
0x0d constant
DW_FORM_strp
0x0e string
DW_FORM_udata
0x0f constant
DW_FORM_ref_addr
0x10 reference
DW_FORM_ref1
0x11 reference
DW_FORM_ref2
0x12 reference
DW_FORM_ref4
0x13 reference
DW_FORM_ref8
0x14 reference
Class
Form name
Value
Class
DW_FORM_ref_udata
0x15 reference
DW_FORM_indirect
DW_FORM_sec_offset
DW_FORM_exprloc
0x18 exprloc
0x20 reference
Page 161
Number
First byte
Second byte
---
127
127
---
128
0+0x80
129
1+0x80
130
2+0x80
12857
57+0x80
100
Page 162
Number
First byte
Second byte
---
-2
0x7e
---
127
127+0x80
-127
1+0x80
0x7f
128
0+0x80
-128
0+0x80
0x7f
129
1+0x80
-129
0x7f+0x80
0x7e
No. of
Operands
DW_OP_addr
0x03
DW_OP_deref
0x06
Operation
Notes
constant address
(size target specific)
Page 163
Code
No. of
Operands
DW_OP_const1u
0x08
1-byte constant
DW_OP_const1s
0x09
1-byte constant
DW_OP_const2u
0x0a
2-byte constant
DW_OP_const2s
0x0b
2-byte constant
DW_OP_const4u
0x0c
4-byte constant
DW_OP_const4s
0x0d
4-byte constant
DW_OP_const8u
0x0e
8-byte constant
DW_OP_const8s
0x0f
8-byte constant
DW_OP_constu
0x10
ULEB128 constant
DW_OP_consts
0x11
SLEB128 constant
DW_OP_dup
0x12
DW_OP_drop
0x13
DW_OP_over
0x14
DW_OP_pick
0x15
DW_OP_swap
0x16
DW_OP_rot
0x17
DW_OP_xderef
0x18
DW_OP_abs
0x19
DW_OP_and
0x1a
DW_OP_div
0x1b
Operation
Page 164
Notes
Code
No. of
Operands
DW_OP_minus
0x1c
DW_OP_mod
0x1d
DW_OP_mul
0x1e
DW_OP_neg
0x1f
DW_OP_not
0x20
DW_OP_or
0x21
DW_OP_plus
0x22
DW_OP_plus_uconst
0x23
DW_OP_shl
0x24
DW_OP_shr
0x25
DW_OP_shra
0x26
DW_OP_xor
0x27
DW_OP_skip
0x2f
DW_OP_bra
0x28
DW_OP_eq
0x29
DW_OP_ge
0x2a
DW_OP_gt
0x2b
DW_OP_le
0x2c
DW_OP_lt
0x2d
DW_OP_ne
0x2e
Operation
Notes
ULEB128 addend
Page 165
Code
No. of
Operands
DW_OP_lit0
0x30
DW_OP_lit1
0x31
DW_OP_lit31
0x4f
DW_OP_reg0
0x50
DW_OP_reg1
0x51
DW_OP_reg31
0x6f
DW_OP_breg0
0x70
DW_OP_breg1
0x71
Operation
...
...
Notes
literals 0..31 =
(DW_OP_lit0 + literal)
reg 0..31 =
(DW_OP_reg0 + regnum)
SLEB128 offset
base register 0..31 =
(DW_OP_breg0 + regnum)
...
DW_OP_breg31
0x8f
DW_OP_regx
0x90
ULEB128 register
DW_OP_fbreg
0x91
SLEB128 offset
DW_OP_bregx
0x92
DW_OP_piece
0x93
DW_OP_deref_size
0x94
DW_OP_xderef_size
0x95
DW_OP_nop
0x96
Page 166
Code
No. of
Operands
DW_OP_push_object_address
0x97
DW_OP_call2
0x98
DW_OP_call4
0x99
DW_OP_call_ref
0x9a
DW_OP_form_tls_address
0x9b
DW_OP_call_frame_cfa
0x9c
DW_OP_bit_piece
0x9d
DW_OP_implicit_value
0x9e
DW_OP_stack_value
0x9f
DW_OP_lo_user
0xe0
DW_OP_hi_user
0xff
Operation
Notes
Page 167
Page 168
DW_ATE_address
0x01
DW_ATE_boolean
0x02
DW_ATE_complex_float
0x03
DW_ATE_float
0x04
DW_ATE_signed
0x05
DW_ATE_signed_char
0x06
DW_ATE_unsigned
0x07
DW_ATE_unsigned_char
0x08
DW_ATE_imaginary_float
0x09
DW_ATE_packed_decimal
0x0a
DW_ATE_numeric_string
0x0b
DW_ATE_edited
0x0c
DW_ATE_signed_fixed
0x0d
DW_ATE_unsigned_fixed
0x0e
0x0f
DW_ATE_UTF
0x10
DW_ATE_lo_user
0x80
DW_ATE_hi_user
0xff
The encodings of the constants used in the DW_AT_decimal_sign attribute are given in Figure
26.
Value
DW_DS_unsigned
0x01
DW_DS_leading_overpunch
0x02
DW_DS_trailing_overpunch
0x03
DW_DS_leading_separate
0x04
DW_DS_trailing_separate
0x05
Page 169
0x00
DW_END_big
0x01
DW_END_little
0x02
DW_END_lo_user
0x40
DW_END_hi_user
0xff
Value
DW_ACCESS_public
0x01
DW_ACCESS_protected
0x02
DW_ACCESS_private
0x03
Page 170
Value
DW_VIS_local
0x01
DW_VIS_exported
0x02
DW_VIS_qualified
0x03
Value
DW_VIRTUALITY_none
0x00
DW_VIRTUALITY_virtual
0x01
DW_VIRTUALITY_pure_virtual
0x02
Page 171
Language name
Page 172
DW_LANG_C89
0x0001
DW_LANG_C
0x0002
DW_LANG_Ada83
0x0003
DW_LANG_C_plus_plus
0x0004
DW_LANG_Cobol74
0x0005
DW_LANG_Cobol85
0x0006
DW_LANG_Fortran77
0x0007
DW_LANG_Fortran90
0x0008
DW_LANG_Pascal83
0x0009
DW_LANG_Modula2
0x000a
DW_LANG_Java
0x000b
DW_LANG_C99
0x000c
DW_LANG_Ada95
0x000d
DW_LANG_Fortran95
0x000e
DW_LANG_PLI
0x000f
Language name
DW_LANG_ObjC
DW_LANG_ObjC_plus_plus 0x0011
DW_LANG_UPC
0x0012
DW_LANG_D
0x0013
DW_LANG_Python
0x0014
DW_LANG_lo_user
0x8000
DW_LANG_hi_user
0xffff
See text
Page 173
Value
DW_ID_case_sensitive
0x00
DW_ID_up_case
0x01
DW_ID_down_case
0x02
DW_ID_case_insensitive
0x03
Value
DW_CC_normal
0x01
DW_CC_program
0x02
DW_CC_nocall
0x03
DW_CC_lo_user
0x40
DW_CC_hi_user
0xff
Page 174
Value
DW_INL_not_inlined
0x00
DW_INL_inlined
0x01
DW_INL_declared_not_inlined
0x02
DW_INL_declared_inlined
0x03
Value
DW_ORD_row_major
0x00
DW_ORD_col_major
0x01
Page 175
Value
DW_DSC_label
0x00
DW_DSC_range
0x01
Page 176
Page 177
Page 178
Value
DW_LNS_copy
0x01
DW_LNS_advance_pc
0x02
DW_LNS_advance_line
0x03
DW_LNS_set_file
0x04
DW_LNS_set_column
0x05
DW_LNS_negate_stmt
0x06
DW_LNS_set_basic_block
0x07
DW_LNS_const_add_pc
0x08
DW_LNS_fixed_advance_pc
0x09
DW_LNS_set_prologue_end
0x0a
Opcode Name
Value
DW_LNS_set_epilogue_begin
0x0b
DW_LNS_set_isa
0x0c
The encodings for the extended opcodes are given in Figure 38.
Opcode Name
Value
DW_LNE_end_sequence
0x01
DW_LNE_set_address
0x02
DW_LNE_define_file
0x03
DW_LNE_set_discriminator
0x04
DW_LNE_lo_user
0x80
DW_LNE_hi_user
0xff
Page 179
Value
DW_MACINFO_define
0x01
DW_MACINFO_undef
0x02
DW_MACINFO_start_file
0x03
DW_MACINFO_end_file
0x04
DW_MACINFO_vendor_ext
0xff
Page 180
High 2
Bits
Low 6
Bits
DW_CFA_advance_loc
0x1
delta
DW_CFA_offset
0x2
register
DW_CFA_restore
0x3
register
DW_CFA_nop
DW_CFA_set_loc
0x01
address
DW_CFA_advance_loc1
0x02
1-byte delta
DW_CFA_advance_loc2
0x03
2-byte delta
DW_CFA_advance_loc4
0x04
4-byte delta
DW_CFA_offset_extended
0x05
DW_CFA_restore_extended
0x06
ULEB128 register
DW_CFA_undefined
0x07
ULEB128 register
DW_CFA_same_value
0x08
ULEB128 register
DW_CFA_register
0x09
DW_CFA_remember_state
0x0a
DW_CFA_restore_state
0x0b
DW_CFA_def_cfa
0x0c
DW_CFA_def_cfa_register
0x0d
ULEB128 register
DW_CFA_def_cfa_offset
0x0e
ULEB128 offset
DW_CFA_def_cfa_expression
0x0f
BLOCK
DW_CFA_expression
0x10
Instruction
Operand 1
Operand 2
ULEB128 offset
Page 181
High 2
Bits
Low 6
Bits
DW_CFA_offset_extended_sf
0x11
DW_CFA_def_cfa_sf
0x12
DW_CFA_def_cfa_offset_sf
0x13
SLEB128 offset
DW_CFA_val_offset
0x14
ULEB128
ULEB128
DW_CFA_val_offset_sf
0x15
ULEB128
SLEB128
DW_CFA_val_expression
0x16
ULEB128
BLOCK
DW_CFA_lo_user
0x1c
DW_CFA_hi_user
0x3f
Instruction
Operand 1
Operand 2
Page 182
Page 183
Representation
sbyte
ubyte
uhalf
uword
Page 184
Page 185
Page 186
Page 187
Page 188
Page 189
Page 190
Applicable Attributes
DW_TAG_access_declaration
DECL
DW_AT_accessibility
DW_AT_description
DW_AT_name
DW_AT_sibling
DW_TAG_array_type
DECL
DW_AT_abstract_origin
DW_AT_accessibility
DW_AT_allocated
DW_AT_associated
DW_AT_bit_size
DW_AT_bit_stride
DW_AT_byte_size
DW_AT_data_location
DW_AT_declaration
DW_AT_description
DW_AT_name
DW_AT_ordering
DW_AT_sibling
DW_AT_specification
DW_AT_start_scope
DW_AT_type
DW_AT_visibility
Page 191
Page 192
DW_TAG_base_type
DECL
DW_AT_allocated
DW_AT_associated
DW_AT_binary_scale
DW_AT_bit_offset
DW_AT_bit_size
DW_AT_byte_size
DW_AT_data_bit_offset
DW_AT_data_location
DW_AT_decimal_scale
DW_AT_decimal_sign
DW_AT_description
DW_AT_digit_count
DW_AT_encoding
DW_AT_endianity
DW_AT_name
DW_AT_picture_string
DW_AT_sibling
DW_AT_small
DW_TAG_catch_block
DECL
DW_AT_abstract_origin
DW_AT_high_pc
DW_AT_low_pc
DW_AT_ranges
DW_AT_segment
DW_AT_sibling
DW_TAG_class_type
DECL
DW_AT_abstract_origin
DW_AT_accessibility
DW_AT_allocated
DW_AT_associated
DW_AT_bit_size
DW_AT_byte_size
DW_AT_data_location
DW_AT_declaration
DW_AT_description
DW_AT_name
DW_AT_sibling
DW_AT_signature
DW_AT_specification
DW_AT_start_scope
DW_AT_visibility
DW_TAG_common_block
DECL
DW_AT_declaration
DW_AT_description
DW_AT_linkage_name
DW_AT_location
DW_AT_name
DW_AT_segment
DW_AT_sibling
DW_AT_visibility
DW_TAG_common_inclusion
DECL
DW_AT_common_reference
DW_AT_declaration
DW_AT_sibling
DW_AT_visibility
Page 193
Page 194
DW_TAG_compile_unit
DW_AT_base_types
DW_AT_comp_dir
DW_AT_identifier_case
DW_AT_high_pc
DW_AT_language
DW_AT_low_pc
DW_AT_macro_info
DW_AT_main_subprogram
DW_AT_name
DW_AT_producer
DW_AT_ranges
DW_AT_segment
DW_AT_stmt_list
DW_AT_use_UTF8
DW_TAG_condition
DECL
DW_AT_name
DW_AT_sibling
DW_TAG_const_type
DW_AT_allocated
DW_AT_associated
DW_AT_data_location
DW_AT_name
DW_AT_sibling
DW_AT_type
DW_TAG_constant
DECL
DW_AT_accessibility
DW_AT_const_value
DW_AT_declaration
DW_AT_description
DW_AT_endianity
DW_AT_external
DW_AT_linkage_name
DW_AT_name
DW_AT_sibling
DW_AT_start_scope
DW_AT_type
DW_AT_visibility
DW_TAG_dwarf_procedure
DW_AT_location
DW_TAG_entry_point
DECL
DW_AT_address_class
DW_AT_description
DW_AT_frame_base
DW_AT_linkage_name
DW_AT_low_pc
DW_AT_name
DW_AT_return_addr
DW_AT_segment
DW_AT_sibling
DW_AT_static_link
DW_AT_type
Page 195
Page 196
DW_TAG_enumeration_type
DECL
DW_AT_abstract_origin
DW_AT_accessibility
DW_AT_allocated
DW_AT_associated
DW_AT_bit_size
DW_AT_bit_stride
DW_AT_byte_size
DW_AT_byte_stride
DW_AT_data_location
DW_AT_declaration
DW_AT_description
DW_AT_enum_class
DW_AT_name
DW_AT_sibling
DW_AT_signature
DW_AT_specification
DW_AT_start_scope
DW_AT_type
DW_AT_visibility
DW_TAG_enumerator
DECL
DW_AT_const_value
DW_AT_description
DW_AT_name
DW_AT_sibling
DW_TAG_file_type
DECL
DW_AT_abstract_origin
DW_AT_allocated
DW_AT_associated
DW_AT_bit_size
DW_AT_byte_size
DW_AT_data_location
DW_AT_description
DW_AT_name
DW_AT_sibling
DW_AT_start_scope
DW_AT_type
DW_AT_visibility
DW_TAG_formal_parameter
DECL
DW_AT_abstract_origin
DW_AT_artificial
DW_AT_const_value
DW_AT_default_value
DW_AT_description
DW_AT_endianity
DW_AT_is_optional
DW_AT_location
DW_AT_name
DW_AT_segment
DW_AT_sibling
DW_AT_type
DW_AT_variable_parameter
DW_TAG_friend
DECL
DW_AT_abstract_origin
DW_AT_friend
DW_AT_sibling
Page 197
Page 198
DW_TAG_imported_declaration
DECL
DW_AT_accessibility
DW_AT_description
DW_AT_import
DW_AT_name
DW_AT_sibling
DW_AT_start_scope
DW_TAG_imported_module
DECL
DW_AT_import
DW_AT_sibling
DW_AT_start_scope
DW_TAG_imported_unit
DW_AT_import
DW_TAG_inheritance
DECL
DW_AT_accessibility
DW_AT_data_member_location
DW_AT_sibling
DW_AT_type
DW_AT_virtuality
DW_TAG_inlined_subroutine
DW_AT_abstract_origin
DW_AT_call_column
DW_AT_call_file
DW_AT_call_line
DW_AT_const_expr
DW_AT_entry_pc
DW_AT_high_pc
DW_AT_low_pc
DW_AT_ranges
DW_AT_return_addr
DW_AT_segment
DW_AT_sibling
DW_AT_start_scope
DW_AT_trampoline
DW_TAG_interface_type
DECL
DW_AT_accessibility
DW_AT_description
DW_AT_name
DW_AT_sibling
DW_AT_start_scope
DW_TAG_label
DECL
DW_AT_abstract_origin
DW_AT_description
DW_AT_low_pc
DW_AT_name
DW_AT_segment
DW_AT_start_scope
DW_AT_sibling
DW_TAG_lexical_block
DECL
DW_AT_abstract_origin
DW_AT_description
DW_AT_high_pc
DW_AT_low_pc
DW_AT_name
DW_AT_ranges
DW_AT_segment
DW_AT_sibling
Page 199
Page 200
DW_TAG_member
DECL
DW_AT_accessibility
DW_AT_bit_offset
DW_AT_bit_size
DW_AT_byte_size
DW_AT_data_bit_offset
DW_AT_data_member_location
DW_AT_declaration
DW_AT_description
DW_AT_mutable
DW_AT_name
DW_AT_sibling
DW_AT_type
DW_AT_visibility
DW_TAG_module
DECL
DW_AT_accessibility
DW_AT_declaration
DW_AT_description
DW_AT_entry_pc
DW_AT_high_pc
DW_AT_low_pc
DW_AT_name
DW_AT_priority
DW_AT_ranges
DW_AT_segment
DW_AT_sibling
DW_AT_specification
DW_AT_visibility
DW_TAG_namelist
DECL
DW_AT_abstract_origin
DW_AT_accessibility
DW_AT_declaration
DW_AT_name
DW_AT_sibling
DW_AT_visibility
DW_TAG_namelist_item
DECL
DW_AT_namelist_item
DW_AT_sibling
DW_TAG_namespace
DECL
DW_AT_description
DW_AT_extension
DW_AT_name
DW_AT_sibling
DW_AT_start_scope
DW_TAG_packed_type
DW_AT_allocated
DW_AT_associated
DW_AT_data_location
DW_AT_name
DW_AT_sibling
DW_AT_type
DW_TAG_partial_unit
DW_AT_base_types
DW_AT_comp_dir
DW_AT_description
DW_AT_identifier_case
DW_AT_high_pc
DW_AT_language
DW_AT_low_pc
DW_AT_macro_info
DW_AT_main_subprogram
DW_AT_name
DW_AT_producer
DW_AT_ranges
DW_AT_segment
DW_AT_stmt_list
DW_AT_use_UTF8
Page 201
Page 202
DW_TAG_pointer_type
DW_AT_address_class
DW_AT_allocated
DW_AT_associated
DW_AT_data_location
DW_AT_name
DW_AT_sibling
DW_AT_type
DW_TAG_ptr_to_member_type
DECL
DW_AT_abstract_origin
DW_AT_address_class
DW_AT_allocated
DW_AT_associated
DW_AT_containing_type
DW_AT_data_location
DW_AT_declaration
DW_AT_description
DW_AT_name
DW_AT_sibling
DW_AT_type
DW_AT_use_location
DW_AT_visibility
DW_TAG_reference_type
DW_AT_address_class
DW_AT_allocated
DW_AT_associated
DW_AT_data_location
DW_AT_name
DW_AT_sibling
DW_AT_type
DW_TAG_restrict_type
DW_AT_allocated
DW_AT_associated
DW_AT_data_location
DW_AT_name
DW_AT_sibling
DW_AT_type
DW_TAG_rvalue_reference_type
DECL
DW_AT_address_class
DW_AT_allocated
DW_AT_associated
DW_AT_data_location
DW_AT_name
DW_AT_sibling
DW_AT_type
DW_TAG_set_type
DECL
DW_AT_abstract_origin
DW_AT_accessibility
DW_AT_allocated
DW_AT_associated
DW_AT_bit_size
DW_AT_byte_size
DW_AT_data_location
DW_AT_declaration
DW_AT_description
DW_AT_name
DW_AT_start_scope
DW_AT_sibling
DW_AT_type
DW_AT_visibility
DW_TAG_shared_type
DW_AT_allocated
DW_AT_associated
DW_AT_count
DW_AT_data_location
DW_AT_name
DW_AT_sibling
DW_AT_type
Page 203
Page 204
DW_TAG_string_type
DECL
DW_AT_abstract_origin
DW_AT_accessibility
DW_AT_allocated
DW_AT_associated
DW_AT_bit_size
DW_AT_byte_size
DW_AT_data_location
DW_AT_declaration
DW_AT_description
DW_AT_name
DW_AT_sibling
DW_AT_start_scope
DW_AT_string_length
DW_AT_visibility
DW_TAG_structure_type
DECL
DW_AT_abstract_origin
DW_AT_accessibility
DW_AT_allocated
DW_AT_associated
DW_AT_bit_size
DW_AT_byte_size
DW_AT_data_location
DW_AT_declaration
DW_AT_description
DW_AT_name
DW_AT_sibling
DW_AT_signature
DW_AT_specification
DW_AT_start_scope
DW_AT_visibility
DW_TAG_subprogram
DECL
DW_AT_abstract_origin
DW_AT_accessibility
DW_AT_address_class
DW_AT_artificial
DW_AT_calling_convention
DW_AT_declaration
DW_AT_description
DW_AT_elemental
DW_AT_entry_pc
DW_AT_explicit
DW_AT_external
DW_AT_frame_base
DW_AT_high_pc
DW_AT_inline
DW_AT_linkage_name
DW_AT_low_pc
DW_AT_main_subprogram
DW_AT_name
DW_AT_object_pointer
DW_AT_prototyped
DW_AT_pure
DW_AT_ranges
DW_AT_recursive
DW_AT_return_addr
DW_AT_segment
DW_AT_sibling
DW_AT_specification
DW_AT_start_scope
DW_AT_static_link
DW_AT_trampoline
DW_AT_type
DW_AT_visibility
DW_AT_virtuality
DW_AT_vtable_elem_location
Page 205
Page 206
DW_TAG_subrange_type
DECL
DW_AT_abstract_origin
DW_AT_accessibility
DW_AT_allocated
DW_AT_associated
DW_AT_bit_size
DW_AT_bit_stride
DW_AT_byte_size
DW_AT_byte_stride
DW_AT_count
DW_AT_data_location
DW_AT_declaration
DW_AT_description
DW_AT_lower_bound
DW_AT_name
DW_AT_sibling
DW_AT_threads_scaled
DW_AT_type
DW_AT_upper_bound
DW_AT_visibility
DW_TAG_subroutine_type
DECL
DW_AT_abstract_origin
DW_AT_accessibility
DW_AT_address_class
DW_AT_allocated
DW_AT_associated
DW_AT_data_location
DW_AT_declaration
DW_AT_description
DW_AT_name
DW_AT_prototyped
DW_AT_sibling
DW_AT_start_scope
DW_AT_type
DW_AT_visibility
DW_TAG_template_alias
DECL
DW_AT_abstract_origin
DW_AT_accessibility
DW_AT_allocated
DW_AT_associated
DW_AT_data_location
DW_AT_declaration
DW_AT_description
DW_AT_name
DW_AT_sibling
DW_AT_signature
DW_AT_start_scope
DW_AT_type
DW_AT_visibility
DW_TAG_template_type_parameter
DECL
DW_AT_description
DW_AT_name
DW_AT_sibling
DW_AT_type
DW_TAG_template_value_parameter DECL
DW_AT_const_value
DW_AT_description
DW_AT_name
DW_AT_sibling
DW_AT_type
DW_TAG_thrown_type
DECL
DW_AT_allocated
DW_AT_associated
DW_AT_data_location
DW_AT_sibling
DW_AT_type
Page 207
Page 208
DW_TAG_try_block
DECL
DW_AT_abstract_origin
DW_AT_high_pc
DW_AT_low_pc
DW_AT_ranges
DW_AT_segment
DW_AT_sibling
DW_TAG_typedef
DECL
DW_AT_abstract_origin
DW_AT_accessibility
DW_AT_allocated
DW_AT_associated
DW_AT_data_location
DW_AT_declaration
DW_AT_description
DW_AT_name
DW_AT_sibling
DW_AT_start_scope
DW_AT_type
DW_AT_visibility
DW_TAG_type_unit
DW_AT_language
DW_TAG_union_type
DECL
DW_AT_abstract_origin
DW_AT_accessibility
DW_AT_allocated
DW_AT_associated
DW_AT_bit_size
DW_AT_byte_size
DW_AT_data_location
DW_AT_declaration
DW_AT_description
DW_AT_name
DW_AT_sibling
DW_AT_signature
DW_AT_specification
DW_AT_start_scope
DW_AT_visibility
DW_TAG_unspecified_parameters
DECL
DW_AT_abstract_origin
DW_AT_artificial
DW_AT_sibling
DW_TAG_unspecified_type
DECL
DW_AT_description
DW_AT_name
Page 209
Page 210
DW_TAG_variable
DECL
DW_AT_abstract_origin
DW_AT_accessibility
DW_AT_const_expr
DW_AT_const_value
DW_AT_declaration
DW_AT_description
DW_AT_endianity
DW_AT_external
DW_AT_linkage_name
DW_AT_location
DW_AT_name
DW_AT_segment
DW_AT_sibling
DW_AT_specification
DW_AT_start_scope
DW_AT_type
DW_AT_visibility
DW_TAG_variant
DECL
DW_AT_accessibility
DW_AT_abstract_origin
DW_AT_declaration
DW_AT_discr_list
DW_AT_discr_value
DW_AT_sibling
DW_TAG_variant_part
DECL
DW_AT_abstract_origin
DW_AT_accessibility
DW_AT_declaration
DW_AT_discr
DW_AT_sibling
DW_AT_type
DW_TAG_volatile_type
DW_AT_allocated
DW_AT_associated
DW_AT_data_location
DW_AT_name
DW_AT_sibling
DW_AT_type
DW_TAG_with_stmt
DW_AT_accessibility
DW_AT_address_class
DW_AT_declaration
DW_AT_high_pc
DW_AT_location
DW_AT_low_pc
DW_AT_ranges
DW_AT_segment
DW_AT_sibling
DW_AT_type
DW_AT_visibility
Page 211
Page 212
Page 213
.debug_aranges
.debug_frame
To abbreviations (c)
.debug_abbrev
.debug_str
DW_FORM_strp (d)
DW_OP_call_ref (e)
.debug_info
.debug_types
.debug_loc
DW_AT_location (f)
and others
DW_AT_ranges (g)
and others
DW_AT_macinfo (h)
.debug_ranges
DW_AT_stmt_list (i)
.debug_pubnames
.debug_pubtypes
.debug_line
.debug_macinfo
Page 214
Notes
(a) .debug_aranges The debug_info_offset value in the header is the offset in the
.debug_info section of the corresponding compilation unit header (not
the compilation unit entry).
(b) .debug_pubnames and .debug_pubtypes
The debug_info_offset value in the header is the offset in the
.debug_info section of the corresponding compilation unit header (not
the compilation unit entry). Each pubname/pubtype has the offset (within
the corresponding compilation unit) of the applicable debugging
information entry.
(c) .debug_info and .debug_types
The debug_abbrev_offset value in the header is the offset in the
.debug_abbrev section of the abbreviations for that compilation unit.
(d) .debug_info and .debug_types
Attribute values of class string may have form DW_FORM_strp, whose
value is the offset in the .debug_str section of the corresponding string.
(e) .debug_loc
(f) .debug_info
(g) .debug_info
(h) .debug_info
(i) .debug_info
Page 215
Page 216
do
{
Page 217
result = 0;
shift = 0;
while(true)
{
byte = next byte in input;
result |= (low order 7 bits of byte << shift);
if (high order bit of byte == 0)
break;
shift += 7;
}
result = 0;
shift = 0;
size = number of bits in signed integer;
while(true)
{
byte = next byte in input;
result |= (low order 7 bits of byte << shift);
shift += 7;
/* sign bit of byte is second high order bit (0x40) */
if (high order bit of byte == 0)
break;
}
if ((shift <size) && (sign bit of byte is set))
/* sign extend */
result |= - (1 << shift);
Page 218
Page 219
2
char
DW_ATE_unsigned_char
1
e2:
3
e1
4
POINTER
e2
0
Compilation Unit 2: .debug_info
length
4
a1 (abbreviations table offset)
4
1
DW_TAG_compile_unit
DW_CHILDREN_yes
DW_AT_name
DW_AT_producer
DW_AT_comp_dir
DW_AT_language
DW_AT_low_pc
DW_AT_high_pc
DW_AT_stmt_list
0
DW_FORM_string
DW_FORM_string
DW_FORM_string
DW_FORM_data1
DW_FORM_addr
DW_FORM_data1
DW_FORM_indirect
0
2
DW_TAG_base_type
DW_CHILDREN_no
DW_AT_name
DW_AT_encoding
DW_AT_byte_size
0
DW_FORM_string
DW_FORM_data1
DW_FORM_data1
0
3
DW_TAG_pointer_type
DW_CHILDREN_no
DW_AT_type
0
DW_FORM_ref4
0
4
DW_TAG_typedef
DW_CHILDREN_no
DW_AT_name
DW_AT_type
0
DW_FORM_string
DW_FORM_ref_addr
0
...
4
strp
e2
...
Page 220
Page 221
//
//
//
//
//
//
Element length
Address of raw data
Pointer is associated flag
Pointer is allocated flag
Number of dimensions
For each dimension...
Page 222
2$:
DW_TAG_array_type
! No name, default (Fortran) ordering, default stride
DW_AT_type(reference to REAL)
DW_AT_associated(expression=
! Test 'ptr_assoc' flag
DW_OP_push_object_address
DW_OP_lit<n>
! where n == offset(ptr_assoc)
DW_OP_plus
DW_OP_deref
DW_OP_lit1
! mask for 'ptr_assoc' flag
DW_OP_and)
DW_AT_data_location(expression= ! Get raw data address
DW_OP_push_object_address
DW_OP_lit<n>
! where n == offset(base)
DW_OP_plus
DW_OP_deref)
! Type of index of array 'ap'
DW_TAG_subrange_type
! No name, default stride
DW_AT_type(reference to INTEGER)
DW_AT_lower_bound(expression=
DW_OP_push_object_address
DW_OP_lit<n>
! where n ==
!
offset(desc, dims) +
!
offset(dims_str, lower_bound)
DW_OP_plus
DW_OP_deref)
DW_AT_upper_bound(expression=
DW_OP_push_object_address
DW_OP_lit<n>
! where n ==
!
offset(desc, dims) +
!
offset(dims_str, upper_bound)
DW_OP_plus
DW_OP_deref)
Page 223
5$:
6$:
7$:
Page 224
DW_TAG_structure_type
DW_AT_name("array_ptr")
DW_AT_byte_size(constant sizeof(REAL) + sizeof(desc<1>))
DW_TAG_member
DW_AT_name("myvar")
DW_AT_type(reference to REAL)
DW_AT_data_member_location(constant 0)
DW_TAG_member
DW_AT_name("ap");
DW_AT_type(reference to 1$)
DW_AT_data_member_location(constant sizeof(REAL))
DW_TAG_array_type
! No name, default (Fortran) ordering, default stride
DW_AT_type(reference to 3$)
DW_AT_allocated(expression=
! Test 'ptr_alloc' flag
DW_OP_push_object_address
DW_OP_lit<n>
! where n == offset(ptr_alloc)
DW_OP_plus
DW_OP_deref
DW_OP_lit2
! mask for 'ptr_alloc' flag
DW_OP_and)
DW_AT_data_location(expression= ! Get raw data address
DW_OP_push_object_address
DW_OP_lit<n>
! where n = offset(base)
DW_OP_plus
DW_OP_deref)
DW_TAG_subrange_type
! No name, default stride
DW_AT_type(reference to INTEGER)
DW_AT_lower_bound(expression=
DW_OP_push_object_address
DW_OP_lit<n>
! where n == ...
DW_OP_plus
DW_OP_deref)
DW_AT_upper_bound(expression=
DW_OP_push_object_address
DW_OP_lit<n>
! where n == ...
DW_OP_plus
DW_OP_deref)
8$:
DW_TAG_variable
DW_AT_name("arrays")
DW_AT_type(reference to 6$)
DW_AT_location(expression=
...as appropriate...)
Suppose the program is stopped immediately following completion of the do loop. Suppose
further that the user enters the following debug command:
debug> print arrays(5)%ap(2)
Page 225
Page 226
Figure 52 illustrates two kinds of Ada parameterized array, one embedded in a record.
M : INTEGER := <exp>;
VEC1 : array (1..M) of INTEGER;
subtype TEENY is INTEGER range 1..100;
type ARR is array (INTEGER range <>) of INTEGER;
type REC2(N : TEENY := 100) is record
VEC2 : ARR(1..N);
end record;
OBJ2B : REC2;
is determined at runtime. Ada semantics require that the value of an array bound is fixed at the
time the array type is elaborated (where elaboration refers to the runtime executable aspects of
type processing). For the purposes of this example, we assume that there are no other
assignments to M so that it safe for the REC1 type description to refer directly to that variable
(rather than a compiler generated copy).
REC2 illustrates another array type (the unnamed type of component VEC2) where the upper
bound of the first and only bound is also determined at runtime. In this case, the upper bound is
contained in a discriminant of the containing record type. (A discriminant is a component of a
record whose value cannot be changed independently of the rest of the record because that value
is potentially used in the specification of other components of the record.)
The DWARF description is shown in Figure 53.
Page 227
11$:
DW_TAG_variable
DW_AT_name("M")
DW_AT_type(reference to INTEGER)
12$:
DW_TAG_array_type
! No name, default (Ada) order, default stride
DW_AT_type(reference to INTEGER)
DW_TAG_subrange_type
DW_AT_type(reference to INTEGER)
DW_AT_lower_bound(constant 1)
DW_AT_upper_bound(reference to variable M at 11$)
13$:
14$:
DW_TAG_variable
DW_AT_name("VEC1")
DW_AT_type(reference to array type at 12$)
. . .
21$:
Page 228
DW_TAG_subrange_type
DW_AT_name("TEENY")
DW_AT_type(reference to INTEGER)
DW_AT_lower_bound(constant 1)
DW_AT_upper_bound(constant 100)
28$:
29$:
30$:
DW_TAG_structure_type
DW_AT_name("REC2")
DW_TAG_member
DW_AT_name("N")
DW_AT_type(reference to subtype TEENY at 21$)
DW_AT_data_member_location(constant 0)
DW_TAG_array_type
! No name, default (Ada) order, default stride
! Default data location
DW_AT_TYPE(reference to INTEGER)
DW_TAG_subrange_type
DW_AT_type(reference to subrange TEENY at 21$)
DW_AT_lower_bound(constant 1)
DW_AT_upper_bound(reference to member N at 27$)
DW_TAG_member
DW_AT_name("VEC2")
DW_AT_type(reference to array subtype at 28$)
DW_AT_data_member_location(machine=
DW_OP_lit<n>
! where n == offset(REC2, VEC2)
DW_OP_plus)
. . .
41$:
DW_TAG_variable
DW_AT_name("OBJ2B")
DW_AT_type(reference to REC2 at 26$)
DW_AT_location(...as appropriate...)
Page 229
The Pascal source in Figure 54 is used to illustrate the representation of packed unaligned bit
fields.
TYPE T : PACKED RECORD
! bit
F5 : BOOLEAN;
! bit
F6 : BOOLEAN;
! bit
END;
VAR V : PACKED RECORD
F1 : BOOLEAN;
! bit
F2 : PACKED RECORD ! bit
F3 : INTEGER; ! bit
END;
F4 : PACKED ARRAY [0..1]
F7 : T;
! bit
END;
size is 2
offset is 0
offset is 1
offset is 0
offset is 1
offset is 0 in F2, 1 in V
OF T; ! bit offset is 33
offset is 37
20$:
Page 230
DW_TAG_base_type
DW_AT_name("BOOLEAN")
...
DW_TAG_base_type
DW_AT_name("INTEGER")
...
DW_TAG_structure_type
DW_AT_name("T")
DW_AT_bit_size(2)
DW_TAG_member
DW_AT_name("F5")
DW_AT_type(reference to 10$)
DW_AT_data_bit_offset(0)
DW_AT_bit_size(1)
DW_TAG_member
DW_AT_name("F6")
DW_AT_type(reference to 10$)
DW_AT_data_bit_offset(1)
DW_AT_bit_size(1)
! may be omitted
21$:
DW_TAG_structure_type
! anonymous type for F2
DW_TAG_member
DW_AT_name("F3")
DW_AT_type(reference to 11$)
22$:
DW_TAG_array_type
! anonymous type for F4
DW_AT_type(reference to 20$)
DW_TAG_subrange_type
DW_AT_type(reference to 11$)
DW_AT_lower_bound(0)
DW_AT_upper_bound(1)
DW_AT_bit_stride(2)
DW_AT_bit_size(4)
23$:
DW_TAG_structure_type
! anonymous type for V
DW_AT_bit_size(39)
DW_TAG_member
DW_AT_name("F1")
DW_AT_type(reference to 10$)
DW_AT_data_bit_offset(0)! may be omitted
DW_AT_bit_size(1)
! may be omitted
DW_AT_member
DW_AT_name("F2")
DW_AT_type(reference to 21$)
DW_AT_data_bit_offset(1)
DW_AT_bit_size(32)
! may be omitted
DW_AT_member
DW_AT_name("F4")
DW_AT_type(reference to 22$)
DW_AT_data_bit_offset(33)
DW_AT_bit_size(4)
! may be omitted
DW_AT_member
DW_AT_name("F7")
DW_AT_type(reference to 20$)
! type T
DW_AT_data_bit_offset(37)
DW_AT_bit_size(2)
! may be omitted
DW_TAG_variable
DW_AT_name("V")
DW_AT_type(reference to 23$)
DW_AT_location(...)
...
Page 231
using A::B::j;
using Foo::myfunc;
namespace A {
namespace B {
using namespace Y;
int k;
}
}
int Foo::myfunc(int a)
{
i = 3;
j = 4;
return myfunc2(3) + j + i + a + 2;
}
Page 232
1$:
2$:
6$:
7$:
10$:
20$:
30$:
34$:
36$:
38$:
DW_TAG_base_type
DW_AT_name("int")
...
DW_TAG_base_type
DW_AT_name("float")
...
DW_TAG_namespace
! no DW_AT_name attribute
DW_TAG_variable
DW_AT_name("i")
DW_AT_type(reference to 1$)
DW_AT_location ...
...
DW_TAG_namespace
DW_AT_name("A")
DW_TAG_namespace
DW_AT_name("B")
DW_TAG_variable
DW_AT_name("j")
DW_AT_type(reference to
DW_AT_location ...
...
DW_TAG_subprogram
DW_AT_name("myfunc")
DW_AT_type(reference to
...
DW_TAG_subprogram
DW_AT_name("myfunc")
DW_AT_type(reference to
...
DW_TAG_subprogram
DW_AT_name("myfunc2")
DW_AT_low_pc ...
DW_AT_high_pc ...
DW_AT_type(reference to
...
1$)
1$)
2$)
1$)
Page 233
DW_TAG_namespace
DW_AT_name("Y")
DW_TAG_imported_declaration
DW_AT_import(reference to 30$)
DW_TAG_variable
DW_AT_name("foo")
DW_AT_type(reference to 1$)
DW_AT_location ...
...
! (1) using-declaration
DW_TAG_imported_declaration
DW_AT_import(reference to 30$)
DW_TAG_imported_declaration
DW_AT_name("Foo")
DW_AT_import(reference to 20$)
DW_TAG_imported_declaration
DW_AT_import(reference to 34$)
DW_TAG_imported_declaration
DW_AT_import(reference to 36$)
DW_TAG_imported_module
DW_AT_import(reference to 20$)
DW_TAG_namespace
DW_AT_extension(reference to 10$)
DW_TAG_namespace
DW_AT_extension(reference to 20$)
DW_TAG_imported_module
! (6) using directive
DW_AT_import(reference to 40$)
DW_TAG_variable
DW_AT_name("k")
DW_AT_type(reference to 1$)
DW_AT_location ...
...
60$:
DW_TAG_subprogram
DW_AT_specification(reference to 34$)
DW_AT_low_pc ...
DW_AT_high_pc ...
...
Page 234
DW_TAG_unspecified_type
DW_AT_name("void")
...
DW_TAG_base_type
DW_AT_name("int")
...
DW_TAG_class_type
DW_AT_name("A")
...
DW_TAG_pointer_type
DW_AT_type(reference to 3$)
...
DW_TAG_const_type
DW_AT_type(reference to 3$)
...
DW_TAG_pointer_type
DW_AT_type(reference to 5$)
...
Page 235
8$:
9$:
10$:
11$:
12$:
13$:
DW_TAG_subprogram
DW_AT_declaration
DW_AT_name("func1")
DW_AT_type(reference to 1$)
DW_AT_object_pointer(reference to 8$)
! References a formal parameter in this member function
...
DW_TAG_formal_parameter
DW_AT_artificial(true)
DW_AT_name("this")
DW_AT_type(reference to 4$)
! Makes type of 'this' as 'A*' =>
! func1 has not been marked const or volatile
DW_AT_location ...
...
DW_TAG_formal_parameter
DW_AT_name(x1)
DW_AT_type(reference to 2$)
...
DW_TAG_subprogram
DW_AT_declaration
DW_AT_name("func2")
DW_AT_type(reference to 1$)
DW_AT_object_pointer(reference to 11$)
! References a formal parameter in this member function
...
DW_TAG_formal_parameter
DW_AT_artificial(true)
DW_AT_name("this")
DW_AT_type(reference to 6$)
! Makes type of 'this' as 'A const*' =>
! func2 marked as const
DW_AT_location ...
...
DW_TAG_subprogram
DW_AT_declaration
DW_AT_name("func3")
DW_AT_type(reference to 1$)
...
! No object pointer reference formal parameter
! implies func3 is static
DW_TAG_formal_parameter
DW_AT_name(x3)
DW_AT_type(reference to 2$)
...
Page 236
Suppose the line number program header includes the following (header fields not needed below
are not shown):
version
minimum_instruction_length
opcode_base
line_base
line_range
4
1
10
1
15
Page 237
Figure 61 shows one encoding of the line number program, which occupies 12 bytes (the opcode
SPECIAL(m,n) indicates the special opcode generated for a line increment of m and an address
increment of n).
Opcode
Operand
Byte Stream
-------------------------------------------------------------------------------DW_LNS_advance_pc
SPECIAL(2, 0)
SPECIAL(2, 3)
SPECIAL(1, 8)
SPECIAL(1, 7)
DW_LNS_advance_pc
DW_LNE_end_sequence
LEB128(0x239)
LEB128(2)
Figure 62 shows an alternate encoding of the same program using standard opcodes to advance
the program counter; this encoding occupies 22 bytes.
Opcode
Operand Byte Stream
------------------------------------------------------------------------DW_LNS_fixed_advance_pc
SPECIAL(2, 0)
DW_LNS_fixed_advance_pc
SPECIAL(2, 0)
DW_LNS_fixed_advance_pc
SPECIAL(1, 0)
DW_LNS_fixed_advance_pc
SPECIAL(1, 0)
DW_LNS_fixed_advance_pc
DW_LNE_end_sequence
0x239
0x3
0x8
0x7
0x2
0x9,
0xb
0x9,
0xb
0x9,
0xa
0x9,
0xa
0x9,
0x0,
0x39, 0x2
0x3, 0x0
0x8, 0x0
0x7, 0x0
0x2, 0x0
0x1, 0x1
Page 238
Page 239
foo
foo+4
foo+8
foo+12
foo+16
foo+64
foo+68
foo+72
foo+76
foo+80
foo+84
;; start prologue
sub
R7, R7, <fs>
; Allocate frame
store R1, R7, (<fs>-4) ; Save the return address
store R6, R7, (<fs>-8) ; Save R6
add
R6, R7, 0
; R6 is now the Frame ptr
store R4, R6, (<fs>-12) ; Save a preserved reg
;; This subroutine does not change R5
...
;; Start epilogue (R7 is returned to entry value)
load R4, R6, (<fs>-12) ; Restore R4
load R6, R7, (<fs>-8)
; Restore R6
load R1, R7, (<fs>-4)
; Restore return address
add R7, R7, <fs>
; Deallocate frame
jump R1
; Return
An abstract table (see Section 6.4.1) for the foo subroutine is shown in Figure 64. Corresponding
fragments from the .debug_frame section are shown in Figure 65.
The following notations apply in Figure 64:
1. R8 is the return address
2. s = same_value rule
3. u = undefined rule
4. rN = register(N) rule
5. cN = offset(N) rule
6. a = architectural rule
Page 240
Location CFA
R0
R1
R2
R3
R4
R5
R6
R7
R8
foo
foo+4
foo+8
foo+12
foo+16
foo+20
...
foo+64
foo+68
foo+72
foo+76
foo+80
[R7]+0
[R7]+fs
[R7]+fs
[R7]+fs
[R6]+fs
[R6]+fs
s
s
s
s
s
s
u
u
u
u
u
u
u
u
u
u
u
u
u
u
u
u
u
u
s
s
s
s
s
c-12
s
s
s
s
s
s
s
s
s
c-8
c-8
c-8
a
a
a
a
a
a
r1
r1
c-4
c-4
c-4
c-4
[R6]+fs
[R6]+fs
[R7]+fs
[R7]+fs
[R7]+0
s
s
s
s
s
u
u
u
u
u
u
u
u
u
u
u
u
u
u
u
c-12
s
s
s
s
s
s
s
s
s
c-8
c-8
s
s
s
a
a
a
a
a
c-4
c-4
c-4
r1
r1
Address
cie
cie+4
cie+8
cie+9
cie+10
cie+11
cie+12
cie+13
cie+14
cie+15
cie+18
cie+20
cie+22
cie+24
cie+26
cie+28
cie+30
cie+32
cie+34
cie+37
cie+38
cie+39
cie+40
Value
36
0xffffffff
4
0
4
0
4
-4
8
DW_CFA_def_cfa (7, 0)
DW_CFA_same_value (0)
DW_CFA_undefined (1)
DW_CFA_undefined (2)
DW_CFA_undefined (3)
DW_CFA_same_value (4)
DW_CFA_same_value (5)
DW_CFA_same_value (6)
DW_CFA_same_value (7)
DW_CFA_register (8, 1)
DW_CFA_nop
DW_CFA_nop
DW_CFA_nop
Comment
length
CIE_id
version
augmentation
address size
segment size
code_alignment_factor, <caf>
data_alignment_factor, <daf>
R8 is the return addr.
CFA = [R7]+0
R0 not modified (=0)
R1 scratch
R2 scratch
R3 scratch
R4 preserve
R5 preserve
R6 preserve
R7 preserve
R8 is in R1
padding
padding
padding
Figure 65. Call frame information example: common information entry encoding
Page 241
Address
fde
fde+4
fde+8
fde+12
fde+16
fde+17
fde+19
fde+20
fde+22
fde+23
fde+25
fde+26
fde+28
fde+29
fde+31
fde+32
fde+33
fde+34
fde+35
fde+37
fde+38
fde+39
fde+40
fde+42
fde+43
fde+44
Value
40
cie
foo
84
DW_CFA_advance_loc(1)
DW_CFA_def_cfa_offset(12)
DW_CFA_advance_loc(1)
DW_CFA_offset(8,1)
DW_CFA_advance_loc(1)
DW_CFA_offset(6,2)
DW_CFA_advance_loc(1)
DW_CFA_def_cfa_register(6)
DW_CFA_advance_loc(1)
DW_CFA_offset(4,3)
DW_CFA_advance_loc(12)
DW_CFA_restore(4)
DW_CFA_advance_loc(1)
DW_CFA_restore(6)
DW_CFA_def_cfa_register(7)
DW_CFA_advance_loc(1)
DW_CFA_restore(8)
DW_CFA_advance_loc(1)
DW_CFA_def_cfa_offset(0)
DW_CFA_nop
DW_CFA_nop
Comment
length
CIE_ptr
initial_location
address_range
instructions
<fs>
4/<caf>
-4/<daf> (second parameter)
-8/<daf> (2nd parameter)
padding
padding
Figure 66. Call frame information example: frame description entry encoding
Page 242
There are several approaches that a compiler might take to inlining for this sort of example. This
presentation considers three such approaches, all of which involve inline expansion of
subprogram OUTER. (If OUTER is not inlined, the inlining reduces to a simpler single level
subset of the two level approaches considered here.)
Page 243
where <io> is either INNER or OUTER to indicate to which subprogram the debugging
information entry applies, <ac> is either AI or CI to indicate abstract instance or concrete
instance respectively, <n> is the number of the alternative being considered, and <s> is a
sequence number that distinguishes the individual entries. There is no implication that symbolic
labels, nor any particular naming convention, are required in actual use.
For conciseness, declaration coordinates and call coordinates are omitted.
D.7.1 Alternative #1: inline both OUTER and INNER
A suitable abstract instance for an alternative where both OUTER and INNER are always inlined
is shown in Figure 68.
Notice in Figure 68 that the debugging information entry for INNER (labelled INNER.AI.1.1) is
nested in (is a child of) that for OUTER (labelled OUTER.AI.1.1). Nonetheless, the abstract
instance tree for INNER is considered to be separate and distinct from that for OUTER.
The call of OUTER shown in Figure 67 might be described as shown in Figure 69.
Page 244
Page 245
Page 246
In the second alternative we assume that subprogram INNER is not inlinable for some reason,
but subprogram OUTER is inlinable. Each concrete inlined instance of OUTER has its own
normal instance of INNER. The abstract instance for OUTER, which includes INNER, is shown
in Figure 70.
Note that the debugging information in this Figure differs from that in Figure 68 in that INNER
lacks a DW_AT_inline attribute and therefore is not a distinct abstract instance. INNER is
merely an out-of-line routine that is part of OUTERs abstract instance. This is reflected in the
Figure 70 by the fact that the labels for INNER use the substring OUTER instead of INNER.
A resulting concrete inlined instance of OUTER is shown in Figure 71.
Notice in Figure 71 that OUTER is expanded as a concrete inlined instance, and that INNER is
nested within it as a concrete out-of-line subprogram. Because INNER is cloned for each inline
expansion of OUTER, only the invariant attributes of INNER (for example, DW_AT_name) are
specified in the abstract instance of OUTER, and the low-level, instance-specific attributes of
INNER (for example, DW_AT_low_pc) are specified in each concrete instance of OUTER.
The several calls of INNER within OUTER are compiled as normal calls to the instance of
INNER that is specific to the same instance of OUTER that contains the calls.
Page 247
Page 248
Page 249
In the third approach, one normal subprogram for INNER is compiled which is called from all
concrete inlined instances of OUTER. The abstract instance for OUTER is shown in Figure 72.
The most distinctive aspect of that Figure is that subprogram INNER exists only within the
abstract instance of OUTER, and not in OUTERs concrete instance. In the abstract instance of
OUTER, the description of INNER has the full complement of attributes that would be expected
for a normal subprogram. While attributes such as DW_AT_low_pc, DW_AT_high_pc,
DW_AT_location, and so on, typically are omitted from an abstract instance because they are not
invariant across instances of the containing abstract instance, in this case those same attributes
are included precisely because they are invariant--there is only one subprogram INNER to be
described and every description is the same.
A concrete inlined instance of OUTER is illustrated in Figure 73.
Notice in Figure 73 that there is no DWARF representation for INNER at all; the representation
of INNER does not vary across instances of OUTER and the abstract instance of OUTER
includes the complete description of INNER, so that the description of INNER may be (and for
reasons of space efficiency, should be) omitted from each concrete instance of OUTER.
There is one aspect of this approach that is problematical from the DWARF perspective. The
single compiled instance of INNER is assumed to access up-level variables of OUTER; however,
those variables may well occur at varying positions within the frames that contain the concrete
inlined instances. A compiler might implement this in several ways, including the use of
additional compiler generated parameters that provide reference parameters for the up-level
variables, or a compiler generated static link like parameter that points to the group of up-level
entities, among other possibilities. In either of these cases, the DWARF description for the
location attribute of each uplevel variable needs to be different if accessed from within INNER
compared to when accessed from within the instances of OUTER. An implementation is likely to
require vendor-specific DWARF attributes and/or debugging information entries to describe such
cases.
Note that in C++, a member function of a class defined within a function definition does not
require any vendor-specific extensions because the C++ language disallows access to entities
that would give rise to this problem. (Neither extern variables nor static members require any
form of static link for accessing purposes.)
Page 250
Page 251
Page 252
1$:
2$:
10$:
11$:
20$:
30$:
40$:
Page 253
Page 254
Page 255
Page 256
// C++ source
//
template<class T>
struct wrapper {
T comp;
};
template<class U>
void consume(wrapper<U>
{
...
}
wrapper<int> obj;
consume(obj);
formal)
! DWARF description
!
11$:
DW_TAG_structure_type
DW_AT_name("wrapper")
12$:
DW_TAG_template_type_parameter
DW_AT_name("T")
DW_AT_type(reference to "int")
13$
DW_TAG_member
DW_AT_name("comp")
DW_AT_type(reference to 12$)
14$:
DW_TAG_variable
DW_AT_name("obj")
DW_AT_type(reference to 11$)
21$:
22$:
23$:
DW_TAG_subprogram
DW_AT_name("consume")
DW_TAG_template_type_parameter
DW_AT_name("U")
DW_AT_type(reference to "int")
DW_TAG_formal_parameter
DW_AT_name("formal")
DW_AT_type(reference to 11$)
Page 257
A consequence of this is that the DWARF information would not distinguish between the
existing example and one where the formal of consume were declared in the source to be
wrapper<int>.
Page 258
Page 259
// C++ source
//
template<class TX> struct X { };
template<class TY> struct Y { };
template<class T> using Z = Y<T>;
X<Y<int>> y;
X<Z<int>> z;
! DWARF representation for X<Y<int>>
!
30$: DW_TAG_structure_type
DW_AT_name("Y")
31$:
DW_TAG_template_type_parameter
DW_AT_name("TY")
DW_AT_type(reference to "int")
32$: DW_TAG_structure_type
DW_AT_name("X")
33$:
DW_TAG_template_type_parameter
DW_AT_name("TX")
DW_AT_type(reference to 30$)
! DWARF representation for X<Z<int>>
!
40$: DW_TAG_template_alias
using Z = Y<int>;
DW_AT_name("Z")
DW_AT_type(reference to 30$)
41$:
DW_TAG_template_type_parameter
DW_AT_name("T")
DW_AT_type(reference to "int")
42$: DW_TAG_structure_type
DW_AT_name("X")
43$:
DW_TAG_template_type_parameter
DW_AT_name("TX")
DW_AT_type(reference to 40$)
// struct Y<int>
// struct X<Y<int>>
// template<class T>
// struct X<Z<int>>
! Note that 32$ and 42$ are actually the same type
!
50$: DW_TAG_variable
DW_AT_name("y")
DW_AT_type(reference to $32)
51$: DW_TAG_variable
DW_AT_name("z")
DW_AT_type(reference to $42)
Page 260
Page 261
The general approach is to break up the debug information of a compilation into separate normal
and partial compilation units, each consisting of one or more sections. By arranging that a
sufficiently similar partitioning occurs in other compilations, a suitable system linker can delete
redundant groups of sections when combining object files.
The following uses some traditional section naming here but aside from the DWARF sections,
the names are just meant to suggest traditional contents as a way of explaining the approach, not
to be limiting.
Page 263
A relocatable object from a compilation system attempting duplicate DWARF elimination might
contain sections as in:
.data
.text
.debug_info
.debug_abbrev
.debug_line
.debug_aranges
followed (or preceded, the order is not significant) by a series of section groups:
==== Section group 1
.debug_info
.debug_abbrev
.debug_line
==== ...
==== Section group N
.debug_info
.debug_abbrev
.debug_line
where each section group might or might not contain executable code (.text sections) or data
(.data sections).
A section group is a named set of section contributions within an object file with the property
that the entire set of section contributions must be retained or discarded as a whole; no partial
elimination is allowed. Section groups can generally be handled by a linker in two ways:
1. Given multiple identical (duplicate) section groups, one of them is chosen to be kept and
used, while the rest are discarded.
2. Given a section group that is not referenced from any section outside of the section group,
the section group is discarded.
Which handling applies may be indicated by the section group itself and/or selection of certain
linker options.
Page 264
A precise description of the means of deriving names usable by the linker to access DWARF
entities is not part of this specification. Nonetheless, an outline of a usable approach is given here
to make this more understandable and to guide implementors.
Implementations should clearly document their naming conventions.
In the following, it will be helpful to refer to the examples in Figure 82 through Figure 89 of
Section E.1.3.
Page 265
designation embedded in the name when appropriate. (Alternatively, the language name
could be embedded in the <gid-number>).
<file-designator> names the file, such as wa.h in the example.
<gid-number> is a string generated to identify the specific wa.h header file in such a way
that
a 'matching' output from another compile generates the same <gid-number>, and
a non-matching output (say because of #defines) generates a different <gid-number>.
It may be useful to think of a <gid-number> as a kind of digital signature that allows a fast
test for the equality of two section groups.
So, for example, the section group corresponding to file wa.h above is given the name
my.compiler.company.cpp.wa.h.123456.
Debugging Information Entry Names
Global labels for debugging information entries (need explained below) within a section group
can be given names of the form
<prefix>.<file-designator>.<gid-number>.<die-number>
such as
my.compiler.company.wa.h.123456.987
Page 266
during compilation.
In general, every point in the section group .debug_info that could be referenced from outside
by any compilation unit must normally have an external name generated for it in the linker
symbol table, whether the current compilation references all those points or not.
The completeness of the set of names generated is a quality-of-implementation issue.
It is up to the producer to ensure that if <die-numbers> in separate compilations would not match
properly then a distinct <gid-number> is generated.
Note that only section groups that are designated as duplicate-removal-applies actually require
the
<prefix>.<file-designator>.<gid-number>.<die-number>
external labels for debugging information entries as all other section group sections can use
'local' labels (section-relative relocations).
(This is a consequence of separate compilation, not a rule imposed by this document.)
Local labels use references with form DW_FORM_ref4 or DW_FORM_ref8. (These are affected
by relocations so DW_FORM_ref_udata, DW_FORM_ref1 and DW_FORM_ref2 are normally
not usable and DW_FORM_ref_addr is not necessary for a local label.)
Use of DW_TAG_compile_unit versus DW_TAG_partial_unit
A section group compilation unit that uses DW_TAG_compile_unit is like any other compilation
unit, in that its contents are evaluated by consumers as though it were an ordinary compilation
unit.
An #include directive appearing outside any other declarations is a good candidate to be
represented using DW_TAG_compile_unit. However, an #include appearing inside a C++
namespace declaration or a function, for example, is not a good candidate because the entities
included are not necessarily file level entities.
Page 267
name should be used for an external symbol and a relocation generated based on that name.
When referencing into a non-section group .debug_info, from another .debug_info (from
anywhere) DW_FORM_ref_addr is still the form to be used, but a section-relative relocation
generated by use of a non-exported name (often called an internal name) may be used for
references within the same object file.
Page 268
This section provides several examples in order to have a concrete basis for discussion.
In these examples, the focus is on the arrangement of DWARF information into sections
(specifically the .debug_info section) and the naming conventions used to achieve references
into section groups. In practice, all of the examples that follow involve DWARF sections other
than just .debug_info (for example, .debug_line, .debug_aranges, or others); however, only
the .debug_info section is shown to keep the figures compact and easier to read.
The grouping of sections into a named set is shown, but the means for achieving this in terms of
the underlying object language is not (and varies from system to system).
C++ Example
The C++ source in Figure 82 is used to illustrate the DWARF representation intended to allow
duplicate elimination.
---- File wa.h ---struct A {
int i;
};
---- File wa.C ---#include "wa.h";
int
f(A &a)
{
return a.i + 2;
}
Page 269
Page 270
DW_TAG_compile_unit
This example uses DW_TAG_compile_unit for the section group, implying that the contents of
the compilation unit are globally visible (in accordance with C++ language rules).
DW_TAG_partial_unit is not needed for the same reason.
Page 271
Page 272
Page 273
Page 274
This example uses DW_TAG_partial_unit for the section group because the included
declarations are not independently visible as global entities.
C Example
The C++ example in this Section might appear to be equally valid as a C example. However, it is
prudent to include a DW_TAG_imported_unit in the primary unit (see Figure 84) with an
DW_AT_import attribute that refers to the proper unit in the section group.
The C rules for consistency of global (file scope) symbols across compilations are less strict
than for C++; inclusion of the import unit attribute assures that the declarations of the proper
section group are considered before declarations from other compilations.
Page 275
As discussed in the previous section (Section E.1), many linkers today support the concept of a
COMDAT group or linkonce section. The general idea is that a key can be attached to a
section or a group of sections, and the linker will include only one copy of a section group (or
individual section) for any given key. For .debug_types sections, the key is the type signature
formed from the algorithm given in Section 7.27.
Page 276
As an example, consider a C++ header file containing the type definitions shown in Figure 90.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
namespace N {
struct B;
struct C {
int x;
int y;
};
class A {
public:
A(int v);
int v();
private:
int v_;
struct A *next;
struct B *bp;
struct C c;
};
}
Page 277
L2:
DW_TAG_member
DW_AT_name: "y"
DW_AT_decl_file: 1
DW_AT_decl_line: 7
DW_AT_type: reference to L2
DW_AT_data_member_location: 4
DW_TAG_base_type
DW_AT_byte_size: 4
DW_AT_encoding: DW_ATE_signed
DW_AT_name: "int"
Page 278
Page 279
Page 280
L2:
L3:
L4:
L5:
DW_TAG_subprogram
DW_AT_external: 1
DW_AT_name: "A"
DW_AT_decl_file: 1
DW_AT_decl_line: 12
DW_AT_declaration: 1
DW_TAG_formal_parameter
DW_AT_type: reference
DW_AT_artificial: 1
DW_TAG_formal_parameter
DW_AT_type: reference
DW_TAG_subprogram
DW_AT_external: 1
DW_AT_name: "v"
DW_AT_decl_file: 1
DW_AT_decl_line: 13
DW_AT_type: reference
DW_AT_declaration: 1
DW_TAG_formal_parameter
DW_AT_type: reference
DW_AT_artificial: 1
to L3
to L2
to L2
to L3
DW_TAG_base_type
DW_AT_byte_size: 4
DW_AT_encoding: DW_ATE_signed
DW_AT_name: "int"
DW_TAG_pointer_type
DW_AT_type: reference to L1
DW_TAG_pointer_type
DW_AT_type: reference to L5
DW_TAG_namespace
DW_AT_name: "N"
DW_TAG_structure_type
DW_AT_name: "B"
DW_AT_declaration: 1
Page 281
Page 282
Page 283
Page 284
Figure 96 presents a semi-formal grammar that may aid in understanding how the bytes of the
flattened type description are formed during the type signature computation algorithm of Section
7.27.
signature
: opt-context debug-entry attributes children
opt-context
: 'C' tag-code string opt-context
: empty
// Step 2
debug-entry
: 'D' tag-code
// Step 3
attributes
: attribute attributes
: empty
// Steps 4, 5, 6
attribute
: 'A' at-code form-encoded-value
: 'N' at-code opt-context 'E' string
: 'R' at-code back-ref
: 'T' at-code signature
children
: child children
: '\0'
//
//
//
//
//
//
Normal attributes
Reference to type
by name
Back-reference
to visited type
Recursive type
// Step 7
Page 285
Page 286
C++ has a much greater problem than C with the number and size of the headers included and
the amount of data in each, but even with C there is substantial header file information
duplication.
A reasonable approach is to put each header file in its own section group, using the naming rules
mentioned above. The section groups are marked to ensure duplicate removal.
All data instances and code instances (even if they came from the header files above) are put into
non-section group sections such as the base object file .debug_info section.
E.3.2 Eliminating function duplication
Function templates (C++) result in code for the same template instantiation being compiled into
multiple archives or relocatable objects. The linker wants to keep only one of a given entity. The
DWARF description, and everything else for this function, should be reduced to just a single
copy.
For each such code group (function template in this example) the compiler assigns a name for the
group which will match all other instantiations of this function but match nothing else. The
section groups are marked to ensure duplicate removal, so that the second and subsequent
definitions seen by the static linker are simply discarded.
References to other .debug_info sections follow the approach suggested above, but the naming
rule might be slightly different in that the <file-designator> should be interpreted as a <functiondesignator>.
E.3.3 Single-function-per-DWARF-compilation-unit
Section groups can help make it easy for a linker to completely remove unused functions.
Such section groups are not marked for duplicate removal, since the functions are not duplicates
of anything.
Each function is given a compilation unit and a section group. Each such compilation unit is
complete, with its own text, data, and DWARF sections.
There will also be a compilation unit that has the file-level declarations and definitions. Other
per-function compilation unit DWARF information (.debug_info) points to this common filelevel compilation unit using DW_TAG_imported_unit.
Page 287
Abstract instances and concrete-out-of-line instances may be put in distinct compilation units
using section groups. This makes possible some useful duplicate DWARF elimination.
No special provision for eliminating class duplication resulting from template instantiation is
made here, though nothing prevents eliminating such duplicates using section groups.
E.3.5 Separate Type Units
Each complete declaration of a globally-visible type can be placed in its own separate type
section, with a group key derived from the type signature. The linker can then remove all
duplicate type declarations based on the key.
Page 288
Page 289
Page 290
Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
http://fsf.org/
0. PREAMBLE
The purpose of this License is to make a manual, textbook, or other
functional and useful document "free" in the sense of freedom: to assure
everyone the effective freedom to copy and redistribute it, with or without
modifying it, either commercially or noncommercially.
Secondarily, this License preserves for the author and publisher a way to get
credit for their work, while not being considered responsible for
modifications made by others.
This License is a kind of "copyleft", which means that derivative works of
the document must themselves be free in the same sense. It complements the
GNU General Public License, which is a copyleft license designed for free
software.
We have designed this License in order to use it for manuals for free
software, because free software needs free documentation: a free program
should come with manuals providing the same freedoms that the software does.
But this License is not limited to software manuals; it can be used for any
textual work, regardless of subject matter or whether it is published as a
printed book. We recommend this License principally for works whose purpose
is instruction or reference.
Page 291
Page 292
2. VERBATIM COPYING
You may copy and distribute the Document in any medium, either commercially
or noncommercially, provided that this License, the copyright notices, and
the license notice saying this License applies to the Document are reproduced
in all copies, and that you add no other conditions whatsoever to those of
this License. You may not use technical measures to obstruct or control the
reading or further copying of the copies you make or distribute. However,
you may accept compensation in exchange for copies. If you distribute a
large enough number of copies you must also follow the conditions in
section 3.
You may also lend copies, under the same conditions stated above, and you may
publicly display copies.
Page 293
4. MODIFICATIONS
You may copy and distribute a Modified Version of the Document under the
conditions of sections 2 and 3 above, provided that you release the Modified
Version under precisely this License, with the Modified Version filling the
role of the Document, thus licensing distribution and modification of the
Modified Version to whoever possesses a copy of it. In addition, you must do
these things in the Modified Version:
A. Use in the Title Page (and on the covers, if any) a title distinct from
that of the Document, and from those of previous versions (which should,
if there were any, be listed in the History section of the Document). You
Page 294
Page 295
5. COMBINING DOCUMENTS
You may combine the Document with other documents released under this
License, under the terms defined in section 4 above for modified versions,
provided that you include in the combination all of the Invariant Sections of
all of the original documents, unmodified, and list them all as Invariant
Sections of your combined work in its license notice, and that you preserve
all their Warranty Disclaimers.
Page 296
6. COLLECTIONS OF DOCUMENTS
You may make a collection consisting of the Document and other documents
released under this License, and replace the individual copies of this
License in the various documents with a single copy that is included in the
collection, provided that you follow the rules of this License for verbatim
copying of each of the documents in all other respects.
You may extract a single document from such a collection, and distribute it
individually under this License, provided you insert a copy of this License
into the extracted document, and follow this License in all other respects
regarding verbatim copying of that document.
Page 297
8. TRANSLATION
Translation is considered a kind of modification, so you may distribute
translations of the Document under the terms of section 4. Replacing
Invariant Sections with translations requires special permission from their
copyright holders, but you may include translations of some or all Invariant
Sections in addition to the original versions of these Invariant Sections.
You may include a translation of this License, and all the license notices in
the Document, and any Warranty Disclaimers, provided that you also include
the original English version of this License and the original versions of
those notices and disclaimers. In case of a disagreement between the
translation and the original version of this License or a notice or
disclaimer, the original version will prevail.
If a section in the Document is Entitled "Acknowledgements", "Dedications",
or "History", the requirement (section 4) to Preserve its Title (section 1)
will typically require changing the actual title.
9. TERMINATION
You may not copy, modify, sublicense, or distribute the Document except as
expressly provided under this License. Any attempt otherwise to copy,
modify, sublicense, or distribute it is void, and will automatically
terminate your rights under this License.
However, if you cease all violation of this License, then your license from a
particular copyright holder is reinstated (a) provisionally, unless and until
the copyright holder explicitly and finally terminates your license, and (b)
permanently, if the copyright holder fails to notify you of the violation by
some reasonable means prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is reinstated
permanently if the copyright holder notifies you of the violation by some
reasonable means, this is the first time you have received notice of
violation of this License (for any work) from that copyright holder, and you
cure the violation prior to 30 days after your receipt of the notice.
Termination of your rights under this section does not terminate the licenses
of parties who have received copies or rights from you under this License. If
your rights have been terminated and not permanently reinstated, receipt of a
copy of some or all of the same material does not give you any rights to use
it.
Page 298
11. RELICENSING
"Massive Multiauthor Collaboration Site" (or "MMC Site") means any World Wide
Web server that publishes copyrightable works and also provides prominent
facilities for anybody to edit those works. A public wiki that anybody can
edit is an example of such a server. A "Massive Multiauthor Collaboration"
(or "MMC") contained in the site means any set of copyrightable works thus
published on the MMC site. "CC-BY-SA" means the Creative Commons
Attribution-Share Alike 3.0 license published by Creative Commons
Corporation, a not-for-profit corporation with a principal place of business
in San Francisco, California, as well as future copyleft versions of that
license published by that same organization.
"Incorporate" means to publish or republish a Document, in whole or in
part, as part of another Document.
An MMC is "eligible for relicensing" if it is licensed under this License,
and if all works that were first published under this License somewhere other
than this MMC, and subsequently incorporated in whole or in part into the
MMC, (1) had no cover texts or invariant sections, and (2) were thus
incorporated prior to November 1, 2008.
The operator of an MMC Site may republish an MMC contained in the site under
CC-BY-SA on the same site at any time before August 1, 2009, provided the MMC
is eligible for relicensing.
Page 299
YEAR
YOUR NAME.
Page 300
Index
... parameters.....................See unspecified parameters entry
.data ................................................................................264
.debug_abbrev......... 141, 144, 145, 183, 215, 264, 276, 289
example ..................................................................219
.debug_aranges ....... 107, 140, 141, 177, 183, 215, 264, 289
.debug_frame .......................... 128, 130, 140, 141, 183, 289
example ..................................................................240
.debug_info ...7, 24, 105, 106, 107, 108, 140, 141, 142, 143,
145, 146, 149, 151, 176, 177, 183, 215, 264, 265, 267,
268, 269, 271, 273, 274, 275, 276, 287, 289
example ..................................................................219
.debug_line 45, 108, 140, 141, 148, 183, 215, 264, 276, 289
.debug_loc......................................... 30, 148, 183, 215, 289
.debug_macinfo ................ 45, 123, 125, 149, 183, 215, 289
.debug_pubnames ... 106, 140, 141, 142, 176, 183, 215, 289
.debug_pubtypes ..... 106, 140, 141, 142, 176, 183, 215, 289
.debug_ranges ................................... 38, 149, 183, 215, 289
.debug_str ............................... 142, 150, 151, 183, 215, 289
.debug_types .7, 24, 105, 107, 140, 141, 142, 143, 144, 145,
146, 183, 276, 289
.text .................................................................264, 271, 274
<caf>............................................See code alignment factor
<daf> ............................................See data alignment factor
32-bit DWARF format....................................................140
64-bit DWARF format....................................................140
abbreviations table ..................................................143, 145
dynamic forms in.......................................................146
example .....................................................................219
abstract instance..............................................................288
example ..................................................... 245, 248, 251
nested...........................................................................63
abstract instance entry.......................................................59
abstract instance root ........................................................59
abstract instance tree...................................................59, 61
abstract origin attribute ...............................................61, 63
accelerated access ...........................................................105
by address..................................................................107
by name .....................................................................106
access declaration entry ....................................................87
accessibility attribute ......................................32, 87, 88, 92
encoding ....................................................................170
activation, call frame.......................................................126
Ada ......1, 9, 32, 41, 44, 79, 80, 81, 103, 222, 227, 228, 229
address
dereference operator ..............................................19, 20
Page 301
Page 302
partial .......................................................................... 43
type ............................................................................. 48
composite location description ......................................... 28
compression ................................See DWARF compression
concrete inlined instance
example..................................................... 245, 248, 251
nested .......................................................................... 63
concrete inlined instance entry ......................................... 61
concrete inlined instance root........................................... 61
concrete inlined instance tree ........................................... 61
concrete out-of-line instance .................................... 62, 288
example..................................................................... 248
of inlined subprogram ................................................. 63
condition entry ................................................................. 95
condition, COBOL level-88 ............................................. 95
const qualified type .......................................................... 81
constant class............................................................ 15, 147
constant entry ................................................................... 69
constant expression attribute ...................................... 60, 72
constant type entry ........................................................... 81
constant value attribute......................................... 71, 93, 96
constexpr .............................................................. 59, 61, 72
containing type attribute................................................. 100
contiguous address range.................................................. 38
count attribute ............................................................ 81, 99
default ......................................................................... 99
D 99
data bit offset attribute................................................ 75, 89
data location attribute ..................................................... 102
data member .................................. See member entry (data)
data member location attribute ................................... 86, 88
debug_abbrev_offset ...................................... 141, 144, 215
debug_info_length.......................................................... 141
debug_info_offset .......................................................... 141
debugging information entry .............................................. 7
global name for ......................................................... 266
ownership relation....................................................... 16
decimal scale attribute................................................ 78, 79
decimal sign attribute ....................................................... 78
DECL ............................................................................. 191
declaration attribute........................................ 35, 49, 69, 85
declaration column attribute............................................. 36
declaration coordinates...............................36, 191, See also
DW_AT_decl_file, DW_AT_decl_line,
DW_AT_decl_column
in concrete instance..................................................... 61
declaration file attribute ................................................... 36
declaration line attribute................................................... 36
default value attribute....................................................... 70
default_is_stmt ....................................................... 111, 113
derived type (C++) .............................. See inheritance entry
description attribute.......................................................... 41
descriptor, array.............................................................. 221
DIE................................... See debugging information entry
INDEX
digit count attribute....................................................78, 79,
discontiguous address ranges....See non-contiguous address
ranges
discriminant (entry) ..........................................................94
discriminant attribute ........................................................94
discriminant list attribute ..................................................94
encoding ....................................................................176
discriminant value attribute...............................................94
discriminator........................................... 111, 116, 119, 122
duplicate elimination..... See DWARF duplicate elimination
DW_ACCESS_private..............................................32, 170
DW_ACCESS_protected..........................................32, 170
DW_ACCESS_public...............................................32, 170
DW_ADDR_far16.............................................................35
DW_ADDR_far32.............................................................35
DW_ADDR_huge16..........................................................35
DW_ADDR_near16 ..........................................................35
DW_ADDR_near32 ..........................................................35
DW_ADDR_none...............................................34, 35, 173
DW_AT_abstract_origin . 9, 61, 62, 63, 156, 191, 192, 193,
196, 197, 198, 199, 200, 202, 203, 204, 205, 206, 207,
208, 209, 210, 247, 250, 253, 254
DW_AT_accessibility 9, 32, 87, 88, 92, 156, 170, 185, 191,
193, 195, 196, 198, 199, 200, 203, 204, 205, 206, 207,
208, 209, 210, 211, 280, 282, 283
DW_AT_address_class.... 9, 34, 55, 81, 156, 185, 195, 202,
203, 205, 206, 211
DW_AT_allocated. 9, 40, 84, 102, 103, 158, 185, 191, 192,
193, 194, 196, 197, 201, 202, 203, 204, 206, 207, 208,
209, 211, 224
DW_AT_artificial 7, 9, 34, 64, 92, 156, 185, 197, 205, 209,
236, 281
DW_AT_associated9, 40, 84, 102, 158, 185, 191, 192, 193,
194, 196, 197, 201, 202, 203, 204, 206, 207, 208, 209,
211, 223
DW_AT_base_types............................. 9, 47, 156, 194, 201
DW_AT_binary_scale .......................... 9, 79, 158, 185, 192
DW_AT_bit_offset ........... 9, 40, 90, 91, 155, 185, 192, 200
DW_AT_bit_offset (V3).............................................76, 91
DW_AT_bit_size. 9, 40, 41, 75, 83, 85, 89, 91, 98, 99, 101,
155, 185, 191, 192, 193, 196, 197, 200, 203, 204, 206,
209, 230, 231
DW_AT_bit_size (V3) ...............................................76, 91
DW_AT_bit_stride .... 9, 40, 41, 83, 97, 100, 156, 185, 191,
196, 206, 231
DW_AT_byte_size 9, 40, 41, 75, 76, 83, 85, 89, 90, 91, 96,
98, 99, 101, 155, 185, 191, 192, 193, 196, 197, 200,
203, 204, 206, 209, 220, 224, 254, 255, 275, 277, 278,
279, 280, 281, 282, 284
DW_AT_byte_size (V3).............................................76, 91
DW_AT_byte_stride.. 9, 40, 41, 83, 97, 100, 158, 185, 196,
206, 226
DW_AT_call_column................................... 9, 60, 158, 198
DW_AT_call_file ......................................... 9, 60, 158, 198
Page 303
Page 304
DW_AT_specification ...13, 36, 50, 59, 70, 85, 92, 93, 157,
187, 191, 193, 196, 200, 204, 205, 209, 210, 234
DW_AT_start_scope.. 13, 37, 38, 60, 71, 75, 156, 191, 193,
195, 196, 197, 198, 199, 201, 203, 204, 205, 206, 207,
208, 209, 210
DW_AT_static_link .....13, 56, 57, 157, 195, 205, 247, 250,
252
DW_AT_stmt_list .......................13, 45, 155, 194, 201, 220
DW_AT_string_length........................13, 98, 155, 186, 204
DW_AT_threads_scaled .....................13, 99, 159, 186, 206
DW_AT_trampoline............................13, 64, 158, 198, 205
DW_AT_type. 13, 32, 55, 57, 58, 66, 70, 72, 81, 82, 83, 86,
88, 93, 94, 95, 96, 97, 98, 99, 100, 101, 103, 157, 187,
191, 194, 195, 196, 197, 198, 200, 201, 202, 203, 205,
206, 207, 208, 210, 211, 220, 223, 224, 225, 228, 229,
230, 231, 233, 234, 235, 236, 246, 249, 252, 254, 255,
256, 257, 258, 260, 270, 271, 273, 274, 277, 278, 279,
280, 281, 282, 283, 284, 285
DW_AT_upper_bound.13, 40, 99, 156, 186, 206, 223, 224,
228, 229, 231, 254, 273
DW_AT_use_location...............13, 100, 101, 157, 186, 202
DW_AT_use_UTF8 ............13, 47, 150, 158, 186, 194, 201
DW_AT_variable_parameter ..............13, 70, 157, 186, 197
DW_AT_virtuality .. 13, 33, 87, 92, 157, 171, 186, 198, 205
DW_AT_visibility...... 14, 33, 155, 171, 186, 191, 193, 195,
196, 197, 200, 202, 203, 204, 205, 206, 207, 208, 209,
210, 211
DW_AT_vtable_elem_location...........14, 92, 157, 186, 205
DW_ATE_address ................................................... 77, 168
DW_ATE_boolean................................................... 77, 168
DW_ATE_complex_float ........................................ 77, 168
DW_ATE_decimal_float.......................................... 77, 169
DW_ATE_edited................................................ 77, 78, 168
DW_ATE_float ........................................................ 77, 168
DW_ATE_hi_user.......................................................... 169
DW_ATE_imaginary_float ...................................... 77, 168
DW_ATE_lo_user.......................................................... 169
DW_ATE_numeric_string ........................... 77, 78, 79, 168
DW_ATE_packed_decimal.......................... 77, 78, 79, 168
DW_ATE_signed....................................... 75, 77, 168, 275
DW_ATE_signed_char ............................................ 77, 168
DW_ATE_signed_fixed..................................... 77, 78, 169
DW_ATE_unsigned ......................................... 77, 168, 220
DW_ATE_unsigned_char ................................ 77, 168, 220
DW_ATE_unsigned_fixed................................. 77, 78, 169
DW_ATE_UTF.......................................... 77, 78, 169, 255
DW_CC_hi_user ............................................................ 174
DW_CC_lo_user ............................................................ 174
DW_CC_nocall ........................................................ 54, 174
DW_CC_normal ...................................................... 54, 174
DW_CC_program .................................................... 54, 174
DW_CFA_advance_loc ..................132, 136, 137, 181, 243
DW_CFA_advance_loc1........................................ 132, 181
DW_CFA_advance_loc2........................................ 132, 181
INDEX
DW_CFA_advance_loc4 ........................................132, 181
DW_CFA_def_cfa.................. 131, 132, 133, 181, 242, 243
DW_CFA_def_cfa_expression .......................131, 133, 181
DW_CFA_def_cfa_offset ...............................133, 181, 243
DW_CFA_def_cfa_offset_sf ..................................133, 182
DW_CFA_def_cfa_register ............................133, 181, 243
DW_CFA_def_cfa_sf .............................................133, 182
DW_CFA_expression.....................................131, 135, 181
DW_CFA_hi_user ..........................................................182
DW_CFA_lo_user ..........................................................182
DW_CFA_nop........................ 130, 131, 136, 181, 242, 243
DW_CFA_offset.............................................134, 181, 243
DW_CFA_offset_extended.............................134, 181, 182
DW_CFA_offset_extended_sf................................134, 182
DW_CFA_register..........................................135, 181, 242
DW_CFA_remember_state.....................................136, 181
DW_CFA_restore ...........................................136, 181, 243
DW_CFA_restore_extended...................................136, 181
DW_CFA_restore_state..........................................136, 181
DW_CFA_same_value ...................................134, 181, 242
DW_CFA_set_loc................................... 132, 136, 137, 181
DW_CFA_undefined .............................. 134, 137, 181, 242
DW_CFA_val_expression .............................. 131, 135, 182
DW_CFA_val_offset ......................................134, 135, 182
DW_CFA_val_offset_sf .........................................135, 182
DW_CHILDREN_no......................................146, 154, 220
DW_CHILDREN_yes ....................................146, 154, 220
DW_DS_leading_overpunch ....................................80, 169
DW_DS_leading_separate........................................80, 169
DW_DS_trailing_overpunch ....................................80, 169
DW_DS_trailing_separate ........................................80, 169
DW_DS_unsigned ....................................................80, 169
DW_DSC_label ........................................................95, 176
DW_DSC_range .......................................................95, 176
DW_END_big ..........................................................72, 170
DW_END_default ....................................................72, 170
DW_END_hi_user..........................................................170
DW_END_little ........................................................72, 170
DW_END_lo_user..........................................................170
DW_FORM_addr ........................... 147, 160, 168, 182, 220
DW_FORM_block ................................. 135, 147, 160, 187
DW_FORM_block1 ...............................................147, 160
DW_FORM_block2 ...............................................147, 160
DW_FORM_block4 ...............................................147, 160
DW_FORM_data1..........................................147, 160, 220
DW_FORM_data2..................................................147, 160
DW_FORM_data4...................... 3, 146, 147, 148, 160, 215
DW_FORM_data8.............................. 3, 146, 147, 148, 160
DW_FORM_exprloc ......................................133, 148, 161
DW_FORM_flag ............................................148, 160, 187
DW_FORM_flag_present.......................................148, 161
DW_FORM_indirect ......................................146, 161, 220
DW_FORM_ref_addr...... 24, 142, 149, 150, 160, 265, 267,
268, 288
Page 305
Page 306
INDEX
DW_TAG_enumerator ......................... 8, 96, 152, 196, 256
DW_TAG_file_type ................................... 8, 101, 152, 197
DW_TAG_formal_parameter .... 8, 67, 69, 95, 97, 151, 197,
236, 246, 247, 249, 250, 252, 253, 254, 258, 281
DW_TAG_friend.................................. 8, 87, 152, 187, 197
DW_TAG_hi_user..................................................139, 154
DW_TAG_imported_declaration.......... 8, 50, 151, 198, 234
DW_TAG_imported_module ............... 8, 51, 153, 198, 234
DW_TAG_imported_unit .... 8, 47, 153, 198, 268, 274, 275,
287
DW_TAG_inheritance.................................. 8, 86, 152, 198
DW_TAG_inlined_subroutine..... 8, 53, 60, 61, 63, 64, 152,
198, 246, 247, 250, 253, 254
DW_TAG_interface_type............................. 8, 86, 153, 199
DW_TAG_label............................................ 8, 65, 151, 199
DW_TAG_lexical_block .............................. 8, 65, 151, 199
DW_TAG_lo_user..................................................139, 154
DW_TAG_member . 8, 70, 88, 95, 151, 200, 224, 228, 229,
230, 231, 257, 258, 260, 270, 277, 278, 279, 280, 282,
283, 284
DW_TAG_module ....................................... 8, 49, 152, 200
DW_TAG_namelist ...................................... 8, 73, 153, 200
DW_TAG_namelist_item ............................. 8, 73, 153, 201
DW_TAG_namespace . 8, 49, 153, 201, 233, 234, 277, 279,
280, 281, 282, 283
DW_TAG_packed_type ............................... 8, 81, 153, 201
DW_TAG_partial_unit 8, 43, 143, 153, 201, 268, 271, 273,
275
DW_TAG_pointer_type 8, 81, 82, 151, 187, 202, 220, 235,
281, 283
DW_TAG_ptr_to_member_type ........ 8, 100, 152, 187, 202
DW_TAG_reference_type............ 8, 81, 151, 187, 202, 271
DW_TAG_restrict_type.......................... 8, 81, 82, 153, 202
DW_TAG_rvalue_reference_type ........ 8, 81, 154, 187, 203
DW_TAG_set_type ...................................... 8, 98, 152, 203
DW_TAG_shared_type ................................ 8, 81, 154, 203
DW_TAG_string_type.................................. 8, 98, 151, 204
DW_TAG_structure_type...... 8, 84, 93, 151, 204, 224, 229,
230, 231, 257, 258, 260, 261, 270, 277, 279, 281, 284
DW_TAG_subprogram ..... 8, 41, 53, 58, 59, 61, 63, 64, 92,
153, 187, 205, 233, 234, 236, 246, 247, 249, 250, 252,
253, 254, 258, 271, 274, 275, 281, 284, 285
DW_TAG_subrange_type 8, 84, 95, 99, 152, 171, 206, 223,
224, 228, 229, 231, 254, 273
DW_TAG_subroutine_type.......................... 8, 97, 151, 206
DW_TAG_template_alias........... 8, 103, 154, 207, 260, 261
DW_TAG_template_type_parameter .... 8, 58, 93, 103, 153,
207, 257, 258, 260, 261
DW_TAG_template_value_parameter . 8, 93, 103, 153, 207
DW_TAG_thrown_type ............................... 8, 57, 153, 207
DW_TAG_try_block .................................... 8, 66, 153, 208
DW_TAG_type_unit .................... 8, 48, 154, 208, 277, 280
DW_TAG_typedef ............................... 8, 82, 151, 208, 220
DW_TAG_union_type............................ 8, 84, 93, 152, 209
Page 307
Page 308
INDEX
loclistptr..........................................................................151
loclistptr class .....................................................15, 26, 148
lookup
by address..................................................................107
by name .....................................................................106
low PC attribute ................ 34, 37, 38, 44, 49, 55, 60, 65, 66
and abstract instance....................................................59
lower bound attribute ........................................................99
default..................................................................99, 171
macinfo types..................................................................123
encoding ....................................................................180
macptr .............................................................................151
macptr class ..............................................................15, 149
macro formal parameter list ............................................124
macro information ..........................................................123
macro information attribute ..............................................45
main subprogram attribute ..........................................47, 53
mangled names .................................................................41
maximum_operations_per_instruction.... 112, 113, 117, 118
MD5 hash ....................................... 184, 188, 189, 280, 284
member entry (data)..........................................................88
as discriminant.............................................................94
member function entry......................................................92
memory location description.............................................27
minimum_instruction_length.. 112, 113, 117, 118, 120, 237
MIPS instruction set architecture....................................108
Modula-2 .................................................. 33, 45, 49, 66, 99
definition module ........................................................49
module entry .....................................................................49
mutable attribute ...............................................................88
name attribute .36, 41, 44, 46, 49, 51, 53, 58, 62, 65, 66, 69,
73, 75, 80, 81, 82, 83, 84, 86, 87, 88, 93, 96, 97, 98, 99,
100, 101, 106
namelist entry ...................................................................73
namelist item attribute ......................................................73
namelist item entry ...........................................................73
names
identifier ......................................................................36
mangled .......................................................................41
namespace (C++) ..............................................................49
alias .............................................................................51
example .....................................................................232
global...........................................................................50
std 50
unnamed ......................................................................50
using declaration..........................................................51
using directive .............................................................52
namespace declaration entry .............................................49
namespace extension entry ...............................................49
nested abstract instance.....................................................63
nested concrete inline instance..........................................63
non-contiguous address ranges .........................................38
non-defining declaration ...................................................35
normal compilation unit....................................................43
Page 309
Page 310
INDEX
uword..............................................................105, 132, 184
variable entry ....................................................................69
examples....................................................................221
in concrete instance .....................................................61
variable length data........................... 161, See also LEB128
variable parameter attribute ..............................................70
variant entry......................................................................94
variant part entry...............................................................94
vendor extensibility ............................................2, 114, 139
vendor extension............. 251, See also vendor extensibility
for macro information................................................124
vendor id.........................................................................139
vendor specifc extensions ...............See vendor extensibility
version number ...............................................................289
Page 311