llvm-project/llvm/test/DebugInfo/MIR/X86
David Stenberg 1ae2d9a2bd [DebugInfo] Add a DW_OP_LLVM_entry_value operation
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
2019-10-15 11:31:21 +00:00
..
DW_OP_entry_value.mir [Alignment] Use llvm::Align in MachineFunction and TargetLowering - fixes mir parsing 2019-09-11 11:16:48 +00:00
avoid-single-entry-value-location.mir [DebugInfo] Add a DW_OP_LLVM_entry_value operation 2019-10-15 11:31:21 +00:00
bit-piece-dh.mir [Alignment] Use llvm::Align in MachineFunction and TargetLowering - fixes mir parsing 2019-09-11 11:16:48 +00:00
clobbered-fragments.mir [DebugInfo] Track multiple registers in DbgEntityHistoryCalculator 2019-04-10 11:28:28 +00:00
dbg-stack-value-range.mir [Alignment] Use llvm::Align in MachineFunction and TargetLowering - fixes mir parsing 2019-09-11 11:16:48 +00:00
dbgcall-site-interpretation.mir [DebugInfo] Add a DW_OP_LLVM_entry_value operation 2019-10-15 11:31:21 +00:00
dbgcall-site-lea-interpretation.mir Reland "[DwarfDebug] Dump call site debug info" 2019-07-31 16:51:28 +00:00
dbginfo-entryvals.mir [DebugInfo] Add a DW_OP_LLVM_entry_value operation 2019-10-15 11:31:21 +00:00
debug-call-site-param.mir [DWARF] Emit call site parameter info when tuning for lldb 2019-09-11 21:23:39 +00:00
debug-loc-0.mir [Alignment] Use llvm::Align in MachineFunction and TargetLowering - fixes mir parsing 2019-09-11 11:16:48 +00:00
empty-inline.mir [Alignment] Use llvm::Align in MachineFunction and TargetLowering - fixes mir parsing 2019-09-11 11:16:48 +00:00
kill-after-spill.mir [Alignment] Use llvm::Align in MachineFunction and TargetLowering - fixes mir parsing 2019-09-11 11:16:48 +00:00
lit.local.cfg
live-debug-values-3preds.mir [Alignment] Use llvm::Align in MachineFunction and TargetLowering - fixes mir parsing 2019-09-11 11:16:48 +00:00
live-debug-values-bad-transfer.mir [DebugInfo] LiveDebugValues: defer DBG_VALUE creation during analysis 2019-10-04 09:38:05 +00:00
live-debug-values-entry-transfer.mir [DebugInfo] LiveDebugValues should always revisit backedges if it skips them 2019-08-29 10:53:29 +00:00
live-debug-values-fragments.mir [X86] Add target triple for live-debug-values-fragments.mir 2019-06-14 01:41:04 +00:00
live-debug-values-reg-copy.mir Revert "[AArch64][DebugInfo] Do not recompute CalleeSavedStackSize" 2019-09-18 14:42:09 +00:00
live-debug-values-restore-collide.mir [Alignment] Use llvm::Align in MachineFunction and TargetLowering - fixes mir parsing 2019-09-11 11:16:48 +00:00
live-debug-values-restore.mir [DebugInfo] LiveDebugValues: move DBG_VALUE creation into VarLoc class 2019-10-04 10:53:47 +00:00
live-debug-values-spill.mir [Alignment] Use llvm::Align in MachineFunction and TargetLowering - fixes mir parsing 2019-09-11 11:16:48 +00:00
live-debug-values-stack-clobber.mir [DebugInfo] LiveDebugValues: explicitly terminate overwritten stack locations 2019-09-06 10:08:22 +00:00
live-debug-values.mir [Alignment] Use llvm::Align in MachineFunction and TargetLowering - fixes mir parsing 2019-09-11 11:16:48 +00:00
live-debug-vars-unused-arg-debugonly.mir [Alignment] Use llvm::Align in MachineFunction and TargetLowering - fixes mir parsing 2019-09-11 11:16:48 +00:00
live-debug-vars-unused-arg.mir [Alignment] Use llvm::Align in MachineFunction and TargetLowering - fixes mir parsing 2019-09-11 11:16:48 +00:00
livedebugvalues-limit.mir [Alignment] Use llvm::Align in MachineFunction and TargetLowering - fixes mir parsing 2019-09-11 11:16:48 +00:00
livedebugvars-crossbb-interval.mir [Alignment] Use llvm::Align in MachineFunction and TargetLowering - fixes mir parsing 2019-09-11 11:16:48 +00:00
machine-cse.mir [DebugInfo] LiveDebugValues: correctly discriminate kinds of variable locations 2019-09-02 12:28:36 +00:00
mlicm-hoist.mir [Alignment] Use llvm::Align in MachineFunction and TargetLowering - fixes mir parsing 2019-09-11 11:16:48 +00:00
multiple-param-dbg-value-entry.mir [DebugInfo] Add a DW_OP_LLVM_entry_value operation 2019-10-15 11:31:21 +00:00
no-cfi-loc.mir [Alignment] Use llvm::Align in MachineFunction and TargetLowering - fixes mir parsing 2019-09-11 11:16:48 +00:00
postra-subreg-sink.mir [DebugInfo] Make postra sinking of DBG_VALUEs subregister-safe 2019-08-19 09:53:07 +00:00
prolog-epilog-indirection.mir [Alignment] Use llvm::Align in MachineFunction and TargetLowering - fixes mir parsing 2019-09-11 11:16:48 +00:00
regcoalescer.mir [Alignment] Use llvm::Align in MachineFunction and TargetLowering - fixes mir parsing 2019-09-11 11:16:48 +00:00
unreachable-block-call-site.mir [DebugInfo] Remove call sites when eliminating unreachable blocks 2019-08-12 13:22:29 +00:00