diff options
| author | George Rimar <grimar@accesssoftek.com> | 2018-10-25 10:56:44 +0000 |
|---|---|---|
| committer | George Rimar <grimar@accesssoftek.com> | 2018-10-25 10:56:44 +0000 |
| commit | 581fc63dc05041e9c17445a1e55b59e6dfb431ee (patch) | |
| tree | 286be52d342883ecc9fde77611a13b18d8dc85da /llvm/test/tools/llvm-dwarfdump/X86 | |
| parent | 071e82218f505396535b2d4abcf008117feb5685 (diff) | |
| download | bcm5719-llvm-581fc63dc05041e9c17445a1e55b59e6dfb431ee.tar.gz bcm5719-llvm-581fc63dc05041e9c17445a1e55b59e6dfb431ee.zip | |
[llvm-dwarfdump] - Fix incorrect parsing of the DW_LLE_startx_length
As was already mentioned in comments for D53364, DWARF 5
spec says about DW_LLE_startx_length:
"This is a form of bounded location description that has two unsigned ULEB operands.
The first value is an address index (into the .debug_addr section) that indicates the beginning of the address range
over which the location is valid. The second value is the length of the range. ")
Currently, the length is always parsed as U32.
Patch change the behavior to parse DW_LLE_startx_length as ULEB128 for DWARF 5
and keeps it as U32 for DWARF4+(pre-DWARF5) for compatibility.
Differential revision: https://reviews.llvm.org/D53564
llvm-svn: 345254
Diffstat (limited to 'llvm/test/tools/llvm-dwarfdump/X86')
| -rw-r--r-- | llvm/test/tools/llvm-dwarfdump/X86/debug_loclists_startx_length.s | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/llvm/test/tools/llvm-dwarfdump/X86/debug_loclists_startx_length.s b/llvm/test/tools/llvm-dwarfdump/X86/debug_loclists_startx_length.s new file mode 100644 index 00000000000..07c68ab2618 --- /dev/null +++ b/llvm/test/tools/llvm-dwarfdump/X86/debug_loclists_startx_length.s @@ -0,0 +1,27 @@ +# RUN: llvm-mc %s -filetype obj -triple x86_64-pc-linux -o %t.o +# RUN: llvm-dwarfdump -v %t.o | FileCheck %s + +# DW_LLE_startx_length has different `length` encoding in pre-DWARF 5 +# and final DWARF 5 versions. This test checks we are able to parse +# the final version which uses ULEB128 and not the U32. + +# CHECK: .debug_loclists contents: +# CHECK-NEXT: 0x00000000: locations list header: length = 0x0000000f, version = 0x0005, addr_size = 0x08, seg_size = 0x00, offset_entry_count = 0x00000000 +# CHECK-NEXT: 0x00000000: +# CHECK-NEXT: Addr idx 1 (w/ length 16): DW_OP_reg5 RDI + +.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. + + .byte 3 # DW_LLE_startx_length + .byte 0x01 # Index + .uleb128 0x10 # Length + .short 1 # Loc expr size + .byte 85 # DW_OP_reg5 + .byte 0 # DW_LLE_end_of_list +.Ldebug_loclist_table_end0: |

