2018-10-22 19:30:54 +08:00
|
|
|
# RUN: llvm-mc %s -filetype obj -triple x86_64-pc-linux -o %t.o
|
|
|
|
# RUN: llvm-dwarfdump -v %t.o | FileCheck %s
|
|
|
|
|
|
|
|
# CHECK: .debug_info
|
|
|
|
# CHECK: DW_AT_name{{.*}}"stub"
|
|
|
|
# CHECK: DW_AT_location [DW_FORM_sec_offset] (0x0000000c
|
2018-10-22 20:18:30 +08:00
|
|
|
# CHECK-NEXT: [0x0000000000000010, 0x0000000000000020): DW_OP_breg5 RDI+0
|
|
|
|
# CHECK-NEXT: [0x0000000000000530, 0x0000000000000540): DW_OP_breg6 RBP-8, DW_OP_deref
|
|
|
|
# CHECK-NEXT: [0x0000000000000700, 0x0000000000000710): DW_OP_breg5 RDI+0
|
2018-10-22 19:30:54 +08:00
|
|
|
|
|
|
|
# CHECK: .debug_loclists contents:
|
2019-02-02 01:11:58 +08:00
|
|
|
# CHECK-NEXT: 0x00000000: locations list header: length = 0x0000002c, version = 0x0005, addr_size = 0x08, seg_size = 0x00, offset_entry_count = 0x00000000
|
2019-10-10 05:25:28 +08:00
|
|
|
# CHECK-NEXT: 0x0000000c:
|
2019-11-12 18:36:19 +08:00
|
|
|
# CHECK-NEXT: DW_LLE_offset_pair (0x0000000000000000, 0x0000000000000010): DW_OP_breg5 RDI+0
|
DWARFDebugLoclists: Move to a incremental parsing model
Summary:
This patch stems from the discussion D68270 (including some offline
talks). The idea is to provide an "incremental" api for parsing location
lists, which will avoid caching or materializing parsed data. An
additional goal is to provide a high level location list api, which
abstracts the differences between different encoding schemes, and can be
used by users which don't care about those (such as LLDB).
This patch implements the first part. It implements a call-back based
"visitLocationList" api. This function parses a single location list,
calling a user-specified callback for each entry. This is going to be
the base api, which other location list functions (right now, just the
dumping code) are going to be based on.
Future patches will do something similar for the v4 location lists, and
add a mechanism to translate raw entries into concrete address ranges.
Reviewers: dblaikie, probinson, JDevlieghere, aprantl, SouraVX
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D69672
2019-10-31 22:05:33 +08:00
|
|
|
# CHECK-NEXT: DW_LLE_base_address (0x0000000000000500)
|
|
|
|
# CHECK-NEXT: DW_LLE_offset_pair (0x0000000000000030, 0x0000000000000040)
|
2019-10-12 03:06:35 +08:00
|
|
|
# CHECK-NEXT: => [0x0000000000000530, 0x0000000000000540): DW_OP_breg6 RBP-8, DW_OP_deref
|
DWARFDebugLoclists: Move to a incremental parsing model
Summary:
This patch stems from the discussion D68270 (including some offline
talks). The idea is to provide an "incremental" api for parsing location
lists, which will avoid caching or materializing parsed data. An
additional goal is to provide a high level location list api, which
abstracts the differences between different encoding schemes, and can be
used by users which don't care about those (such as LLDB).
This patch implements the first part. It implements a call-back based
"visitLocationList" api. This function parses a single location list,
calling a user-specified callback for each entry. This is going to be
the base api, which other location list functions (right now, just the
dumping code) are going to be based on.
Future patches will do something similar for the v4 location lists, and
add a mechanism to translate raw entries into concrete address ranges.
Reviewers: dblaikie, probinson, JDevlieghere, aprantl, SouraVX
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D69672
2019-10-31 22:05:33 +08:00
|
|
|
# CHECK-NEXT: DW_LLE_start_length (0x0000000000000700, 0x0000000000000010)
|
2019-10-12 03:06:35 +08:00
|
|
|
# CHECK-NEXT: => [0x0000000000000700, 0x0000000000000710): DW_OP_breg5 RDI+0
|
DWARFDebugLoclists: Move to a incremental parsing model
Summary:
This patch stems from the discussion D68270 (including some offline
talks). The idea is to provide an "incremental" api for parsing location
lists, which will avoid caching or materializing parsed data. An
additional goal is to provide a high level location list api, which
abstracts the differences between different encoding schemes, and can be
used by users which don't care about those (such as LLDB).
This patch implements the first part. It implements a call-back based
"visitLocationList" api. This function parses a single location list,
calling a user-specified callback for each entry. This is going to be
the base api, which other location list functions (right now, just the
dumping code) are going to be based on.
Future patches will do something similar for the v4 location lists, and
add a mechanism to translate raw entries into concrete address ranges.
Reviewers: dblaikie, probinson, JDevlieghere, aprantl, SouraVX
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D69672
2019-10-31 22:05:33 +08:00
|
|
|
# CHECK-NEXT: DW_LLE_end_of_list ()
|
2018-10-22 19:30:54 +08:00
|
|
|
|
|
|
|
.section .debug_str,"MS",@progbits,1
|
|
|
|
.asciz "stub"
|
|
|
|
|
|
|
|
.section .debug_str_offsets,"",@progbits
|
|
|
|
.long 68
|
|
|
|
.short 5
|
|
|
|
.short 0
|
|
|
|
.Lstr_offsets_base0:
|
|
|
|
.zero 64
|
|
|
|
|
|
|
|
.section .debug_loclists,"",@progbits
|
|
|
|
.long .Ldebug_loclist_table_end0-.Ldebug_loclist_table_start0
|
|
|
|
.Ldebug_loclist_table_start0:
|
|
|
|
.short 5 # Version.
|
|
|
|
.byte 8 # Address size.
|
|
|
|
.byte 0 # Segmen selector size.
|
|
|
|
.long 0 # Offset entry count.
|
|
|
|
.Lloclists_table_base0:
|
|
|
|
.Ldebug_loc0:
|
|
|
|
.byte 4 # DW_LLE_offset_pair
|
|
|
|
.uleb128 0x0 # starting offset
|
|
|
|
.uleb128 0x10 # ending offset
|
2019-02-02 01:11:58 +08:00
|
|
|
.byte 2 # Loc expr size
|
2018-10-22 19:30:54 +08:00
|
|
|
.byte 117 # DW_OP_breg5
|
|
|
|
.byte 0 # 0
|
|
|
|
|
|
|
|
.byte 6 # DW_LLE_base_address
|
|
|
|
.quad 0x500 # Some address
|
|
|
|
|
|
|
|
.byte 4 # DW_LLE_offset_pair
|
|
|
|
.uleb128 0x30 # starting offset
|
|
|
|
.uleb128 0x40 # ending offset
|
2019-02-02 01:11:58 +08:00
|
|
|
.byte 3 # Loc expr size
|
2018-10-22 19:30:54 +08:00
|
|
|
.byte 118 # DW_OP_breg6
|
|
|
|
.byte 120 # -8
|
|
|
|
.byte 6 # DW_OP_deref
|
|
|
|
|
|
|
|
.byte 8 # DW_LLE_start_length
|
|
|
|
.quad 0x700 # Some address
|
|
|
|
.uleb128 0x10 # length
|
2019-02-02 01:11:58 +08:00
|
|
|
.byte 2 # Loc expr size
|
2018-10-22 19:30:54 +08:00
|
|
|
.byte 117 # DW_OP_breg5
|
|
|
|
.byte 0 # 0
|
|
|
|
|
|
|
|
.byte 0 # DW_LLE_end_of_list
|
|
|
|
|
|
|
|
.Ldebug_loclist_table_end0:
|
|
|
|
|
|
|
|
.section .debug_abbrev,"",@progbits
|
|
|
|
.byte 1 # Abbreviation Code
|
|
|
|
.byte 17 # DW_TAG_compile_unit
|
|
|
|
.byte 1 # DW_CHILDREN_yes
|
|
|
|
.byte 37 # DW_AT_producer
|
|
|
|
.byte 37 # DW_FORM_strx1
|
|
|
|
.byte 19 # DW_AT_language
|
|
|
|
.byte 5 # DW_FORM_data2
|
|
|
|
.byte 3 # DW_AT_name
|
|
|
|
.byte 37 # DW_FORM_strx1
|
|
|
|
.byte 114 # DW_AT_str_offsets_base
|
|
|
|
.byte 23 # DW_FORM_sec_offset
|
|
|
|
.byte 16 # DW_AT_stmt_list
|
|
|
|
.byte 23 # DW_FORM_sec_offset
|
|
|
|
.byte 27 # DW_AT_comp_dir
|
|
|
|
.byte 37 # DW_FORM_strx1
|
|
|
|
.byte 17 # DW_AT_low_pc
|
|
|
|
.byte 1 # DW_FORM_addr
|
|
|
|
.byte 18 # DW_AT_high_pc
|
|
|
|
.byte 6 # DW_FORM_data4
|
|
|
|
.ascii "\214\001" # DW_AT_loclists_base
|
|
|
|
.byte 23 # DW_FORM_sec_offset
|
|
|
|
.byte 0 # EOM(1)
|
|
|
|
.byte 0 # EOM(2)
|
|
|
|
.byte 2 # Abbreviation Code
|
|
|
|
.byte 46 # DW_TAG_subprogram
|
|
|
|
.byte 1 # DW_CHILDREN_yes
|
|
|
|
.byte 17 # DW_AT_low_pc
|
|
|
|
.byte 1 # DW_FORM_addr
|
|
|
|
.byte 18 # DW_AT_high_pc
|
|
|
|
.byte 6 # DW_FORM_data4
|
|
|
|
.byte 64 # DW_AT_frame_base
|
|
|
|
.byte 24 # DW_FORM_exprloc
|
|
|
|
.byte 110 # DW_AT_linkage_name
|
|
|
|
.byte 37 # DW_FORM_strx1
|
|
|
|
.byte 3 # DW_AT_name
|
|
|
|
.byte 37 # DW_FORM_strx1
|
|
|
|
.byte 58 # DW_AT_decl_file
|
|
|
|
.byte 11 # DW_FORM_data1
|
|
|
|
.byte 59 # DW_AT_decl_line
|
|
|
|
.byte 11 # DW_FORM_data1
|
|
|
|
.byte 63 # DW_AT_external
|
|
|
|
.byte 25 # DW_FORM_flag_present
|
|
|
|
.byte 0 # EOM(1)
|
|
|
|
.byte 0 # EOM(2)
|
|
|
|
.byte 3 # Abbreviation Code
|
|
|
|
.byte 52 # DW_TAG_variable
|
|
|
|
.byte 0 # DW_CHILDREN_no
|
|
|
|
.byte 2 # DW_AT_location
|
|
|
|
.byte 23 # DW_FORM_sec_offset
|
|
|
|
.byte 3 # DW_AT_name
|
|
|
|
.byte 37 # DW_FORM_strx1
|
|
|
|
.byte 58 # DW_AT_decl_file
|
|
|
|
.byte 11 # DW_FORM_data1
|
|
|
|
.byte 59 # DW_AT_decl_line
|
|
|
|
.byte 11 # DW_FORM_data1
|
|
|
|
.byte 73 # DW_AT_type
|
|
|
|
.byte 19 # DW_FORM_ref4
|
|
|
|
.byte 0 # EOM(1)
|
|
|
|
.byte 0 # EOM(2)
|
|
|
|
.byte 0 # EOM(3)
|
|
|
|
|
|
|
|
.section .debug_info,"",@progbits
|
|
|
|
.Lcu_begin0:
|
|
|
|
.long 70 # Length of Unit
|
|
|
|
.short 5 # DWARF version number
|
|
|
|
.byte 1 # DWARF Unit Type
|
|
|
|
.byte 8 # Address Size (in bytes)
|
|
|
|
.long .debug_abbrev # Offset Into Abbrev. Section
|
|
|
|
.byte 1 # Abbrev [1] 0xc:0xef DW_TAG_compile_unit
|
|
|
|
.byte 0 # DW_AT_producer
|
|
|
|
.short 4 # DW_AT_language
|
|
|
|
.byte 1 # DW_AT_name
|
|
|
|
.long .Lstr_offsets_base0 # DW_AT_str_offsets_base
|
|
|
|
.long .Lline_table_start0 # DW_AT_stmt_list
|
|
|
|
.byte 2 # DW_AT_comp_dir
|
|
|
|
.quad 0x10 # DW_AT_low_pc
|
|
|
|
.long 0 # DW_AT_high_pc
|
|
|
|
.long .Lloclists_table_base0 # DW_AT_loclists_base
|
|
|
|
.byte 2 # Abbrev [2] 0x2a:0x20 DW_TAG_subprogram
|
|
|
|
.quad 0 # DW_AT_low_pc
|
|
|
|
.long 0 # DW_AT_high_pc
|
|
|
|
.byte 1 # DW_AT_frame_base
|
|
|
|
.byte 86
|
|
|
|
.byte 11 # DW_AT_linkage_name
|
|
|
|
.byte 12 # DW_AT_name
|
|
|
|
.byte 1 # DW_AT_decl_file
|
|
|
|
.byte 6 # DW_AT_decl_line
|
|
|
|
# DW_AT_external
|
|
|
|
.byte 3 # Abbrev [3] 0x40:0xb DW_TAG_variable
|
|
|
|
.long .Ldebug_loc0 # DW_AT_location
|
|
|
|
.byte 7 # DW_AT_name
|
|
|
|
.byte 1 # DW_AT_decl_file
|
|
|
|
.byte 6 # DW_AT_decl_line
|
|
|
|
.long 76 # DW_AT_type
|
|
|
|
.byte 0 # End Of Children Mark
|
|
|
|
.byte 0 # End Of Children Mark
|
|
|
|
.byte 0 # End Of Children Mark
|
|
|
|
|
|
|
|
.section .debug_line,"",@progbits
|
|
|
|
.Lline_table_start0:
|
|
|
|
|