[llvm-branch-commits] [llvm-branch] r353029 - Merging r352889:
Hans Wennborg via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Mon Feb 4 01:31:38 PST 2019
Author: hans
Date: Mon Feb 4 01:31:37 2019
New Revision: 353029
URL: http://llvm.org/viewvc/llvm-project?rev=353029&view=rev
Log:
Merging r352889:
------------------------------------------------------------------------
r352889 | wolfgangp | 2019-02-01 18:11:58 +0100 (Fri, 01 Feb 2019) | 6 lines
[DWARF v5] Fix DWARF emitter and consumer to produce/expect a uleb for a location description's length.
Reviewer: davide, JDevliegere
Differential Revision: https://reviews.llvm.org/D57550
------------------------------------------------------------------------
Modified:
llvm/branches/release_80/ (props changed)
llvm/branches/release_80/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
llvm/branches/release_80/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp
llvm/branches/release_80/test/CodeGen/X86/debug-loclists.ll
llvm/branches/release_80/test/DebugInfo/X86/dwarfdump-debug-loclists.test
llvm/branches/release_80/test/tools/llvm-dwarfdump/X86/debug_loclists_startx_length.s
Propchange: llvm/branches/release_80/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Feb 4 01:31:37 2019
@@ -1,3 +1,3 @@
/llvm/branches/Apple/Pertwee:110850,110961
/llvm/branches/type-system-rewrite:133420-134817
-/llvm/trunk:155241,351325,351344-351345,351349,351351,351370,351381,351421,351426,351436,351475,351485,351753-351754,351910,351930,351932,352034,352204,352246,352374,352770
+/llvm/trunk:155241,351325,351344-351345,351349,351351,351370,351381,351421,351426,351436,351475,351485,351753-351754,351910,351930,351932,352034,352204,352246,352374,352770,352889
Modified: llvm/branches/release_80/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_80/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=353029&r1=353028&r2=353029&view=diff
==============================================================================
--- llvm/branches/release_80/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/branches/release_80/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Mon Feb 4 01:31:37 2019
@@ -1956,8 +1956,10 @@ void DebugLocEntry::finalize(const AsmPr
void DwarfDebug::emitDebugLocEntryLocation(const DebugLocStream::Entry &Entry) {
// Emit the size.
Asm->OutStreamer->AddComment("Loc expr size");
- Asm->emitInt16(DebugLocs.getBytes(Entry).size());
-
+ if (getDwarfVersion() >= 5)
+ Asm->EmitULEB128(DebugLocs.getBytes(Entry).size());
+ else
+ Asm->emitInt16(DebugLocs.getBytes(Entry).size());
// Emit the entry.
APByteStreamer Streamer(*Asm);
emitDebugLocEntry(Streamer, Entry);
Modified: llvm/branches/release_80/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_80/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp?rev=353029&r1=353028&r2=353029&view=diff
==============================================================================
--- llvm/branches/release_80/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp (original)
+++ llvm/branches/release_80/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp Mon Feb 4 01:31:37 2019
@@ -184,7 +184,8 @@ DWARFDebugLoclists::parseOneLocationList
}
if (Kind != dwarf::DW_LLE_base_address) {
- unsigned Bytes = Data.getU16(Offset);
+ unsigned Bytes =
+ Version >= 5 ? Data.getULEB128(Offset) : Data.getU16(Offset);
// A single location description describing the location of the object...
StringRef str = Data.getData().substr(*Offset, Bytes);
*Offset += Bytes;
Modified: llvm/branches/release_80/test/CodeGen/X86/debug-loclists.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_80/test/CodeGen/X86/debug-loclists.ll?rev=353029&r1=353028&r2=353029&view=diff
==============================================================================
--- llvm/branches/release_80/test/CodeGen/X86/debug-loclists.ll (original)
+++ llvm/branches/release_80/test/CodeGen/X86/debug-loclists.ll Mon Feb 4 01:31:37 2019
@@ -11,7 +11,7 @@
; CHECK-NEXT: DW_AT_type [DW_FORM_ref4] (cu + 0x0040 => {0x00000040} "A")
; CHECK: .debug_loclists contents:
-; CHECK-NEXT: 0x00000000: locations list header: length = 0x00000017, version = 0x0005, addr_size = 0x08, seg_size = 0x00, offset_entry_count = 0x00000000
+; CHECK-NEXT: 0x00000000: locations list header: length = 0x00000015, version = 0x0005, addr_size = 0x08, seg_size = 0x00, offset_entry_count = 0x00000000
; CHECK-NEXT: 0x00000000:
; CHECK-NEXT: [0x0000000000000000, 0x0000000000000004): DW_OP_breg5 RDI+0
; CHECK-NEXT: [0x0000000000000004, 0x0000000000000012): DW_OP_breg3 RBX+0
@@ -32,13 +32,13 @@
; ASM-NEXT: .byte 4 # DW_LLE_offset_pair
; ASM-NEXT: .uleb128 .Lfunc_begin0-.Lfunc_begin0 # starting offset
; ASM-NEXT: .uleb128 .Ltmp0-.Lfunc_begin0 # ending offset
-; ASM-NEXT: .short 2 # Loc expr size
+; ASM-NEXT: .byte 2 # Loc expr size
; ASM-NEXT: .byte 117 # DW_OP_breg5
; ASM-NEXT: .byte 0 # 0
; ASM-NEXT: .byte 4 # DW_LLE_offset_pair
; ASM-NEXT: .uleb128 .Ltmp0-.Lfunc_begin0 # starting offset
; ASM-NEXT: .uleb128 .Ltmp1-.Lfunc_begin0 # ending offset
-; ASM-NEXT: .short 2 # Loc expr size
+; ASM-NEXT: .byte 2 # Loc expr size
; ASM-NEXT: .byte 115 # DW_OP_breg3
; ASM-NEXT: .byte 0 # 0
; ASM-NEXT: .byte 0 # DW_LLE_end_of_list
Modified: llvm/branches/release_80/test/DebugInfo/X86/dwarfdump-debug-loclists.test
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_80/test/DebugInfo/X86/dwarfdump-debug-loclists.test?rev=353029&r1=353028&r2=353029&view=diff
==============================================================================
--- llvm/branches/release_80/test/DebugInfo/X86/dwarfdump-debug-loclists.test (original)
+++ llvm/branches/release_80/test/DebugInfo/X86/dwarfdump-debug-loclists.test Mon Feb 4 01:31:37 2019
@@ -9,7 +9,7 @@
# CHECK-NEXT: [0x0000000000000700, 0x0000000000000710): DW_OP_breg5 RDI+0
# CHECK: .debug_loclists contents:
-# CHECK-NEXT: 0x00000000: locations list header: length = 0x0000002f, version = 0x0005, addr_size = 0x08, seg_size = 0x00, offset_entry_count = 0x00000000
+# CHECK-NEXT: 0x00000000: locations list header: length = 0x0000002c, version = 0x0005, addr_size = 0x08, seg_size = 0x00, offset_entry_count = 0x00000000
# CHECK-NEXT: 0x00000000:
# CHECK-NEXT: [0x0000000000000000, 0x0000000000000010): DW_OP_breg5 RDI+0
# CHECK-NEXT: [0x0000000000000530, 0x0000000000000540): DW_OP_breg6 RBP-8, DW_OP_deref
@@ -37,7 +37,7 @@
.byte 4 # DW_LLE_offset_pair
.uleb128 0x0 # starting offset
.uleb128 0x10 # ending offset
- .short 2 # Loc expr size
+ .byte 2 # Loc expr size
.byte 117 # DW_OP_breg5
.byte 0 # 0
@@ -47,7 +47,7 @@
.byte 4 # DW_LLE_offset_pair
.uleb128 0x30 # starting offset
.uleb128 0x40 # ending offset
- .short 3 # Loc expr size
+ .byte 3 # Loc expr size
.byte 118 # DW_OP_breg6
.byte 120 # -8
.byte 6 # DW_OP_deref
@@ -55,7 +55,7 @@
.byte 8 # DW_LLE_start_length
.quad 0x700 # Some address
.uleb128 0x10 # length
- .short 2 # Loc expr size
+ .byte 2 # Loc expr size
.byte 117 # DW_OP_breg5
.byte 0 # 0
Modified: llvm/branches/release_80/test/tools/llvm-dwarfdump/X86/debug_loclists_startx_length.s
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_80/test/tools/llvm-dwarfdump/X86/debug_loclists_startx_length.s?rev=353029&r1=353028&r2=353029&view=diff
==============================================================================
--- llvm/branches/release_80/test/tools/llvm-dwarfdump/X86/debug_loclists_startx_length.s (original)
+++ llvm/branches/release_80/test/tools/llvm-dwarfdump/X86/debug_loclists_startx_length.s Mon Feb 4 01:31:37 2019
@@ -6,7 +6,7 @@
# 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: locations list header: length = 0x0000000e, 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
@@ -21,7 +21,7 @@
.byte 3 # DW_LLE_startx_length
.byte 0x01 # Index
.uleb128 0x10 # Length
- .short 1 # Loc expr size
+ .byte 1 # Loc expr size
.byte 85 # DW_OP_reg5
.byte 0 # DW_LLE_end_of_list
.Ldebug_loclist_table_end0:
More information about the llvm-branch-commits
mailing list