[PATCH] D35321: [DWARF] Fix for bug processing the debug_str_offs section on Mach-O

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 12 13:04:50 PDT 2017


dblaikie added inline comments.


================
Comment at: test/DebugInfo/Inputs/dwarfdump-str-offsets-macho.s:1-5
+# Test object to verify dwarfdump handles v5 string offset tables in Mach-O.
+#
+# To generate the test object:
+# llvm-mc -triple i386-apple-darwin9 dwarfdump-str-offsets-macho.s -filetype=obj \
+#         -o dwarfdump-str-offsets-macho.o
----------------
Might be worth also commenting on what the original source is for ease of understanding/reading.


================
Comment at: test/DebugInfo/dwarfdump-str-offsets.test:16-35
 ; Verify that strings are displayed correctly as indexed strings
-CHECK:      .debug_info contents:
-CHECK-NOT:  contents:     
-CHECK:      DW_TAG_compile_unit
-CHECK-NEXT: DW_AT_producer [DW_FORM_strx] ( indexed (00000000) string = "Handmade DWARF producer")
-CHECK-NEXT: DW_AT_name [DW_FORM_strx] ( indexed (00000001) string = "Compile_Unit_1")
-CHECK-NEXT: DW_AT_str_offsets_base [DW_FORM_sec_offset] (0x00000008)
-CHECK-NEXT: DW_AT_comp_dir [DW_FORM_strx] ( indexed (00000002) string = "/home/test/CU1")
-CHECK-NOT:  NULL
-CHECK:      DW_TAG_subprogram
-CHECK-NEXT: DW_AT_name [DW_FORM_strx1] ( indexed (00000003) string = "MyFunc")
-CHECK-NOT:  NULL
-CHECK:      DW_TAG_variable
-CHECK-NEXT: DW_AT_name [DW_FORM_strx2] ( indexed (00000004) string = "MyVar1")
-CHECK-NOT:  NULL
-CHECK:      DW_TAG_variable
-CHECK-NEXT: DW_AT_name [DW_FORM_strx3] ( indexed (00000005) string = "MyVar2")
-CHECK-NOT:  NULL
-CHECK:      DW_TAG_variable
-CHECK-NEXT: DW_AT_name [DW_FORM_strx4] ( indexed (00000006) string = "MyVar3")
+COMMON:      .debug_info contents:
+COMMON-NOT:  contents:     
+COMMON:      DW_TAG_compile_unit
+COMMON-NEXT: DW_AT_producer [DW_FORM_strx] ( indexed (00000000) string = "Handmade DWARF producer")
+COMMON-NEXT: DW_AT_name [DW_FORM_strx] ( indexed (00000001) string = "Compile_Unit_1")
+COMMON-NEXT: DW_AT_str_offsets_base [DW_FORM_sec_offset] (0x00000008)
----------------
is theer much value in checking all of these strings? Or having such complicated code (I'd expect maybe a single subprogram - check that the DW_AT_name of the CU and of the subprogram are correct & that ought to suffice? - similarly for the second CU and type units)


================
Comment at: test/DebugInfo/dwarfdump-str-offsets.test:87-94
+ELF:         .debug_str_offsets.dwo contents:
+ELF-NEXT:    0x00000000: Contribution size = 12, Version = 5
+ELF-NEXT:    0x00000008: 00000000 "Handmade split DWARF producer"
+ELF-NEXT:    0x0000000c: 0000001e "V5_split_compile_unit"
+ELF-NEXT:    0x00000010: 00000034 "/home/test/splitCU"
+ELF-NEXT:    0x00000014: Contribution size = 8, Version = 5
+ELF-NEXT:    0x0000001c: 00000047 "V5_split_type_unit"
----------------
Maybe SPLIT rather than ELF? (I mean, yeah, split-dwarf is only supported on ELF for now, but it'd be easier to read/understand I think, if it was clear this is a split dwarf thing, rather than an elf thing)


https://reviews.llvm.org/D35321





More information about the llvm-commits mailing list