llvm-project/llvm/test/DebugInfo
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
..
AArch64 [ISEL][ARM][AARCH64] Tracking simple parameter forwarding registers 2019-10-08 09:43:05 +00:00
AMDGPU AMDGPU: Fix tests using old number for constant address space 2018-09-10 02:54:25 +00:00
ARM [DebugInfo] Add a DW_OP_LLVM_entry_value operation 2019-10-15 11:31:21 +00:00
COFF [DebugInfo] Remove some users of DBG_VALUEs IsIndirect field 2019-10-15 10:46:24 +00:00
Generic Remove the obsolete BlockByRefStruct flag from LLVM IR 2019-09-18 22:38:56 +00:00
Inputs [DebugInfo] Add column info for inline sites 2019-07-12 19:25:45 +00:00
Lanai
MIR [DebugInfo] Add a DW_OP_LLVM_entry_value operation 2019-10-15 11:31:21 +00:00
MSP430 MachineOperand/MIParser: Do not print debug-use flag, infer it 2018-10-30 23:28:27 +00:00
Mips [mips][micromips] Fix how values in .gcc_except_table are calculated 2019-02-07 22:57:33 +00:00
NVPTX [DwarfExpression] Disallow some rewrites to avoid undefined behavior 2019-09-07 11:40:10 +00:00
PDB Make pdbdump-objfilename test work again 2019-07-09 17:02:51 +00:00
PowerPC [DWARF] - Emit the correct value for DW_AT_addr_base. 2018-09-20 09:17:36 +00:00
RISCV [DebugInfo] Some fields do not need relocations even relax is enabled. 2019-07-19 06:10:36 +00:00
Sparc [DebugInfo] Add a DW_OP_LLVM_entry_value operation 2019-10-15 11:31:21 +00:00
SystemZ [lit] Delete empty lines at the end of lit.local.cfg NFC 2019-06-17 09:51:07 +00:00
WebAssembly [WebAssembly] Make returns variadic 2019-10-09 21:42:08 +00:00
X86 [DebugInfo] Remove some users of DBG_VALUEs IsIndirect field 2019-10-15 10:46:24 +00:00
arange-overlap.test [llvm-symbolizer][test] Extract tests from llvm-symbolizer.test and simplify (#1) 2019-01-31 14:11:17 +00:00
arm-relocs.test
check-debugify-preserves-analyses.ll
cross-cu-inlining.test [llvm-symbolizer][test] Extract tests from llvm-symbolizer.test and simplify (#1) 2019-01-31 14:11:17 +00:00
cross-cu-scope.ll Specify REQUIRES: default_triple in two debuginfo tests 2018-11-06 00:16:32 +00:00
debugify-bogus-dbg-value.ll [Debugify] Allow unsigned values narrower than their variables 2018-07-06 17:32:40 +00:00
debugify-each.ll
debugify-export.ll [Debugify] Export per-pass debug info loss statistics 2018-07-24 00:41:29 +00:00
debugify-report-missing-locs-only.ll Tighten up a test for -check-debugify, NFC 2018-07-02 17:08:36 +00:00
debugify.ll [DebugInfo] IR/Bitcode changes for DISubprogram flags. 2018-11-28 21:14:32 +00:00
debuglineinfo-macho.test
debuglineinfo-path.ll [llvm-nm][llvm-readelf] Avoid single-dash -long-option in tests 2019-04-27 16:12:14 +00:00
debuglineinfo.test Reapply: DebugInfo: Assume an absence of ranges or high_pc on a CU means the CU is empty (devoid of code addresses) 2018-12-21 22:25:01 +00:00
debugmacinfo.test
dwarfdump-64-bit-dwarf.test [CommandLine] Don't allow unlimitted dashes for options. Part 1 or 5 2019-04-29 18:34:18 +00:00
dwarfdump-accel.test
dwarfdump-bad-lookup-address.test [DWARF] check whether the DIE is valid before querying for information 2019-04-03 17:13:45 +00:00
dwarfdump-debug-frame-simple.test
dwarfdump-decompression-corrupt.test
dwarfdump-decompression-error.test
dwarfdump-dump-flags.test
dwarfdump-dump-gdbindex.test [llvm-dwarfdump] --gdb-index: fix uninitialized TuListOffset 2019-06-19 13:51:29 +00:00
dwarfdump-dwp.test
dwarfdump-implicit-const.test
dwarfdump-invalid-line-table.test
dwarfdump-invalid.test
dwarfdump-macho-relocs.test
dwarfdump-macho-universal.test
dwarfdump-objc.test
dwarfdump-pubnames.test
dwarfdump-ranges.test Revert "[DWARF] reposting r342048, which was reverted in r342056 due to buildbot errors. Adjusted 2 test cases for ARM and darwin and fixed a bug with the original change in dsymutil." 2018-09-17 15:40:01 +00:00
dwarfdump-type-units.test
dwarfdump-zlib.test
dwo.ll
gcc-local-mem-func.test [llvm-symbolizer][test] Extract tests from llvm-symbolizer.test and simplify (#1) 2019-01-31 14:11:17 +00:00
high-pc-constant.test [llvm-symbolizer][test] Extract tests from llvm-symbolizer.test and simplify (#1) 2019-01-31 14:11:17 +00:00
invalid-relocations.test [yaml2obj][obj2yaml] - Change how symbol's binding is descibed when parsing/dumping. 2019-04-03 14:53:42 +00:00
macro_link.ll
member-pointers.o
missing-abstract-variable.o
omit-empty.ll
pr34186.ll
pr34672.ll
precomp.test [llvm-readobj] Change -long-option to --long-option in tests. NFC 2019-05-01 05:27:20 +00:00
skeletoncu.ll
strip-DIGlobalVariable.ll
strip-loop-metadata.ll
strip-module-flags.ll
symbolize-64bit-address.test [DebugInfo][llvm-symbolizer]Add some tests for edge cases when symbolizing 2019-02-06 10:13:14 +00:00
symbolize-absolute-path-in-debug-line.s [DebugInfo][llvm-symbolizer]Add some tests for edge cases when symbolizing 2019-02-06 10:13:14 +00:00
symbolize-demangling.s [llvm-symbolizer][test] Extract tests from llvm-symbolizer.test and simplify (#2) 2019-01-31 14:17:33 +00:00
symbolize-directory.s Fix more Windows bots after r360015. 2019-05-06 19:12:25 +00:00
symbolize-gnu-debuglink-fallback.test [DebugInfo] Fix /usr/lib/debug llvm-symbolizer lookup with relative paths 2019-02-11 18:05:48 +00:00
symbolize-gnu-debuglink-no-realpath.test [DebugInfo] Fix mkdir use in test 2019-02-01 21:14:21 +00:00
symbolize-gnu-debuglink.test [llvm-symbolizer][test] Extract tests from llvm-symbolizer.test and simplify (#3) 2019-01-31 14:22:50 +00:00
symbolize-inlined.test [llvm-symbolizer][test] Extract tests from llvm-symbolizer.test and simplify (#3) 2019-01-31 14:22:50 +00:00
symbolize-macho-universal-unknown-arch.test [llvm-symbolizer][test] Extract tests from llvm-symbolizer.test and simplify (#2) 2019-01-31 14:17:33 +00:00
symbolize-macho-universal.test [llvm-symbolizer][test] Extract tests from llvm-symbolizer.test and simplify (#2) 2019-01-31 14:17:33 +00:00
symbolize-missing-file.test [llvm-symbolizer][test] Extract tests from llvm-symbolizer.test and simplify (#3) 2019-01-31 14:22:50 +00:00
symbolize-no-debug-str.test [DebugInfo][llvm-symbolizer]Add some tests for edge cases when symbolizing 2019-02-06 10:13:14 +00:00
symbolize-shared-abbrev.s [DebugInfo][llvm-symbolizer]Add some tests for edge cases when symbolizing 2019-02-06 10:13:14 +00:00
symbolize-split-dwarf-empty.test [llvm-symbolizer][test] Rename and tweak tests using llvm-symbolizer 2019-02-01 10:24:55 +00:00
symbolize-split-dwarf-no-skel-address.test [llvm-symbolizer][test] Rename and tweak tests using llvm-symbolizer 2019-02-01 10:24:55 +00:00
symbolize-stripped-sections.test [DebugInfo][llvm-symbolizer]Add some tests for edge cases when symbolizing 2019-02-06 10:13:14 +00:00
symbolize-stripped.test [llvm-symbolizer][test] Extract tests from llvm-symbolizer.test and simplify (#1) 2019-01-31 14:11:17 +00:00
symbolize-tu.test [llvm-symbolizer][test] Rename and tweak tests using llvm-symbolizer 2019-02-01 10:24:55 +00:00
symbolize-zlib.test [llvm-symbolizer][test] Rename and tweak tests using llvm-symbolizer 2019-02-01 10:24:55 +00:00
symbolize.test [llvm-symbolizer][test] Rename and tweak tests using llvm-symbolizer 2019-02-01 10:24:55 +00:00
typeunit-header.test
unrolled-loop-remainder.ll Remove irrelevant references to legacy git repositories from 2019-01-15 16:18:52 +00:00