]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Remove DWARF expression composition check
authorZoran Zaric <Zoran.Zaric@amd.com>
Wed, 14 Oct 2020 16:41:54 +0000 (17:41 +0100)
committerZoran Zaric <zoran.zaric@amd.com>
Fri, 5 Nov 2021 11:46:38 +0000 (11:46 +0000)
The dwarf_expr_require_composition function reports an error if the
last operation is not a leaf node of the DWARF expression. This was
previously used to prevent location description operations to be used
freely in the DWARF expression.

With the new approach, all operations are treated the same and
everything is composable, so there is no need for the previous
restrictions in the expression evaluator.

gdb/ChangeLog:

* dwarf2/expr.c (dwarf_expr_context::execute_stack_op): Remove
the use of dwarf_expr_require_composition.

gdb/dwarf2/expr.c

index 2555f9969efb04789f18f628fdf0f5a618720f05..676e0bae8a703de05328c119ca3343f8da558f32 100644 (file)
@@ -3308,7 +3308,6 @@ dwarf_expr_context::execute_stack_op (const gdb_byte *op_ptr,
            else
              result = op - DW_OP_reg0;
 
-           dwarf_expr_require_composition (op_ptr, op_end, "DW_OP_reg");
            push (make_unique<dwarf_register> (arch, result));
            break;
          }
@@ -3324,8 +3323,6 @@ dwarf_expr_context::execute_stack_op (const gdb_byte *op_ptr,
                    (arch, gdb::array_view<const gdb_byte> (op_ptr, len),
                     BFD_ENDIAN_UNKNOWN));
            op_ptr += len;
-           dwarf_expr_require_composition (op_ptr, op_end,
-                                           "DW_OP_implicit_value");
            break;
          }
 
@@ -3337,9 +3334,6 @@ dwarf_expr_context::execute_stack_op (const gdb_byte *op_ptr,
            push (make_unique<dwarf_implicit>
                    (arch, value->contents (),
                     type_byte_order (value->type ())));
-
-           dwarf_expr_require_composition (op_ptr, op_end,
-                                           "DW_OP_stack_value");
            break;
          }
 
@@ -3364,8 +3358,6 @@ dwarf_expr_context::execute_stack_op (const gdb_byte *op_ptr,
                                                       this->m_per_cu,
                                                       this->m_addr_size,
                                                       die_offset, len));
-           dwarf_expr_require_composition (op_ptr, op_end,
-                                           "DW_OP_implicit_pointer");
            break;
          }