]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Remove DWARF expression composition check
authorZoran Zaric <Zoran.Zaric@amd.com>
Mon, 7 Dec 2020 19:00:27 +0000 (19:00 +0000)
committerSimon Marchi <simon.marchi@polymtl.ca>
Tue, 8 Dec 2020 16:16:21 +0000 (11:16 -0500)
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, everything all operations are treated the same
and everything is composable, so there is no need for the previous
restriction in the expression evaluator.

gdb/ChangeLog:

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

Change-Id: Ibcfd02dfec0cf7354cf2494a13ae1a5125c1233a

gdb/dwarf2/expr.c

index ee3732a6d97798cbc1d21796117d7d38357b985b..1f07502059e023ca7e5b9b360f512506ab816003 100644 (file)
@@ -2971,7 +2971,6 @@ dwarf_expr_context::execute_stack_op (const gdb_byte *op_ptr,
        case DW_OP_reg29:
        case DW_OP_reg30:
        case DW_OP_reg31:
-         dwarf_expr_require_composition (op_ptr, op_end, "DW_OP_reg");
          ensure_have_frame (this->frame, "DW_OP_reg");
 
          result = op - DW_OP_reg0;
@@ -2980,7 +2979,6 @@ dwarf_expr_context::execute_stack_op (const gdb_byte *op_ptr,
 
        case DW_OP_regx:
          op_ptr = safe_read_uleb128 (op_ptr, op_end, &reg);
-         dwarf_expr_require_composition (op_ptr, op_end, "DW_OP_regx");
          ensure_have_frame (this->frame, "DW_OP_regx");
 
          result = reg;
@@ -2997,8 +2995,6 @@ dwarf_expr_context::execute_stack_op (const gdb_byte *op_ptr,
            result_entry = entry_factory->create_implicit (op_ptr, len,
                                                           BFD_ENDIAN_UNKNOWN);
            op_ptr += len;
-           dwarf_expr_require_composition (op_ptr, op_end,
-                                           "DW_OP_implicit_value");
          }
          break;
 
@@ -3014,8 +3010,6 @@ dwarf_expr_context::execute_stack_op (const gdb_byte *op_ptr,
              = entry_factory->create_implicit (value->get_contents (),
                                                TYPE_LENGTH (type),
                                                type_byte_order (type));
-
-           dwarf_expr_require_composition (op_ptr, op_end, "DW_OP_stack_value");
          }
          break;
 
@@ -3039,9 +3033,6 @@ dwarf_expr_context::execute_stack_op (const gdb_byte *op_ptr,
                                                        this->per_cu,
                                                        this->addr_size,
                                                        die_offset, len);
-
-           dwarf_expr_require_composition (op_ptr, op_end,
-                                           "DW_OP_implicit_pointer");
          }
          break;