forked from OSchip/llvm-project
1ae2d9a2bd
Summary: Internally in LLVM's metadata we use DW_OP_entry_value operations with the same semantics as DWARF; that is, its operand specifies the number of bytes that the entry value covers. At the time of emitting entry values we don't know the emitted size of the DWARF expression that the entry value will cover. Currently the size is hardcoded to 1 in DIExpression, and other values causes the verifier to fail. As the size is 1, that effectively means that we can only have valid entry values for registers that can be encoded in one byte, which are the registers with DWARF numbers 0 to 31 (as they can be encoded as single-byte DW_OP_reg0..DW_OP_reg31 rather than a multi-byte DW_OP_regx). It is a bit confusing, but it seems like llvm-dwarfdump will print an operation "correctly", even if the byte size is less than that, which may make it seem that we emit correct DWARF for registers with DWARF numbers > 31. If you instead use readelf for such cases, it will interpret the number of specified bytes as a DWARF expression. This seems like a limitation in llvm-dwarfdump. As suggested in D66746, a way forward would be to add an internal variant of DW_OP_entry_value, DW_OP_LLVM_entry_value, whose operand instead specifies the number of operations that the entry value covers, and we then translate that into the byte size at the time of emission. In this patch that internal operation is added. This patch keeps the limitation that a entry value can only be applied to simple register locations, but it will fix the issue with the size operand being incorrect for DWARF numbers > 31. Reviewers: aprantl, vsk, djtodoro, NikolaPrica Reviewed By: aprantl Subscribers: jyknight, fedor.sergeev, hiraditya, llvm-commits Tags: #debug-info, #llvm Differential Revision: https://reviews.llvm.org/D67492 llvm-svn: 374881 |
||
---|---|---|
.. | ||
DW_OP_entry_value.mir | ||
avoid-single-entry-value-location.mir | ||
bit-piece-dh.mir | ||
clobbered-fragments.mir | ||
dbg-stack-value-range.mir | ||
dbgcall-site-interpretation.mir | ||
dbgcall-site-lea-interpretation.mir | ||
dbginfo-entryvals.mir | ||
debug-call-site-param.mir | ||
debug-loc-0.mir | ||
empty-inline.mir | ||
kill-after-spill.mir | ||
lit.local.cfg | ||
live-debug-values-3preds.mir | ||
live-debug-values-bad-transfer.mir | ||
live-debug-values-entry-transfer.mir | ||
live-debug-values-fragments.mir | ||
live-debug-values-reg-copy.mir | ||
live-debug-values-restore-collide.mir | ||
live-debug-values-restore.mir | ||
live-debug-values-spill.mir | ||
live-debug-values-stack-clobber.mir | ||
live-debug-values.mir | ||
live-debug-vars-unused-arg-debugonly.mir | ||
live-debug-vars-unused-arg.mir | ||
livedebugvalues-limit.mir | ||
livedebugvars-crossbb-interval.mir | ||
machine-cse.mir | ||
mlicm-hoist.mir | ||
multiple-param-dbg-value-entry.mir | ||
no-cfi-loc.mir | ||
postra-subreg-sink.mir | ||
prolog-epilog-indirection.mir | ||
regcoalescer.mir | ||
unreachable-block-call-site.mir |