[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:17:33 PDT 2017


dblaikie accepted this revision.
dblaikie added a comment.
This revision is now accepted and ready to land.

(consider the ELF suffix rename, but otherwise looks fine)



================
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)
----------------
wolfgangp wrote:
> dblaikie wrote:
> > 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)
> I wanted to be sure to check all strx<n> forms as well as index values other than 0 and 1. Or are you just referring to the Macho-O part?
Nah, not just Mach-O, just looking at the test in general, given all the changes.

*shrug* No big deal - I'd probably try to pare it down a bit to focus, but reasonable folks disagree about how far to go.


https://reviews.llvm.org/D35321





More information about the llvm-commits mailing list