]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Add support for DW_OP_LLVM_undefined operation
authorZoran Zaric <Zoran.Zaric@amd.com>
Thu, 5 Nov 2020 11:53:14 +0000 (11:53 +0000)
committerZoran Zaric <zoran.zaric@amd.com>
Fri, 5 Nov 2021 11:48:16 +0000 (11:48 +0000)
commit63ec59357c3b7d47e725ccbbba00b104bc9dc2cf
treeca8fca4437cb30e45f651a2901a6021b98965775
parent0dec3e5ba26fd278ad872d5905507adc4ed8860a
Add support for DW_OP_LLVM_undefined operation

For the DW_OP_piece and DW_OP_bit_piece operations, in the DWARF 5
standard, it is stated that if the location description (of that piece)
is empty, then the piece is describing an undefined location
description.

The act of allowing any location description to be placed on a DWARF
stack means that now a new operations can be defined which could pop
more then one location description from a DWARF stack.

This means that the old rule is not really applicable any more and a
new operation that explicitly pushes an undefined location description
on the DWARF stack is needed.

This new rule however is fully backward compatibility as described
in the document found on:

https://llvm.org/docs/AMDGPUDwarfExtensionsForHeterogeneousDebugging.html

Under the new definitions for the DW_OP_piece and DW_OP_bit_piece
operations.

gdb/ChangeLog:

* compile/compile-loc2c.c (compute_stack_depth_worker): Add
support for new DW_OP_LLVM_undefined operations.
* dwarf2/expr.c (dwarf_expr_context::execute_stack_op): Add
support for new DW_OP_LLVM_undefined operations.
        * dwarf2/loc.c (dwarf2_get_symbol_read_needs): Add new
        DW_OP_LLVM_undefined operation support.

include/ChangeLog:

* dwarf2.def (DW_OP): New DW_OP_LLVM_undefined operations
enumeration.

gdb/testsuite/ChangeLog:

* gdb.dwarf2/dw2-llvm-undefined.exp: New test.
gdb/compile/compile-loc2c.c
gdb/dwarf2/expr.c
gdb/dwarf2/loc.c
gdb/testsuite/gdb.dwarf2/dw2-llvm-undefined.exp [new file with mode: 0644]
include/dwarf2.def