[all-commits] [llvm/llvm-project] 586693: [DebugInfo] Add DW_OP_LLVM_user extension point

Scott Linder via All-commits all-commits at lists.llvm.org
Mon Jun 19 14:47:05 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 58669354bf1f8eef39979e31915b1e212a3985c9
      https://github.com/llvm/llvm-project/commit/58669354bf1f8eef39979e31915b1e212a3985c9
  Author: Scott Linder <Scott.Linder at amd.com>
  Date:   2023-06-19 (Mon, 19 Jun 2023)

  Changed paths:
    M llvm/include/llvm/BinaryFormat/Dwarf.def
    M llvm/include/llvm/BinaryFormat/Dwarf.h
    M llvm/include/llvm/DebugInfo/DWARF/DWARFExpression.h
    M llvm/lib/BinaryFormat/Dwarf.cpp
    M llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
    M llvm/lib/DWARFLinker/DWARFLinker.cpp
    M llvm/lib/DebugInfo/DWARF/DWARFExpression.cpp
    A llvm/test/tools/llvm-dwarfdump/X86/DW_OP_LLVM_user.s
    M llvm/unittests/DebugInfo/DWARF/DWARFExpressionCompactPrinterTest.cpp

  Log Message:
  -----------
  [DebugInfo] Add DW_OP_LLVM_user extension point

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.

Reviewed By: #debug-info, dblaikie

Differential Revision: https://reviews.llvm.org/D147271




More information about the All-commits mailing list