[llvm] 8e1f820 - [dsymutil] Update DWARF 5 tests after 8119ab9bf78b
Jonas Devlieghere via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 16 13:57:44 PDT 2023
Author: Jonas Devlieghere
Date: 2023-06-16T13:57:40-07:00
New Revision: 8e1f820bb4eadf5c0704818f6063e0db1006e32d
URL: https://github.com/llvm/llvm-project/commit/8e1f820bb4eadf5c0704818f6063e0db1006e32d
DIFF: https://github.com/llvm/llvm-project/commit/8e1f820bb4eadf5c0704818f6063e0db1006e32d.diff
LOG: [dsymutil] Update DWARF 5 tests after 8119ab9bf78b
Update test affected by 8119ab9bf78b and address Adrian's post commit
review feedback.
Added:
Modified:
llvm/test/tools/dsymutil/ARM/dwarf5-dwarf4-combination-macho.test
llvm/test/tools/dsymutil/ARM/dwarf5-macho.test
llvm/tools/dsymutil/DwarfLinkerForBinary.cpp
Removed:
################################################################################
diff --git a/llvm/test/tools/dsymutil/ARM/dwarf5-dwarf4-combination-macho.test b/llvm/test/tools/dsymutil/ARM/dwarf5-dwarf4-combination-macho.test
index c0b1af306461d..f0e74457d59f5 100644
--- a/llvm/test/tools/dsymutil/ARM/dwarf5-dwarf4-combination-macho.test
+++ b/llvm/test/tools/dsymutil/ARM/dwarf5-dwarf4-combination-macho.test
@@ -1,13 +1,13 @@
; This test checks to ensure that if a DWARF v5 and DWARF v4 object file is used to
; generate a dsym, dsymutil correctly outputs the debug information, by keeping
-; the DWARF v5 and DWARF v4 debug info distinct, and that all the section headers
+; the DWARF v5 and DWARF v4 debug info distinct, and that all the section headers
; have the correct format.
; 1.o was produced with the source file:
; a.cpp
; __attribute__((section("1,__text_foo"))) void foo() {}
-;
+;
; int foo2(int a) {
; return a+5;
; }
@@ -21,7 +21,7 @@
; b.cpp
; __attribute__((section("1,__text_foo2"))) void foo2() {}
-;
+;
; int bar(int x) {
; int y = x + 2;
; return y;
@@ -39,19 +39,19 @@ CHECK:.debug_abbrev contents:
CHECK-NEXT: Abbrev table for offset: 0x00000000
CHECK: .debug_info contents:
-CHECK-NEXT: 0x00000000: Compile Unit: length = 0x0000007d, format = DWARF32, version = 0x0005, unit_type = DW_UT_compile, abbr_offset = 0x0000, addr_size = 0x08 (next unit at 0x00000081)
+CHECK: 0x00000000: Compile Unit: length = 0x00000064, format = DWARF32, version = 0x0005, unit_type = DW_UT_compile, abbr_offset = 0x0000, addr_size = 0x08 (next unit at 0x00000068)
CHECK: DW_AT_ranges [DW_FORM_sec_offset] (0x[[RANGELIST_OFFSET:[0-9a-f]+]]
CHECK-NEXT: [0x[[RANGELIST_OFFSET_START:[0-9a-f]+]], 0x[[RANGELIST_OFFSET_END:[0-9a-f]+]]))
-CHECK: 0x00000050: DW_TAG_formal_parameter [3] (0x00000033)
-CHECK-NEXT: DW_AT_location [DW_FORM_sec_offset] (0x[[LOCLIST_OFFSET:[0-9a-f]+]]:
+CHECK: DW_TAG_formal_parameter [3] (0x00000033)
+CHECK-NEXT: DW_AT_location [DW_FORM_sec_offset] (0x[[LOCLIST_OFFSET:[0-9a-f]+]]:
CHECK-NEXT: [0x[[LOCLIST_OFFSET_START:[0-9a-f]+]], 0x[[LOCLIST_OFFSET_END:[0-9a-f]+]]): [[LOCLIST_EXPR:.*]]
CHECK-NEXT: [0x[[LOCLIST_OFFSET_START2:[0-9a-f]+]], 0x[[LOCLIST_OFFSET_END2:[0-9a-f]+]]): [[LOCLIST_EXPR2:.*]])
-CHECK: 0x00000081: Compile Unit: length = 0x00000072, format = DWARF32, version = 0x0004, abbr_offset = 0x0000, addr_size = 0x08 (next unit at 0x000000f7)
+CHECK: 0x00000068: Compile Unit: length = 0x00000072, format = DWARF32, version = 0x0004, abbr_offset = 0x0000, addr_size = 0x08 (next unit at 0x000000de)
CHECK: DW_AT_ranges [DW_FORM_sec_offset] (0x00000000
CHECK-NEXT: [0x00000000000200[[RANGE_OFFSET_START:[0-9a-f][0-9a-f]]], 0x00000000000200[[RANGE_OFFSET_END:[0-9a-f][0-9a-f]]]))
-CHECK:0x000000d0: DW_TAG_formal_parameter [3] (0x000000b3)
-CHECK-NEXT: DW_AT_location [DW_FORM_sec_offset] (0x[[LOC_OFFSET:[0-9a-f]+]]:
+CHECK: DW_TAG_formal_parameter [3] (0x0000009a)
+CHECK-NEXT: DW_AT_location [DW_FORM_sec_offset] (0x[[LOC_OFFSET:[0-9a-f]+]]:
CHECK-NEXT: [0x00000000000200[[LOC_OFFSET_START:[0-9a-f][0-9a-f]]], 0x00000000000200[[LOC_OFFSET_END:[0-9a-f][0-9a-f]]]): [[LOC_EXPR:.*]]
CHECK-NEXT: [0x00000000000200[[LOC_OFFSET_START2:[0-9a-f][0-9a-f]]], 0x00000000000200[[LOC_OFFSET_END2:[0-9a-f][0-9a-f]]]): [[LOC_EXPR2:.*]])
@@ -62,7 +62,7 @@ CHECK-NEXT: (0x0000000000000004, 0x0000000000000008): [[LOC_EXPR2:.*]
CHECK: .debug_loclists contents:
CHECK-NEXT: 0x00000000: locations list header: length = 0x00000024, format = DWARF32, version = 0x0005, addr_size = 0x08, seg_size = 0x00, offset_entry_count = 0x00000000
-CHECK-NEXT: 0x[[LOCLIST_OFFSET]]:
+CHECK-NEXT: 0x[[LOCLIST_OFFSET]]:
CHECK-NEXT: DW_LLE_start_length {{.*}}
CHECK-NEXT: => [0x[[LOCLIST_OFFSET_START]], 0x[[LOCLIST_OFFSET_END]]): [[LOCLIST_EXPR]]
CHECK-NEXT: DW_LLE_start_length {{.*}}
@@ -72,7 +72,7 @@ CHECK-NEXT: DW_LLE_end_of_list ()
CHECK: .debug_line contents:
CHECK-NEXT: debug_line[0x00000000]
CHECK-NEXT: Line table prologue:
-CHECK-NEXT: total_length: 0x00000050
+CHECK-NEXT: total_length: 0x00000048
CHECK-NEXT: format: DWARF32
CHECK-NEXT: version: 5
CHECK-NEXT: address_size: 8
@@ -101,7 +101,7 @@ CHECK-NEXT: file_names[ 0]:
CHECK-NEXT: name: .debug_line_str[0x00000029] = "a.cpp"
CHECK-NEXT: dir_index: 0
-CHECK: debug_line[0x00000054]
+CHECK: debug_line[0x0000004c]
CHECK-NEXT: Line table prologue:
CHECK-NEXT: total_length: 0x0000003b
CHECK-NEXT: format: DWARF32
@@ -148,14 +148,14 @@ CHECK-NEXT: [[RANGELIST_OFFSET]]: [DW_RLE_start_length]: {{.*}}[0x[[RANGELIST_OF
CHECK: .debug_names contents:
CHECK-NEXT: Name Index @ 0x0 {
CHECK-NEXT: Header {
-CHECK-NEXT: Length: 0xD4
+CHECK-NEXT: Length: 0xBC
CHECK-NEXT: Format: DWARF32
CHECK-NEXT: Version: 5
CHECK-NEXT: CU count: 2
CHECK-NEXT: Local TU count: 0
CHECK-NEXT: Foreign TU count: 0
-CHECK-NEXT: Bucket count: 6
-CHECK-NEXT: Name count: 6
+CHECK-NEXT: Bucket count: 5
+CHECK-NEXT: Name count: 5
CHECK-NEXT: Abbreviations table size: 0x11
CHECK-NEXT: Augmentation: 'LLVM0700'
CHECK-NEXT: }
diff --git a/llvm/test/tools/dsymutil/ARM/dwarf5-macho.test b/llvm/test/tools/dsymutil/ARM/dwarf5-macho.test
index 0823debc8b552..c73eaf1dfe989 100644
--- a/llvm/test/tools/dsymutil/ARM/dwarf5-macho.test
+++ b/llvm/test/tools/dsymutil/ARM/dwarf5-macho.test
@@ -6,7 +6,7 @@
; a.cpp
; __attribute__((section("1,__text_foo"))) void foo() {}
-;
+;
; int foo2(int a) {
; return a+5;
; }
@@ -25,17 +25,17 @@ CHECK:.debug_abbrev contents:
CHECK-NEXT: Abbrev table for offset: 0x00000000
CHECK: .debug_info contents:
-CHECK-NEXT: 0x00000000: Compile Unit: length = 0x0000007d, format = DWARF32, version = 0x0005, unit_type = DW_UT_compile, abbr_offset = 0x0000, addr_size = 0x08 (next unit at 0x00000081)
+CHECK-NEXT: 0x00000000: Compile Unit: length = 0x00000064, format = DWARF32, version = 0x0005, unit_type = DW_UT_compile, abbr_offset = 0x0000, addr_size = 0x08 (next unit at 0x00000068)
CHECK: DW_AT_ranges [DW_FORM_sec_offset] (0x[[RANGE_OFFSET:[0-9a-f]+]]
CHECK-NEXT: [0x[[RANGE_OFFSET_START:[0-9a-f]+]], 0x[[RANGE_OFFSET_END:[0-9a-f]+]]))
CHECK: 0x00000050: DW_TAG_formal_parameter [3] (0x00000033)
-CHECK-NEXT: DW_AT_location [DW_FORM_sec_offset] (0x[[LOC_OFFSET:[0-9a-f]+]]:
+CHECK-NEXT: DW_AT_location [DW_FORM_sec_offset] (0x[[LOC_OFFSET:[0-9a-f]+]]:
CHECK-NEXT: [0x[[LOC_OFFSET_START:[0-9a-f]+]], 0x[[LOC_OFFSET_END:[0-9a-f]+]]): [[LOC_EXPR:.*]]
CHECK-NEXT: [0x[[LOC_OFFSET_START2:[0-9a-f]+]], 0x[[LOC_OFFSET_END2:[0-9a-f]+]]): [[LOC_EXPR2:.*]])
CHECK: .debug_loclists contents:
CHECK-NEXT: 0x00000000: locations list header: length = 0x00000024, format = DWARF32, version = 0x0005, addr_size = 0x08, seg_size = 0x00, offset_entry_count = 0x00000000
-CHECK-NEXT: 0x[[LOC_OFFSET]]:
+CHECK-NEXT: 0x[[LOC_OFFSET]]:
CHECK-NEXT: DW_LLE_start_length {{.*}}
CHECK-NEXT: => [0x[[LOC_OFFSET_START]], 0x[[LOC_OFFSET_END]]): [[LOC_EXPR]]
CHECK-NEXT: DW_LLE_start_length {{.*}}
@@ -45,7 +45,7 @@ CHECK-NEXT: DW_LLE_end_of_list ()
CHECK: .debug_line contents:
CHECK-NEXT: debug_line[0x00000000]
CHECK-NEXT: Line table prologue:
-CHECK-NEXT: total_length: 0x00000050
+CHECK-NEXT: total_length: 0x00000048
CHECK-NEXT: format: DWARF32
CHECK-NEXT: version: 5
CHECK-NEXT: address_size: 8
@@ -87,17 +87,16 @@ CHECK-NEXT: ranges:
CHECK-NEXT: [[RANGE_OFFSET]]: [DW_RLE_start_length]: {{.*}}[0x[[RANGE_OFFSET_START]], 0x[[RANGE_OFFSET_END]])
CHECK: .debug_names contents:
-CHECK-NEXT: Name Index @ 0x0 {
-CHECK-NEXT: Header {
-CHECK-NEXT: Length: 0x94
-CHECK-NEXT: Format: DWARF32
-CHECK-NEXT: Version: 5
-CHECK-NEXT: CU count: 1
-CHECK-NEXT: Local TU count: 0
-CHECK-NEXT: Foreign TU count: 0
-CHECK-NEXT: Bucket count: 4
-CHECK-NEXT: Name count: 4
-CHECK-NEXT: Abbreviations table size: 0xD
-CHECK-NEXT: Augmentation: 'LLVM0700'
-CHECK-NEXT: }
-
+CHECK-NEX:T Name Index @ 0x0 {
+CHECK-NEX:T Header {
+CHECK-NEX:T Length: 0x7C
+CHECK-NEX:T Format: DWARF32
+CHECK-NEX:T Version: 5
+CHECK-NEX:T CU count: 1
+CHECK-NEX:T Local TU count: 0
+CHECK-NEX:T Foreign TU count: 0
+CHECK-NEX:T Bucket count: 3
+CHECK-NEX:T Name count: 3
+CHECK-NEX:T Abbreviations table size: 0xD
+CHECK-NEX:T Augmentation: 'LLVM0700'
+CHECK-NEX:T }
diff --git a/llvm/tools/dsymutil/DwarfLinkerForBinary.cpp b/llvm/tools/dsymutil/DwarfLinkerForBinary.cpp
index dd1c42fffb5c4..09a69a35a23ca 100644
--- a/llvm/tools/dsymutil/DwarfLinkerForBinary.cpp
+++ b/llvm/tools/dsymutil/DwarfLinkerForBinary.cpp
@@ -1083,10 +1083,10 @@ std::optional<int64_t> DwarfLinkerForBinary::AddressManager<
DIE.getDwarfUnit()->getAddrOffsetSectionBase()) {
// Addrx is a index into the debug_addr section, not an offset, so we need
// to multiply by byte size.
- const uint64_t ByteSize = DIE.getDwarfUnit()->getAddressByteSize();
+ const uint64_t AddrSize = DIE.getDwarfUnit()->getAddressByteSize();
const uint64_t StartOffset =
- *AddrOffsetSectionBase + (AddrValue->getRawUValue() * ByteSize);
- const uint64_t EndOffset = StartOffset + ByteSize;
+ *AddrOffsetSectionBase + (AddrValue->getRawUValue() * AddrSize);
+ const uint64_t EndOffset = StartOffset + AddrSize;
return hasValidRelocationAt(ValidDebugAddrRelocs, StartOffset, EndOffset);
}
More information about the llvm-commits
mailing list