Home | History | Annotate | Download | only in X86
      1 RUN: llvm-dsymutil -f -o - -oso-prepend-path=%p/.. %p/../Inputs/basic-lto.macho.x86_64 | llvm-dwarfdump - | FileCheck %s
      2 RUN: llvm-dsymutil -oso-prepend-path=%p/.. -dump-debug-map %p/../Inputs/basic-lto.macho.x86_64 | llvm-dsymutil -f -o - -y - | llvm-dwarfdump - | FileCheck %s
      3 
      4 CHECK: file format Mach-O 64-bit x86-64
      5 
      6 CHECK: debug_info contents
      7 
      8 CHECK:  Compile Unit:
      9 
     10 CHECK:  DW_TAG_compile_unit [1] *
     11 CHECK:    DW_AT_producer [DW_FORM_strp]     ( .debug_str[0x00000001] = "Apple LLVM version 6.0 (clang-600.0.39) (based on LLVM 3.5svn)")
     12 CHECK:    DW_AT_language [DW_FORM_data2]	(DW_LANG_C99)
     13 CHECK:    DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000040] = "basic1.c")
     14 CHECK:    DW_AT_stmt_list [DW_FORM_data4]   (0x00000000)
     15 CHECK:    DW_AT_comp_dir [DW_FORM_strp]     ( .debug_str[0x00000049] = "/Inputs")
     16 CHECK:    DW_AT_low_pc [DW_FORM_addr]       (0x0000000100000f40)
     17 CHECK:    DW_TAG_subprogram [2] *
     18 CHECK:      DW_AT_name [DW_FORM_strp]       ( .debug_str[0x00000051] = "main")
     19 CHECK:      DW_AT_decl_file [DW_FORM_data1] ("/Inputs{{[/\\]}}basic1.c")
     20 CHECK:      DW_AT_decl_line [DW_FORM_data1]	(23)
     21 CHECK:      DW_AT_prototyped [DW_FORM_flag]	(0x01)
     22 CHECK:      DW_AT_type [DW_FORM_ref4]       (cu + 0x0063 => {0x00000063})
     23 CHECK:      DW_AT_external [DW_FORM_flag]	(0x01)
     24 CHECK:      DW_AT_accessibility [DW_FORM_data1]	(DW_ACCESS_public)
     25 CHECK:      DW_AT_low_pc [DW_FORM_addr]     (0x0000000100000f40)
     26 CHECK:      DW_AT_high_pc [DW_FORM_addr]     (0x0000000100000f4b)
     27 CHECK:      DW_AT_frame_base [DW_FORM_block1]	(<0x01> 56 )
     28 CHECK:      DW_TAG_formal_parameter [3]
     29 CHECK:        DW_AT_name [DW_FORM_strp]     ( .debug_str[0x00000056] = "argc")
     30 CHECK:        DW_AT_type [DW_FORM_ref4]     (cu + 0x0063 => {0x00000063})
     31 CHECK:        DW_AT_location [DW_FORM_block1]	(<0x03> 55 93 04 )
     32 CHECK:      DW_TAG_formal_parameter [3]
     33 CHECK:        DW_AT_name [DW_FORM_strp]     ( .debug_str[0x0000005b] = "argv")
     34 CHECK:        DW_AT_type [DW_FORM_ref4]     (cu + 0x006a => {0x0000006a})
     35 CHECK:        DW_AT_location [DW_FORM_block1]	(<0x01> 54 )
     36 CHECK:      NULL
     37 CHECK:    DW_TAG_base_type [4]
     38 CHECK:      DW_AT_name [DW_FORM_strp]       ( .debug_str[0x00000060] = "int")
     39 CHECK:      DW_AT_encoding [DW_FORM_data1]	(DW_ATE_signed)
     40 CHECK:      DW_AT_byte_size [DW_FORM_data1]	(0x04)
     41 CHECK:    DW_TAG_pointer_type [5]
     42 CHECK:      DW_AT_type [DW_FORM_ref4]       (cu + 0x006f => {0x0000006f})
     43 CHECK:    DW_TAG_pointer_type [5]
     44 CHECK:      DW_AT_type [DW_FORM_ref4]       (cu + 0x0074 => {0x00000074})
     45 CHECK:    DW_TAG_const_type [6]
     46 CHECK:      DW_AT_type [DW_FORM_ref4]       (cu + 0x0079 => {0x00000079})
     47 CHECK:    DW_TAG_base_type [4]
     48 CHECK:      DW_AT_name [DW_FORM_strp]       ( .debug_str[0x00000064] = "char")
     49 CHECK:      DW_AT_encoding [DW_FORM_data1]	(DW_ATE_signed_char)
     50 CHECK:      DW_AT_byte_size [DW_FORM_data1]	(0x01)
     51 CHECK:    NULL
     52 
     53 CHECK:  Compile Unit:
     54 
     55 CHECK:  DW_TAG_compile_unit [1] *
     56 CHECK:    DW_AT_producer [DW_FORM_strp]     ( .debug_str[0x00000001] = "Apple LLVM version 6.0 (clang-600.0.39) (based on LLVM 3.5svn)")
     57 CHECK:    DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000069] = "basic2.c")
     58 CHECK:    DW_AT_stmt_list [DW_FORM_data4]   (0x0000003e)
     59 CHECK:    DW_AT_comp_dir [DW_FORM_strp]     ( .debug_str[0x00000049] = "/Inputs")
     60 CHECK:   DW_AT_low_pc [DW_FORM_addr]       (0x0000000100000f50)
     61 CHECK:    DW_TAG_variable [7]
     62 CHECK:      DW_AT_name [DW_FORM_strp]       ( .debug_str[0x00000072] = "private_int")
     63 CHECK:      DW_AT_type [DW_FORM_ref_addr]   (0x0000000000000063)
     64 CHECK:      DW_AT_decl_file [DW_FORM_data1] ("/Inputs{{[/\\]}}basic2.c")
     65 CHECK:      DW_AT_location [DW_FORM_block1] (<0x09> 03 08 10 00 00 01 00 00 00 )
     66 CHECK:    DW_TAG_variable [7]
     67 CHECK:      DW_AT_name [DW_FORM_strp]       ( .debug_str[0x0000007e] = "baz")
     68 CHECK:      DW_AT_type [DW_FORM_ref_addr]   (0x0000000000000063)
     69 CHECK:      DW_AT_location [DW_FORM_block1] (<0x09> 03 00 10 00 00 01 00 00 00 )
     70 CHECK:    DW_TAG_subprogram [8] *
     71 CHECK:      DW_AT_name [DW_FORM_strp]       ( .debug_str[0x00000082] = "foo")
     72 CHECK:      DW_AT_type [DW_FORM_ref_addr]   (0x0000000000000063)
     73 CHECK:      DW_AT_low_pc [DW_FORM_addr]     (0x0000000100000f50)
     74 CHECK:      DW_AT_high_pc [DW_FORM_addr]    (0x0000000100000f89)
     75 CHECK:      DW_AT_frame_base [DW_FORM_block1]	(<0x01> 56 )
     76 CHECK:      DW_TAG_formal_parameter [9]
     77 CHECK:        DW_AT_name [DW_FORM_strp]     ( .debug_str[0x00000086] = "arg")
     78 CHECK:        DW_AT_type [DW_FORM_ref_addr] (0x0000000000000063)
     79 CHECK:        DW_AT_location [DW_FORM_data4]        (0x00000000)
     80 CHECK:      DW_TAG_inlined_subroutine [10]
     81 CHECK:        DW_AT_abstract_origin [DW_FORM_ref4]  (cu + 0x00a7 => {0x00000128} "inc")
     82 CHECK:        DW_AT_low_pc [DW_FORM_addr]   (0x0000000100000f63)
     83 CHECK:        DW_AT_high_pc [DW_FORM_addr]  (0x0000000100000f72)
     84 CHECK:        DW_AT_call_line [DW_FORM_data1]	(20)
     85 CHECK:      NULL
     86 CHECK:    DW_TAG_subprogram [11]
     87 CHECK:      DW_AT_name [DW_FORM_strp]       ( .debug_str[0x0000008a] = "inc")
     88 CHECK:      DW_AT_type [DW_FORM_ref_addr]   (0x0000000000000063)
     89 CHECK:      DW_AT_inline [DW_FORM_data1]	(DW_INL_inlined)
     90 CHECK:    NULL
     91 
     92 CHECK:  Compile Unit:
     93 
     94 CHECK:  DW_TAG_compile_unit [1] *
     95 CHECK:    DW_AT_producer [DW_FORM_strp]     ( .debug_str[0x00000001] = "Apple LLVM version 6.0 (clang-600.0.39) (based on LLVM 3.5svn)")
     96 CHECK:    DW_AT_name [DW_FORM_strp] ( .debug_str[0x0000008e] = "basic3.c")
     97 CHECK:    DW_AT_stmt_list [DW_FORM_data4]   (0x0000007e)
     98 CHECK:    DW_AT_comp_dir [DW_FORM_strp]     ( .debug_str[0x00000049] = "/Inputs")
     99 CHECK:    DW_AT_low_pc [DW_FORM_addr]       (0x0000000100000f90)
    100 CHECK:    DW_TAG_variable [12]
    101 CHECK:      DW_AT_name [DW_FORM_strp]       ( .debug_str[0x00000097] = "val")
    102 CHECK:      DW_AT_type [DW_FORM_ref4]       (cu + 0x003c => {0x00000176})
    103 CHECK:      DW_AT_decl_file [DW_FORM_data1] ("/Inputs{{[/\\]}}basic3.c")
    104 CHECK:      DW_AT_location [DW_FORM_block1] (<0x09> 03 04 10 00 00 01 00 00 00 )
    105 CHECK:    DW_TAG_volatile_type [13]
    106 CHECK:      DW_AT_type [DW_FORM_ref_addr]   (0x0000000000000063)
    107 CHECK:    DW_TAG_subprogram [8] *
    108 CHECK:      DW_AT_name [DW_FORM_strp]       ( .debug_str[0x0000009b] = "bar")
    109 CHECK:      DW_AT_type [DW_FORM_ref_addr]   (0x0000000000000063)
    110 CHECK:      DW_AT_low_pc [DW_FORM_addr]     (0x0000000100000f90)
    111 CHECK:      DW_AT_high_pc [DW_FORM_addr]    (0x0000000100000fb4)
    112 CHECK:      DW_AT_frame_base [DW_FORM_block1]	(<0x01> 56 )
    113 CHECK:      DW_TAG_formal_parameter [9]
    114 CHECK:        DW_AT_name [DW_FORM_strp]     ( .debug_str[0x00000086] = "arg")
    115 CHECK:        DW_AT_type [DW_FORM_ref_addr] (0x0000000000000063)
    116 CHECK:        DW_AT_location [DW_FORM_data4]        (0x00000025)
    117 CHECK:      DW_TAG_lexical_block [14] *
    118 CHECK:        DW_AT_low_pc [DW_FORM_addr]   (0x0000000100000f94)
    119 CHECK:        DW_AT_high_pc [DW_FORM_addr]  (0x0000000100000fa7)
    120 CHECK:        DW_TAG_inlined_subroutine [15]
    121 CHECK:          DW_AT_abstract_origin [DW_FORM_ref4]        (cu + 0x009a => {0x000001d4} "inc")
    122 CHECK:          DW_AT_ranges [DW_FORM_data4]        (0x00000000
    123 CHECK:             [0x0000000100000f94 - 0x0000000100000f9a)
    124 CHECK:             [0x0000000100000f9f - 0x0000000100000fa7))
    125 CHECK:        NULL
    126 CHECK:      NULL
    127 CHECK:    DW_TAG_subprogram [11]
    128 CHECK:      DW_AT_name [DW_FORM_strp]       ( .debug_str[0x0000008a] = "inc")
    129 CHECK:      DW_AT_type [DW_FORM_ref_addr]   (0x0000000000000063)
    130 CHECK:    NULL
    131 
    132 CHECK:.debug_loc contents:
    133 CHECK-NEXT: 0x00000000: Beginning address offset: 0x0000000000000000
    134 CHECK-NEXT:                Ending address offset: 0x000000000000000e
    135 CHECK-NEXT:                 Location description: 55 93 04 
    136 CHECK-NEXT: {{^$}}
    137 CHECK-NEXT: 0x00000025: Beginning address offset: 0x0000000000000000
    138 CHECK-NEXT:                Ending address offset: 0x000000000000000f
    139 CHECK-NEXT:                 Location description: 55 93 04 
    140 CHECK-NEXT: {{^$}}
    141 CHECK-NEXT:             Beginning address offset: 0x0000000000000019
    142 CHECK-NEXT:                Ending address offset: 0x000000000000001d
    143 CHECK-NEXT:                 Location description: 55 93 04 
    144 
    145 CHECK: .debug_aranges contents:
    146 CHECK-NEXT: Address Range Header: length = 0x0000002c, version = 0x0002, cu_offset = 0x00000000, addr_size = 0x08, seg_size = 0x00
    147 CHECK-NEXT: [0x0000000100000f40 - 0x0000000100000f4b)
    148 CHECK-NEXT: Address Range Header: length = 0x0000002c, version = 0x0002, cu_offset = 0x00000081, addr_size = 0x08, seg_size = 0x00
    149 CHECK-NEXT: [0x0000000100000f50 - 0x0000000100000f89)
    150 CHECK-NEXT: Address Range Header: length = 0x0000002c, version = 0x0002, cu_offset = 0x0000013a, addr_size = 0x08, seg_size = 0x00
    151 CHECK-NEXT: [0x0000000100000f90 - 0x0000000100000fb4)
    152 
    153 
    154 CHECK: .debug_line contents
    155 CHECK:                 Dir  Mod Time   File Len   File Name
    156 CHECK-NEXT:                 ---- ---------- ---------- ---------------------------
    157 CHECK-NEXT: file_names[  1]    0 0x00000000 0x00000000 basic1.c
    158 CHECK: Address            Line   Column File   ISA Discriminator Flags
    159 CHECK-NEXT: ------------------ ------ ------ ------ --- ------------- -------------
    160 CHECK-NEXT: 0x0000000100000f40     23      0      1   0             0  is_stmt
    161 CHECK-NEXT: 0x0000000100000f44     24      0      1   0             0  is_stmt prologue_end
    162 CHECK-NEXT: 0x0000000100000f4b     24      0      1   0             0  is_stmt end_sequence
    163 
    164 CHECK:                 Dir  Mod Time   File Len   File Name
    165 CHECK-NEXT:                 ---- ---------- ---------- ---------------------------
    166 CHECK-NEXT: file_names[  1]    0 0x00000000 0x00000000 basic2.c
    167 CHECK: Address            Line   Column File   ISA Discriminator Flags
    168 CHECK-NEXT: ------------------ ------ ------ ------ --- ------------- -------------
    169 CHECK-NEXT: 0x0000000100000f50     19      0      1   0             0  is_stmt
    170 CHECK-NEXT: 0x0000000100000f54     20      0      1   0             0  is_stmt prologue_end
    171 CHECK-NEXT: 0x0000000100000f63     15      0      1   0             0  is_stmt
    172 CHECK-NEXT: 0x0000000100000f72     20      0      1   0             0  is_stmt
    173 CHECK-NEXT: 0x0000000100000f89     20      0      1   0             0  is_stmt end_sequence
    174 
    175 CHECK:                 Dir  Mod Time   File Len   File Name
    176 CHECK-NEXT:                 ---- ---------- ---------- ---------------------------
    177 CHECK-NEXT: file_names[  1]    0 0x00000000 0x00000000 basic3.c
    178 CHECK: Address            Line   Column File   ISA Discriminator Flags
    179 CHECK-NEXT: ------------------ ------ ------ ------ --- ------------- -------------
    180 CHECK-NEXT: 0x0000000100000f90     16      0      1   0             0  is_stmt
    181 CHECK-NEXT: 0x0000000100000f94     12      0      1   0             0  is_stmt prologue_end
    182 CHECK-NEXT: 0x0000000100000f9a     17      0      1   0             0  is_stmt
    183 CHECK-NEXT: 0x0000000100000f9f     12      0      1   0             0  is_stmt
    184 CHECK-NEXT: 0x0000000100000fa7     20      0      1   0             0  is_stmt
    185 CHECK-NEXT: 0x0000000100000fa9     19      0      1   0             0  is_stmt
    186 CHECK-NEXT: 0x0000000100000fb2     20      0      1   0             0  is_stmt
    187 CHECK-NEXT: 0x0000000100000fb4     20      0      1   0             0  is_stmt end_sequence
    188 
    189 CHECK: .debug_pubnames contents:
    190 CHECK-NEXT: length = 0x00000017 version = 0x0002 unit_offset = 0x00000000 unit_size = 0x00000081
    191 CHECK-NEXT: Offset     Name
    192 CHECK-NEXT: 0x00000026 "main"
    193 CHECK-NEXT: length = 0x0000002e version = 0x0002 unit_offset = 0x00000081 unit_size = 0x000000b9
    194 CHECK-NEXT: Offset     Name
    195 CHECK-NEXT: 0x00000026 "private_int"
    196 CHECK-NEXT: 0x0000003f "baz"
    197 CHECK-NEXT: 0x00000058 "foo"
    198 CHECK-NEXT: length = 0x0000001e version = 0x0002 unit_offset = 0x0000013a unit_size = 0x000000ac
    199 CHECK-NEXT: Offset     Name
    200 CHECK-NEXT: 0x00000026 "val"
    201 CHECK-NEXT: 0x00000045 "bar"
    202 
    203 CHECK: .debug_pubtypes contents:
    204 CHECK-NEXT: length = 0x0000001f version = 0x0002 unit_offset = 0x00000000 unit_size = 0x00000081
    205 CHECK-NEXT: Offset     Name
    206 CHECK-NEXT: 0x00000063 "int"
    207 CHECK-NEXT: 0x00000079 "char"
    208