[PATCH] D147271: [DebugInfo] Add DW_OP_LLVM_user extension point

Scott Linder via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 30 13:53:24 PDT 2023


scott.linder created this revision.
Herald added subscribers: cmtice, hiraditya, kristof.beyls.
Herald added a reviewer: jhenderson.
Herald added a project: All.
scott.linder requested review of this revision.
Herald added subscribers: llvm-commits, MaskRay.
Herald added a project: LLVM.

The extension codespace for DWARF expressions (DW_OP_LLVM_{lo,hi}_user)
has shrunk over time, as no extension is ever "retired" in practice. To
facilitate future extensions, this patch reserves one open opcode as an extension
point (0xfe), which is followed by a ULEB128-encoded SubOperation, and
then by the subop's operands.

There is some prior-art, namely DW_OP_AARCH64_operation
(see https://github.com/ARM-software/abi-aa/blob/edd7460d87493fff124b8b5713acf71ffc06ee91/aadwarf64/aadwarf64.rst#45dwarf-expression-operations).

This version makes some different tradeoffs, opting to use a ULEB128 for
the subop encoding for future-proofing.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D147271

Files:
  llvm/include/llvm/BinaryFormat/Dwarf.def
  llvm/include/llvm/BinaryFormat/Dwarf.h
  llvm/include/llvm/DebugInfo/DWARF/DWARFExpression.h
  llvm/lib/BinaryFormat/Dwarf.cpp
  llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
  llvm/lib/DWARFLinker/DWARFLinker.cpp
  llvm/lib/DebugInfo/DWARF/DWARFExpression.cpp
  llvm/lib/DebugInfo/LogicalView/Readers/LVELFReader.cpp
  llvm/test/tools/llvm-dwarfdump/X86/DW_OP_LLVM_user.s
  llvm/unittests/DebugInfo/DWARF/DWARFExpressionCompactPrinterTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D147271.509806.patch
Type: text/x-patch
Size: 13314 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230330/df9fac3c/attachment.bin>


More information about the llvm-commits mailing list