.dwsect pseudo-op

Purpose

Defines a section for saving DWARF debugging information for use by a symbolic debugger.

Syntax

Item Description
.dwsect flag [, opt-label ]

Description

The .dwsect pseudo-op identifies the beginning or continuation of a section containing data to be used by the symbolic debugger. A corresponding DWARF symbol is generated as well. All data-definition pseudo-ops can be used following the .dwsect pseudo-op, but the data generated within a DWARF section is not aligned. A dwarf section can be continued with a .dwsect statement having the same flag.

Multiple DWARF symbols can be generated for the same flag value by specifying the opt-label parameter. The data for a given opt-label and flag parameters is collected and prepended with the length (except for the .dwabrev section, which does not have a length field). In 32-bit mode, the length field is 4 bytes long and in 64-bit mode it is 12 bytes. The data for all sections with the same flag value is then concatenated and saved in the DWARF section identified by the flag.

The flag parameter can take one of the following values:
  • A number that is mapped to a particular DWARF section.
  • A string that is a shortened section name as documented in the XCOFF format or is a full-length section name as documented in the DWARF specification.
    Note: The length field is not generated when the flag value is a string.

When DWARF sections are specified, the pseudo-ops used to specify the symbol table entries for debuggers are not required.

Parameters

Item Description
flag Specifies the type of DWARF section. The following are the valid values:
 
0x10000, ".dwinfo", ".debug_info"
0x20000, ".dwline", ".debug_line"
0x30000, ".dwpbnms", ".debug_pubnames"
0x40000, ".dwpbtyp", ".debug_pubtypes"
0x50000, ".dwarnge", ".debug_aranges"
0x60000, ".dwabrev", ".debug_abbrev"
0x70000, ".dwstr", ".debug_str"
0x80000, ".dwrnges", ".debug_ranges"
0x90000, ".dwloc", ".debug_loc"
0xA0000, ".dwframe", ".debug_frame"
0xB0000, ".dwmac", ".debug_macinfo"
opt-label Specifies the DWARF symbols that are generated for each unique flag, opt-label pair. The opt-label identifer is only used to match other .dwsect statements with the same flag value, and does not appear in the output object file. The opt-label parameter is an optional label identifying a particular DWARF symbol.

Examples

  1. Define a .dwinfo section.
    
           .dwsect       0x00010000              # section name .dwinfo
    .dwinfo:
           .short        0x0002                  # dwarf version
           .long         .dwabrev                # Reference to .dwabrev section
           .llong        0x04012f7473743133
           ...
    
  2. Define a .dwabrev section.
    
           .dwsect       0x00060000              # section name .dwabrev
    .dwabrev:
           .llong       0x0111010308100611
           .llong       0x011201130b1b0825
    
  3. Continue data for the first .dwinfo symbol from the first example.
    
           .dwsect 0x10000
           .llong       0x312f6469732f6432
    
  4. Define a second .dwinfo symbol.
    
           .dwsect 0x10000,dwinfo_2
           .short  2       # Version number