278 lines · plain
1# REQUIRES: x862 3# RUN: split-file %s %t4# RUN: llvm-mc --triple=x86_64-pc-linux -filetype=obj %t/a.s -o %t/a.o5# RUN: %lldb %t/a.o -o "settings set target.source-map . %t" \6# RUN: -o "settings set interpreter.stop-command-source-on-error false" \7# RUN: -s %t/commands -o exit 2>&1 | FileCheck %s8 9#--- commands10# CASE 0: function at the start of the file11source list -n func012# CHECK-LABEL: source list -n func013# CHECK-NEXT: File: file0.c14# CHECK-NEXT: 1 content of file0.c:115# CHECK-NEXT: 2 content of file0.c:216# CHECK-NEXT: 3 content of file0.c:317# CHECK-NEXT: 4 content of file0.c:418# CHECK-NEXT: 5 content of file0.c:519# CHECK-NEXT: 6 content of file0.c:620# CHECK-NEXT: 7 content of file0.c:721# CHECK-NEXT: 8 content of file0.c:822# CHECK-NEXT: 9 content of file0.c:923# CHECK-NEXT: 10 content of file0.c:1024 25# CASE 1: function in the middle of the file26source list -n func127# CHECK-NEXT: source list -n func128# CHECK-NEXT: File: file0.c29# CHECK-NEXT: 5 content of file0.c:530# CHECK-NEXT: 6 content of file0.c:631# CHECK-NEXT: 7 content of file0.c:732# CHECK-NEXT: 8 content of file0.c:833# CHECK-NEXT: 9 content of file0.c:934# CHECK-NEXT: 10 content of file0.c:1035# CHECK-NEXT: 11 content of file0.c:1136# CHECK-NEXT: 12 content of file0.c:1237# CHECK-NEXT: 13 content of file0.c:1338# CHECK-NEXT: 14 content of file0.c:1439# CHECK-NEXT: 15 content of file0.c:1540# CHECK-NEXT: 16 content of file0.c:1641# CHECK-NEXT: 17 content of file0.c:1742 43# CASE 2: function at the end of the file44source list -n func245# CHECK-NEXT: source list -n func246# CHECK-NEXT: File: file0.c47# CHECK-NEXT: 20 content of file0.c:2048# CHECK-NEXT: 21 content of file0.c:2149# CHECK-NEXT: 22 content of file0.c:2250# CHECK-NEXT: 23 content of file0.c:2351# CHECK-NEXT: 24 content of file0.c:2452# CHECK-NEXT: 25 content of file0.c:2553# CHECK-NEXT: 26 content of file0.c:2654# CHECK-NEXT: 27 content of file0.c:2755# CHECK-NEXT: 28 content of file0.c:2856# CHECK-NEXT: 29 content of file0.c:2957# CHECK-NEXT: 30 content of file0.c:3058 59# CASE 3: function ends in a different file60source list -n func361# CHECK-NEXT: source list -n func362# CHECK-NEXT: File: file0.c63# CHECK-NEXT: 1 content of file0.c:164# CHECK-NEXT: 2 content of file0.c:265# CHECK-NEXT: 3 content of file0.c:366# CHECK-NEXT: 4 content of file0.c:467# CHECK-NEXT: 5 content of file0.c:568# CHECK-NEXT: 6 content of file0.c:669# CHECK-NEXT: 7 content of file0.c:770# CHECK-NEXT: 8 content of file0.c:871# CHECK-NEXT: 9 content of file0.c:972# CHECK-NEXT: 10 content of file0.c:1073 74# CASE 4: function has no line entry with line!=075source list -n func476# CHECK-LABEL: source list -n func477# CHECK: error: Could not find line information for function "func4".78 79# CASE 5: discontinuous function80source list -n func581# CHECK-LABEL: source list -n func582# CHECK-NEXT: File: file0.c83# CHECK-NEXT: 1 content of file0.c:184# CHECK-NEXT: 2 content of file0.c:285# CHECK-NEXT: 3 content of file0.c:386# CHECK-NEXT: 4 content of file0.c:487# CHECK-NEXT: 5 content of file0.c:588# CHECK-NEXT: 6 content of file0.c:689# CHECK-NEXT: 7 content of file0.c:790# CHECK-NEXT: 8 content of file0.c:891# CHECK-NEXT: 9 content of file0.c:992# CHECK-NEXT: 10 content of file0.c:1093 94 95#--- a.s96 .file 0 "." "file0.c"97 .file 1 "." "file1.c"98 .text99func0:100 .loc 0 1101 nop102 .loc 0 5103 nop104.Lfunc0_end:105 106func1:107 .loc 0 10108 nop109 .loc 0 12110 nop111.Lfunc1_end:112 113func2:114 .loc 0 25115 nop116 .loc 0 30117 nop118.Lfunc2_end:119 120func3:121 .loc 0 1122 nop123 .loc 0 5124 nop125 .loc 1 5126 nop127.Lfunc3_end:128 129func4:130 .loc 0 0131 nop132.Lfunc4_end:133 134func5.__part.1:135 .loc 0 1136 nop137.Lfunc5.__part.1_end:138 139.Lpadding:140 nop141 142func5:143 .loc 0 5144 nop145.Lfunc5_end:146 147.Ltext_end:148 149 .section .debug_abbrev,"",@progbits150 .byte 1 # Abbreviation Code151 .byte 17 # DW_TAG_compile_unit152 .byte 1 # DW_CHILDREN_yes153 .byte 3 # DW_AT_name154 .byte 8 # DW_FORM_string155 .byte 37 # DW_AT_producer156 .byte 8 # DW_FORM_string157 .byte 19 # DW_AT_language158 .byte 5 # DW_FORM_data2159 .byte 17 # DW_AT_low_pc160 .byte 1 # DW_FORM_addr161 .byte 18 # DW_AT_high_pc162 .byte 1 # DW_FORM_addr163 .byte 16 # DW_AT_stmt_list164 .byte 23 # DW_FORM_sec_offset165 .byte 0 # EOM(1)166 .byte 0 # EOM(2)167 .byte 2 # Abbreviation Code168 .byte 46 # DW_TAG_subprogram169 .byte 0 # DW_CHILDREN_no170 .byte 17 # DW_AT_low_pc171 .byte 1 # DW_FORM_addr172 .byte 18 # DW_AT_high_pc173 .byte 1 # DW_FORM_addr174 .byte 3 # DW_AT_name175 .byte 8 # DW_FORM_string176 .byte 0 # EOM(1)177 .byte 0 # EOM(2)178 .byte 3 # Abbreviation Code179 .byte 46 # DW_TAG_subprogram180 .byte 0 # DW_CHILDREN_no181 .byte 85 # DW_AT_ranges182 .byte 23 # DW_FORM_sec_offset183 .byte 3 # DW_AT_name184 .byte 8 # DW_FORM_string185 .byte 0 # EOM(1)186 .byte 0 # EOM(2)187 .byte 0 # EOM(3)188 .section .debug_info,"",@progbits189.Lcu_begin0:190 .long .Ldebug_info_end0-.Ldebug_info_start0 # Length of Unit191.Ldebug_info_start0:192 .short 5 # DWARF version number193 .byte 1 # DWARF Unit Type194 .byte 8 # Address Size (in bytes)195 .long .debug_abbrev # Offset Into Abbrev. Section196 .byte 1 # Abbrev DW_TAG_compile_unit197 .asciz "file0.c" # DW_AT_producer198 .asciz "Hand-written DWARF" # DW_AT_producer199 .short 29 # DW_AT_language200 .quad .text # DW_AT_low_pc201 .quad .Ltext_end # DW_AT_high_pc202 .long .Lline_table_start0 # DW_AT_stmt_list203 .rept 5204 .byte 2 # Abbrev DW_TAG_subprogram205 .quad func\+ # DW_AT_low_pc206 .quad .Lfunc\+_end # DW_AT_high_pc207 .asciz "func\+" # DW_AT_name208 .endr209 .byte 3 # Abbrev DW_TAG_subprogram210 .long .Ldebug_ranges0211 .asciz "func5" # DW_AT_name212 .byte 0 # End Of Children Mark213.Ldebug_info_end0:214 215 .section .debug_rnglists,"",@progbits216 .long .Ldebug_list_header_end0-.Ldebug_list_header_start0 # Length217.Ldebug_list_header_start0:218 .short 5 # Version219 .byte 8 # Address size220 .byte 0 # Segment selector size221 .long 2 # Offset entry count222.Lrnglists_table_base0:223 .long .Ldebug_ranges0-.Lrnglists_table_base0224.Ldebug_ranges0:225 .byte 6 # DW_RLE_start_end226 .quad func5227 .quad .Lfunc5_end228 .byte 6 # DW_RLE_start_end229 .quad func5.__part.1230 .quad .Lfunc5.__part.1_end231 .byte 0 # DW_RLE_end_of_list232.Ldebug_list_header_end0:233 .section .debug_line,"",@progbits234.Lline_table_start0:235 236#--- file0.c237content of file0.c:1238content of file0.c:2239content of file0.c:3240content of file0.c:4241content of file0.c:5242content of file0.c:6243content of file0.c:7244content of file0.c:8245content of file0.c:9246content of file0.c:10247content of file0.c:11248content of file0.c:12249content of file0.c:13250content of file0.c:14251content of file0.c:15252content of file0.c:16253content of file0.c:17254content of file0.c:18255content of file0.c:19256content of file0.c:20257content of file0.c:21258content of file0.c:22259content of file0.c:23260content of file0.c:24261content of file0.c:25262content of file0.c:26263content of file0.c:27264content of file0.c:28265content of file0.c:29266content of file0.c:30267#--- file1.c268content of file1.c:1269content of file1.c:2270content of file1.c:3271content of file1.c:4272content of file1.c:5273content of file1.c:6274content of file1.c:7275content of file1.c:8276content of file1.c:9277content of file1.c:10278