128 lines · plain
1# Test handling of DWARF5 line tables. In particular, test that we handle files2# which are present in the line table more than once.3 4# RUN: llvm-mc -filetype=obj -o %t -triple x86_64-pc-linux %s5# RUN: %lldb %t -o "source info -f file0.c" -o "source info -f file1.c" \6# RUN: -o "breakpoint set -f file0.c -l 42" \7# RUN: -o "breakpoint set -f file0.c -l 47" \8# RUN: -o exit | FileCheck %s9 10# CHECK-LABEL: source info -f file0.c11# CHECK: [0x0000000000000000-0x0000000000000001): /file0.c:4212# CHECK-LABEL: source info -f file1.c13# CHECK: [0x0000000000000001-0x0000000000000002): /file1.c:4714# CHECK-LABEL: breakpoint set -f file0.c -l 4215# CHECK: Breakpoint 1: {{.*}}`foo,16# CHECK-LABEL: breakpoint set -f file0.c -l 4717# CHECK: Breakpoint 2: {{.*}}`foo + 2,18 19 .text20 .globl foo21foo:22 nop23 nop24 nop25.Lfoo_end:26 27 .section .debug_abbrev,"",@progbits28 .byte 1 # Abbreviation Code29 .byte 17 # DW_TAG_compile_unit30 .byte 0 # DW_CHILDREN_no31 .byte 37 # DW_AT_producer32 .byte 8 # DW_FORM_string33 .byte 19 # DW_AT_language34 .byte 5 # DW_FORM_data235 .byte 3 # DW_AT_name36 .byte 8 # DW_FORM_string37 .byte 16 # DW_AT_stmt_list38 .byte 23 # DW_FORM_sec_offset39 .byte 27 # DW_AT_comp_dir40 .byte 8 # DW_FORM_string41 .byte 17 # DW_AT_low_pc42 .byte 1 # DW_FORM_addr43 .byte 18 # DW_AT_high_pc44 .byte 6 # DW_FORM_data445 .byte 0 # EOM(1)46 .byte 0 # EOM(2)47 .byte 0 # EOM(3)48 49 .section .debug_info,"",@progbits50.Lcu_begin0:51 .long .Ldebug_info_end0-.Ldebug_info_start0 # Length of Unit52.Ldebug_info_start0:53 .short 5 # DWARF version number54 .byte 1 # DWARF Unit Type55 .byte 8 # Address Size (in bytes)56 .long .debug_abbrev # Offset Into Abbrev. Section57 .byte 1 # Abbrev [1] 0xc:0x23 DW_TAG_compile_unit58 .asciz "Hand-written DWARF" # DW_AT_producer59 .short 12 # DW_AT_language60 .asciz "file0.c" # DW_AT_name61 .long .Lline_table_begin # DW_AT_stmt_list62 .asciz "/" # DW_AT_comp_dir63 .quad foo # DW_AT_low_pc64 .long .Lfoo_end-foo # DW_AT_high_pc65.Ldebug_info_end0:66 67 .section .debug_line,"",@progbits68.Lline_table_begin:69 .long .Lline_end-.Lline_start70.Lline_start:71 .short 5 # DWARF version number72 .byte 8 # Address Size (in bytes)73 .byte 0 # Segment Selector Size74 .long .Lheader_end-.Lheader_start75.Lheader_start:76 .byte 1 # Minimum Instruction Length77 .byte 1 # Maximum Operations per Instruction78 .byte 1 # Default is_stmt79 .byte 0 # Line Base80 .byte 0 # Line Range81 .byte 5 # Opcode Base82 .byte 0, 1, 1, 1 # Standard Opcode Lengths83 84 # Directory table format85 .byte 1 # One element per directory entry86 .byte 1 # DW_LNCT_path87 .byte 0x08 # DW_FORM_string88 89 # Directory table entries90 .byte 1 # 1 directory91 .asciz "/"92 93 # File table format94 .byte 2 # 2 elements per file entry95 .byte 1 # DW_LNCT_path96 .byte 0x08 # DW_FORM_string97 .byte 2 # DW_LNCT_directory_index98 .byte 0x0b # DW_FORM_data199 100 # File table entries101 .byte 3 # 3 files102 .asciz "file0.c"103 .byte 0104 .asciz "file1.c"105 .byte 0106 .asciz "file0.c"107 .byte 0108.Lheader_end:109 110 .byte 4, 0 # DW_LNS_set_file 0111 .byte 0, 9, 2 # DW_LNE_set_address112 .quad foo113 .byte 3, 41 # DW_LNS_advance_line 41114 .byte 1 # DW_LNS_copy115 116 .byte 4, 1 # DW_LNS_set_file 1117 .byte 2, 1 # DW_LNS_advance_pc 1118 .byte 3, 5 # DW_LNS_advance_line 5119 .byte 1 # DW_LNS_copy120 121 .byte 4, 2 # DW_LNS_set_file 2122 .byte 2, 1 # DW_LNS_advance_pc 1123 .byte 1 # DW_LNS_copy124 125 .byte 2, 1 # DW_LNS_advance_pc 1126 .byte 0, 1, 1 # DW_LNE_end_sequence127.Lline_end:128