[PATCH] D67492: [DebugInfo] Add a DW_OP_LLVM_entry_value operation

David Stenberg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 12 04:30:42 PDT 2019


dstenb created this revision.
dstenb added reviewers: aprantl, vsk, djtodoro, NikolaPrica.
dstenb added a project: debug-info.
Herald added subscribers: llvm-commits, hiraditya.
Herald added a project: LLVM.

This is a refactoring spun out of comments on D66746 <https://reviews.llvm.org/D66746>. 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
the single-byte DW_OP_reg0..DW_OP_reg31 rather than as multi-byte
DW_OP_regx).

As suggested in D66746 <https://reviews.llvm.org/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, but still with the same
semantics as the DW_OP_entry_value. I've started working on a follow-up
patch for changing the semantics, but I have not come up with something
robust for calculating the sizes yet.


Repository:
  rL LLVM

https://reviews.llvm.org/D67492

Files:
  llvm/docs/LangRef.rst
  llvm/include/llvm/BinaryFormat/Dwarf.h
  llvm/include/llvm/CodeGen/MachineInstr.h
  llvm/include/llvm/IR/DebugInfoMetadata.h
  llvm/lib/BinaryFormat/Dwarf.cpp
  llvm/lib/CodeGen/AsmPrinter/DbgEntityHistoryCalculator.cpp
  llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
  llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp
  llvm/lib/IR/DebugInfoMetadata.cpp
  llvm/test/DebugInfo/MIR/Hexagon/live-debug-values-bundled-entry-values.mir
  llvm/test/DebugInfo/MIR/X86/avoid-single-entry-value-location.mir
  llvm/test/DebugInfo/MIR/X86/dbgcall-site-interpretation.mir
  llvm/test/DebugInfo/MIR/X86/dbginfo-entryvals.mir
  llvm/test/DebugInfo/MIR/X86/multiple-param-dbg-value-entry.mir
  llvm/test/Verifier/diexpression-dwarf-entry-value.ll
  llvm/test/Verifier/diexpression-entry-value.ll
  llvm/test/Verifier/diexpression-valid-entry-value.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D67492.219881.patch
Type: text/x-patch
Size: 14109 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190912/dd06bd74/attachment.bin>


More information about the llvm-commits mailing list