From: Zoran Zaric Date: Wed, 14 Oct 2020 16:41:54 +0000 (+0100) Subject: Remove DWARF expression composition check X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=087ced679c2644f893966d814a1efd2f84baee03;p=thirdparty%2Fbinutils-gdb.git Remove DWARF expression composition check 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. --- diff --git a/gdb/dwarf2/expr.c b/gdb/dwarf2/expr.c index 2555f9969ef..676e0bae8a7 100644 --- a/gdb/dwarf2/expr.c +++ b/gdb/dwarf2/expr.c @@ -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 (arch, result)); break; } @@ -3324,8 +3323,6 @@ dwarf_expr_context::execute_stack_op (const gdb_byte *op_ptr, (arch, gdb::array_view (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 (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; }