X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=gdb%2Fdwarf2expr.c;h=3c81cba3dfc1156c7a6750652901ba0bf5cf5801;hb=63ffd7c9131c0e9723016d33cf8d435cc508d02b;hp=f1ca033389ab8163b3e6e81d7eccf0232a22db2c;hpb=a6b786da4e3353bf634ec7d9c7bffbd7569e73c6;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/dwarf2expr.c b/gdb/dwarf2expr.c index f1ca033389..3c81cba3df 100644 --- a/gdb/dwarf2expr.c +++ b/gdb/dwarf2expr.c @@ -1,6 +1,6 @@ /* DWARF 2 Expression Evaluator. - Copyright (C) 2001-2018 Free Software Foundation, Inc. + Copyright (C) 2001-2020 Free Software Foundation, Inc. Contributed by Daniel Berlin (dan@dberlin.org) @@ -27,7 +27,8 @@ #include "dwarf2.h" #include "dwarf2expr.h" #include "dwarf2loc.h" -#include "common/underlying.h" +#include "gdbsupport/underlying.h" +#include "gdbarch.h" /* Cookie for gdbarch data. */ @@ -634,6 +635,7 @@ dwarf_expr_context::execute_stack_op (const gdb_byte *op_ptr, result_val = value_from_ulongest (address_type, result); break; + case DW_OP_addrx: case DW_OP_GNU_addr_index: op_ptr = safe_read_uleb128 (op_ptr, op_end, &uoffset); result = this->get_addr_index (uoffset); @@ -952,12 +954,12 @@ dwarf_expr_context::execute_stack_op (const gdb_byte *op_ptr, from the type length, we need to zero-extend it. */ if (TYPE_LENGTH (type) != addr_size) { - ULONGEST result = + ULONGEST datum = extract_unsigned_integer (buf, addr_size, byte_order); buf = (gdb_byte *) alloca (TYPE_LENGTH (type)); store_unsigned_integer (buf, TYPE_LENGTH (type), - byte_order, result); + byte_order, datum); } result_val = value_from_contents_and_address (type, buf, addr); @@ -1218,12 +1220,12 @@ dwarf_expr_context::execute_stack_op (const gdb_byte *op_ptr, case DW_OP_bit_piece: { - uint64_t size, offset; + uint64_t size, uleb_offset; /* Record the piece. */ op_ptr = safe_read_uleb128 (op_ptr, op_end, &size); - op_ptr = safe_read_uleb128 (op_ptr, op_end, &offset); - add_piece (size, offset); + op_ptr = safe_read_uleb128 (op_ptr, op_end, &uleb_offset); + add_piece (size, uleb_offset); /* Pop off the address/regnum, and reset the location type. */