[PATCH] D32492: [llvm-dwarfdump] - Change format for .gdb_index dump.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 27 02:09:45 PDT 2017


>I don't think that any tool currently depends on parsing that syntax and I agree that using the mathematical [x,y) notation makes most sense here. It would be great >to wrap this in a formatDWARFrange() function, so we can be consistent everywhere (and in case it really turns out that I need to produce darwin-dwarfdump >compatible output at one point, we have one point where this can easily be parameterized).

>
>-- adrian

I took a look on output that llvm-dwarfdump produces and it is really not consistent now:

// DWARF: .debug_aranges contents:
// DWARF-NEXT: Address Range Header: length = 0x00000024, version = 0x0002, cu_offset = 0x00000000, addr_size = 0x04, seg_size = 0x00
// DWARF-NEXT: [0x00000000 - 0x00000004)
// DWARF-NEXT: [0x00000000 - 0x00000004)

# CHECK: .debug_ranges contents:
# CHECK:   00000000 0000000000000000 0000000000000001
# CHECK:   00000000 0000000000000000 0000000000000002
# CHECK:   00000000 <End of list>?

CHECK:        DW_AT_ranges [DW_FORM_sec_offset]     (0x00000000
CHECK:           [0x0000000100000f94 - 0x0000000100000f9a)
CHECK:           [0x0000000100000f9f - 0x0000000100000fa7))

And output for .gdb_index after landing this patch will be:
; CHECK:      Address area offset = 0x38, has 2 entries:
; CHECK-NEXT:   Low/High address = [0x4000e8, 0x4000f3) (Size: 0xb), CU id = 0
; CHECK-NEXT:   Low/High address = [0x4000f3, 0x4000fe) (Size: 0xb), CU id = 1

So we will have 3 different formats now:
1) [A - B)
2) A B
3) [A, B)

formatDWARFrange?() or something alike seems good idea to have. I can probably prepare a patch for this a bit later
and now going to commit this one with [A, B) change since this format looks acceptable for everyone and seems will be
a first user of mathematical notation for ranges output.
George.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170427/3154433e/attachment.html>


More information about the llvm-commits mailing list