128 lines · plain
1# This test checks the handling of location lists in the case when the module is2# not loaded at the address at which it was linked (as happens with ASLR for3# instance).4 5# RUN: yaml2obj %S/Inputs/debug_loc-aslr.yaml -o %t.dmp6# RUN: llvm-mc --triple=x86_64-pc-linux --filetype=obj %s >%t.o7# RUN: %lldb -c %t.dmp -o "image add %t.o" \8# RUN: -o "image load --file %t.o --slide 0x470000" \9# RUN: -o "thread info" -o "frame variable" -o exit | FileCheck %s10 11# CHECK: thread #1: tid = 16001, 0x0000000000470001 {{.*}}`_start12# CHECK: (int) x = 4713# CHECK: (int) y = 7414 15 .text16 .globl _start17_start:18 nop19 retq20.Lstart_end:21 22 .section .debug_loc,"",@progbits23# This location list implicitly uses the base address of the compile unit.24.Ldebug_loc0:25 .quad _start-_start26 .quad .Lstart_end-_start27 .short 3 # Loc expr size28 .byte 8 # DW_OP_const1u29 .byte 4730 .byte 159 # DW_OP_stack_value31 .quad 032 .quad 033 34# This is an equivalent location list to the first one, but here the base35# address is set explicitly.36.Ldebug_loc1:37 .quad -138 .quad _start39 .quad _start-_start40 .quad .Lstart_end-_start41 .short 3 # Loc expr size42 .byte 8 # DW_OP_const1u43 .byte 7444 .byte 159 # DW_OP_stack_value45 .quad 046 .quad 047 48 .section .debug_abbrev,"",@progbits49 .byte 1 # Abbreviation Code50 .byte 17 # DW_TAG_compile_unit51 .byte 1 # DW_CHILDREN_yes52 .byte 37 # DW_AT_producer53 .byte 8 # DW_FORM_string54 .byte 19 # DW_AT_language55 .byte 5 # DW_FORM_data256 .byte 17 # DW_AT_low_pc57 .byte 1 # DW_FORM_addr58 .byte 18 # DW_AT_high_pc59 .byte 6 # DW_FORM_data460 .byte 0 # EOM(1)61 .byte 0 # EOM(2)62 .byte 2 # Abbreviation Code63 .byte 46 # DW_TAG_subprogram64 .byte 1 # DW_CHILDREN_yes65 .byte 17 # DW_AT_low_pc66 .byte 1 # DW_FORM_addr67 .byte 18 # DW_AT_high_pc68 .byte 6 # DW_FORM_data469 .byte 3 # DW_AT_name70 .byte 8 # DW_FORM_string71 .byte 0 # EOM(1)72 .byte 0 # EOM(2)73 .byte 4 # Abbreviation Code74 .byte 52 # DW_TAG_variable75 .byte 0 # DW_CHILDREN_no76 .byte 2 # DW_AT_location77 .byte 23 # DW_FORM_sec_offset78 .byte 3 # DW_AT_name79 .byte 8 # DW_FORM_string80 .byte 73 # DW_AT_type81 .byte 19 # DW_FORM_ref482 .byte 0 # EOM(1)83 .byte 0 # EOM(2)84 .byte 6 # Abbreviation Code85 .byte 36 # DW_TAG_base_type86 .byte 0 # DW_CHILDREN_no87 .byte 3 # DW_AT_name88 .byte 8 # DW_FORM_string89 .byte 62 # DW_AT_encoding90 .byte 11 # DW_FORM_data191 .byte 11 # DW_AT_byte_size92 .byte 11 # DW_FORM_data193 .byte 0 # EOM(1)94 .byte 0 # EOM(2)95 .byte 0 # EOM(3)96 .section .debug_info,"",@progbits97.Lcu_begin0:98 .long .Ldebug_info_end0-.Ldebug_info_start0 # Length of Unit99.Ldebug_info_start0:100 .short 4 # DWARF version number101 .long .debug_abbrev # Offset Into Abbrev. Section102 .byte 8 # Address Size (in bytes)103 .byte 1 # Abbrev [1] 0xb:0x6a DW_TAG_compile_unit104 .asciz "Hand-written DWARF" # DW_AT_producer105 .short 12 # DW_AT_language106 .quad _start # DW_AT_low_pc107 .long .Lstart_end-_start # DW_AT_high_pc108 .byte 2 # Abbrev [2] 0x2a:0x43 DW_TAG_subprogram109 .quad _start # DW_AT_low_pc110 .long .Lstart_end-_start # DW_AT_high_pc111 .asciz "_start" # DW_AT_name112 .byte 4 # Abbrev [4] 0x52:0xf DW_TAG_variable113 .long .Ldebug_loc0 # DW_AT_location114 .asciz "x" # DW_AT_name115 .long .Lint # DW_AT_type116 .byte 4 # Abbrev [4] 0x52:0xf DW_TAG_variable117 .long .Ldebug_loc1 # DW_AT_location118 .asciz "y" # DW_AT_name119 .long .Lint # DW_AT_type120 .byte 0 # End Of Children Mark121.Lint:122 .byte 6 # Abbrev [6] 0x6d:0x7 DW_TAG_base_type123 .asciz "int" # DW_AT_name124 .byte 5 # DW_AT_encoding125 .byte 4 # DW_AT_byte_size126 .byte 0 # End Of Children Mark127.Ldebug_info_end0:128