[PATCH] D68465: [DebugInfo] Trim call-clobbered location list entries when tuning for GDB
David Stenberg via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 10 02:49:53 PDT 2019
dstenb added a comment.
In D68465#1698682 <https://reviews.llvm.org/D68465#1698682>, @dblaikie wrote:
> So your changes to the address pool don't actually cause the address pool to contain entries with offsets - it stores only the base address in the actual debug_addr pool output, but then uses the offset from there in the place that refers to the address pool.
The offset will make it into the address pool output. In the parent patch (D68466 <https://reviews.llvm.org/D68466>) the offset is added to the output in `AddressPool::emit()`.
Such a case is tested in the attached call-clobbered-split.mir test:
# CHECK: .Ldebug_loc0:
[...]
# CHECK-NEXT: .byte 3
# CHECK-NEXT: .byte 2 <---------
# CHECK-NEXT: .long .Ltmp2-(.Ltmp2-1)
# CHECK-NEXT: .byte 4 # Loc expr size
# CHECK-NEXT: .byte 48 # DW_OP_lit0
# CHECK-NEXT: .byte 159 # DW_OP_stack_value
# CHECK-NEXT: .byte 147 # DW_OP_piece
# CHECK-NEXT: .byte 8 # 8
[...]
# CHECK: .Laddr_table_base0:
# CHECK-NEXT: .quad .Lfunc_begin0
# CHECK-NEXT: .quad .Ltmp1
# CHECK-NEXT: .quad .Ltmp2-1 <-----
# CHECK-NEXT: .quad .Ltmp2
> So I think that would mean there would end up with duplicate entries in debug_addr, which would be a waste of space/relocations/etc.
>
> So only the address should go in the pool - the pool shouldn't be aware of the offset. (this would mean the semantics of the in-memory data structures would match more closely to the output)
I think it's necessary to emit the offsets in the address pool output since `DW_LLE_offset_pair` takes unsigned operands.
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D68465/new/
https://reviews.llvm.org/D68465
More information about the llvm-commits
mailing list